[x3d-public] node-X3DJSAIL showing same problem as PyJNIus?

John Carlson yottzumm at gmail.com
Sat Apr 11 18:51:51 PDT 2020


node-X3DJSAIL fails on setName return value.   Same issue as PyJNIus
possibly.  Nashorn does NOT show same problem with near equal code.

Suggestions (alternatives):

Use Nashorn for JavaScript interfacing with X3DJSAIL, use different coding
style in NodeSerializer.js/XSLT, use X_ITE for SAI (not tested and
generation isn't complete yet, need to change sets/adds to property
access--possibly), hope and pray that Nashorn isn't buried, and/or is
maintained in OpenJDK or otherwise opensourced, fix contract violation in
X3DJSAIL, or complain to node-java developers.

Recommendation: Move towards X_ITE solution for SAI for now.  Test a few
individual cases in browser, generate HTML around generated JavaScript code
to make it VRMLScript.   Create VRMLScriptSerializer.js based on
node/JavaScriptSerializer.js (SAI version).   Create a vrmlscript folder
for project on sourceforge.

Future:   Work towards supporting VRMLScript in X3DOM, possibly based on
X3DJSONLD's Script*.js program.

X3DJSAIL Interfaces:

$ grep setName MetadataSetObject.java ../../sai/Core/MetadataSet.java|grep
public
MetadataSetObject.java: public final MetadataSetObject setName(String
newValue)
MetadataSetObject.java: public MetadataSetObject setName(SFStringObject
newValue)
../../sai/Core/MetadataSet.java:        public MetadataSet setName(String
newValue);

$ node examples/HelloWorldProgramOutput.js
C:\x3d-code\www.web3d.org
\x3d\stylesheets\node\examples\HelloWorldProgramOutput.
js:95
                .setValue(new
autoclass.MetadataString().setName("extraChildTest
").setValue(java.newArray("java.lang.String", ["checks MetadataSetObject
addValu
e() method"]))))
                ^

TypeError: Cannot read property 'setValue' of null
    at Object.<anonymous> (C:\x3d-code\www.web3d.org
\x3d\stylesheets\node\exampl
es\HelloWorldProgramOutput.js:95:17)
?[90m    at Module._compile (internal/modules/cjs/loader.js:1139:30)?[39m
?[90m    at Object.Module._extensions..js
(internal/modules/cjs/loader.js:1159:1
0)?[39m
?[90m    at Module.load (internal/modules/cjs/loader.js:988:32)?[39m
?[90m    at Function.Module._load
(internal/modules/cjs/loader.js:896: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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20200411/72a3b767/attachment.html>


More information about the x3d-public mailing list