I have done a semi ActionScript 3 virtual machine (no WebAssembly, SWF or AVM2 involved) that runs over W3C and Node.js compatible engines.
This Vector.<float>
is the __AS3_.vec::Vector$float
present in AVM2, whose memory is optimized fo single-precision floating points. There is also the optimization version for int, uint, and Number.
E4X uses the NPM package @xmldom/xmldom
that is compliant to the XML APIs in W3C engines. A few differences include that the root document is what you get when using new XML(object)
and that methods like setNamespace()
have been removed as these do not exist in @xmldom/xmldom
APIs.
Three-dimensional names: public/AS3 namespace or namespace set: during name lookup, if the qualifier is either the "AS3" namespace, or any "public" namespace, or a namespace set containing "AS3" or any "public", or unspecified, the qualifier is considered public.
The Dictionary
type has been programmed to act like:
dict.k
= access to "k" data
dict.k()
= call to a Dictionary method whose name is "k"
dict.call("k")
= call to "k" data (assuming dict.k is Function
)
The thrown errors are normally thrown as in JavaScript; however I have provided fromjserror(val)
and tojserror(val)
operations for transitioning the Error
naturality (it uses an ECMAScript Symbol
-key property for storing the original AS3 error in JS Error
s, but it does a bit more than that).
Bound methods are interned, as well.
Plain objects, arrays, and JSON interconvert, for example, in JSON.parse()
and JSON.stringify()
(out of ActionCore, right in the language global .as sources), because every Object is represented as a JavaScript Array in the format [ctorclass: Class, dynamicproperties: Map, ...slots]
. In ActionScript sources a flex.externals.js.*
package would be used which defines a not too many compiler processed functions that use ActionCore (such as for resolving lexical references from the JavaScript side).