Feature #2886
closedConverting JS Objects to XDM maps
100%
Description
[Mike email 24/07/2016]
JS-to-XDM conversion shouldn't construct a HashTrie as the conversion of a JS object; rather it should wrap the JS object as a JSValue, and a JSValue should behave like a map. To make a JSValue behave like a map, it needs to implement the same methods as HashTrie, at least for read access:
containsKey - true if the object contains the given key
get - if the object contains the given key, return the result of doing JS-to-XDM conversion on the corresponding value
inSituPut - throw error
put - throw error
remove - throw error
keys - return all the keys as XDMString objects
forAllPairs - a composite of keys() and get()
conforms - roughly the same logic as HashTrie.conforms()
and
SaxonJS.U.isMap(item) should return true if item is a JSValue.
With this, we don't have the conflict between JS objects (like Style) that are converted to maps, and others (like Window) that are wrapped as a JSValue.
Please register to edit this issue
Also available in: Atom PDF Tracking page