Open lakeinchina opened 6 years ago
well,canvas is a function,so I replaced
var c = new canvas(view);
with
var c = canvas(view);
And it works,but why?
These are two different ways of calling constructors in v8 native-backed functions. I'll look into it, thanks.
I compile ejecta-v8 as a module of ejecta-v8-sample.when i 'run in Ejecta-v8 View' , it crash. plasma.js:
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?