Skip to content

"canvas is not a constructor" #12

Description

@lakeinchina

I compile ejecta-v8 as a module of ejecta-v8-sample.when i 'run in Ejecta-v8 View' , it crash.
plasma.js:

	var canvas = require('canvas');
	console.log("canvasA="+canvas);
	var c = new canvas(view);

ag.boersego.bgjs.sample I/BGJSV8Engine-jni: viewCreated called [object Arguments]
ag.boersego.bgjs.sample I/BGJSV8Engine-jni: canvasA=[object HTMLCanvasElement]

beginning of crash
ag.boersego.bgjs.sample E/AndroidRuntime: FATAL EXCEPTION: Thread-4296
Process: ag.boersego.bgjs.sample, PID: 23679
ag.boersego.bgjs.V8Exception: An exception was thrown in JavaScript
at ag.boersego.bgjs.JNIV8Function._callAsV8Function(Native Method)
at ag.boersego.bgjs.JNIV8Function.callAsV8Function(JNIV8Function.java:22)
at ag.boersego.bgjs.sample.DemoEjectaFragment.initializeV8(DemoEjectaFragment.java:76)
at ag.boersego.bgjs.sample.DemoEjectaFragment.access$200(DemoEjectaFragment.java:24)
at ag.boersego.bgjs.sample.DemoEjectaFragment$1$1.onGLCreated(DemoEjectaFragment.java:97)
at ag.boersego.bgjs.V8TextureView$RenderThread.run(V8TextureView.java:743)
Caused by: ag.boersego.bgjs.V8JSException: [TypeError] canvas is not a constructor
at global.startPlasma(js/plasma.js:106)

any help?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions