[x3d-public] X3DJSAIL, possible bug in JS generation

John Carlson yottzumm at gmail.com
Tue Oct 16 18:01:34 PDT 2018


It looks like the JS generation (JavaScriptSerializer.js) may have an issue with addShaders being
generated for ProtoInstanceObject’s. This happens when mapToMethod2.js has no override for the ProtoInstance child I think, but
I will check soon.

Here is the JS code:

coderextreme at DESKTOP-DOPK2VD MINGW64 /c/x3d-code/www.web3d.org/x3d/stylesheets/java/nashorn/examples
$ grep addShaders *
HelloWorldProgramOutput.Nashorn.js:            .addShaders(new ProgramShaderObject().setDEF("TestShader1")
HelloWorldProgramOutput.Nashorn.js:            .addShaders(new ComposedShaderObject().setDEF("TestShader4")

Here is the original Java code:


HelloWorldProgram.java:                        .addShaders(new ProgramShaderObject("TestShader1")
HelloWorldProgram.java:                        .addShaders(new ProtoInstanceObject("ShaderProto","TestShader3"))
HelloWorldProgram.java:                        .addShaders(new ComposedShaderObject("TestShader4")


Here is the generated Java code:

HelloWorldProgramOutput.java:        .addShaders(new ProgramShaderObject()
HelloWorldProgramOutput.java:        .addShaders(new ProtoInstanceObject("ShaderProto", "TestShader3"))
HelloWorldProgramOutput.java:        .addShaders(new ComposedShaderObject()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20181016/0e9fa5d6/attachment.html>


More information about the x3d-public mailing list