script_ecma.C File Reference

Integration of ECMAScript (ECMA-262) engine. More...

#include <archon/x3d/server/field_type.H>
#include <archon/x3d/server/dump.H>
#include <archon/x3d/server/script_ecma.H>
#include <archon/x3d/server/server.H>

Include dependency graph for script_ecma.C:

Go to the source code of this file.

Namespaces

namespace  Archon
namespace  Archon::X3D
namespace  Archon::X3D::ECMA


Detailed Description

Integration of ECMAScript (ECMA-262) engine.

See also:
http://www.ecma-international.org/publications/standards/Ecma-262.htm
Currently the integrated scripting engine is SpiderMonkey from the Mozilla project.

See also:
http://www.mozilla.org/js/spidermonkey
Todo:
We might need to use the special unicode variants of the SpiderMonkey API calls.
It seems though that it handles UTF8 in strings with no problems (thanks to the cool features of the UTF8 encoding). Never the less, using UTF8 encoded identifiers makes it barf. So if the X3D specification requires that a script input field may use non-ascii characters then we need to switch to the unicode aware API of SpiderMonkey.

Todo:
Currently, events generated by the script methods will be delivered imediately.
This is against the X3D specification. See X3D Specification, ISO/IEC 19775:200x 4.8.3.3 Responding to events (3rd paragraph). The requrement of the specification, that events generated in the course of evaluating a script method should be buffered and delivered no earlier than when the method execution completes, is sensible, since it eliminates potential problem of reentrant script method invocations. It is proberbly best done by simply binding each defined property to a jsval in the Invocation structure and queued in the order of definition. Then upon completion of the handler the queue could be processed.

Todo:
Currently we do not properly support inputOutput fields since we cannot have both a method and a property of the same name.
How is this to solved?

Todo:
Currently we will not be able to handle a situation where a handler for an inputOutput field writes to the same field.
This will cause an infinit recursion. See X3D Specification, ISO/IEC 19775:200x 4.8.3.8 inputOutput fields and the containing node (2nd paragraph).

Definition in file script_ecma.C.


Generated on Sun Jul 30 22:56:29 2006 for Archon by  doxygen 1.4.4