<div dir="ltr">LOL! forgot the bug!   I believe this is left over from Nashorn API. I think once we fix JavaScript output from X3DJSAIL, this file will get overwritten.<div><br></div><div>$ node examples/HelloWorldProgramOutput.Node.js<br>C:\x3d-code\<a href="http://www.web3d.org">www.web3d.org</a>\x3d\stylesheets\java\node\examples\HelloWorldProgramOu<br>tput.Node.js:58<br>          .addChild(new autoclass.Viewpoint().setDEF("TopDownView").setDescripti<br>on("top-down view from above").setOrientation(<a href="http://java.to">java.to</a>([1,0,0,-1.570796], java.ty<br>pe("float[]"))).setPosition(<a href="http://java.to">java.to</a>([0,100,0], java.type("float[]")))))<br><br>                                                                              ^<br><br>TypeError: java.type is not a function<br>    at Object.<anonymous> (C:\x3d-code\<a href="http://www.web3d.org">www.web3d.org</a>\x3d\stylesheets\java\node\e<br>xamples\HelloWorldProgramOutput.Node.js:58:159)<br>?[90m    at Module._compile (internal/modules/cjs/loader.js:1176:30)?[39m<br>?[90m    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1196:1<br>0)?[39m<br>?[90m    at Module.load (internal/modules/cjs/loader.js:1040:32)?[39m<br>?[90m    at Function.Module._load (internal/modules/cjs/loader.js:929:14)?[39m<br>?[90m    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_ma<br>in.js:71:12)?[39m<br>?[90m    at internal/main/run_main_module.js:17:47?[39m<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, May 28, 2020 at 6:05 PM John Carlson <<a href="mailto:yottzumm@gmail.com">yottzumm@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Found a bug in:<div><br><div><div><a href="http://www.web3d.org/x3d/stylesheets/java/node" target="_blank">www.web3d.org/x3d/stylesheets/java/node</a>!</div><div><br></div></div></div><div>I believe this is due to X3DJSAIL no longer emitting JavaScript.</div><div><br></div><div>We can either delete the example from the build, or add the X3dToNodeJS.xslt to the to*JavaScript() functions in X3DJSAIL (recommended):</div><div><br></div><div>$ grep -i javascript'('  CreateX3dSceneAccessInterfaceJava.xslt|grep public</div>        public String toStringJavaScript()<br>    public File toFileJavaScript(String fileName)<br><div><br></div><div>This is a effort replace the nashorn output from X3DJSAIL.   We are now supporting nodejs instead since Nashorn has been deprecated by Oracle.</div><div><br></div><div>I kind of think the main purpose of the nodejs output is to have a alternate to Java for things like large methods.  Plus, we don't have a good python-X3DJSAIL solution.</div><div><br></div><div>It's a good test of the FFI, and supports node.js processing on the server, for those that choose that route.</div><div><br></div><div>The solution on the browser is to write an es6 x3d.mjs library (TBD--partly done).</div><div><br></div><div>Thanks,</div><div><br></div><div>John</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, May 28, 2020 at 5:37 PM John Carlson <<a href="mailto:yottzumm@gmail.com" target="_blank">yottzumm@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">I fixed the bug in<div><br></div><div><a href="http://www.web3d.org/x3d/stylesheets/java/node" target="_blank">www.web3d.org/x3d/stylesheets/java/node</a>!</div><div><br></div><div>Diff:</div><div><br></div><div>$ svn diff examples/HelloWorldProgramOutput.js<br>Index: examples/HelloWorldProgramOutput.js<br>===================================================================<br>--- examples/HelloWorldProgramOutput.js (revision 30476)<br>+++ examples/HelloWorldProgramOutput.js (working copy)<br>@@ -19,7 +19,7 @@<br> var ProtoInstance4 = null;<br> var ProtoInstance5 = null;<br> var ProtoInstance6 = null;<br>-      var X3D0 =  new autoclass.X3D().setProfile("Immersive").setVersion("3.3")<br>+      var X3D0 =  (new autoclass.X3D()).setProfile("Immersive").setVersion("3.3")<br>       .addComments(new autoclass.CommentsBlock(" x3dVersionComparisonTest for this model: supportsX3dVersion(X3DObject.VERSION_3_0)=true "))<br>       .setHead(new autoclass.head()<br>         .addComments(new autoclass.CommentsBlock(" comment #1 "))<br></div><div><br></div><div>Will check in soon.</div><div><br></div><div>I believe this is a problem with the X3dToNodeJS.xslt.  If you want Don, I can go ahead and repair the stylesheet as well, but awaiting your permission.</div><div><br></div><div>Thanks,</div><div><br></div><div>John</div></div>
</blockquote></div>
</blockquote></div>