[x3d-public] Yay! Bug fixed!

John Carlson yottzumm at gmail.com
Thu May 28 16:07:48 PDT 2020


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.

$ node examples/HelloWorldProgramOutput.Node.js
C:\x3d-code\www.web3d.org
\x3d\stylesheets\java\node\examples\HelloWorldProgramOu
tput.Node.js:58
          .addChild(new
autoclass.Viewpoint().setDEF("TopDownView").setDescripti
on("top-down view from above").setOrientation(java.to([1,0,0,-1.570796],
java.ty
pe("float[]"))).setPosition(java.to([0,100,0], java.type("float[]")))))


  ^

TypeError: java.type is not a function
    at Object.<anonymous> (C:\x3d-code\www.web3d.org
\x3d\stylesheets\java\node\e
xamples\HelloWorldProgramOutput.Node.js:58:159)
?[90m    at Module._compile (internal/modules/cjs/loader.js:1176:30)?[39m
?[90m    at Object.Module._extensions..js
(internal/modules/cjs/loader.js:1196:1
0)?[39m
?[90m    at Module.load (internal/modules/cjs/loader.js:1040:32)?[39m
?[90m    at Function.Module._load
(internal/modules/cjs/loader.js:929:14)?[39m
?[90m    at Function.executeUserEntryPoint [as runMain]
(internal/modules/run_ma
in.js:71:12)?[39m
?[90m    at internal/main/run_main_module.js:17:47?[39m

On Thu, May 28, 2020 at 6:05 PM John Carlson <yottzumm at gmail.com> wrote:

> Found a bug in:
>
> www.web3d.org/x3d/stylesheets/java/node!
>
> I believe this is due to X3DJSAIL no longer emitting JavaScript.
>
> We can either delete the example from the build, or add the
> X3dToNodeJS.xslt to the to*JavaScript() functions in X3DJSAIL (recommended):
>
> $ grep -i javascript'('  CreateX3dSceneAccessInterfaceJava.xslt|grep public
>         public String toStringJavaScript()
>     public File toFileJavaScript(String fileName)
>
> This is a effort replace the nashorn output from X3DJSAIL.   We are now
> supporting nodejs instead since Nashorn has been deprecated by Oracle.
>
> 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.
>
> It's a good test of the FFI, and supports node.js processing on the
> server, for those that choose that route.
>
> The solution on the browser is to write an es6 x3d.mjs library
> (TBD--partly done).
>
> Thanks,
>
> John
>
> On Thu, May 28, 2020 at 5:37 PM John Carlson <yottzumm at gmail.com> wrote:
>
>> I fixed the bug in
>>
>> www.web3d.org/x3d/stylesheets/java/node!
>>
>> Diff:
>>
>> $ svn diff examples/HelloWorldProgramOutput.js
>> Index: examples/HelloWorldProgramOutput.js
>> ===================================================================
>> --- examples/HelloWorldProgramOutput.js (revision 30476)
>> +++ examples/HelloWorldProgramOutput.js (working copy)
>> @@ -19,7 +19,7 @@
>>  var ProtoInstance4 = null;
>>  var ProtoInstance5 = null;
>>  var ProtoInstance6 = null;
>> -      var X3D0 =  new
>> autoclass.X3D().setProfile("Immersive").setVersion("3.3")
>> +      var X3D0 =  (new
>> autoclass.X3D()).setProfile("Immersive").setVersion("3.3")
>>        .addComments(new autoclass.CommentsBlock("
>> x3dVersionComparisonTest for this model:
>> supportsX3dVersion(X3DObject.VERSION_3_0)=true "))
>>        .setHead(new autoclass.head()
>>          .addComments(new autoclass.CommentsBlock(" comment #1 "))
>>
>> Will check in soon.
>>
>> 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.
>>
>> Thanks,
>>
>> John
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20200528/4593c2ff/attachment-0001.html>


More information about the x3d-public mailing list