svelte 4.0.0 → 4.0.2
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/README.md +1 -1
- package/compiler.cjs +604 -226
- package/package.json +15 -14
- package/src/compiler/compile/internal_exports.js +1 -1
- package/src/compiler/compile/nodes/Element.js +5 -1
- package/src/compiler/compile/nodes/shared/Context.js +1 -0
- package/src/compiler/compile/render_dom/wrappers/Element/Attribute.js +12 -1
- package/src/compiler/compile/render_dom/wrappers/Element/index.js +12 -4
- package/src/compiler/compile/render_dom/wrappers/RawMustacheTag.js +1 -1
- package/src/runtime/action/public.d.ts +7 -10
- package/src/runtime/internal/Component.js +89 -83
- package/src/runtime/internal/public.d.ts +4 -6
- package/src/runtime/internal/utils.js +36 -1
- package/src/shared/version.js +1 -1
- package/types/index.d.ts +11 -16
- package/types/index.d.ts.map +1 -1
- package/src/compiler/tsconfig.json +0 -15
- package/src/runtime/tsconfig.json +0 -18
package/compiler.cjs
CHANGED
|
@@ -103,6 +103,9 @@ var nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\
|
|
|
103
103
|
var nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u0870-\u0887\u0889-\u088e\u08a0-\u08c9\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c5d\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cdd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u1711\u171f-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4c\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7ca\ua7d0\ua7d1\ua7d3\ua7d5-\ua7d9\ua7f2-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc";
|
|
104
104
|
|
|
105
105
|
// These are a run-length and offset encoded representation of the
|
|
106
|
+
// >0xffff code points that are a valid part of identifiers. The
|
|
107
|
+
// offset starts at 0x10000, and each pair of numbers represents an
|
|
108
|
+
// offset to the next range, and then a size of the range.
|
|
106
109
|
|
|
107
110
|
// Reserved word lists for various dialects of the language
|
|
108
111
|
|
|
@@ -1221,6 +1224,16 @@ pp$8.parseThrowStatement = function(node) {
|
|
|
1221
1224
|
|
|
1222
1225
|
var empty$1 = [];
|
|
1223
1226
|
|
|
1227
|
+
pp$8.parseCatchClauseParam = function() {
|
|
1228
|
+
var param = this.parseBindingAtom();
|
|
1229
|
+
var simple = param.type === "Identifier";
|
|
1230
|
+
this.enterScope(simple ? SCOPE_SIMPLE_CATCH : 0);
|
|
1231
|
+
this.checkLValPattern(param, simple ? BIND_SIMPLE_CATCH : BIND_LEXICAL);
|
|
1232
|
+
this.expect(types$1.parenR);
|
|
1233
|
+
|
|
1234
|
+
return param
|
|
1235
|
+
};
|
|
1236
|
+
|
|
1224
1237
|
pp$8.parseTryStatement = function(node) {
|
|
1225
1238
|
this.next();
|
|
1226
1239
|
node.block = this.parseBlock();
|
|
@@ -1229,11 +1242,7 @@ pp$8.parseTryStatement = function(node) {
|
|
|
1229
1242
|
var clause = this.startNode();
|
|
1230
1243
|
this.next();
|
|
1231
1244
|
if (this.eat(types$1.parenL)) {
|
|
1232
|
-
clause.param = this.
|
|
1233
|
-
var simple = clause.param.type === "Identifier";
|
|
1234
|
-
this.enterScope(simple ? SCOPE_SIMPLE_CATCH : 0);
|
|
1235
|
-
this.checkLValPattern(clause.param, simple ? BIND_SIMPLE_CATCH : BIND_LEXICAL);
|
|
1236
|
-
this.expect(types$1.parenR);
|
|
1245
|
+
clause.param = this.parseCatchClauseParam();
|
|
1237
1246
|
} else {
|
|
1238
1247
|
if (this.options.ecmaVersion < 10) { this.unexpected(); }
|
|
1239
1248
|
clause.param = null;
|
|
@@ -1249,9 +1258,9 @@ pp$8.parseTryStatement = function(node) {
|
|
|
1249
1258
|
return this.finishNode(node, "TryStatement")
|
|
1250
1259
|
};
|
|
1251
1260
|
|
|
1252
|
-
pp$8.parseVarStatement = function(node, kind) {
|
|
1261
|
+
pp$8.parseVarStatement = function(node, kind, allowMissingInitializer) {
|
|
1253
1262
|
this.next();
|
|
1254
|
-
this.parseVar(node, false, kind);
|
|
1263
|
+
this.parseVar(node, false, kind, allowMissingInitializer);
|
|
1255
1264
|
this.semicolon();
|
|
1256
1265
|
return this.finishNode(node, "VariableDeclaration")
|
|
1257
1266
|
};
|
|
@@ -1380,7 +1389,7 @@ pp$8.parseForIn = function(node, init) {
|
|
|
1380
1389
|
|
|
1381
1390
|
// Parse a list of variable declarations.
|
|
1382
1391
|
|
|
1383
|
-
pp$8.parseVar = function(node, isFor, kind) {
|
|
1392
|
+
pp$8.parseVar = function(node, isFor, kind, allowMissingInitializer) {
|
|
1384
1393
|
node.declarations = [];
|
|
1385
1394
|
node.kind = kind;
|
|
1386
1395
|
for (;;) {
|
|
@@ -1388,9 +1397,9 @@ pp$8.parseVar = function(node, isFor, kind) {
|
|
|
1388
1397
|
this.parseVarId(decl, kind);
|
|
1389
1398
|
if (this.eat(types$1.eq)) {
|
|
1390
1399
|
decl.init = this.parseMaybeAssign(isFor);
|
|
1391
|
-
} else if (kind === "const" && !(this.type === types$1._in || (this.options.ecmaVersion >= 6 && this.isContextual("of")))) {
|
|
1400
|
+
} else if (!allowMissingInitializer && kind === "const" && !(this.type === types$1._in || (this.options.ecmaVersion >= 6 && this.isContextual("of")))) {
|
|
1392
1401
|
this.unexpected();
|
|
1393
|
-
} else if (decl.id.type !== "Identifier" && !(isFor && (this.type === types$1._in || this.isContextual("of")))) {
|
|
1402
|
+
} else if (!allowMissingInitializer && decl.id.type !== "Identifier" && !(isFor && (this.type === types$1._in || this.isContextual("of")))) {
|
|
1394
1403
|
this.raise(this.lastTokEnd, "Complex binding patterns require an initialization value");
|
|
1395
1404
|
} else {
|
|
1396
1405
|
decl.init = null;
|
|
@@ -1479,7 +1488,7 @@ pp$8.parseClass = function(node, isStatement) {
|
|
|
1479
1488
|
if (element) {
|
|
1480
1489
|
classBody.body.push(element);
|
|
1481
1490
|
if (element.type === "MethodDefinition" && element.kind === "constructor") {
|
|
1482
|
-
if (hadConstructor) { this.
|
|
1491
|
+
if (hadConstructor) { this.raiseRecoverable(element.start, "Duplicate constructor in the same class"); }
|
|
1483
1492
|
hadConstructor = true;
|
|
1484
1493
|
} else if (element.key && element.key.type === "PrivateIdentifier" && isPrivateNameConflicted(privateNameMap, element)) {
|
|
1485
1494
|
this.raiseRecoverable(element.key.start, ("Identifier '#" + (element.key.name) + "' has already been declared"));
|
|
@@ -1728,44 +1737,36 @@ function checkKeyName(node, name) {
|
|
|
1728
1737
|
|
|
1729
1738
|
// Parses module export declaration.
|
|
1730
1739
|
|
|
1740
|
+
pp$8.parseExportAllDeclaration = function(node, exports) {
|
|
1741
|
+
if (this.options.ecmaVersion >= 11) {
|
|
1742
|
+
if (this.eatContextual("as")) {
|
|
1743
|
+
node.exported = this.parseModuleExportName();
|
|
1744
|
+
this.checkExport(exports, node.exported, this.lastTokStart);
|
|
1745
|
+
} else {
|
|
1746
|
+
node.exported = null;
|
|
1747
|
+
}
|
|
1748
|
+
}
|
|
1749
|
+
this.expectContextual("from");
|
|
1750
|
+
if (this.type !== types$1.string) { this.unexpected(); }
|
|
1751
|
+
node.source = this.parseExprAtom();
|
|
1752
|
+
this.semicolon();
|
|
1753
|
+
return this.finishNode(node, "ExportAllDeclaration")
|
|
1754
|
+
};
|
|
1755
|
+
|
|
1731
1756
|
pp$8.parseExport = function(node, exports) {
|
|
1732
1757
|
this.next();
|
|
1733
1758
|
// export * from '...'
|
|
1734
1759
|
if (this.eat(types$1.star)) {
|
|
1735
|
-
|
|
1736
|
-
if (this.eatContextual("as")) {
|
|
1737
|
-
node.exported = this.parseModuleExportName();
|
|
1738
|
-
this.checkExport(exports, node.exported, this.lastTokStart);
|
|
1739
|
-
} else {
|
|
1740
|
-
node.exported = null;
|
|
1741
|
-
}
|
|
1742
|
-
}
|
|
1743
|
-
this.expectContextual("from");
|
|
1744
|
-
if (this.type !== types$1.string) { this.unexpected(); }
|
|
1745
|
-
node.source = this.parseExprAtom();
|
|
1746
|
-
this.semicolon();
|
|
1747
|
-
return this.finishNode(node, "ExportAllDeclaration")
|
|
1760
|
+
return this.parseExportAllDeclaration(node, exports)
|
|
1748
1761
|
}
|
|
1749
1762
|
if (this.eat(types$1._default)) { // export default ...
|
|
1750
1763
|
this.checkExport(exports, "default", this.lastTokStart);
|
|
1751
|
-
|
|
1752
|
-
if (this.type === types$1._function || (isAsync = this.isAsyncFunction())) {
|
|
1753
|
-
var fNode = this.startNode();
|
|
1754
|
-
this.next();
|
|
1755
|
-
if (isAsync) { this.next(); }
|
|
1756
|
-
node.declaration = this.parseFunction(fNode, FUNC_STATEMENT | FUNC_NULLABLE_ID, false, isAsync);
|
|
1757
|
-
} else if (this.type === types$1._class) {
|
|
1758
|
-
var cNode = this.startNode();
|
|
1759
|
-
node.declaration = this.parseClass(cNode, "nullableID");
|
|
1760
|
-
} else {
|
|
1761
|
-
node.declaration = this.parseMaybeAssign();
|
|
1762
|
-
this.semicolon();
|
|
1763
|
-
}
|
|
1764
|
+
node.declaration = this.parseExportDefaultDeclaration();
|
|
1764
1765
|
return this.finishNode(node, "ExportDefaultDeclaration")
|
|
1765
1766
|
}
|
|
1766
1767
|
// export var|const|let|function|class ...
|
|
1767
1768
|
if (this.shouldParseExportStatement()) {
|
|
1768
|
-
node.declaration = this.
|
|
1769
|
+
node.declaration = this.parseExportDeclaration(node);
|
|
1769
1770
|
if (node.declaration.type === "VariableDeclaration")
|
|
1770
1771
|
{ this.checkVariableExport(exports, node.declaration.declarations); }
|
|
1771
1772
|
else
|
|
@@ -1799,6 +1800,27 @@ pp$8.parseExport = function(node, exports) {
|
|
|
1799
1800
|
return this.finishNode(node, "ExportNamedDeclaration")
|
|
1800
1801
|
};
|
|
1801
1802
|
|
|
1803
|
+
pp$8.parseExportDeclaration = function(node) {
|
|
1804
|
+
return this.parseStatement(null)
|
|
1805
|
+
};
|
|
1806
|
+
|
|
1807
|
+
pp$8.parseExportDefaultDeclaration = function() {
|
|
1808
|
+
var isAsync;
|
|
1809
|
+
if (this.type === types$1._function || (isAsync = this.isAsyncFunction())) {
|
|
1810
|
+
var fNode = this.startNode();
|
|
1811
|
+
this.next();
|
|
1812
|
+
if (isAsync) { this.next(); }
|
|
1813
|
+
return this.parseFunction(fNode, FUNC_STATEMENT | FUNC_NULLABLE_ID, false, isAsync)
|
|
1814
|
+
} else if (this.type === types$1._class) {
|
|
1815
|
+
var cNode = this.startNode();
|
|
1816
|
+
return this.parseClass(cNode, "nullableID")
|
|
1817
|
+
} else {
|
|
1818
|
+
var declaration = this.parseMaybeAssign();
|
|
1819
|
+
this.semicolon();
|
|
1820
|
+
return declaration
|
|
1821
|
+
}
|
|
1822
|
+
};
|
|
1823
|
+
|
|
1802
1824
|
pp$8.checkExport = function(exports, name, pos) {
|
|
1803
1825
|
if (!exports) { return }
|
|
1804
1826
|
if (typeof name !== "string")
|
|
@@ -1856,6 +1878,20 @@ pp$8.shouldParseExportStatement = function() {
|
|
|
1856
1878
|
|
|
1857
1879
|
// Parses a comma-separated list of module exports.
|
|
1858
1880
|
|
|
1881
|
+
pp$8.parseExportSpecifier = function(exports) {
|
|
1882
|
+
var node = this.startNode();
|
|
1883
|
+
node.local = this.parseModuleExportName();
|
|
1884
|
+
|
|
1885
|
+
node.exported = this.eatContextual("as") ? this.parseModuleExportName() : node.local;
|
|
1886
|
+
this.checkExport(
|
|
1887
|
+
exports,
|
|
1888
|
+
node.exported,
|
|
1889
|
+
node.exported.start
|
|
1890
|
+
);
|
|
1891
|
+
|
|
1892
|
+
return this.finishNode(node, "ExportSpecifier")
|
|
1893
|
+
};
|
|
1894
|
+
|
|
1859
1895
|
pp$8.parseExportSpecifiers = function(exports) {
|
|
1860
1896
|
var nodes = [], first = true;
|
|
1861
1897
|
// export { x, y as z } [from '...']
|
|
@@ -1866,15 +1902,7 @@ pp$8.parseExportSpecifiers = function(exports) {
|
|
|
1866
1902
|
if (this.afterTrailingComma(types$1.braceR)) { break }
|
|
1867
1903
|
} else { first = false; }
|
|
1868
1904
|
|
|
1869
|
-
|
|
1870
|
-
node.local = this.parseModuleExportName();
|
|
1871
|
-
node.exported = this.eatContextual("as") ? this.parseModuleExportName() : node.local;
|
|
1872
|
-
this.checkExport(
|
|
1873
|
-
exports,
|
|
1874
|
-
node.exported,
|
|
1875
|
-
node.exported.start
|
|
1876
|
-
);
|
|
1877
|
-
nodes.push(this.finishNode(node, "ExportSpecifier"));
|
|
1905
|
+
nodes.push(this.parseExportSpecifier(exports));
|
|
1878
1906
|
}
|
|
1879
1907
|
return nodes
|
|
1880
1908
|
};
|
|
@@ -1883,6 +1911,7 @@ pp$8.parseExportSpecifiers = function(exports) {
|
|
|
1883
1911
|
|
|
1884
1912
|
pp$8.parseImport = function(node) {
|
|
1885
1913
|
this.next();
|
|
1914
|
+
|
|
1886
1915
|
// import '...'
|
|
1887
1916
|
if (this.type === types$1.string) {
|
|
1888
1917
|
node.specifiers = empty$1;
|
|
@@ -1898,23 +1927,46 @@ pp$8.parseImport = function(node) {
|
|
|
1898
1927
|
|
|
1899
1928
|
// Parses a comma-separated list of module imports.
|
|
1900
1929
|
|
|
1930
|
+
pp$8.parseImportSpecifier = function() {
|
|
1931
|
+
var node = this.startNode();
|
|
1932
|
+
node.imported = this.parseModuleExportName();
|
|
1933
|
+
|
|
1934
|
+
if (this.eatContextual("as")) {
|
|
1935
|
+
node.local = this.parseIdent();
|
|
1936
|
+
} else {
|
|
1937
|
+
this.checkUnreserved(node.imported);
|
|
1938
|
+
node.local = node.imported;
|
|
1939
|
+
}
|
|
1940
|
+
this.checkLValSimple(node.local, BIND_LEXICAL);
|
|
1941
|
+
|
|
1942
|
+
return this.finishNode(node, "ImportSpecifier")
|
|
1943
|
+
};
|
|
1944
|
+
|
|
1945
|
+
pp$8.parseImportDefaultSpecifier = function() {
|
|
1946
|
+
// import defaultObj, { x, y as z } from '...'
|
|
1947
|
+
var node = this.startNode();
|
|
1948
|
+
node.local = this.parseIdent();
|
|
1949
|
+
this.checkLValSimple(node.local, BIND_LEXICAL);
|
|
1950
|
+
return this.finishNode(node, "ImportDefaultSpecifier")
|
|
1951
|
+
};
|
|
1952
|
+
|
|
1953
|
+
pp$8.parseImportNamespaceSpecifier = function() {
|
|
1954
|
+
var node = this.startNode();
|
|
1955
|
+
this.next();
|
|
1956
|
+
this.expectContextual("as");
|
|
1957
|
+
node.local = this.parseIdent();
|
|
1958
|
+
this.checkLValSimple(node.local, BIND_LEXICAL);
|
|
1959
|
+
return this.finishNode(node, "ImportNamespaceSpecifier")
|
|
1960
|
+
};
|
|
1961
|
+
|
|
1901
1962
|
pp$8.parseImportSpecifiers = function() {
|
|
1902
1963
|
var nodes = [], first = true;
|
|
1903
1964
|
if (this.type === types$1.name) {
|
|
1904
|
-
|
|
1905
|
-
var node = this.startNode();
|
|
1906
|
-
node.local = this.parseIdent();
|
|
1907
|
-
this.checkLValSimple(node.local, BIND_LEXICAL);
|
|
1908
|
-
nodes.push(this.finishNode(node, "ImportDefaultSpecifier"));
|
|
1965
|
+
nodes.push(this.parseImportDefaultSpecifier());
|
|
1909
1966
|
if (!this.eat(types$1.comma)) { return nodes }
|
|
1910
1967
|
}
|
|
1911
1968
|
if (this.type === types$1.star) {
|
|
1912
|
-
|
|
1913
|
-
this.next();
|
|
1914
|
-
this.expectContextual("as");
|
|
1915
|
-
node$1.local = this.parseIdent();
|
|
1916
|
-
this.checkLValSimple(node$1.local, BIND_LEXICAL);
|
|
1917
|
-
nodes.push(this.finishNode(node$1, "ImportNamespaceSpecifier"));
|
|
1969
|
+
nodes.push(this.parseImportNamespaceSpecifier());
|
|
1918
1970
|
return nodes
|
|
1919
1971
|
}
|
|
1920
1972
|
this.expect(types$1.braceL);
|
|
@@ -1924,16 +1976,7 @@ pp$8.parseImportSpecifiers = function() {
|
|
|
1924
1976
|
if (this.afterTrailingComma(types$1.braceR)) { break }
|
|
1925
1977
|
} else { first = false; }
|
|
1926
1978
|
|
|
1927
|
-
|
|
1928
|
-
node$2.imported = this.parseModuleExportName();
|
|
1929
|
-
if (this.eatContextual("as")) {
|
|
1930
|
-
node$2.local = this.parseIdent();
|
|
1931
|
-
} else {
|
|
1932
|
-
this.checkUnreserved(node$2.imported);
|
|
1933
|
-
node$2.local = node$2.imported;
|
|
1934
|
-
}
|
|
1935
|
-
this.checkLValSimple(node$2.local, BIND_LEXICAL);
|
|
1936
|
-
nodes.push(this.finishNode(node$2, "ImportSpecifier"));
|
|
1979
|
+
nodes.push(this.parseImportSpecifier());
|
|
1937
1980
|
}
|
|
1938
1981
|
return nodes
|
|
1939
1982
|
};
|
|
@@ -2106,7 +2149,7 @@ pp$7.parseBindingAtom = function() {
|
|
|
2106
2149
|
return this.parseIdent()
|
|
2107
2150
|
};
|
|
2108
2151
|
|
|
2109
|
-
pp$7.parseBindingList = function(close, allowEmpty, allowTrailingComma) {
|
|
2152
|
+
pp$7.parseBindingList = function(close, allowEmpty, allowTrailingComma, allowModifiers) {
|
|
2110
2153
|
var elts = [], first = true;
|
|
2111
2154
|
while (!this.eat(close)) {
|
|
2112
2155
|
if (first) { first = false; }
|
|
@@ -2119,18 +2162,22 @@ pp$7.parseBindingList = function(close, allowEmpty, allowTrailingComma) {
|
|
|
2119
2162
|
var rest = this.parseRestBinding();
|
|
2120
2163
|
this.parseBindingListItem(rest);
|
|
2121
2164
|
elts.push(rest);
|
|
2122
|
-
if (this.type === types$1.comma) { this.
|
|
2165
|
+
if (this.type === types$1.comma) { this.raiseRecoverable(this.start, "Comma is not permitted after the rest element"); }
|
|
2123
2166
|
this.expect(close);
|
|
2124
2167
|
break
|
|
2125
2168
|
} else {
|
|
2126
|
-
|
|
2127
|
-
this.parseBindingListItem(elem);
|
|
2128
|
-
elts.push(elem);
|
|
2169
|
+
elts.push(this.parseAssignableListItem(allowModifiers));
|
|
2129
2170
|
}
|
|
2130
2171
|
}
|
|
2131
2172
|
return elts
|
|
2132
2173
|
};
|
|
2133
2174
|
|
|
2175
|
+
pp$7.parseAssignableListItem = function(allowModifiers) {
|
|
2176
|
+
var elem = this.parseMaybeDefault(this.start, this.startLoc);
|
|
2177
|
+
this.parseBindingListItem(elem);
|
|
2178
|
+
return elem
|
|
2179
|
+
};
|
|
2180
|
+
|
|
2134
2181
|
pp$7.parseBindingListItem = function(param) {
|
|
2135
2182
|
return param
|
|
2136
2183
|
};
|
|
@@ -2296,6 +2343,9 @@ pp$7.checkLValInnerPattern = function(expr, bindingType, checkClashes) {
|
|
|
2296
2343
|
};
|
|
2297
2344
|
|
|
2298
2345
|
// The algorithm used to determine whether a regexp can appear at a
|
|
2346
|
+
// given point in the program is loosely based on sweet.js' approach.
|
|
2347
|
+
// See https://github.com/mozilla/sweet.js/wiki/design
|
|
2348
|
+
|
|
2299
2349
|
|
|
2300
2350
|
var TokContext = function TokContext(token, isExpr, preserveSpace, override, generator) {
|
|
2301
2351
|
this.token = token;
|
|
@@ -2451,6 +2501,23 @@ types$1.name.updateContext = function(prevType) {
|
|
|
2451
2501
|
};
|
|
2452
2502
|
|
|
2453
2503
|
// A recursive descent parser operates by defining functions for all
|
|
2504
|
+
// syntactic elements, and recursively calling those, each function
|
|
2505
|
+
// advancing the input stream and returning an AST node. Precedence
|
|
2506
|
+
// of constructs (for example, the fact that `!x[1]` means `!(x[1])`
|
|
2507
|
+
// instead of `(!x)[1]` is handled by the fact that the parser
|
|
2508
|
+
// function that parses unary prefix operators is called first, and
|
|
2509
|
+
// in turn calls the function that parses `[]` subscripts — that
|
|
2510
|
+
// way, it'll receive the node for `x[1]` already parsed, and wraps
|
|
2511
|
+
// *that* in the unary operator node.
|
|
2512
|
+
//
|
|
2513
|
+
// Acorn uses an [operator precedence parser][opp] to handle binary
|
|
2514
|
+
// operator precedence, because it is much more compact than using
|
|
2515
|
+
// the technique outlined above, which uses different, nesting
|
|
2516
|
+
// functions to specify precedence, for all of the ten binary
|
|
2517
|
+
// precedence levels that JavaScript defines.
|
|
2518
|
+
//
|
|
2519
|
+
// [opp]: http://en.wikipedia.org/wiki/Operator-precedence_parser
|
|
2520
|
+
|
|
2454
2521
|
|
|
2455
2522
|
var pp$5 = Parser$1.prototype;
|
|
2456
2523
|
|
|
@@ -2754,6 +2821,14 @@ pp$5.parseSubscripts = function(base, startPos, startLoc, noCalls, forInit) {
|
|
|
2754
2821
|
}
|
|
2755
2822
|
};
|
|
2756
2823
|
|
|
2824
|
+
pp$5.shouldParseAsyncArrow = function() {
|
|
2825
|
+
return !this.canInsertSemicolon() && this.eat(types$1.arrow)
|
|
2826
|
+
};
|
|
2827
|
+
|
|
2828
|
+
pp$5.parseSubscriptAsyncArrow = function(startPos, startLoc, exprList, forInit) {
|
|
2829
|
+
return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, true, forInit)
|
|
2830
|
+
};
|
|
2831
|
+
|
|
2757
2832
|
pp$5.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained, forInit) {
|
|
2758
2833
|
var optionalSupported = this.options.ecmaVersion >= 11;
|
|
2759
2834
|
var optional = optionalSupported && this.eat(types$1.questionDot);
|
|
@@ -2782,7 +2857,7 @@ pp$5.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArro
|
|
|
2782
2857
|
this.awaitPos = 0;
|
|
2783
2858
|
this.awaitIdentPos = 0;
|
|
2784
2859
|
var exprList = this.parseExprList(types$1.parenR, this.options.ecmaVersion >= 8, false, refDestructuringErrors);
|
|
2785
|
-
if (maybeAsyncArrow && !optional &&
|
|
2860
|
+
if (maybeAsyncArrow && !optional && this.shouldParseAsyncArrow()) {
|
|
2786
2861
|
this.checkPatternErrors(refDestructuringErrors, false);
|
|
2787
2862
|
this.checkYieldAwaitInDefaultParams();
|
|
2788
2863
|
if (this.awaitIdentPos > 0)
|
|
@@ -2790,7 +2865,7 @@ pp$5.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArro
|
|
|
2790
2865
|
this.yieldPos = oldYieldPos;
|
|
2791
2866
|
this.awaitPos = oldAwaitPos;
|
|
2792
2867
|
this.awaitIdentPos = oldAwaitIdentPos;
|
|
2793
|
-
return this.
|
|
2868
|
+
return this.parseSubscriptAsyncArrow(startPos, startLoc, exprList, forInit)
|
|
2794
2869
|
}
|
|
2795
2870
|
this.checkExpressionErrors(refDestructuringErrors, true);
|
|
2796
2871
|
this.yieldPos = oldYieldPos || this.yieldPos;
|
|
@@ -2820,7 +2895,7 @@ pp$5.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArro
|
|
|
2820
2895
|
// `new`, or an expression wrapped in punctuation like `()`, `[]`,
|
|
2821
2896
|
// or `{}`.
|
|
2822
2897
|
|
|
2823
|
-
pp$5.parseExprAtom = function(refDestructuringErrors, forInit) {
|
|
2898
|
+
pp$5.parseExprAtom = function(refDestructuringErrors, forInit, forNew) {
|
|
2824
2899
|
// If a division operator appears in an expression position, the
|
|
2825
2900
|
// tokenizer got confused, and we force it to read a regexp instead.
|
|
2826
2901
|
if (this.type === types$1.slash) { this.readRegexp(); }
|
|
@@ -2921,17 +2996,21 @@ pp$5.parseExprAtom = function(refDestructuringErrors, forInit) {
|
|
|
2921
2996
|
|
|
2922
2997
|
case types$1._import:
|
|
2923
2998
|
if (this.options.ecmaVersion >= 11) {
|
|
2924
|
-
return this.parseExprImport()
|
|
2999
|
+
return this.parseExprImport(forNew)
|
|
2925
3000
|
} else {
|
|
2926
3001
|
return this.unexpected()
|
|
2927
3002
|
}
|
|
2928
3003
|
|
|
2929
3004
|
default:
|
|
2930
|
-
this.
|
|
3005
|
+
return this.parseExprAtomDefault()
|
|
2931
3006
|
}
|
|
2932
3007
|
};
|
|
2933
3008
|
|
|
2934
|
-
pp$5.
|
|
3009
|
+
pp$5.parseExprAtomDefault = function() {
|
|
3010
|
+
this.unexpected();
|
|
3011
|
+
};
|
|
3012
|
+
|
|
3013
|
+
pp$5.parseExprImport = function(forNew) {
|
|
2935
3014
|
var node = this.startNode();
|
|
2936
3015
|
|
|
2937
3016
|
// Consume `import` as an identifier for `import.meta`.
|
|
@@ -2939,13 +3018,12 @@ pp$5.parseExprImport = function() {
|
|
|
2939
3018
|
if (this.containsEsc) { this.raiseRecoverable(this.start, "Escape sequence in keyword import"); }
|
|
2940
3019
|
var meta = this.parseIdent(true);
|
|
2941
3020
|
|
|
2942
|
-
|
|
2943
|
-
case types$1.parenL:
|
|
3021
|
+
if (this.type === types$1.parenL && !forNew) {
|
|
2944
3022
|
return this.parseDynamicImport(node)
|
|
2945
|
-
|
|
3023
|
+
} else if (this.type === types$1.dot) {
|
|
2946
3024
|
node.meta = meta;
|
|
2947
3025
|
return this.parseImportMeta(node)
|
|
2948
|
-
|
|
3026
|
+
} else {
|
|
2949
3027
|
this.unexpected();
|
|
2950
3028
|
}
|
|
2951
3029
|
};
|
|
@@ -3001,6 +3079,10 @@ pp$5.parseParenExpression = function() {
|
|
|
3001
3079
|
return val
|
|
3002
3080
|
};
|
|
3003
3081
|
|
|
3082
|
+
pp$5.shouldParseArrow = function(exprList) {
|
|
3083
|
+
return !this.canInsertSemicolon()
|
|
3084
|
+
};
|
|
3085
|
+
|
|
3004
3086
|
pp$5.parseParenAndDistinguishExpression = function(canBeArrow, forInit) {
|
|
3005
3087
|
var startPos = this.start, startLoc = this.startLoc, val, allowTrailingComma = this.options.ecmaVersion >= 8;
|
|
3006
3088
|
if (this.options.ecmaVersion >= 6) {
|
|
@@ -3020,7 +3102,12 @@ pp$5.parseParenAndDistinguishExpression = function(canBeArrow, forInit) {
|
|
|
3020
3102
|
} else if (this.type === types$1.ellipsis) {
|
|
3021
3103
|
spreadStart = this.start;
|
|
3022
3104
|
exprList.push(this.parseParenItem(this.parseRestBinding()));
|
|
3023
|
-
if (this.type === types$1.comma) {
|
|
3105
|
+
if (this.type === types$1.comma) {
|
|
3106
|
+
this.raiseRecoverable(
|
|
3107
|
+
this.start,
|
|
3108
|
+
"Comma is not permitted after the rest element"
|
|
3109
|
+
);
|
|
3110
|
+
}
|
|
3024
3111
|
break
|
|
3025
3112
|
} else {
|
|
3026
3113
|
exprList.push(this.parseMaybeAssign(false, refDestructuringErrors, this.parseParenItem));
|
|
@@ -3029,7 +3116,7 @@ pp$5.parseParenAndDistinguishExpression = function(canBeArrow, forInit) {
|
|
|
3029
3116
|
var innerEndPos = this.lastTokEnd, innerEndLoc = this.lastTokEndLoc;
|
|
3030
3117
|
this.expect(types$1.parenR);
|
|
3031
3118
|
|
|
3032
|
-
if (canBeArrow &&
|
|
3119
|
+
if (canBeArrow && this.shouldParseArrow(exprList) && this.eat(types$1.arrow)) {
|
|
3033
3120
|
this.checkPatternErrors(refDestructuringErrors, false);
|
|
3034
3121
|
this.checkYieldAwaitInDefaultParams();
|
|
3035
3122
|
this.yieldPos = oldYieldPos;
|
|
@@ -3095,11 +3182,8 @@ pp$5.parseNew = function() {
|
|
|
3095
3182
|
{ this.raiseRecoverable(node.start, "'new.target' can only be used in functions and class static block"); }
|
|
3096
3183
|
return this.finishNode(node, "MetaProperty")
|
|
3097
3184
|
}
|
|
3098
|
-
var startPos = this.start, startLoc = this.startLoc
|
|
3099
|
-
node.callee = this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true, false);
|
|
3100
|
-
if (isImport && node.callee.type === "ImportExpression") {
|
|
3101
|
-
this.raise(startPos, "Cannot use new with import()");
|
|
3102
|
-
}
|
|
3185
|
+
var startPos = this.start, startLoc = this.startLoc;
|
|
3186
|
+
node.callee = this.parseSubscripts(this.parseExprAtom(null, false, true), startPos, startLoc, true, false);
|
|
3103
3187
|
if (this.eat(types$1.parenL)) { node.arguments = this.parseExprList(types$1.parenR, this.options.ecmaVersion >= 8, false); }
|
|
3104
3188
|
else { node.arguments = empty; }
|
|
3105
3189
|
return this.finishNode(node, "NewExpression")
|
|
@@ -3181,7 +3265,7 @@ pp$5.parseProperty = function(isPattern, refDestructuringErrors) {
|
|
|
3181
3265
|
if (isPattern) {
|
|
3182
3266
|
prop.argument = this.parseIdent(false);
|
|
3183
3267
|
if (this.type === types$1.comma) {
|
|
3184
|
-
this.
|
|
3268
|
+
this.raiseRecoverable(this.start, "Comma is not permitted after the rest element");
|
|
3185
3269
|
}
|
|
3186
3270
|
return this.finishNode(prop, "RestElement")
|
|
3187
3271
|
}
|
|
@@ -3217,6 +3301,23 @@ pp$5.parseProperty = function(isPattern, refDestructuringErrors) {
|
|
|
3217
3301
|
return this.finishNode(prop, "Property")
|
|
3218
3302
|
};
|
|
3219
3303
|
|
|
3304
|
+
pp$5.parseGetterSetter = function(prop) {
|
|
3305
|
+
prop.kind = prop.key.name;
|
|
3306
|
+
this.parsePropertyName(prop);
|
|
3307
|
+
prop.value = this.parseMethod(false);
|
|
3308
|
+
var paramCount = prop.kind === "get" ? 0 : 1;
|
|
3309
|
+
if (prop.value.params.length !== paramCount) {
|
|
3310
|
+
var start = prop.value.start;
|
|
3311
|
+
if (prop.kind === "get")
|
|
3312
|
+
{ this.raiseRecoverable(start, "getter should have no params"); }
|
|
3313
|
+
else
|
|
3314
|
+
{ this.raiseRecoverable(start, "setter should have exactly one param"); }
|
|
3315
|
+
} else {
|
|
3316
|
+
if (prop.kind === "set" && prop.value.params[0].type === "RestElement")
|
|
3317
|
+
{ this.raiseRecoverable(prop.value.params[0].start, "Setter cannot use rest params"); }
|
|
3318
|
+
}
|
|
3319
|
+
};
|
|
3320
|
+
|
|
3220
3321
|
pp$5.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc) {
|
|
3221
3322
|
if ((isGenerator || isAsync) && this.type === types$1.colon)
|
|
3222
3323
|
{ this.unexpected(); }
|
|
@@ -3234,20 +3335,7 @@ pp$5.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startP
|
|
|
3234
3335
|
(prop.key.name === "get" || prop.key.name === "set") &&
|
|
3235
3336
|
(this.type !== types$1.comma && this.type !== types$1.braceR && this.type !== types$1.eq)) {
|
|
3236
3337
|
if (isGenerator || isAsync) { this.unexpected(); }
|
|
3237
|
-
|
|
3238
|
-
this.parsePropertyName(prop);
|
|
3239
|
-
prop.value = this.parseMethod(false);
|
|
3240
|
-
var paramCount = prop.kind === "get" ? 0 : 1;
|
|
3241
|
-
if (prop.value.params.length !== paramCount) {
|
|
3242
|
-
var start = prop.value.start;
|
|
3243
|
-
if (prop.kind === "get")
|
|
3244
|
-
{ this.raiseRecoverable(start, "getter should have no params"); }
|
|
3245
|
-
else
|
|
3246
|
-
{ this.raiseRecoverable(start, "setter should have exactly one param"); }
|
|
3247
|
-
} else {
|
|
3248
|
-
if (prop.kind === "set" && prop.value.params[0].type === "RestElement")
|
|
3249
|
-
{ this.raiseRecoverable(prop.value.params[0].start, "Setter cannot use rest params"); }
|
|
3250
|
-
}
|
|
3338
|
+
this.parseGetterSetter(prop);
|
|
3251
3339
|
} else if (this.options.ecmaVersion >= 6 && !prop.computed && prop.key.type === "Identifier") {
|
|
3252
3340
|
if (isGenerator || isAsync) { this.unexpected(); }
|
|
3253
3341
|
this.checkUnreserved(prop.key);
|
|
@@ -3459,6 +3547,18 @@ pp$5.checkUnreserved = function(ref) {
|
|
|
3459
3547
|
// identifiers.
|
|
3460
3548
|
|
|
3461
3549
|
pp$5.parseIdent = function(liberal) {
|
|
3550
|
+
var node = this.parseIdentNode();
|
|
3551
|
+
this.next(!!liberal);
|
|
3552
|
+
this.finishNode(node, "Identifier");
|
|
3553
|
+
if (!liberal) {
|
|
3554
|
+
this.checkUnreserved(node);
|
|
3555
|
+
if (node.name === "await" && !this.awaitIdentPos)
|
|
3556
|
+
{ this.awaitIdentPos = node.start; }
|
|
3557
|
+
}
|
|
3558
|
+
return node
|
|
3559
|
+
};
|
|
3560
|
+
|
|
3561
|
+
pp$5.parseIdentNode = function() {
|
|
3462
3562
|
var node = this.startNode();
|
|
3463
3563
|
if (this.type === types$1.name) {
|
|
3464
3564
|
node.name = this.value;
|
|
@@ -3470,19 +3570,12 @@ pp$5.parseIdent = function(liberal) {
|
|
|
3470
3570
|
// But there is no chance to pop the context if the keyword is consumed as an identifier such as a property name.
|
|
3471
3571
|
// If the previous token is a dot, this does not apply because the context-managing code already ignored the keyword
|
|
3472
3572
|
if ((node.name === "class" || node.name === "function") &&
|
|
3473
|
-
|
|
3573
|
+
(this.lastTokEnd !== this.lastTokStart + 1 || this.input.charCodeAt(this.lastTokStart) !== 46)) {
|
|
3474
3574
|
this.context.pop();
|
|
3475
3575
|
}
|
|
3476
3576
|
} else {
|
|
3477
3577
|
this.unexpected();
|
|
3478
3578
|
}
|
|
3479
|
-
this.next(!!liberal);
|
|
3480
|
-
this.finishNode(node, "Identifier");
|
|
3481
|
-
if (!liberal) {
|
|
3482
|
-
this.checkUnreserved(node);
|
|
3483
|
-
if (node.name === "await" && !this.awaitIdentPos)
|
|
3484
|
-
{ this.awaitIdentPos = node.start; }
|
|
3485
|
-
}
|
|
3486
3579
|
return node
|
|
3487
3580
|
};
|
|
3488
3581
|
|
|
@@ -3722,6 +3815,18 @@ var unicodeBinaryProperties = {
|
|
|
3722
3815
|
14: ecma14BinaryProperties
|
|
3723
3816
|
};
|
|
3724
3817
|
|
|
3818
|
+
// #table-binary-unicode-properties-of-strings
|
|
3819
|
+
var ecma14BinaryPropertiesOfStrings = "Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji";
|
|
3820
|
+
|
|
3821
|
+
var unicodeBinaryPropertiesOfStrings = {
|
|
3822
|
+
9: "",
|
|
3823
|
+
10: "",
|
|
3824
|
+
11: "",
|
|
3825
|
+
12: "",
|
|
3826
|
+
13: "",
|
|
3827
|
+
14: ecma14BinaryPropertiesOfStrings
|
|
3828
|
+
};
|
|
3829
|
+
|
|
3725
3830
|
// #table-unicode-general-category-values
|
|
3726
3831
|
var unicodeGeneralCategoryValues = "Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu";
|
|
3727
3832
|
|
|
@@ -3731,7 +3836,7 @@ var ecma10ScriptValues = ecma9ScriptValues + " Dogra Dogr Gunjala_Gondi Gong Han
|
|
|
3731
3836
|
var ecma11ScriptValues = ecma10ScriptValues + " Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho";
|
|
3732
3837
|
var ecma12ScriptValues = ecma11ScriptValues + " Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi";
|
|
3733
3838
|
var ecma13ScriptValues = ecma12ScriptValues + " Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith";
|
|
3734
|
-
var ecma14ScriptValues = ecma13ScriptValues + " Kawi Nag_Mundari Nagm";
|
|
3839
|
+
var ecma14ScriptValues = ecma13ScriptValues + " Hrkt Katakana_Or_Hiragana Kawi Nag_Mundari Nagm Unknown Zzzz";
|
|
3735
3840
|
|
|
3736
3841
|
var unicodeScriptValues = {
|
|
3737
3842
|
9: ecma9ScriptValues,
|
|
@@ -3746,6 +3851,7 @@ var data = {};
|
|
|
3746
3851
|
function buildUnicodeData(ecmaVersion) {
|
|
3747
3852
|
var d = data[ecmaVersion] = {
|
|
3748
3853
|
binary: wordsRegexp(unicodeBinaryProperties[ecmaVersion] + " " + unicodeGeneralCategoryValues),
|
|
3854
|
+
binaryOfStrings: wordsRegexp(unicodeBinaryPropertiesOfStrings[ecmaVersion]),
|
|
3749
3855
|
nonBinary: {
|
|
3750
3856
|
General_Category: wordsRegexp(unicodeGeneralCategoryValues),
|
|
3751
3857
|
Script: wordsRegexp(unicodeScriptValues[ecmaVersion])
|
|
@@ -3768,12 +3874,13 @@ var pp$1 = Parser$1.prototype;
|
|
|
3768
3874
|
|
|
3769
3875
|
var RegExpValidationState = function RegExpValidationState(parser) {
|
|
3770
3876
|
this.parser = parser;
|
|
3771
|
-
this.validFlags = "gim" + (parser.options.ecmaVersion >= 6 ? "uy" : "") + (parser.options.ecmaVersion >= 9 ? "s" : "") + (parser.options.ecmaVersion >= 13 ? "d" : "");
|
|
3877
|
+
this.validFlags = "gim" + (parser.options.ecmaVersion >= 6 ? "uy" : "") + (parser.options.ecmaVersion >= 9 ? "s" : "") + (parser.options.ecmaVersion >= 13 ? "d" : "") + (parser.options.ecmaVersion >= 15 ? "v" : "");
|
|
3772
3878
|
this.unicodeProperties = data[parser.options.ecmaVersion >= 14 ? 14 : parser.options.ecmaVersion];
|
|
3773
3879
|
this.source = "";
|
|
3774
3880
|
this.flags = "";
|
|
3775
3881
|
this.start = 0;
|
|
3776
3882
|
this.switchU = false;
|
|
3883
|
+
this.switchV = false;
|
|
3777
3884
|
this.switchN = false;
|
|
3778
3885
|
this.pos = 0;
|
|
3779
3886
|
this.lastIntValue = 0;
|
|
@@ -3786,12 +3893,20 @@ var RegExpValidationState = function RegExpValidationState(parser) {
|
|
|
3786
3893
|
};
|
|
3787
3894
|
|
|
3788
3895
|
RegExpValidationState.prototype.reset = function reset (start, pattern, flags) {
|
|
3896
|
+
var unicodeSets = flags.indexOf("v") !== -1;
|
|
3789
3897
|
var unicode = flags.indexOf("u") !== -1;
|
|
3790
3898
|
this.start = start | 0;
|
|
3791
3899
|
this.source = pattern + "";
|
|
3792
3900
|
this.flags = flags;
|
|
3793
|
-
|
|
3794
|
-
|
|
3901
|
+
if (unicodeSets && this.parser.options.ecmaVersion >= 15) {
|
|
3902
|
+
this.switchU = true;
|
|
3903
|
+
this.switchV = true;
|
|
3904
|
+
this.switchN = true;
|
|
3905
|
+
} else {
|
|
3906
|
+
this.switchU = unicode && this.parser.options.ecmaVersion >= 6;
|
|
3907
|
+
this.switchV = false;
|
|
3908
|
+
this.switchN = unicode && this.parser.options.ecmaVersion >= 9;
|
|
3909
|
+
}
|
|
3795
3910
|
};
|
|
3796
3911
|
|
|
3797
3912
|
RegExpValidationState.prototype.raise = function raise (message) {
|
|
@@ -3860,6 +3975,23 @@ RegExpValidationState.prototype.eat = function eat (ch, forceU) {
|
|
|
3860
3975
|
return false
|
|
3861
3976
|
};
|
|
3862
3977
|
|
|
3978
|
+
RegExpValidationState.prototype.eatChars = function eatChars (chs, forceU) {
|
|
3979
|
+
if ( forceU === void 0 ) forceU = false;
|
|
3980
|
+
|
|
3981
|
+
var pos = this.pos;
|
|
3982
|
+
for (var i = 0, list = chs; i < list.length; i += 1) {
|
|
3983
|
+
var ch = list[i];
|
|
3984
|
+
|
|
3985
|
+
var current = this.at(pos, forceU);
|
|
3986
|
+
if (current === -1 || current !== ch) {
|
|
3987
|
+
return false
|
|
3988
|
+
}
|
|
3989
|
+
pos = this.nextIndex(pos, forceU);
|
|
3990
|
+
}
|
|
3991
|
+
this.pos = pos;
|
|
3992
|
+
return true
|
|
3993
|
+
};
|
|
3994
|
+
|
|
3863
3995
|
/**
|
|
3864
3996
|
* Validate the flags part of a given RegExpLiteral.
|
|
3865
3997
|
*
|
|
@@ -3870,6 +4002,9 @@ pp$1.validateRegExpFlags = function(state) {
|
|
|
3870
4002
|
var validFlags = state.validFlags;
|
|
3871
4003
|
var flags = state.flags;
|
|
3872
4004
|
|
|
4005
|
+
var u = false;
|
|
4006
|
+
var v = false;
|
|
4007
|
+
|
|
3873
4008
|
for (var i = 0; i < flags.length; i++) {
|
|
3874
4009
|
var flag = flags.charAt(i);
|
|
3875
4010
|
if (validFlags.indexOf(flag) === -1) {
|
|
@@ -3878,6 +4013,11 @@ pp$1.validateRegExpFlags = function(state) {
|
|
|
3878
4013
|
if (flags.indexOf(flag, i + 1) > -1) {
|
|
3879
4014
|
this.raise(state.start, "Duplicate regular expression flag");
|
|
3880
4015
|
}
|
|
4016
|
+
if (flag === "u") { u = true; }
|
|
4017
|
+
if (flag === "v") { v = true; }
|
|
4018
|
+
}
|
|
4019
|
+
if (this.options.ecmaVersion >= 15 && u && v) {
|
|
4020
|
+
this.raise(state.start, "Invalid regular expression flag");
|
|
3881
4021
|
}
|
|
3882
4022
|
};
|
|
3883
4023
|
|
|
@@ -4496,6 +4636,12 @@ pp$1.regexp_eatDecimalEscape = function(state) {
|
|
|
4496
4636
|
return false
|
|
4497
4637
|
};
|
|
4498
4638
|
|
|
4639
|
+
// Return values used by character set parsing methods, needed to
|
|
4640
|
+
// forbid negation of sets that can match strings.
|
|
4641
|
+
var CharSetNone = 0; // Nothing parsed
|
|
4642
|
+
var CharSetOk = 1; // Construct parsed, cannot contain strings
|
|
4643
|
+
var CharSetString = 2; // Construct parsed, can contain strings
|
|
4644
|
+
|
|
4499
4645
|
// https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClassEscape
|
|
4500
4646
|
pp$1.regexp_eatCharacterClassEscape = function(state) {
|
|
4501
4647
|
var ch = state.current();
|
|
@@ -4503,28 +4649,32 @@ pp$1.regexp_eatCharacterClassEscape = function(state) {
|
|
|
4503
4649
|
if (isCharacterClassEscape(ch)) {
|
|
4504
4650
|
state.lastIntValue = -1;
|
|
4505
4651
|
state.advance();
|
|
4506
|
-
return
|
|
4652
|
+
return CharSetOk
|
|
4507
4653
|
}
|
|
4508
4654
|
|
|
4655
|
+
var negate = false;
|
|
4509
4656
|
if (
|
|
4510
4657
|
state.switchU &&
|
|
4511
4658
|
this.options.ecmaVersion >= 9 &&
|
|
4512
|
-
(ch === 0x50 /* P */ || ch === 0x70 /* p */)
|
|
4659
|
+
((negate = ch === 0x50 /* P */) || ch === 0x70 /* p */)
|
|
4513
4660
|
) {
|
|
4514
4661
|
state.lastIntValue = -1;
|
|
4515
4662
|
state.advance();
|
|
4663
|
+
var result;
|
|
4516
4664
|
if (
|
|
4517
4665
|
state.eat(0x7B /* { */) &&
|
|
4518
|
-
this.regexp_eatUnicodePropertyValueExpression(state) &&
|
|
4666
|
+
(result = this.regexp_eatUnicodePropertyValueExpression(state)) &&
|
|
4519
4667
|
state.eat(0x7D /* } */)
|
|
4520
4668
|
) {
|
|
4521
|
-
|
|
4669
|
+
if (negate && result === CharSetString) { state.raise("Invalid property name"); }
|
|
4670
|
+
return result
|
|
4522
4671
|
}
|
|
4523
4672
|
state.raise("Invalid property name");
|
|
4524
4673
|
}
|
|
4525
4674
|
|
|
4526
|
-
return
|
|
4675
|
+
return CharSetNone
|
|
4527
4676
|
};
|
|
4677
|
+
|
|
4528
4678
|
function isCharacterClassEscape(ch) {
|
|
4529
4679
|
return (
|
|
4530
4680
|
ch === 0x64 /* d */ ||
|
|
@@ -4548,7 +4698,7 @@ pp$1.regexp_eatUnicodePropertyValueExpression = function(state) {
|
|
|
4548
4698
|
if (this.regexp_eatUnicodePropertyValue(state)) {
|
|
4549
4699
|
var value = state.lastStringValue;
|
|
4550
4700
|
this.regexp_validateUnicodePropertyNameAndValue(state, name, value);
|
|
4551
|
-
return
|
|
4701
|
+
return CharSetOk
|
|
4552
4702
|
}
|
|
4553
4703
|
}
|
|
4554
4704
|
state.pos = start;
|
|
@@ -4556,20 +4706,22 @@ pp$1.regexp_eatUnicodePropertyValueExpression = function(state) {
|
|
|
4556
4706
|
// LoneUnicodePropertyNameOrValue
|
|
4557
4707
|
if (this.regexp_eatLoneUnicodePropertyNameOrValue(state)) {
|
|
4558
4708
|
var nameOrValue = state.lastStringValue;
|
|
4559
|
-
this.regexp_validateUnicodePropertyNameOrValue(state, nameOrValue)
|
|
4560
|
-
return true
|
|
4709
|
+
return this.regexp_validateUnicodePropertyNameOrValue(state, nameOrValue)
|
|
4561
4710
|
}
|
|
4562
|
-
return
|
|
4711
|
+
return CharSetNone
|
|
4563
4712
|
};
|
|
4713
|
+
|
|
4564
4714
|
pp$1.regexp_validateUnicodePropertyNameAndValue = function(state, name, value) {
|
|
4565
4715
|
if (!hasOwn(state.unicodeProperties.nonBinary, name))
|
|
4566
4716
|
{ state.raise("Invalid property name"); }
|
|
4567
4717
|
if (!state.unicodeProperties.nonBinary[name].test(value))
|
|
4568
4718
|
{ state.raise("Invalid property value"); }
|
|
4569
4719
|
};
|
|
4720
|
+
|
|
4570
4721
|
pp$1.regexp_validateUnicodePropertyNameOrValue = function(state, nameOrValue) {
|
|
4571
|
-
if (
|
|
4572
|
-
|
|
4722
|
+
if (state.unicodeProperties.binary.test(nameOrValue)) { return CharSetOk }
|
|
4723
|
+
if (state.switchV && state.unicodeProperties.binaryOfStrings.test(nameOrValue)) { return CharSetString }
|
|
4724
|
+
state.raise("Invalid property name");
|
|
4573
4725
|
};
|
|
4574
4726
|
|
|
4575
4727
|
// UnicodePropertyName ::
|
|
@@ -4583,6 +4735,7 @@ pp$1.regexp_eatUnicodePropertyName = function(state) {
|
|
|
4583
4735
|
}
|
|
4584
4736
|
return state.lastStringValue !== ""
|
|
4585
4737
|
};
|
|
4738
|
+
|
|
4586
4739
|
function isUnicodePropertyNameCharacter(ch) {
|
|
4587
4740
|
return isControlLetter(ch) || ch === 0x5F /* _ */
|
|
4588
4741
|
}
|
|
@@ -4611,21 +4764,29 @@ pp$1.regexp_eatLoneUnicodePropertyNameOrValue = function(state) {
|
|
|
4611
4764
|
// https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClass
|
|
4612
4765
|
pp$1.regexp_eatCharacterClass = function(state) {
|
|
4613
4766
|
if (state.eat(0x5B /* [ */)) {
|
|
4614
|
-
state.eat(0x5E /* ^ */);
|
|
4615
|
-
this.
|
|
4616
|
-
if (state.eat(0x5D /* ] */))
|
|
4617
|
-
|
|
4618
|
-
|
|
4619
|
-
|
|
4620
|
-
|
|
4767
|
+
var negate = state.eat(0x5E /* ^ */);
|
|
4768
|
+
var result = this.regexp_classContents(state);
|
|
4769
|
+
if (!state.eat(0x5D /* ] */))
|
|
4770
|
+
{ state.raise("Unterminated character class"); }
|
|
4771
|
+
if (negate && result === CharSetString)
|
|
4772
|
+
{ state.raise("Negated character class may contain strings"); }
|
|
4773
|
+
return true
|
|
4621
4774
|
}
|
|
4622
4775
|
return false
|
|
4623
4776
|
};
|
|
4624
4777
|
|
|
4778
|
+
// https://tc39.es/ecma262/#prod-ClassContents
|
|
4625
4779
|
// https://www.ecma-international.org/ecma-262/8.0/#prod-ClassRanges
|
|
4780
|
+
pp$1.regexp_classContents = function(state) {
|
|
4781
|
+
if (state.current() === 0x5D /* ] */) { return CharSetOk }
|
|
4782
|
+
if (state.switchV) { return this.regexp_classSetExpression(state) }
|
|
4783
|
+
this.regexp_nonEmptyClassRanges(state);
|
|
4784
|
+
return CharSetOk
|
|
4785
|
+
};
|
|
4786
|
+
|
|
4626
4787
|
// https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRanges
|
|
4627
4788
|
// https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRangesNoDash
|
|
4628
|
-
pp$1.
|
|
4789
|
+
pp$1.regexp_nonEmptyClassRanges = function(state) {
|
|
4629
4790
|
while (this.regexp_eatClassAtom(state)) {
|
|
4630
4791
|
var left = state.lastIntValue;
|
|
4631
4792
|
if (state.eat(0x2D /* - */) && this.regexp_eatClassAtom(state)) {
|
|
@@ -4697,6 +4858,205 @@ pp$1.regexp_eatClassEscape = function(state) {
|
|
|
4697
4858
|
)
|
|
4698
4859
|
};
|
|
4699
4860
|
|
|
4861
|
+
// https://tc39.es/ecma262/#prod-ClassSetExpression
|
|
4862
|
+
// https://tc39.es/ecma262/#prod-ClassUnion
|
|
4863
|
+
// https://tc39.es/ecma262/#prod-ClassIntersection
|
|
4864
|
+
// https://tc39.es/ecma262/#prod-ClassSubtraction
|
|
4865
|
+
pp$1.regexp_classSetExpression = function(state) {
|
|
4866
|
+
var result = CharSetOk, subResult;
|
|
4867
|
+
if (this.regexp_eatClassSetRange(state)) ; else if (subResult = this.regexp_eatClassSetOperand(state)) {
|
|
4868
|
+
if (subResult === CharSetString) { result = CharSetString; }
|
|
4869
|
+
// https://tc39.es/ecma262/#prod-ClassIntersection
|
|
4870
|
+
var start = state.pos;
|
|
4871
|
+
while (state.eatChars([0x26, 0x26] /* && */)) {
|
|
4872
|
+
if (
|
|
4873
|
+
state.current() !== 0x26 /* & */ &&
|
|
4874
|
+
(subResult = this.regexp_eatClassSetOperand(state))
|
|
4875
|
+
) {
|
|
4876
|
+
if (subResult !== CharSetString) { result = CharSetOk; }
|
|
4877
|
+
continue
|
|
4878
|
+
}
|
|
4879
|
+
state.raise("Invalid character in character class");
|
|
4880
|
+
}
|
|
4881
|
+
if (start !== state.pos) { return result }
|
|
4882
|
+
// https://tc39.es/ecma262/#prod-ClassSubtraction
|
|
4883
|
+
while (state.eatChars([0x2D, 0x2D] /* -- */)) {
|
|
4884
|
+
if (this.regexp_eatClassSetOperand(state)) { continue }
|
|
4885
|
+
state.raise("Invalid character in character class");
|
|
4886
|
+
}
|
|
4887
|
+
if (start !== state.pos) { return result }
|
|
4888
|
+
} else {
|
|
4889
|
+
state.raise("Invalid character in character class");
|
|
4890
|
+
}
|
|
4891
|
+
// https://tc39.es/ecma262/#prod-ClassUnion
|
|
4892
|
+
for (;;) {
|
|
4893
|
+
if (this.regexp_eatClassSetRange(state)) { continue }
|
|
4894
|
+
subResult = this.regexp_eatClassSetOperand(state);
|
|
4895
|
+
if (!subResult) { return result }
|
|
4896
|
+
if (subResult === CharSetString) { result = CharSetString; }
|
|
4897
|
+
}
|
|
4898
|
+
};
|
|
4899
|
+
|
|
4900
|
+
// https://tc39.es/ecma262/#prod-ClassSetRange
|
|
4901
|
+
pp$1.regexp_eatClassSetRange = function(state) {
|
|
4902
|
+
var start = state.pos;
|
|
4903
|
+
if (this.regexp_eatClassSetCharacter(state)) {
|
|
4904
|
+
var left = state.lastIntValue;
|
|
4905
|
+
if (state.eat(0x2D /* - */) && this.regexp_eatClassSetCharacter(state)) {
|
|
4906
|
+
var right = state.lastIntValue;
|
|
4907
|
+
if (left !== -1 && right !== -1 && left > right) {
|
|
4908
|
+
state.raise("Range out of order in character class");
|
|
4909
|
+
}
|
|
4910
|
+
return true
|
|
4911
|
+
}
|
|
4912
|
+
state.pos = start;
|
|
4913
|
+
}
|
|
4914
|
+
return false
|
|
4915
|
+
};
|
|
4916
|
+
|
|
4917
|
+
// https://tc39.es/ecma262/#prod-ClassSetOperand
|
|
4918
|
+
pp$1.regexp_eatClassSetOperand = function(state) {
|
|
4919
|
+
if (this.regexp_eatClassSetCharacter(state)) { return CharSetOk }
|
|
4920
|
+
return this.regexp_eatClassStringDisjunction(state) || this.regexp_eatNestedClass(state)
|
|
4921
|
+
};
|
|
4922
|
+
|
|
4923
|
+
// https://tc39.es/ecma262/#prod-NestedClass
|
|
4924
|
+
pp$1.regexp_eatNestedClass = function(state) {
|
|
4925
|
+
var start = state.pos;
|
|
4926
|
+
if (state.eat(0x5B /* [ */)) {
|
|
4927
|
+
var negate = state.eat(0x5E /* ^ */);
|
|
4928
|
+
var result = this.regexp_classContents(state);
|
|
4929
|
+
if (state.eat(0x5D /* ] */)) {
|
|
4930
|
+
if (negate && result === CharSetString) {
|
|
4931
|
+
state.raise("Negated character class may contain strings");
|
|
4932
|
+
}
|
|
4933
|
+
return result
|
|
4934
|
+
}
|
|
4935
|
+
state.pos = start;
|
|
4936
|
+
}
|
|
4937
|
+
if (state.eat(0x5C /* \ */)) {
|
|
4938
|
+
var result$1 = this.regexp_eatCharacterClassEscape(state);
|
|
4939
|
+
if (result$1) {
|
|
4940
|
+
return result$1
|
|
4941
|
+
}
|
|
4942
|
+
state.pos = start;
|
|
4943
|
+
}
|
|
4944
|
+
return null
|
|
4945
|
+
};
|
|
4946
|
+
|
|
4947
|
+
// https://tc39.es/ecma262/#prod-ClassStringDisjunction
|
|
4948
|
+
pp$1.regexp_eatClassStringDisjunction = function(state) {
|
|
4949
|
+
var start = state.pos;
|
|
4950
|
+
if (state.eatChars([0x5C, 0x71] /* \q */)) {
|
|
4951
|
+
if (state.eat(0x7B /* { */)) {
|
|
4952
|
+
var result = this.regexp_classStringDisjunctionContents(state);
|
|
4953
|
+
if (state.eat(0x7D /* } */)) {
|
|
4954
|
+
return result
|
|
4955
|
+
}
|
|
4956
|
+
} else {
|
|
4957
|
+
// Make the same message as V8.
|
|
4958
|
+
state.raise("Invalid escape");
|
|
4959
|
+
}
|
|
4960
|
+
state.pos = start;
|
|
4961
|
+
}
|
|
4962
|
+
return null
|
|
4963
|
+
};
|
|
4964
|
+
|
|
4965
|
+
// https://tc39.es/ecma262/#prod-ClassStringDisjunctionContents
|
|
4966
|
+
pp$1.regexp_classStringDisjunctionContents = function(state) {
|
|
4967
|
+
var result = this.regexp_classString(state);
|
|
4968
|
+
while (state.eat(0x7C /* | */)) {
|
|
4969
|
+
if (this.regexp_classString(state) === CharSetString) { result = CharSetString; }
|
|
4970
|
+
}
|
|
4971
|
+
return result
|
|
4972
|
+
};
|
|
4973
|
+
|
|
4974
|
+
// https://tc39.es/ecma262/#prod-ClassString
|
|
4975
|
+
// https://tc39.es/ecma262/#prod-NonEmptyClassString
|
|
4976
|
+
pp$1.regexp_classString = function(state) {
|
|
4977
|
+
var count = 0;
|
|
4978
|
+
while (this.regexp_eatClassSetCharacter(state)) { count++; }
|
|
4979
|
+
return count === 1 ? CharSetOk : CharSetString
|
|
4980
|
+
};
|
|
4981
|
+
|
|
4982
|
+
// https://tc39.es/ecma262/#prod-ClassSetCharacter
|
|
4983
|
+
pp$1.regexp_eatClassSetCharacter = function(state) {
|
|
4984
|
+
var start = state.pos;
|
|
4985
|
+
if (state.eat(0x5C /* \ */)) {
|
|
4986
|
+
if (
|
|
4987
|
+
this.regexp_eatCharacterEscape(state) ||
|
|
4988
|
+
this.regexp_eatClassSetReservedPunctuator(state)
|
|
4989
|
+
) {
|
|
4990
|
+
return true
|
|
4991
|
+
}
|
|
4992
|
+
if (state.eat(0x62 /* b */)) {
|
|
4993
|
+
state.lastIntValue = 0x08; /* <BS> */
|
|
4994
|
+
return true
|
|
4995
|
+
}
|
|
4996
|
+
state.pos = start;
|
|
4997
|
+
return false
|
|
4998
|
+
}
|
|
4999
|
+
var ch = state.current();
|
|
5000
|
+
if (ch < 0 || ch === state.lookahead() && isClassSetReservedDoublePunctuatorCharacter(ch)) { return false }
|
|
5001
|
+
if (isClassSetSyntaxCharacter(ch)) { return false }
|
|
5002
|
+
state.advance();
|
|
5003
|
+
state.lastIntValue = ch;
|
|
5004
|
+
return true
|
|
5005
|
+
};
|
|
5006
|
+
|
|
5007
|
+
// https://tc39.es/ecma262/#prod-ClassSetReservedDoublePunctuator
|
|
5008
|
+
function isClassSetReservedDoublePunctuatorCharacter(ch) {
|
|
5009
|
+
return (
|
|
5010
|
+
ch === 0x21 /* ! */ ||
|
|
5011
|
+
ch >= 0x23 /* # */ && ch <= 0x26 /* & */ ||
|
|
5012
|
+
ch >= 0x2A /* * */ && ch <= 0x2C /* , */ ||
|
|
5013
|
+
ch === 0x2E /* . */ ||
|
|
5014
|
+
ch >= 0x3A /* : */ && ch <= 0x40 /* @ */ ||
|
|
5015
|
+
ch === 0x5E /* ^ */ ||
|
|
5016
|
+
ch === 0x60 /* ` */ ||
|
|
5017
|
+
ch === 0x7E /* ~ */
|
|
5018
|
+
)
|
|
5019
|
+
}
|
|
5020
|
+
|
|
5021
|
+
// https://tc39.es/ecma262/#prod-ClassSetSyntaxCharacter
|
|
5022
|
+
function isClassSetSyntaxCharacter(ch) {
|
|
5023
|
+
return (
|
|
5024
|
+
ch === 0x28 /* ( */ ||
|
|
5025
|
+
ch === 0x29 /* ) */ ||
|
|
5026
|
+
ch === 0x2D /* - */ ||
|
|
5027
|
+
ch === 0x2F /* / */ ||
|
|
5028
|
+
ch >= 0x5B /* [ */ && ch <= 0x5D /* ] */ ||
|
|
5029
|
+
ch >= 0x7B /* { */ && ch <= 0x7D /* } */
|
|
5030
|
+
)
|
|
5031
|
+
}
|
|
5032
|
+
|
|
5033
|
+
// https://tc39.es/ecma262/#prod-ClassSetReservedPunctuator
|
|
5034
|
+
pp$1.regexp_eatClassSetReservedPunctuator = function(state) {
|
|
5035
|
+
var ch = state.current();
|
|
5036
|
+
if (isClassSetReservedPunctuator(ch)) {
|
|
5037
|
+
state.lastIntValue = ch;
|
|
5038
|
+
state.advance();
|
|
5039
|
+
return true
|
|
5040
|
+
}
|
|
5041
|
+
return false
|
|
5042
|
+
};
|
|
5043
|
+
|
|
5044
|
+
// https://tc39.es/ecma262/#prod-ClassSetReservedPunctuator
|
|
5045
|
+
function isClassSetReservedPunctuator(ch) {
|
|
5046
|
+
return (
|
|
5047
|
+
ch === 0x21 /* ! */ ||
|
|
5048
|
+
ch === 0x23 /* # */ ||
|
|
5049
|
+
ch === 0x25 /* % */ ||
|
|
5050
|
+
ch === 0x26 /* & */ ||
|
|
5051
|
+
ch === 0x2C /* , */ ||
|
|
5052
|
+
ch === 0x2D /* - */ ||
|
|
5053
|
+
ch >= 0x3A /* : */ && ch <= 0x3E /* > */ ||
|
|
5054
|
+
ch === 0x40 /* @ */ ||
|
|
5055
|
+
ch === 0x60 /* ` */ ||
|
|
5056
|
+
ch === 0x7E /* ~ */
|
|
5057
|
+
)
|
|
5058
|
+
}
|
|
5059
|
+
|
|
4700
5060
|
// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassControlLetter
|
|
4701
5061
|
pp$1.regexp_eatClassControlLetter = function(state) {
|
|
4702
5062
|
var ch = state.current();
|
|
@@ -5617,8 +5977,23 @@ pp$a.readWord = function() {
|
|
|
5617
5977
|
};
|
|
5618
5978
|
|
|
5619
5979
|
// Acorn is a tiny, fast JavaScript parser written in JavaScript.
|
|
5980
|
+
//
|
|
5981
|
+
// Acorn was written by Marijn Haverbeke, Ingvar Stepanyan, and
|
|
5982
|
+
// various contributors and released under an MIT license.
|
|
5983
|
+
//
|
|
5984
|
+
// Git repositories for Acorn are available at
|
|
5985
|
+
//
|
|
5986
|
+
// http://marijnhaverbeke.nl/git/acorn
|
|
5987
|
+
// https://github.com/acornjs/acorn.git
|
|
5988
|
+
//
|
|
5989
|
+
// Please use the [github bug tracker][ghbt] to report issues.
|
|
5990
|
+
//
|
|
5991
|
+
// [ghbt]: https://github.com/acornjs/acorn/issues
|
|
5992
|
+
//
|
|
5993
|
+
// [walk]: util/walk.js
|
|
5620
5994
|
|
|
5621
|
-
|
|
5995
|
+
|
|
5996
|
+
var version = "8.9.0";
|
|
5622
5997
|
|
|
5623
5998
|
Parser$1.acorn = {
|
|
5624
5999
|
Parser: Parser$1,
|
|
@@ -16445,6 +16820,7 @@ function unpack_destructuring({
|
|
|
16445
16820
|
if (in_rest_element) {
|
|
16446
16821
|
context_rest_properties.set(node.name, node);
|
|
16447
16822
|
}
|
|
16823
|
+
component.used_names.add(node.name);
|
|
16448
16824
|
} else if (node.type === 'ArrayPattern') {
|
|
16449
16825
|
node.elements.forEach((element, i) => {
|
|
16450
16826
|
if (!element) {
|
|
@@ -18730,22 +19106,6 @@ var sectionRole = {
|
|
|
18730
19106
|
prohibitedProps: [],
|
|
18731
19107
|
props: {},
|
|
18732
19108
|
relatedConcepts: [{
|
|
18733
|
-
concept: {
|
|
18734
|
-
attributes: [{
|
|
18735
|
-
name: 'aria-label'
|
|
18736
|
-
}],
|
|
18737
|
-
name: 'section'
|
|
18738
|
-
},
|
|
18739
|
-
module: 'HTML'
|
|
18740
|
-
}, {
|
|
18741
|
-
concept: {
|
|
18742
|
-
attributes: [{
|
|
18743
|
-
name: 'aria-labelledby'
|
|
18744
|
-
}],
|
|
18745
|
-
name: 'section'
|
|
18746
|
-
},
|
|
18747
|
-
module: 'HTML'
|
|
18748
|
-
}, {
|
|
18749
19109
|
concept: {
|
|
18750
19110
|
name: 'frontmatter'
|
|
18751
19111
|
},
|
|
@@ -19395,95 +19755,85 @@ var comboboxRole = {
|
|
|
19395
19755
|
relatedConcepts: [{
|
|
19396
19756
|
concept: {
|
|
19397
19757
|
attributes: [{
|
|
19398
|
-
|
|
19399
|
-
}, {
|
|
19758
|
+
constraints: ['set'],
|
|
19400
19759
|
name: 'list'
|
|
19401
19760
|
}, {
|
|
19402
19761
|
name: 'type',
|
|
19403
19762
|
value: 'email'
|
|
19404
19763
|
}],
|
|
19405
|
-
constraints: ['the aria-controls attribute is set to the same value as the list attribute'],
|
|
19406
19764
|
name: 'input'
|
|
19407
19765
|
},
|
|
19408
19766
|
module: 'HTML'
|
|
19409
19767
|
}, {
|
|
19410
19768
|
concept: {
|
|
19411
19769
|
attributes: [{
|
|
19412
|
-
|
|
19413
|
-
}, {
|
|
19770
|
+
constraints: ['set'],
|
|
19414
19771
|
name: 'list'
|
|
19415
19772
|
}, {
|
|
19416
19773
|
name: 'type',
|
|
19417
19774
|
value: 'search'
|
|
19418
19775
|
}],
|
|
19419
|
-
constraints: ['the aria-controls attribute is set to the same value as the list attribute'],
|
|
19420
19776
|
name: 'input'
|
|
19421
19777
|
},
|
|
19422
19778
|
module: 'HTML'
|
|
19423
19779
|
}, {
|
|
19424
19780
|
concept: {
|
|
19425
19781
|
attributes: [{
|
|
19426
|
-
|
|
19427
|
-
}, {
|
|
19782
|
+
constraints: ['set'],
|
|
19428
19783
|
name: 'list'
|
|
19429
19784
|
}, {
|
|
19430
19785
|
name: 'type',
|
|
19431
19786
|
value: 'tel'
|
|
19432
19787
|
}],
|
|
19433
|
-
constraints: ['the aria-controls attribute is set to the same value as the list attribute'],
|
|
19434
19788
|
name: 'input'
|
|
19435
19789
|
},
|
|
19436
19790
|
module: 'HTML'
|
|
19437
19791
|
}, {
|
|
19438
19792
|
concept: {
|
|
19439
19793
|
attributes: [{
|
|
19440
|
-
|
|
19441
|
-
}, {
|
|
19794
|
+
constraints: ['set'],
|
|
19442
19795
|
name: 'list'
|
|
19443
19796
|
}, {
|
|
19444
19797
|
name: 'type',
|
|
19445
19798
|
value: 'text'
|
|
19446
19799
|
}],
|
|
19447
|
-
constraints: ['the aria-controls attribute is set to the same value as the list attribute'],
|
|
19448
19800
|
name: 'input'
|
|
19449
19801
|
},
|
|
19450
19802
|
module: 'HTML'
|
|
19451
19803
|
}, {
|
|
19452
19804
|
concept: {
|
|
19453
19805
|
attributes: [{
|
|
19454
|
-
|
|
19455
|
-
}, {
|
|
19806
|
+
constraints: ['set'],
|
|
19456
19807
|
name: 'list'
|
|
19457
19808
|
}, {
|
|
19458
19809
|
name: 'type',
|
|
19459
19810
|
value: 'url'
|
|
19460
19811
|
}],
|
|
19461
|
-
constraints: ['the aria-controls attribute is set to the same value as the list attribute'],
|
|
19462
19812
|
name: 'input'
|
|
19463
19813
|
},
|
|
19464
19814
|
module: 'HTML'
|
|
19465
19815
|
}, {
|
|
19466
19816
|
concept: {
|
|
19467
19817
|
attributes: [{
|
|
19468
|
-
|
|
19469
|
-
}, {
|
|
19818
|
+
constraints: ['set'],
|
|
19470
19819
|
name: 'list'
|
|
19471
19820
|
}, {
|
|
19472
19821
|
name: 'type',
|
|
19473
19822
|
value: 'url'
|
|
19474
19823
|
}],
|
|
19475
|
-
constraints: ['the aria-controls attribute is set to the same value as the list attribute'],
|
|
19476
19824
|
name: 'input'
|
|
19477
19825
|
},
|
|
19478
19826
|
module: 'HTML'
|
|
19479
19827
|
}, {
|
|
19480
19828
|
concept: {
|
|
19481
19829
|
attributes: [{
|
|
19830
|
+
constraints: ['undefined'],
|
|
19482
19831
|
name: 'multiple'
|
|
19483
19832
|
}, {
|
|
19833
|
+
constraints: ['undefined'],
|
|
19484
19834
|
name: 'size'
|
|
19485
19835
|
}],
|
|
19486
|
-
constraints: ['the multiple attribute and the size attribute
|
|
19836
|
+
constraints: ['the multiple attribute is not set and the size attribute does not have a value greater than 1'],
|
|
19487
19837
|
name: 'select'
|
|
19488
19838
|
},
|
|
19489
19839
|
module: 'HTML'
|
|
@@ -19527,6 +19877,7 @@ var complementaryRole = {
|
|
|
19527
19877
|
}, {
|
|
19528
19878
|
concept: {
|
|
19529
19879
|
attributes: [{
|
|
19880
|
+
constraints: ['set'],
|
|
19530
19881
|
name: 'aria-label'
|
|
19531
19882
|
}],
|
|
19532
19883
|
constraints: ['scoped to a sectioning content element', 'scoped to a sectioning root element other than body'],
|
|
@@ -19536,6 +19887,7 @@ var complementaryRole = {
|
|
|
19536
19887
|
}, {
|
|
19537
19888
|
concept: {
|
|
19538
19889
|
attributes: [{
|
|
19890
|
+
constraints: ['set'],
|
|
19539
19891
|
name: 'aria-labelledby'
|
|
19540
19892
|
}],
|
|
19541
19893
|
constraints: ['scoped to a sectioning content element', 'scoped to a sectioning root element other than body'],
|
|
@@ -19827,6 +20179,7 @@ var formRole = {
|
|
|
19827
20179
|
relatedConcepts: [{
|
|
19828
20180
|
concept: {
|
|
19829
20181
|
attributes: [{
|
|
20182
|
+
constraints: ['set'],
|
|
19830
20183
|
name: 'aria-label'
|
|
19831
20184
|
}],
|
|
19832
20185
|
name: 'form'
|
|
@@ -19835,6 +20188,7 @@ var formRole = {
|
|
|
19835
20188
|
}, {
|
|
19836
20189
|
concept: {
|
|
19837
20190
|
attributes: [{
|
|
20191
|
+
constraints: ['set'],
|
|
19838
20192
|
name: 'aria-labelledby'
|
|
19839
20193
|
}],
|
|
19840
20194
|
name: 'form'
|
|
@@ -19843,6 +20197,7 @@ var formRole = {
|
|
|
19843
20197
|
}, {
|
|
19844
20198
|
concept: {
|
|
19845
20199
|
attributes: [{
|
|
20200
|
+
constraints: ['set'],
|
|
19846
20201
|
name: 'name'
|
|
19847
20202
|
}],
|
|
19848
20203
|
name: 'form'
|
|
@@ -20031,7 +20386,7 @@ var gridcellRole = {
|
|
|
20031
20386
|
},
|
|
20032
20387
|
relatedConcepts: [{
|
|
20033
20388
|
concept: {
|
|
20034
|
-
constraints: ['ancestor table element has grid role'],
|
|
20389
|
+
constraints: ['ancestor table element has grid role', 'ancestor table element has treegrid role'],
|
|
20035
20390
|
name: 'td'
|
|
20036
20391
|
},
|
|
20037
20392
|
module: 'HTML'
|
|
@@ -20166,6 +20521,19 @@ var imgRole = {
|
|
|
20166
20521
|
props: {},
|
|
20167
20522
|
relatedConcepts: [{
|
|
20168
20523
|
concept: {
|
|
20524
|
+
attributes: [{
|
|
20525
|
+
constraints: ['set'],
|
|
20526
|
+
name: 'alt'
|
|
20527
|
+
}],
|
|
20528
|
+
name: 'img'
|
|
20529
|
+
},
|
|
20530
|
+
module: 'HTML'
|
|
20531
|
+
}, {
|
|
20532
|
+
concept: {
|
|
20533
|
+
attributes: [{
|
|
20534
|
+
constraints: ['undefined'],
|
|
20535
|
+
name: 'alt'
|
|
20536
|
+
}],
|
|
20169
20537
|
name: 'img'
|
|
20170
20538
|
},
|
|
20171
20539
|
module: 'HTML'
|
|
@@ -20234,6 +20602,7 @@ var linkRole = {
|
|
|
20234
20602
|
relatedConcepts: [{
|
|
20235
20603
|
concept: {
|
|
20236
20604
|
attributes: [{
|
|
20605
|
+
constraints: ['set'],
|
|
20237
20606
|
name: 'href'
|
|
20238
20607
|
}],
|
|
20239
20608
|
name: 'a'
|
|
@@ -20242,6 +20611,7 @@ var linkRole = {
|
|
|
20242
20611
|
}, {
|
|
20243
20612
|
concept: {
|
|
20244
20613
|
attributes: [{
|
|
20614
|
+
constraints: ['set'],
|
|
20245
20615
|
name: 'href'
|
|
20246
20616
|
}],
|
|
20247
20617
|
name: 'area'
|
|
@@ -20321,17 +20691,7 @@ var listboxRole = {
|
|
|
20321
20691
|
relatedConcepts: [{
|
|
20322
20692
|
concept: {
|
|
20323
20693
|
attributes: [{
|
|
20324
|
-
|
|
20325
|
-
}, {
|
|
20326
|
-
name: 'multiple'
|
|
20327
|
-
}],
|
|
20328
|
-
constraints: ['the size attribute value is greater than 1'],
|
|
20329
|
-
name: 'select'
|
|
20330
|
-
},
|
|
20331
|
-
module: 'HTML'
|
|
20332
|
-
}, {
|
|
20333
|
-
concept: {
|
|
20334
|
-
attributes: [{
|
|
20694
|
+
constraints: ['>1'],
|
|
20335
20695
|
name: 'size'
|
|
20336
20696
|
}],
|
|
20337
20697
|
constraints: ['the size attribute value is greater than 1'],
|
|
@@ -20343,29 +20703,14 @@ var listboxRole = {
|
|
|
20343
20703
|
attributes: [{
|
|
20344
20704
|
name: 'multiple'
|
|
20345
20705
|
}],
|
|
20346
|
-
constraints: ['the multiple attribute value is greater than 1'],
|
|
20347
20706
|
name: 'select'
|
|
20348
20707
|
},
|
|
20349
20708
|
module: 'HTML'
|
|
20350
20709
|
}, {
|
|
20351
20710
|
concept: {
|
|
20352
|
-
attributes: [{
|
|
20353
|
-
name: 'aria-multiselectable',
|
|
20354
|
-
value: 'true'
|
|
20355
|
-
}],
|
|
20356
|
-
constraints: ['the datalist selection model allows multiple option elements to be selected at a time'],
|
|
20357
20711
|
name: 'datalist'
|
|
20358
20712
|
},
|
|
20359
20713
|
module: 'HTML'
|
|
20360
|
-
}, {
|
|
20361
|
-
concept: {
|
|
20362
|
-
name: 'datalist',
|
|
20363
|
-
attributes: [{
|
|
20364
|
-
name: 'aria-multiselectable',
|
|
20365
|
-
value: 'false'
|
|
20366
|
-
}]
|
|
20367
|
-
},
|
|
20368
|
-
module: 'HTML'
|
|
20369
20714
|
}, {
|
|
20370
20715
|
concept: {
|
|
20371
20716
|
name: 'list'
|
|
@@ -20668,6 +21013,11 @@ var menuitemRole = {
|
|
|
20668
21013
|
name: 'MENU_ITEM'
|
|
20669
21014
|
},
|
|
20670
21015
|
module: 'JAPI'
|
|
21016
|
+
}, {
|
|
21017
|
+
concept: {
|
|
21018
|
+
name: 'listitem'
|
|
21019
|
+
},
|
|
21020
|
+
module: 'ARIA'
|
|
20671
21021
|
}, {
|
|
20672
21022
|
concept: {
|
|
20673
21023
|
name: 'option'
|
|
@@ -20986,20 +21336,6 @@ var progressbarRole = {
|
|
|
20986
21336
|
name: 'progress'
|
|
20987
21337
|
},
|
|
20988
21338
|
module: 'HTML'
|
|
20989
|
-
}, {
|
|
20990
|
-
concept: {
|
|
20991
|
-
attributes: [{
|
|
20992
|
-
name: 'aria-valuemax'
|
|
20993
|
-
}, {
|
|
20994
|
-
name: 'aria-valuemin',
|
|
20995
|
-
value: 0
|
|
20996
|
-
}, {
|
|
20997
|
-
name: 'aria-valuenow'
|
|
20998
|
-
}],
|
|
20999
|
-
constraints: ['the progress bar is determinate'],
|
|
21000
|
-
name: 'progress'
|
|
21001
|
-
},
|
|
21002
|
-
module: 'HTML'
|
|
21003
21339
|
}, {
|
|
21004
21340
|
concept: {
|
|
21005
21341
|
name: 'status'
|
|
@@ -21105,6 +21441,7 @@ var regionRole = {
|
|
|
21105
21441
|
relatedConcepts: [{
|
|
21106
21442
|
concept: {
|
|
21107
21443
|
attributes: [{
|
|
21444
|
+
constraints: ['set'],
|
|
21108
21445
|
name: 'aria-label'
|
|
21109
21446
|
}],
|
|
21110
21447
|
name: 'section'
|
|
@@ -21113,6 +21450,7 @@ var regionRole = {
|
|
|
21113
21450
|
}, {
|
|
21114
21451
|
concept: {
|
|
21115
21452
|
attributes: [{
|
|
21453
|
+
constraints: ['set'],
|
|
21116
21454
|
name: 'aria-labelledby'
|
|
21117
21455
|
}],
|
|
21118
21456
|
name: 'section'
|
|
@@ -21326,6 +21664,7 @@ var searchboxRole = {
|
|
|
21326
21664
|
relatedConcepts: [{
|
|
21327
21665
|
concept: {
|
|
21328
21666
|
attributes: [{
|
|
21667
|
+
constraints: ['undefined'],
|
|
21329
21668
|
name: 'list'
|
|
21330
21669
|
}, {
|
|
21331
21670
|
name: 'type',
|
|
@@ -21600,12 +21939,9 @@ var switchRole = {
|
|
|
21600
21939
|
props: {},
|
|
21601
21940
|
relatedConcepts: [{
|
|
21602
21941
|
concept: {
|
|
21603
|
-
attributes: [{
|
|
21604
|
-
name: 'aria-checked'
|
|
21605
|
-
}],
|
|
21606
21942
|
name: 'button'
|
|
21607
21943
|
},
|
|
21608
|
-
module: '
|
|
21944
|
+
module: 'ARIA'
|
|
21609
21945
|
}],
|
|
21610
21946
|
requireContextRole: [],
|
|
21611
21947
|
requiredContextRole: [],
|
|
@@ -21798,6 +22134,13 @@ var textboxRole = {
|
|
|
21798
22134
|
},
|
|
21799
22135
|
relatedConcepts: [{
|
|
21800
22136
|
concept: {
|
|
22137
|
+
attributes: [{
|
|
22138
|
+
constraints: ['undefined'],
|
|
22139
|
+
name: 'type'
|
|
22140
|
+
}, {
|
|
22141
|
+
constraints: ['undefined'],
|
|
22142
|
+
name: 'list'
|
|
22143
|
+
}],
|
|
21801
22144
|
constraints: ['the list attribute is not set'],
|
|
21802
22145
|
name: 'input'
|
|
21803
22146
|
},
|
|
@@ -21805,6 +22148,9 @@ var textboxRole = {
|
|
|
21805
22148
|
}, {
|
|
21806
22149
|
concept: {
|
|
21807
22150
|
attributes: [{
|
|
22151
|
+
constraints: ['undefined'],
|
|
22152
|
+
name: 'list'
|
|
22153
|
+
}, {
|
|
21808
22154
|
name: 'type',
|
|
21809
22155
|
value: 'email'
|
|
21810
22156
|
}],
|
|
@@ -21815,6 +22161,9 @@ var textboxRole = {
|
|
|
21815
22161
|
}, {
|
|
21816
22162
|
concept: {
|
|
21817
22163
|
attributes: [{
|
|
22164
|
+
constraints: ['undefined'],
|
|
22165
|
+
name: 'list'
|
|
22166
|
+
}, {
|
|
21818
22167
|
name: 'type',
|
|
21819
22168
|
value: 'tel'
|
|
21820
22169
|
}],
|
|
@@ -21825,6 +22174,9 @@ var textboxRole = {
|
|
|
21825
22174
|
}, {
|
|
21826
22175
|
concept: {
|
|
21827
22176
|
attributes: [{
|
|
22177
|
+
constraints: ['undefined'],
|
|
22178
|
+
name: 'list'
|
|
22179
|
+
}, {
|
|
21828
22180
|
name: 'type',
|
|
21829
22181
|
value: 'text'
|
|
21830
22182
|
}],
|
|
@@ -21835,6 +22187,9 @@ var textboxRole = {
|
|
|
21835
22187
|
}, {
|
|
21836
22188
|
concept: {
|
|
21837
22189
|
attributes: [{
|
|
22190
|
+
constraints: ['undefined'],
|
|
22191
|
+
name: 'list'
|
|
22192
|
+
}, {
|
|
21838
22193
|
name: 'type',
|
|
21839
22194
|
value: 'url'
|
|
21840
22195
|
}],
|
|
@@ -28035,7 +28390,11 @@ let Element$1 = class Element extends Node {
|
|
|
28035
28390
|
);
|
|
28036
28391
|
}
|
|
28037
28392
|
// no-redundant-roles
|
|
28038
|
-
if (
|
|
28393
|
+
if (
|
|
28394
|
+
current_role === get_implicit_role(this.name, attribute_map) &&
|
|
28395
|
+
// <ul role="list"> is ok because CSS list-style:none removes the semantics and this is a way to bring them back
|
|
28396
|
+
!['ul', 'ol', 'li'].includes(this.name)
|
|
28397
|
+
) {
|
|
28039
28398
|
component.warn(
|
|
28040
28399
|
attribute,
|
|
28041
28400
|
compiler_warnings.a11y_no_redundant_roles(current_role)
|
|
@@ -31244,6 +31603,9 @@ class AttributeWrapper extends BaseAttributeWrapper {
|
|
|
31244
31603
|
/** @type {boolean} */
|
|
31245
31604
|
is_src;
|
|
31246
31605
|
|
|
31606
|
+
/** @type {boolean} */
|
|
31607
|
+
is_srcset;
|
|
31608
|
+
|
|
31247
31609
|
/** @type {boolean} */
|
|
31248
31610
|
is_select_value_attribute;
|
|
31249
31611
|
|
|
@@ -31300,6 +31662,9 @@ class AttributeWrapper extends BaseAttributeWrapper {
|
|
|
31300
31662
|
this.is_src =
|
|
31301
31663
|
this.name === 'src' &&
|
|
31302
31664
|
(!this.parent.node.namespace || this.parent.node.namespace === namespaces.html);
|
|
31665
|
+
this.is_srcset =
|
|
31666
|
+
this.name === 'srcset' &&
|
|
31667
|
+
(!this.parent.node.namespace || this.parent.node.namespace === namespaces.html);
|
|
31303
31668
|
this.should_cache = should_cache(this);
|
|
31304
31669
|
}
|
|
31305
31670
|
|
|
@@ -31344,6 +31709,11 @@ class AttributeWrapper extends BaseAttributeWrapper {
|
|
|
31344
31709
|
b$1`if (!@src_url_equal(${element.var}.src, ${init})) ${method}(${element.var}, "${name}", ${this.last});`
|
|
31345
31710
|
);
|
|
31346
31711
|
updater = b$1`${method}(${element.var}, "${name}", ${should_cache ? this.last : value});`;
|
|
31712
|
+
} else if (this.is_srcset) {
|
|
31713
|
+
block.chunks.hydrate.push(
|
|
31714
|
+
b$1`if (!@srcset_url_equal(${element.var}, ${init})) ${method}(${element.var}, "${name}", ${this.last});`
|
|
31715
|
+
);
|
|
31716
|
+
updater = b$1`${method}(${element.var}, "${name}", ${should_cache ? this.last : value});`;
|
|
31347
31717
|
} else if (property_name) {
|
|
31348
31718
|
block.chunks.hydrate.push(b$1`${element.var}.${property_name} = ${init};`);
|
|
31349
31719
|
updater = block.renderer.options.dev
|
|
@@ -31583,7 +31953,7 @@ Object.keys(attribute_lookup).forEach((name) => {
|
|
|
31583
31953
|
|
|
31584
31954
|
/** @param {AttributeWrapper} attribute */
|
|
31585
31955
|
function should_cache(attribute) {
|
|
31586
|
-
return attribute.is_src || attribute.node.should_cache();
|
|
31956
|
+
return attribute.is_src || attribute.is_srcset || attribute.node.should_cache();
|
|
31587
31957
|
}
|
|
31588
31958
|
const regex_contains_checked_or_group = /checked|group/;
|
|
31589
31959
|
|
|
@@ -32483,7 +32853,7 @@ class RawMustacheTagWrapper extends Tag$1 {
|
|
|
32483
32853
|
render(block, parent_node, _parent_nodes) {
|
|
32484
32854
|
const in_head = is_head(parent_node);
|
|
32485
32855
|
const can_use_innerhtml = !in_head && parent_node && !this.prev && !this.next;
|
|
32486
|
-
if (can_use_innerhtml) {
|
|
32856
|
+
if (can_use_innerhtml && !this.renderer.options.hydratable) {
|
|
32487
32857
|
/** @param {import('estree').Node} content */
|
|
32488
32858
|
const insert = (content) => b$1`${parent_node}.innerHTML = ${content};`[0];
|
|
32489
32859
|
const { init } = this.rename_this_method(block, (content) => insert(content));
|
|
@@ -32757,6 +33127,14 @@ class ElementWrapper extends Wrapper {
|
|
|
32757
33127
|
strip_whitespace,
|
|
32758
33128
|
next_sibling
|
|
32759
33129
|
);
|
|
33130
|
+
|
|
33131
|
+
// in the case of `parent_block -> child_dynamic_element_block -> child_dynamic_element`
|
|
33132
|
+
// `child_dynamic_element_block.add_intro/outro` is called inside `new ElementWrapper()`
|
|
33133
|
+
// but when `is_local === true` it does not bubble to parent_block
|
|
33134
|
+
// we manually add transitions back to the parent_block (#8233)
|
|
33135
|
+
if (node.intro) block.add_intro(node.intro.is_local);
|
|
33136
|
+
if (node.outro) block.add_outro(node.outro.is_local);
|
|
33137
|
+
|
|
32760
33138
|
// the original svelte:element is never used for rendering, because
|
|
32761
33139
|
// it gets assigned a child_dynamic_element which is used in all rendering logic.
|
|
32762
33140
|
// so doing all of this on the original svelte:element will just cause double
|
|
@@ -32790,10 +33168,10 @@ class ElementWrapper extends Wrapper {
|
|
|
32790
33168
|
this.event_handlers = this.node.handlers.map(
|
|
32791
33169
|
(event_handler) => new EventHandlerWrapper(event_handler, this)
|
|
32792
33170
|
);
|
|
32793
|
-
|
|
32794
|
-
|
|
32795
|
-
|
|
32796
|
-
|
|
33171
|
+
|
|
33172
|
+
if (node.intro) block.add_intro(node.intro.is_local);
|
|
33173
|
+
if (node.outro) block.add_outro(node.outro.is_local);
|
|
33174
|
+
|
|
32797
33175
|
if (node.animation) {
|
|
32798
33176
|
block.add_animation();
|
|
32799
33177
|
}
|
|
@@ -43280,7 +43658,7 @@ class Fragment extends Node {
|
|
|
43280
43658
|
}
|
|
43281
43659
|
|
|
43282
43660
|
// This file is automatically generated
|
|
43283
|
-
var internal_exports = new Set(["HtmlTag","HtmlTagHydration","ResizeObserverSingleton","SvelteComponent","SvelteComponentDev","SvelteComponentTyped","SvelteElement","action_destroyer","add_attribute","add_classes","add_flush_callback","add_iframe_resize_listener","add_location","add_render_callback","add_styles","add_transform","afterUpdate","append","append_dev","append_empty_stylesheet","append_hydration","append_hydration_dev","append_styles","assign","attr","attr_dev","attribute_to_object","beforeUpdate","bind","binding_callbacks","blank_object","bubble","check_outros","children","claim_comment","claim_component","claim_element","claim_html_tag","claim_space","claim_svg_element","claim_text","clear_loops","comment","component_subscribe","compute_rest_props","compute_slots","construct_svelte_component","construct_svelte_component_dev","contenteditable_truthy_values","createEventDispatcher","create_animation","create_bidirectional_transition","create_component","create_custom_element","create_in_transition","create_out_transition","create_slot","create_ssr_component","current_component","custom_event","dataset_dev","debug","destroy_block","destroy_component","destroy_each","detach","detach_after_dev","detach_before_dev","detach_between_dev","detach_dev","dirty_components","dispatch_dev","each","element","element_is","empty","end_hydrating","ensure_array_like","ensure_array_like_dev","escape","escape_attribute_value","escape_object","exclude_internal_props","fix_and_destroy_block","fix_and_outro_and_destroy_block","fix_position","flush","flush_render_callbacks","getAllContexts","getContext","get_all_dirty_from_scope","get_binding_group_value","get_current_component","get_custom_elements_slots","get_root_for_style","get_slot_changes","get_spread_object","get_spread_update","get_store_value","get_svelte_dataset","globals","group_outros","handle_promise","hasContext","has_prop","head_selector","identity","init","init_binding_group","init_binding_group_dynamic","insert","insert_dev","insert_hydration","insert_hydration_dev","intros","invalid_attribute_name_character","is_client","is_crossorigin","is_empty","is_function","is_promise","is_void","listen","listen_dev","loop","loop_guard","merge_ssr_styles","missing_component","mount_component","noop","not_equal","now","null_to_empty","object_without_properties","onDestroy","onMount","once","outro_and_destroy_block","prevent_default","prop_dev","query_selector_all","raf","resize_observer_border_box","resize_observer_content_box","resize_observer_device_pixel_content_box","run","run_all","safe_not_equal","schedule_update","select_multiple_value","select_option","select_options","select_value","self","setContext","set_attributes","set_current_component","set_custom_element_data","set_custom_element_data_map","set_data","set_data_contenteditable","set_data_contenteditable_dev","set_data_dev","set_data_maybe_contenteditable","set_data_maybe_contenteditable_dev","set_dynamic_element_data","set_input_type","set_input_value","set_now","set_raf","set_store_value","set_style","set_svg_attributes","space","split_css_unit","spread","src_url_equal","start_hydrating","stop_immediate_propagation","stop_propagation","subscribe","svg_element","text","tick","time_ranges_to_array","to_number","toggle_class","transition_in","transition_out","trusted","update_await_block_branch","update_keyed_each","update_slot","update_slot_base","validate_component","validate_dynamic_element","validate_each_keys","validate_slots","validate_store","validate_void_dynamic_element","xlink_attr"]);
|
|
43661
|
+
var internal_exports = new Set(["HtmlTag","HtmlTagHydration","ResizeObserverSingleton","SvelteComponent","SvelteComponentDev","SvelteComponentTyped","SvelteElement","action_destroyer","add_attribute","add_classes","add_flush_callback","add_iframe_resize_listener","add_location","add_render_callback","add_styles","add_transform","afterUpdate","append","append_dev","append_empty_stylesheet","append_hydration","append_hydration_dev","append_styles","assign","attr","attr_dev","attribute_to_object","beforeUpdate","bind","binding_callbacks","blank_object","bubble","check_outros","children","claim_comment","claim_component","claim_element","claim_html_tag","claim_space","claim_svg_element","claim_text","clear_loops","comment","component_subscribe","compute_rest_props","compute_slots","construct_svelte_component","construct_svelte_component_dev","contenteditable_truthy_values","createEventDispatcher","create_animation","create_bidirectional_transition","create_component","create_custom_element","create_in_transition","create_out_transition","create_slot","create_ssr_component","current_component","custom_event","dataset_dev","debug","destroy_block","destroy_component","destroy_each","detach","detach_after_dev","detach_before_dev","detach_between_dev","detach_dev","dirty_components","dispatch_dev","each","element","element_is","empty","end_hydrating","ensure_array_like","ensure_array_like_dev","escape","escape_attribute_value","escape_object","exclude_internal_props","fix_and_destroy_block","fix_and_outro_and_destroy_block","fix_position","flush","flush_render_callbacks","getAllContexts","getContext","get_all_dirty_from_scope","get_binding_group_value","get_current_component","get_custom_elements_slots","get_root_for_style","get_slot_changes","get_spread_object","get_spread_update","get_store_value","get_svelte_dataset","globals","group_outros","handle_promise","hasContext","has_prop","head_selector","identity","init","init_binding_group","init_binding_group_dynamic","insert","insert_dev","insert_hydration","insert_hydration_dev","intros","invalid_attribute_name_character","is_client","is_crossorigin","is_empty","is_function","is_promise","is_void","listen","listen_dev","loop","loop_guard","merge_ssr_styles","missing_component","mount_component","noop","not_equal","now","null_to_empty","object_without_properties","onDestroy","onMount","once","outro_and_destroy_block","prevent_default","prop_dev","query_selector_all","raf","resize_observer_border_box","resize_observer_content_box","resize_observer_device_pixel_content_box","run","run_all","safe_not_equal","schedule_update","select_multiple_value","select_option","select_options","select_value","self","setContext","set_attributes","set_current_component","set_custom_element_data","set_custom_element_data_map","set_data","set_data_contenteditable","set_data_contenteditable_dev","set_data_dev","set_data_maybe_contenteditable","set_data_maybe_contenteditable_dev","set_dynamic_element_data","set_input_type","set_input_value","set_now","set_raf","set_store_value","set_style","set_svg_attributes","space","split_css_unit","spread","src_url_equal","srcset_url_equal","start_hydrating","stop_immediate_propagation","stop_propagation","subscribe","svg_element","text","tick","time_ranges_to_array","to_number","toggle_class","transition_in","transition_out","trusted","update_await_block_branch","update_keyed_each","update_slot","update_slot_base","validate_component","validate_dynamic_element","validate_each_keys","validate_slots","validate_store","validate_void_dynamic_element","xlink_attr"]);
|
|
43284
43662
|
|
|
43285
43663
|
/**
|
|
43286
43664
|
*
|
|
@@ -43330,7 +43708,7 @@ function is_used_as_reference(node, parent) {
|
|
|
43330
43708
|
* https://svelte.dev/docs/svelte-compiler#svelte-version
|
|
43331
43709
|
* @type {string}
|
|
43332
43710
|
*/
|
|
43333
|
-
const VERSION = '4.0.
|
|
43711
|
+
const VERSION = '4.0.2';
|
|
43334
43712
|
|
|
43335
43713
|
const regex_leading_directory_separator = /^[/\\]/;
|
|
43336
43714
|
const regex_starts_with_term_export = /^Export/;
|