create3000 / titania

Titania X3D Editor
https://github.com/create3000/titania/wiki
GNU General Public License v3.0
39 stars 10 forks source link

[script] vrml types constructors not available outside functions. #121

Closed splace closed 5 years ago

splace commented 5 years ago

see

http://x3dgraphics.com/examples/X3dForWebAuthors/Chapter09EventUtilitiesScripting/newECMAscriptTestIndex.html

console:

ReferenceError: "SFString is not defined"

create3000 commented 5 years ago

This is a bug in the example.

The spec defines no SFString object, see http://www.web3d.org/documents/specifications/19777-1/V3.3/Part1/functions.html#FieldServices.

Scalar types like SFBool, SFDouble, SFFloat, SFInt32, SFString, SFTime are converted to ECMAScript native types Boolean, Number, String, see http://www.web3d.org/documents/specifications/19777-1/V3.3/Part1/types.html#X3DFieldToECMAScriptConversion and http://www.web3d.org/documents/specifications/19777-1/V3.3/Part1/types.html#t-t-X3DTypesToECMAScriptTypes.

splace commented 5 years ago

OK, good