[x3d-public] Foray into ES6 SAI HelloWorld.mjs. Look at x3d.py examples? Best way to do comments in ECMAScript?
    John Carlson 
    yottzumm at gmail.com
       
    Sat Apr 17 16:20:23 PDT 2021
    
    
  
~/X3DJSONLD/src/main/node/ECMAScriptSerializer.js output from 
~/X3DJSONLD/src/main/data/HelloWorld.json
Other conversions use addComments(..., x3d.py uses #, I suggest we 
follow after the python example.
Below, not valid ECMAScript (see #comment)
From: ~/X3DJSONLD/src/main/node/net/ecma/data/HelloWorld.mjs
var X3D0 =  new X3D({
       profile : new SFString("Immersive"),
       version : new SFString("3.3"),
       head : new SFNode(
         new head({
           { "#comment" : new CommentsBlock("Alternate encodings: 
VRML97, X3D ClassicVRML Encoding, X3D Compressed Binary Encoding (CBE),
  X3DOM, JSON") },
           meta : new MFNode([
             new meta({
               name : new SFString("title"),
               content : new SFString("HelloWorld.x3d")}),
             new meta({
               name : new SFString("description"),
               content : new SFString("Simple X3D model example: Hello 
World!")}),
             new meta({
               name : new SFString("created"),
               content : new SFString("30 October 2000")}),
Suggest using /* */ or // (comments) to remove from JS code (this is NOT 
JSON!).
Feedback from JavaScript SAI standard?
    
    
More information about the x3d-public
mailing list