@wavemaker/angular-codegen 11.15.5-rc.259 → 11.15.5-rc.262
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/angular-app/dependency-report.html +1 -1
- package/angular-app/npm-shrinkwrap.json +1134 -1108
- package/angular-app/package-lock.json +1134 -1108
- package/angular-app/package.json +14 -12
- package/build-angular-app.js +2 -2
- package/dependencies/custom-widgets-bundle.cjs.js +14 -37
- package/dependencies/pipe-provider.cjs.js +370 -60
- package/dependencies/transpilation-web.cjs.js +185 -30
- package/npm-shrinkwrap.json +76 -73
- package/package-lock.json +76 -73
- package/package.json +2 -2
- package/src/expr-parser-utils.js +1 -1
- package/src/gen-app-skeleton.js +1 -1
- package/src/wm-utils.js +1 -1
|
@@ -37722,11 +37722,22 @@ function requireConventions () {
|
|
|
37722
37722
|
XMLNS: 'http://www.w3.org/2000/xmlns/',
|
|
37723
37723
|
});
|
|
37724
37724
|
|
|
37725
|
+
//[4] NameStartChar ::= ":" | [A-Z] | "_" | [a-z] | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x2FF] | [#x370-#x37D] | [#x37F-#x1FFF] | [#x200C-#x200D] | [#x2070-#x218F] | [#x2C00-#x2FEF] | [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF]
|
|
37726
|
+
//[4a] NameChar ::= NameStartChar | "-" | "." | [0-9] | #xB7 | [#x0300-#x036F] | [#x203F-#x2040]
|
|
37727
|
+
//[5] Name ::= NameStartChar (NameChar)*
|
|
37728
|
+
var nameStartChar = /[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;//\u10000-\uEFFFF
|
|
37729
|
+
var nameChar = new RegExp("[\\-\\.0-9"+nameStartChar.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]");
|
|
37730
|
+
var tagNamePattern = new RegExp('^'+nameStartChar.source+nameChar.source+'*(?:\:'+nameStartChar.source+nameChar.source+'*)?$');
|
|
37731
|
+
//var tagNamePattern = /^[a-zA-Z_][\w\-\.]*(?:\:[a-zA-Z_][\w\-\.]*)?$/
|
|
37732
|
+
|
|
37725
37733
|
conventions.assign = assign;
|
|
37726
37734
|
conventions.find = find;
|
|
37727
37735
|
conventions.freeze = freeze;
|
|
37728
37736
|
conventions.MIME_TYPE = MIME_TYPE;
|
|
37729
37737
|
conventions.NAMESPACE = NAMESPACE;
|
|
37738
|
+
conventions.nameStartChar = nameStartChar;
|
|
37739
|
+
conventions.nameChar = nameChar;
|
|
37740
|
+
conventions.tagNamePattern = tagNamePattern;
|
|
37730
37741
|
return conventions;
|
|
37731
37742
|
}
|
|
37732
37743
|
|
|
@@ -37739,6 +37750,7 @@ function requireDom () {
|
|
|
37739
37750
|
|
|
37740
37751
|
var find = conventions.find;
|
|
37741
37752
|
var NAMESPACE = conventions.NAMESPACE;
|
|
37753
|
+
var tagNamePattern = conventions.tagNamePattern;
|
|
37742
37754
|
|
|
37743
37755
|
/**
|
|
37744
37756
|
* A prerequisite for `[].filter`, to drop elements that are empty
|
|
@@ -37970,6 +37982,13 @@ function requireDom () {
|
|
|
37970
37982
|
* used for attributes or DocumentType entities
|
|
37971
37983
|
*/
|
|
37972
37984
|
function NamedNodeMap() {
|
|
37985
|
+
// nodeName -> Attr membership index; lets the parse-time de-duplication in
|
|
37986
|
+
// setNamedItem resolve an existing attribute in O(1) instead of scanning the
|
|
37987
|
+
// list, so building an element with M attributes costs O(M) rather than O(M^2).
|
|
37988
|
+
// The numbered entries and length remain the sole authority for attribute order.
|
|
37989
|
+
// Object.create(null) so an attribute named __proto__ or constructor is an
|
|
37990
|
+
// ordinary key.
|
|
37991
|
+
this._nameIndex = Object.create(null);
|
|
37973
37992
|
}
|
|
37974
37993
|
function _findNodeIndex(list,node){
|
|
37975
37994
|
var i = list.length;
|
|
@@ -37978,12 +37997,27 @@ function requireDom () {
|
|
|
37978
37997
|
}
|
|
37979
37998
|
}
|
|
37980
37999
|
|
|
38000
|
+
function _nnmIndexAdd(list, attr) {
|
|
38001
|
+
list._nameIndex[attr.nodeName] = attr;
|
|
38002
|
+
}
|
|
38003
|
+
function _nnmIndexRemove(list, attr) {
|
|
38004
|
+
// Only drop the entry if it still points at this attribute; a replacement with
|
|
38005
|
+
// a different nodeName may already have re-keyed it.
|
|
38006
|
+
if (list._nameIndex[attr.nodeName] === attr) {
|
|
38007
|
+
delete list._nameIndex[attr.nodeName];
|
|
38008
|
+
}
|
|
38009
|
+
}
|
|
38010
|
+
|
|
37981
38011
|
function _addNamedNode(el,list,newAttr,oldAttr){
|
|
37982
38012
|
if(oldAttr){
|
|
37983
38013
|
list[_findNodeIndex(list,oldAttr)] = newAttr;
|
|
38014
|
+
// oldAttr leaves the list; drop its index entry (its nodeName may differ
|
|
38015
|
+
// from newAttr's when the replacement came via setNamedItemNS).
|
|
38016
|
+
_nnmIndexRemove(list, oldAttr);
|
|
37984
38017
|
}else {
|
|
37985
38018
|
list[list.length++] = newAttr;
|
|
37986
38019
|
}
|
|
38020
|
+
_nnmIndexAdd(list, newAttr);
|
|
37987
38021
|
if(el){
|
|
37988
38022
|
newAttr.ownerElement = el;
|
|
37989
38023
|
var doc = el.ownerDocument;
|
|
@@ -38002,6 +38036,7 @@ function requireDom () {
|
|
|
38002
38036
|
list[i] = list[++i];
|
|
38003
38037
|
}
|
|
38004
38038
|
list.length = lastIndex;
|
|
38039
|
+
_nnmIndexRemove(list, attr);
|
|
38005
38040
|
if(el){
|
|
38006
38041
|
var doc = el.ownerDocument;
|
|
38007
38042
|
if(doc){
|
|
@@ -38035,7 +38070,11 @@ function requireDom () {
|
|
|
38035
38070
|
if(el && el!=this._ownerElement){
|
|
38036
38071
|
throw new DOMException(INUSE_ATTRIBUTE_ERR);
|
|
38037
38072
|
}
|
|
38038
|
-
|
|
38073
|
+
// Resolve any existing attribute with the same nodeName through the O(1)
|
|
38074
|
+
// membership index rather than an O(M) scan — this is the parse-dedup hot
|
|
38075
|
+
// path (setAttributeNode per attribute during parse). Absent -> undefined,
|
|
38076
|
+
// matching getNamedItem's contract.
|
|
38077
|
+
var oldAttr = this._nameIndex[attr.nodeName];
|
|
38039
38078
|
_addNamedNode(this._ownerElement,this,attr,oldAttr);
|
|
38040
38079
|
return oldAttr;
|
|
38041
38080
|
},
|
|
@@ -38268,9 +38307,38 @@ function requireDom () {
|
|
|
38268
38307
|
while (child) {
|
|
38269
38308
|
var next = child.nextSibling;
|
|
38270
38309
|
if (next !== null && next.nodeType === TEXT_NODE && child.nodeType === TEXT_NODE) {
|
|
38271
|
-
|
|
38272
|
-
|
|
38273
|
-
//
|
|
38310
|
+
// Merge the whole run of adjacent text nodes at once: gather the
|
|
38311
|
+
// following text siblings' data, unlink them in a single pass, and
|
|
38312
|
+
// re-index the child list a single time. Per-sibling `removeChild`
|
|
38313
|
+
// (each an O(K) re-index) plus per-sibling `appendData` (each an O(K)
|
|
38314
|
+
// string rebuild) is O(K^2) over a long run of single-character text
|
|
38315
|
+
// nodes; this keeps it O(K). The first text node of the run survives
|
|
38316
|
+
// and carries the concatenated data, preserving node identity and
|
|
38317
|
+
// locator semantics.
|
|
38318
|
+
var tail = [];
|
|
38319
|
+
var sibling = next;
|
|
38320
|
+
while (sibling !== null && sibling.nodeType === TEXT_NODE) {
|
|
38321
|
+
tail.push(sibling.data);
|
|
38322
|
+
sibling = sibling.nextSibling;
|
|
38323
|
+
}
|
|
38324
|
+
// `sibling` is now the first non-text node after the run, or null.
|
|
38325
|
+
var removed = child.nextSibling;
|
|
38326
|
+
while (removed !== sibling) {
|
|
38327
|
+
var following = removed.nextSibling;
|
|
38328
|
+
removed.parentNode = null;
|
|
38329
|
+
removed.previousSibling = null;
|
|
38330
|
+
removed.nextSibling = null;
|
|
38331
|
+
removed = following;
|
|
38332
|
+
}
|
|
38333
|
+
child.nextSibling = sibling;
|
|
38334
|
+
if (sibling !== null) {
|
|
38335
|
+
sibling.previousSibling = child;
|
|
38336
|
+
} else {
|
|
38337
|
+
node.lastChild = child;
|
|
38338
|
+
}
|
|
38339
|
+
child.appendData(tail.join('')); // single O(K) string rebuild
|
|
38340
|
+
_onUpdateChild(node.ownerDocument, node); // single O(K) re-index
|
|
38341
|
+
child = sibling;
|
|
38274
38342
|
} else {
|
|
38275
38343
|
child = next;
|
|
38276
38344
|
}
|
|
@@ -39081,8 +39149,10 @@ function requireDom () {
|
|
|
39081
39149
|
* - it does not do any input validation on the arguments and doesn't throw "InvalidCharacterError".
|
|
39082
39150
|
*
|
|
39083
39151
|
* Note: When the resulting document is serialized with `requireWellFormed: true`, the
|
|
39084
|
-
* serializer throws with code `INVALID_STATE_ERR` if `.
|
|
39085
|
-
*
|
|
39152
|
+
* serializer throws with code `INVALID_STATE_ERR` if `.target` is not a valid XML `NCName`
|
|
39153
|
+
* (a `Name` with no colon) or is an ASCII case-insensitive match for `"xml"`, or if `.data`
|
|
39154
|
+
* contains `?>` (W3C DOM Parsing §3.2.1.7). Without that option the target and data are
|
|
39155
|
+
* emitted verbatim.
|
|
39086
39156
|
*
|
|
39087
39157
|
* @param {string} target
|
|
39088
39158
|
* @param {string} data
|
|
@@ -39107,7 +39177,27 @@ function requireDom () {
|
|
|
39107
39177
|
node.specified = true;
|
|
39108
39178
|
return node;
|
|
39109
39179
|
},
|
|
39180
|
+
/**
|
|
39181
|
+
* Creates an EntityReference object, serialized as `&name;`.
|
|
39182
|
+
*
|
|
39183
|
+
* The `name` is validated against the XML `Name` production at creation time; an invalid name
|
|
39184
|
+
* throws a `DOMException` with code `INVALID_CHARACTER_ERR`. When the resulting node is
|
|
39185
|
+
* serialized with `requireWellFormed: true`, the serializer re-validates `nodeName` and throws
|
|
39186
|
+
* a `DOMException` with code `INVALID_STATE_ERR` if a later `nodeName` mutation made it invalid;
|
|
39187
|
+
* without that option the name is emitted verbatim.
|
|
39188
|
+
*
|
|
39189
|
+
* Note: xmldom does not expand entities — the parser resolves entity references inline and never
|
|
39190
|
+
* constructs `EntityReference` nodes, so this method is the only producer.
|
|
39191
|
+
*
|
|
39192
|
+
* @param {string} name The name of the entity to reference.
|
|
39193
|
+
* @returns {EntityReference}
|
|
39194
|
+
* @throws {DOMException} With code `INVALID_CHARACTER_ERR` when `name` is not a valid XML `Name`.
|
|
39195
|
+
* @see https://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-392B75AE
|
|
39196
|
+
*/
|
|
39110
39197
|
createEntityReference : function(name){
|
|
39198
|
+
if (!tagNamePattern.test(name)) {
|
|
39199
|
+
throw new DOMException(INVALID_CHARACTER_ERR, 'not a valid xml name "' + name + '"');
|
|
39200
|
+
}
|
|
39111
39201
|
var node = new EntityReference();
|
|
39112
39202
|
node.ownerDocument = this;
|
|
39113
39203
|
node.nodeName = name;
|
|
@@ -39319,15 +39409,16 @@ function requireDom () {
|
|
|
39319
39409
|
/**
|
|
39320
39410
|
* Represents a DocumentType node (the `<!DOCTYPE ...>` declaration).
|
|
39321
39411
|
*
|
|
39322
|
-
* `publicId`, `systemId`, and `internalSubset` are plain own-property assignments.
|
|
39412
|
+
* `name`, `publicId`, `systemId`, and `internalSubset` are plain own-property assignments.
|
|
39323
39413
|
* xmldom does not enforce the `readonly` constraint declared by the WHATWG DOM spec —
|
|
39324
39414
|
* direct property writes succeed silently. Values are serialized verbatim when
|
|
39325
39415
|
* `requireWellFormed` is false (the default). When the serializer is invoked with
|
|
39326
39416
|
* `requireWellFormed: true` (via the 4th-parameter options object), it validates each
|
|
39327
|
-
* field
|
|
39417
|
+
* field — including `name`, which is checked against the XML `Name` production — and throws
|
|
39418
|
+
* `DOMException` with code `INVALID_STATE_ERR` on invalid values.
|
|
39328
39419
|
*
|
|
39329
39420
|
* @class
|
|
39330
|
-
* @see https://developer.mozilla.org/
|
|
39421
|
+
* @see https://developer.mozilla.org/docs/Web/API/DocumentType MDN
|
|
39331
39422
|
*/
|
|
39332
39423
|
function DocumentType() {
|
|
39333
39424
|
} DocumentType.prototype.nodeType = DOCUMENT_TYPE_NODE;
|
|
@@ -39341,6 +39432,20 @@ function requireDom () {
|
|
|
39341
39432
|
} Entity.prototype.nodeType = ENTITY_NODE;
|
|
39342
39433
|
_extends(Entity,Node);
|
|
39343
39434
|
|
|
39435
|
+
/**
|
|
39436
|
+
* Represents an EntityReference node, serialized as `&nodeName;`.
|
|
39437
|
+
*
|
|
39438
|
+
* `nodeName` is the referenced entity's name, stored verbatim. When serialized with
|
|
39439
|
+
* `requireWellFormed: true`, the serializer validates `nodeName` against the XML `Name` production
|
|
39440
|
+
* and throws a `DOMException` with code `INVALID_STATE_ERR` if it does not match; without that
|
|
39441
|
+
* option the name is emitted verbatim between `&` and `;`.
|
|
39442
|
+
*
|
|
39443
|
+
* Note: xmldom does not expand entities — the parser resolves entity references inline and never
|
|
39444
|
+
* constructs `EntityReference` nodes, so the only producer is `Document.createEntityReference`.
|
|
39445
|
+
*
|
|
39446
|
+
* @class
|
|
39447
|
+
* @see https://www.w3.org/TR/xml/#NT-Name
|
|
39448
|
+
*/
|
|
39344
39449
|
function EntityReference() {
|
|
39345
39450
|
} EntityReference.prototype.nodeType = ENTITY_REFERENCE_NODE;
|
|
39346
39451
|
_extends(EntityReference,Node);
|
|
@@ -39378,14 +39483,20 @@ function requireDom () {
|
|
|
39378
39483
|
* @returns {string}
|
|
39379
39484
|
* @throws {DOMException}
|
|
39380
39485
|
* With code `INVALID_STATE_ERR` when `requireWellFormed` is `true` and:
|
|
39486
|
+
* - an Element's qualified name (including any namespace prefix) is not a valid XML QName,
|
|
39487
|
+
* - an attribute's qualified name (including a synthesized `xmlns:` namespace declaration) is
|
|
39488
|
+
* not a valid XML QName,
|
|
39381
39489
|
* - a CDATASection node's data contains `"]]>"`,
|
|
39382
39490
|
* - a Comment node's data contains `"-->"` (bare `"--"` does not throw on this branch),
|
|
39383
|
-
* - a ProcessingInstruction's
|
|
39491
|
+
* - a ProcessingInstruction's target is not a valid XML `NCName` (a `Name` with no colon) or is
|
|
39492
|
+
* an ASCII case-insensitive match for `"xml"`, or its data contains `"?>"`,
|
|
39493
|
+
* - a DocumentType's `name` is not a valid XML `Name` (XML 1.0 production [5]),
|
|
39384
39494
|
* - a DocumentType's `publicId` is non-empty and does not match the XML `PubidLiteral`
|
|
39385
39495
|
* production,
|
|
39386
39496
|
* - a DocumentType's `systemId` is non-empty and does not match the XML `SystemLiteral`
|
|
39387
|
-
* production,
|
|
39388
|
-
* - a DocumentType's `internalSubset` contains `"]>"
|
|
39497
|
+
* production,
|
|
39498
|
+
* - a DocumentType's `internalSubset` contains `"]>"`, or
|
|
39499
|
+
* - an EntityReference's `nodeName` is not a valid XML `Name` (XML 1.0 production [5]).
|
|
39389
39500
|
* Note: xmldom does not enforce `readonly` on DocumentType fields — direct property
|
|
39390
39501
|
* writes succeed and are covered by the serializer-level checks above.
|
|
39391
39502
|
* @see https://html.spec.whatwg.org/#dom-xmlserializer-serializetostring
|
|
@@ -39459,7 +39570,10 @@ function requireDom () {
|
|
|
39459
39570
|
* @see https://www.w3.org/TR/xml11/#AVNormalize
|
|
39460
39571
|
* @see https://w3c.github.io/DOM-Parsing/#serializing-an-element-s-attributes
|
|
39461
39572
|
*/
|
|
39462
|
-
function addSerializedAttribute(buf, qualifiedName, value) {
|
|
39573
|
+
function addSerializedAttribute(buf, qualifiedName, value, requireWellFormed) {
|
|
39574
|
+
if (requireWellFormed && !tagNamePattern.test(qualifiedName)) {
|
|
39575
|
+
throw new DOMException(INVALID_STATE_ERR, 'The attribute name "' + qualifiedName + '" is not a valid XML QName');
|
|
39576
|
+
}
|
|
39463
39577
|
buf.push(' ', qualifiedName, '="', value.replace(/[<>&"\t\n\r]/g, _xmlEncoder), '"');
|
|
39464
39578
|
}
|
|
39465
39579
|
|
|
@@ -39525,6 +39639,9 @@ function requireDom () {
|
|
|
39525
39639
|
}
|
|
39526
39640
|
}
|
|
39527
39641
|
|
|
39642
|
+
if (requireWellFormed && !tagNamePattern.test(prefixedNodeName)) {
|
|
39643
|
+
throw new DOMException(INVALID_STATE_ERR, 'The element name "' + prefixedNodeName + '" is not a valid XML QName');
|
|
39644
|
+
}
|
|
39528
39645
|
buf.push('<', prefixedNodeName);
|
|
39529
39646
|
|
|
39530
39647
|
// Build a fresh namespace snapshot for this element's children.
|
|
@@ -39544,7 +39661,7 @@ function requireDom () {
|
|
|
39544
39661
|
if (needNamespaceDefine(attr, html, childNs)) {
|
|
39545
39662
|
var attrPrefix = attr.prefix || '';
|
|
39546
39663
|
var uri = attr.namespaceURI;
|
|
39547
|
-
addSerializedAttribute(buf, attrPrefix ? 'xmlns:' + attrPrefix : 'xmlns', uri);
|
|
39664
|
+
addSerializedAttribute(buf, attrPrefix ? 'xmlns:' + attrPrefix : 'xmlns', uri, requireWellFormed);
|
|
39548
39665
|
childNs.push({ prefix: attrPrefix, namespace: uri });
|
|
39549
39666
|
}
|
|
39550
39667
|
// Apply nodeFilter and serialize the attribute.
|
|
@@ -39553,7 +39670,7 @@ function requireDom () {
|
|
|
39553
39670
|
if (typeof filteredAttr === 'string') {
|
|
39554
39671
|
buf.push(filteredAttr);
|
|
39555
39672
|
} else {
|
|
39556
|
-
addSerializedAttribute(buf, filteredAttr.name, filteredAttr.value);
|
|
39673
|
+
addSerializedAttribute(buf, filteredAttr.name, filteredAttr.value, requireWellFormed);
|
|
39557
39674
|
}
|
|
39558
39675
|
}
|
|
39559
39676
|
}
|
|
@@ -39562,7 +39679,7 @@ function requireDom () {
|
|
|
39562
39679
|
if (nodeName === prefixedNodeName && needNamespaceDefine(n, html, childNs)) {
|
|
39563
39680
|
var nodePrefix = n.prefix || '';
|
|
39564
39681
|
var uri = n.namespaceURI;
|
|
39565
|
-
addSerializedAttribute(buf, nodePrefix ? 'xmlns:' + nodePrefix : 'xmlns', uri);
|
|
39682
|
+
addSerializedAttribute(buf, nodePrefix ? 'xmlns:' + nodePrefix : 'xmlns', uri, requireWellFormed);
|
|
39566
39683
|
childNs.push({ prefix: nodePrefix, namespace: uri });
|
|
39567
39684
|
}
|
|
39568
39685
|
|
|
@@ -39595,7 +39712,7 @@ function requireDom () {
|
|
|
39595
39712
|
return { ns: ns.slice(), isHTML: html, tag: null };
|
|
39596
39713
|
|
|
39597
39714
|
case ATTRIBUTE_NODE:
|
|
39598
|
-
addSerializedAttribute(buf, n.name, n.value);
|
|
39715
|
+
addSerializedAttribute(buf, n.name, n.value, requireWellFormed);
|
|
39599
39716
|
return null;
|
|
39600
39717
|
|
|
39601
39718
|
case TEXT_NODE:
|
|
@@ -39634,6 +39751,9 @@ function requireDom () {
|
|
|
39634
39751
|
|
|
39635
39752
|
case DOCUMENT_TYPE_NODE:
|
|
39636
39753
|
if (requireWellFormed) {
|
|
39754
|
+
if (!tagNamePattern.test(n.name)) {
|
|
39755
|
+
throw new DOMException(INVALID_STATE_ERR, 'The doctype name "' + n.name + '" is not a valid XML Name');
|
|
39756
|
+
}
|
|
39637
39757
|
if (n.publicId && !/^("[\x20\r\na-zA-Z0-9\-()+,.\/:=?;!*#@$_%']*"|'[\x20\r\na-zA-Z0-9\-()+,.\/:=?;!*#@$_%'"]*')$/.test(n.publicId)) {
|
|
39638
39758
|
throw new DOMException(INVALID_STATE_ERR, 'DocumentType publicId is not a valid PubidLiteral');
|
|
39639
39759
|
}
|
|
@@ -39665,13 +39785,27 @@ function requireDom () {
|
|
|
39665
39785
|
return null;
|
|
39666
39786
|
|
|
39667
39787
|
case PROCESSING_INSTRUCTION_NODE:
|
|
39668
|
-
if (requireWellFormed
|
|
39669
|
-
|
|
39788
|
+
if (requireWellFormed) {
|
|
39789
|
+
if (!tagNamePattern.test(n.target) || n.target.indexOf(':') !== -1 || n.target.toLowerCase() === 'xml') {
|
|
39790
|
+
throw new DOMException(
|
|
39791
|
+
INVALID_STATE_ERR,
|
|
39792
|
+
'The processing instruction target "' + n.target + '" is not a valid XML NCName or is reserved'
|
|
39793
|
+
);
|
|
39794
|
+
}
|
|
39795
|
+
if (n.data.indexOf('?>') !== -1) {
|
|
39796
|
+
throw new DOMException(INVALID_STATE_ERR, 'The ProcessingInstruction data contains "?>"');
|
|
39797
|
+
}
|
|
39670
39798
|
}
|
|
39671
39799
|
buf.push('<?', n.target, ' ', n.data, '?>');
|
|
39672
39800
|
return null;
|
|
39673
39801
|
|
|
39674
39802
|
case ENTITY_REFERENCE_NODE:
|
|
39803
|
+
if (requireWellFormed && !tagNamePattern.test(n.nodeName)) {
|
|
39804
|
+
throw new DOMException(
|
|
39805
|
+
INVALID_STATE_ERR,
|
|
39806
|
+
'The entity reference name "' + n.nodeName + '" is not a valid XML Name'
|
|
39807
|
+
);
|
|
39808
|
+
}
|
|
39675
39809
|
buf.push('&', n.nodeName, ';');
|
|
39676
39810
|
return null;
|
|
39677
39811
|
|
|
@@ -42052,14 +42186,8 @@ function requireSax () {
|
|
|
42052
42186
|
if (hasRequiredSax) return sax;
|
|
42053
42187
|
hasRequiredSax = 1;
|
|
42054
42188
|
var NAMESPACE = requireConventions().NAMESPACE;
|
|
42189
|
+
var tagNamePattern = requireConventions().tagNamePattern;
|
|
42055
42190
|
|
|
42056
|
-
//[4] NameStartChar ::= ":" | [A-Z] | "_" | [a-z] | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x2FF] | [#x370-#x37D] | [#x37F-#x1FFF] | [#x200C-#x200D] | [#x2070-#x218F] | [#x2C00-#x2FEF] | [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF]
|
|
42057
|
-
//[4a] NameChar ::= NameStartChar | "-" | "." | [0-9] | #xB7 | [#x0300-#x036F] | [#x203F-#x2040]
|
|
42058
|
-
//[5] Name ::= NameStartChar (NameChar)*
|
|
42059
|
-
var nameStartChar = /[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;//\u10000-\uEFFFF
|
|
42060
|
-
var nameChar = new RegExp("[\\-\\.0-9"+nameStartChar.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]");
|
|
42061
|
-
var tagNamePattern = new RegExp('^'+nameStartChar.source+nameChar.source+'*(?:\:'+nameStartChar.source+nameChar.source+'*)?$');
|
|
42062
|
-
//var tagNamePattern = /^[a-zA-Z_][\w\-\.]*(?:\:[a-zA-Z_][\w\-\.]*)?$/
|
|
42063
42191
|
//var handlers = 'resolveEntity,getExternalSubset,characters,endDocument,endElement,endPrefixMapping,ignorableWhitespace,processingInstruction,setDocumentLocator,skippedEntity,startDocument,startElement,startPrefixMapping,notationDecl,unparsedEntityDecl,error,fatalError,warning,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,comment,endCDATA,endDTD,endEntity,startCDATA,startDTD,startEntity'.split(',')
|
|
42064
42192
|
|
|
42065
42193
|
//S_TAG, S_ATTR, S_EQ, S_ATTR_NOQUOT_VALUE
|
|
@@ -42170,7 +42298,13 @@ function requireSax () {
|
|
|
42170
42298
|
switch(source.charAt(tagStart+1)){
|
|
42171
42299
|
case '/':
|
|
42172
42300
|
var end = source.indexOf('>',tagStart+3);
|
|
42173
|
-
|
|
42301
|
+
// Anchored trailing-whitespace trim. The former `/[ \t\n\r]+$/g` backtracked
|
|
42302
|
+
// quadratically on a name shaped `whitespace-run + non-whitespace char`
|
|
42303
|
+
// (an end tag `</ … x>`): from every start position it extended `[ws]+`
|
|
42304
|
+
// to the end and then failed the `$` anchor. This anchored form matches the
|
|
42305
|
+
// whole string once and captures everything up to the last non-whitespace
|
|
42306
|
+
// character, so it trims in linear time with byte-identical output.
|
|
42307
|
+
var tagName = source.substring(tagStart + 2, end).replace(/^([\s\S]*?[^ \t\n\r])?[ \t\n\r]*$/, '$1');
|
|
42174
42308
|
var config = parseStack.pop();
|
|
42175
42309
|
if(end<0){
|
|
42176
42310
|
|
|
@@ -42181,6 +42315,14 @@ function requireSax () {
|
|
|
42181
42315
|
tagName = tagName.replace(/[\s<].*/,'');
|
|
42182
42316
|
errorHandler.error("end tag name: "+tagName+' maybe not complete');
|
|
42183
42317
|
end = tagStart+1+tagName.length;
|
|
42318
|
+
}else if(/[ \t\n\r]/.test(tagName) && tagNamePattern.test(tagName.split(/[ \t\n\r]/)[0])){
|
|
42319
|
+
// The XML `ETag` production is `'</' Name S? '>'`: only optional whitespace may follow
|
|
42320
|
+
// the `Name`. A valid `Name` followed by whitespace and non-whitespace residue (e.g.
|
|
42321
|
+
// `</a\nbogus>` or `</a bogus>`) is not well-formed, but historically it was silently
|
|
42322
|
+
// accepted (the malformed end tag ignored, the residue dropped, the element left on the
|
|
42323
|
+
// stack). Report it as a recoverable `error` (which a custom errorHandler may escalate to
|
|
42324
|
+
// fatal) while keeping the existing recovery so the parsed DOM stays byte-identical.
|
|
42325
|
+
errorHandler.error('end tag name is followed by whitespace and trailing content: "'+tagName+'"');
|
|
42184
42326
|
}
|
|
42185
42327
|
var localNSMap = config.localNSMap;
|
|
42186
42328
|
var endMatch = config.tagName == tagName;
|
|
@@ -42304,6 +42446,15 @@ function requireSax () {
|
|
|
42304
42446
|
var s = S_TAG;//status
|
|
42305
42447
|
while(true){
|
|
42306
42448
|
var c = source.charAt(p);
|
|
42449
|
+
if (s === S_TAG && c === '<') {
|
|
42450
|
+
// A `<` can never occur inside a tag name. Without this guard the scan runs
|
|
42451
|
+
// on to the next `>` (or EOF) before the tag name is rejected, so a document
|
|
42452
|
+
// with many `<` inside a malformed tag makes each one-character recovery step
|
|
42453
|
+
// re-scan to the distant `>` — O(n^2). Stopping at the `<` keeps each recovery
|
|
42454
|
+
// step bounded. The candidate scanned so far is reported raw, consistent with
|
|
42455
|
+
// the sibling invalid-tag-name throw below.
|
|
42456
|
+
throw new Error('unexpected < in tag name: ' + source.slice(start, p));
|
|
42457
|
+
}
|
|
42307
42458
|
switch(c){
|
|
42308
42459
|
case '=':
|
|
42309
42460
|
if(s === S_ATTR){//attrName
|
|
@@ -42496,9 +42647,13 @@ function requireSax () {
|
|
|
42496
42647
|
if(nsPrefix !== false){//hack!!
|
|
42497
42648
|
if(localNSMap == null){
|
|
42498
42649
|
localNSMap = {};
|
|
42499
|
-
//
|
|
42500
|
-
|
|
42501
|
-
//
|
|
42650
|
+
// Derive the child scope's namespace map by prototype-chain inheritance
|
|
42651
|
+
// instead of a flat copy: lookups inherit ancestor prefixes transparently,
|
|
42652
|
+
// so a document nesting N scopes retains O(N) map entries rather than
|
|
42653
|
+
// sum(1..N) = O(N^2). localNSMap stays a flat own-only record of the
|
|
42654
|
+
// prefixes declared at THIS element, so own-property enumeration
|
|
42655
|
+
// (endPrefixMapping below) still reports only local declarations.
|
|
42656
|
+
currentNSMap = Object.create(currentNSMap);
|
|
42502
42657
|
}
|
|
42503
42658
|
currentNSMap[nsPrefix] = localNSMap[nsPrefix] = value;
|
|
42504
42659
|
a.uri = NAMESPACE.XMLNS;
|