Commit Graph
2 Commits
Author SHA1 Message Date
dotCooCoo 01673695af JavaScript: a computed XML name or attribute run cannot add markup
An embedded expression used as a tag or attribute name must now be one XML
name, and one used as a run of attributes must hold only name="value"
attributes separated by white space. Anything else throws SyntaxError, so a
script string cannot add an attribute, close the tag or add a child.

{name}={value} in a tag now reads as a computed attribute name, as in the
example in ECMA-357 section 11.1.4.
2026-11-09 07:47:29 -08:00
dotCooCoo f85c555014 JavaScript: run E4X XML literals and the XML, XMLList, Namespace and QName objects behind an option
With `Options::e4x` set, vectorcraft-js runs ECMA-357 (2nd edition):
XML and XMLList literals with embedded expressions, the `..`, `.@`,
`.*`, `.()` and `::` selectors, assignment and `delete` on selected
nodes, `for each`, `default xml namespace`, and the four objects with
their methods and settings. The option is off by default, and without
it the syntax and globals do not exist.

Parsing, serializing, comparing and copying trees use no native stack,
and each takes fuel and counts against the heap limit. Inserting a node
into itself or its descendants throws a TypeError before the tree
changes. A literal or XML string nested past `Options::max_depth` gives
a SyntaxError, and a tree built past that depth stops at the heap limit.
`XML.prototype.xpath` is not provided.
2026-11-09 06:50:32 -08:00