@webqit/oohtml 5.0.7 → 5.0.8
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/dist/bindings-api.js +78 -32
- package/dist/bindings-api.js.map +3 -3
- package/dist/context-api.js +67 -25
- package/dist/context-api.js.map +3 -3
- package/dist/data-binding.js +120 -81
- package/dist/data-binding.js.map +4 -4
- package/dist/html-imports.js +70 -27
- package/dist/html-imports.js.map +3 -3
- package/dist/main.js +937 -282
- package/dist/main.js.map +3 -3
- package/dist/main.lite.js +115 -49
- package/dist/main.lite.js.map +3 -3
- package/dist/namespaced-html.js +69 -27
- package/dist/namespaced-html.js.map +3 -3
- package/dist/scoped-css.js +70 -28
- package/dist/scoped-css.js.map +3 -3
- package/dist/scoped-js.js +109 -68
- package/dist/scoped-js.js.map +4 -4
- package/package.json +3 -3
- package/src/bindings-api/index.js +80 -75
- package/src/context-api/DOMContext.js +2 -1
- package/src/data-binding/index.js +1 -1
- package/src/html-imports/_HTMLImportElement.js +4 -2
- package/src/namespaced-html/index.js +3 -2
- package/src/scoped-css/index.js +2 -1
- package/src/scoped-js/index.js +71 -68
- package/test/bindings-api.test.js +3 -1
- package/test/imports.test.js +8 -0
- package/test/modules.test.js +6 -4
package/dist/main.js
CHANGED
|
@@ -974,7 +974,9 @@ function set(target, prop, value, receiver = (x) => x, params = {}, def = false)
|
|
|
974
974
|
const listenerRegistry = ListenerRegistry.getInstance(originalTarget, false, params.namespace);
|
|
975
975
|
if (listenerRegistry)
|
|
976
976
|
listenerRegistry.emit(descriptors, { eventsArePropertyDescriptors: !!def });
|
|
977
|
-
return receiver(
|
|
977
|
+
return receiver(
|
|
978
|
+
isPropsList(prop) ? descriptors.map((opr) => opr.status) : descriptors[0]?.status
|
|
979
|
+
);
|
|
978
980
|
});
|
|
979
981
|
}
|
|
980
982
|
function defineProperty(target, prop, descriptor, receiver = (x) => x, params = {}) {
|
|
@@ -1020,7 +1022,9 @@ function deleteProperty(target, prop, receiver = (x) => x, params = {}) {
|
|
|
1020
1022
|
const listenerRegistry = ListenerRegistry.getInstance(originalTarget, false, params.namespace);
|
|
1021
1023
|
if (listenerRegistry)
|
|
1022
1024
|
listenerRegistry.emit(descriptors);
|
|
1023
|
-
return receiver(
|
|
1025
|
+
return receiver(
|
|
1026
|
+
isPropsList(prop) ? descriptors.map((opr) => opr.status) : descriptors[0].status
|
|
1027
|
+
);
|
|
1024
1028
|
});
|
|
1025
1029
|
}
|
|
1026
1030
|
function deleteProperties(target, props, receiver = (x) => x, params = {}) {
|
|
@@ -1042,7 +1046,11 @@ function apply(target, thisArgument, argumentsList, receiver = (x) => x, params
|
|
|
1042
1046
|
listenerRegistry?.emit([descriptor], { eventIsArrayMethodDescriptor: true });
|
|
1043
1047
|
}
|
|
1044
1048
|
_wq(originalThis).set("$length", originalThis.length);
|
|
1045
|
-
returnValue = batch(
|
|
1049
|
+
returnValue = batch(
|
|
1050
|
+
originalThis,
|
|
1051
|
+
() => exec(target, "apply", { thisArgument, argumentsList }, receiver, params),
|
|
1052
|
+
params
|
|
1053
|
+
);
|
|
1046
1054
|
_wq(originalThis).delete("$length");
|
|
1047
1055
|
} else {
|
|
1048
1056
|
returnValue = exec(target, "apply", { thisArgument: originalThis, argumentsList }, receiver, params);
|
|
@@ -1236,10 +1244,10 @@ function nextKeyword(input, start = 0, mode = null) {
|
|
|
1236
1244
|
}
|
|
1237
1245
|
|
|
1238
1246
|
// node_modules/acorn/dist/acorn.mjs
|
|
1239
|
-
var astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9,
|
|
1240
|
-
var astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1,
|
|
1241
|
-
var nonASCIIidentifierChars = "\u200C\u200D\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\
|
|
1242
|
-
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-\
|
|
1247
|
+
var astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 7, 9, 32, 4, 318, 1, 80, 3, 71, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 68, 8, 2, 0, 3, 0, 2, 3, 2, 4, 2, 0, 15, 1, 83, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 7, 19, 58, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 343, 9, 54, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 10, 1, 2, 0, 49, 6, 4, 4, 14, 10, 5350, 0, 7, 14, 11465, 27, 2343, 9, 87, 9, 39, 4, 60, 6, 26, 9, 535, 9, 470, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4178, 9, 519, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13, 245, 1, 2, 9, 726, 6, 110, 6, 6, 9, 4759, 9, 787719, 239];
|
|
1248
|
+
var astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 4, 51, 13, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 39, 27, 10, 22, 251, 41, 7, 1, 17, 2, 60, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 20, 1, 64, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 31, 9, 2, 0, 3, 0, 2, 37, 2, 0, 26, 0, 2, 0, 45, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 200, 32, 32, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 16, 0, 2, 12, 2, 33, 125, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1071, 18, 5, 26, 3994, 6, 582, 6842, 29, 1763, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 433, 44, 212, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 42, 9, 8936, 3, 2, 6, 2, 1, 2, 290, 16, 0, 30, 2, 3, 0, 15, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 7, 5, 262, 61, 147, 44, 11, 6, 17, 0, 322, 29, 19, 43, 485, 27, 229, 29, 3, 0, 496, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4153, 7, 221, 3, 5761, 15, 7472, 16, 621, 2467, 541, 1507, 4938, 6, 4191];
|
|
1249
|
+
var nonASCIIidentifierChars = "\u200C\u200D\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65";
|
|
1250
|
+
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-\u1C8A\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-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\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";
|
|
1243
1251
|
var reservedWords = {
|
|
1244
1252
|
3: "abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",
|
|
1245
1253
|
5: "class enum extends super const export import",
|
|
@@ -1450,8 +1458,9 @@ var hasOwn = Object.hasOwn || function(obj, propName) {
|
|
|
1450
1458
|
var isArray = Array.isArray || function(obj) {
|
|
1451
1459
|
return toString.call(obj) === "[object Array]";
|
|
1452
1460
|
};
|
|
1461
|
+
var regexpCache = /* @__PURE__ */ Object.create(null);
|
|
1453
1462
|
function wordsRegexp(words) {
|
|
1454
|
-
return new RegExp("^(?:" + words.replace(/ /g, "|") + ")$");
|
|
1463
|
+
return regexpCache[words] || (regexpCache[words] = new RegExp("^(?:" + words.replace(/ /g, "|") + ")$"));
|
|
1455
1464
|
}
|
|
1456
1465
|
function codePointToString(code) {
|
|
1457
1466
|
if (code <= 65535) {
|
|
@@ -1496,6 +1505,7 @@ var defaultOptions = {
|
|
|
1496
1505
|
allowAwaitOutsideFunction: null,
|
|
1497
1506
|
allowSuperOutsideMethod: null,
|
|
1498
1507
|
allowHashBang: false,
|
|
1508
|
+
checkPrivateFields: true,
|
|
1499
1509
|
locations: false,
|
|
1500
1510
|
onToken: null,
|
|
1501
1511
|
onComment: null,
|
|
@@ -1565,6 +1575,7 @@ var SCOPE_SIMPLE_CATCH = 32;
|
|
|
1565
1575
|
var SCOPE_SUPER = 64;
|
|
1566
1576
|
var SCOPE_DIRECT_SUPER = 128;
|
|
1567
1577
|
var SCOPE_CLASS_STATIC_BLOCK = 256;
|
|
1578
|
+
var SCOPE_CLASS_FIELD_INIT = 512;
|
|
1568
1579
|
var SCOPE_VAR = SCOPE_TOP | SCOPE_FUNCTION | SCOPE_CLASS_STATIC_BLOCK;
|
|
1569
1580
|
function functionFlags(async, generator) {
|
|
1570
1581
|
return SCOPE_FUNCTION | (async ? SCOPE_ASYNC : 0) | (generator ? SCOPE_GENERATOR : 0);
|
|
@@ -1633,19 +1644,20 @@ prototypeAccessors.inFunction.get = function() {
|
|
|
1633
1644
|
return (this.currentVarScope().flags & SCOPE_FUNCTION) > 0;
|
|
1634
1645
|
};
|
|
1635
1646
|
prototypeAccessors.inGenerator.get = function() {
|
|
1636
|
-
return (this.currentVarScope().flags & SCOPE_GENERATOR) > 0
|
|
1647
|
+
return (this.currentVarScope().flags & SCOPE_GENERATOR) > 0;
|
|
1637
1648
|
};
|
|
1638
1649
|
prototypeAccessors.inAsync.get = function() {
|
|
1639
|
-
return (this.currentVarScope().flags & SCOPE_ASYNC) > 0
|
|
1650
|
+
return (this.currentVarScope().flags & SCOPE_ASYNC) > 0;
|
|
1640
1651
|
};
|
|
1641
1652
|
prototypeAccessors.canAwait.get = function() {
|
|
1642
1653
|
for (var i = this.scopeStack.length - 1; i >= 0; i--) {
|
|
1643
|
-
var
|
|
1644
|
-
|
|
1654
|
+
var ref2 = this.scopeStack[i];
|
|
1655
|
+
var flags = ref2.flags;
|
|
1656
|
+
if (flags & (SCOPE_CLASS_STATIC_BLOCK | SCOPE_CLASS_FIELD_INIT)) {
|
|
1645
1657
|
return false;
|
|
1646
1658
|
}
|
|
1647
|
-
if (
|
|
1648
|
-
return (
|
|
1659
|
+
if (flags & SCOPE_FUNCTION) {
|
|
1660
|
+
return (flags & SCOPE_ASYNC) > 0;
|
|
1649
1661
|
}
|
|
1650
1662
|
}
|
|
1651
1663
|
return this.inModule && this.options.ecmaVersion >= 13 || this.options.allowAwaitOutsideFunction;
|
|
@@ -1653,8 +1665,7 @@ prototypeAccessors.canAwait.get = function() {
|
|
|
1653
1665
|
prototypeAccessors.allowSuper.get = function() {
|
|
1654
1666
|
var ref2 = this.currentThisScope();
|
|
1655
1667
|
var flags = ref2.flags;
|
|
1656
|
-
|
|
1657
|
-
return (flags & SCOPE_SUPER) > 0 || inClassFieldInit || this.options.allowSuperOutsideMethod;
|
|
1668
|
+
return (flags & SCOPE_SUPER) > 0 || this.options.allowSuperOutsideMethod;
|
|
1658
1669
|
};
|
|
1659
1670
|
prototypeAccessors.allowDirectSuper.get = function() {
|
|
1660
1671
|
return (this.currentThisScope().flags & SCOPE_DIRECT_SUPER) > 0;
|
|
@@ -1663,10 +1674,14 @@ prototypeAccessors.treatFunctionsAsVar.get = function() {
|
|
|
1663
1674
|
return this.treatFunctionsAsVarInScope(this.currentScope());
|
|
1664
1675
|
};
|
|
1665
1676
|
prototypeAccessors.allowNewDotTarget.get = function() {
|
|
1666
|
-
var
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1677
|
+
for (var i = this.scopeStack.length - 1; i >= 0; i--) {
|
|
1678
|
+
var ref2 = this.scopeStack[i];
|
|
1679
|
+
var flags = ref2.flags;
|
|
1680
|
+
if (flags & (SCOPE_CLASS_STATIC_BLOCK | SCOPE_CLASS_FIELD_INIT) || flags & SCOPE_FUNCTION && !(flags & SCOPE_ARROW)) {
|
|
1681
|
+
return true;
|
|
1682
|
+
}
|
|
1683
|
+
}
|
|
1684
|
+
return false;
|
|
1670
1685
|
};
|
|
1671
1686
|
prototypeAccessors.inClassStaticBlock.get = function() {
|
|
1672
1687
|
return (this.currentVarScope().flags & SCOPE_CLASS_STATIC_BLOCK) > 0;
|
|
@@ -1694,7 +1709,7 @@ Parser.tokenizer = function tokenizer(input, options) {
|
|
|
1694
1709
|
};
|
|
1695
1710
|
Object.defineProperties(Parser.prototype, prototypeAccessors);
|
|
1696
1711
|
var pp$9 = Parser.prototype;
|
|
1697
|
-
var literal = /^(?:'((
|
|
1712
|
+
var literal = /^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;
|
|
1698
1713
|
pp$9.strictDirective = function(start) {
|
|
1699
1714
|
if (this.options.ecmaVersion < 5) {
|
|
1700
1715
|
return false;
|
|
@@ -1884,6 +1899,44 @@ pp$8.isAsyncFunction = function() {
|
|
|
1884
1899
|
var next = this.pos + skip[0].length, after2;
|
|
1885
1900
|
return !lineBreak.test(this.input.slice(this.pos, next)) && this.input.slice(next, next + 8) === "function" && (next + 8 === this.input.length || !(isIdentifierChar(after2 = this.input.charCodeAt(next + 8)) || after2 > 55295 && after2 < 56320));
|
|
1886
1901
|
};
|
|
1902
|
+
pp$8.isUsingKeyword = function(isAwaitUsing, isFor) {
|
|
1903
|
+
if (this.options.ecmaVersion < 17 || !this.isContextual(isAwaitUsing ? "await" : "using")) {
|
|
1904
|
+
return false;
|
|
1905
|
+
}
|
|
1906
|
+
skipWhiteSpace.lastIndex = this.pos;
|
|
1907
|
+
var skip = skipWhiteSpace.exec(this.input);
|
|
1908
|
+
var next = this.pos + skip[0].length;
|
|
1909
|
+
if (lineBreak.test(this.input.slice(this.pos, next))) {
|
|
1910
|
+
return false;
|
|
1911
|
+
}
|
|
1912
|
+
if (isAwaitUsing) {
|
|
1913
|
+
var awaitEndPos = next + 5, after2;
|
|
1914
|
+
if (this.input.slice(next, awaitEndPos) !== "using" || awaitEndPos === this.input.length || isIdentifierChar(after2 = this.input.charCodeAt(awaitEndPos)) || after2 > 55295 && after2 < 56320) {
|
|
1915
|
+
return false;
|
|
1916
|
+
}
|
|
1917
|
+
skipWhiteSpace.lastIndex = awaitEndPos;
|
|
1918
|
+
var skipAfterUsing = skipWhiteSpace.exec(this.input);
|
|
1919
|
+
if (skipAfterUsing && lineBreak.test(this.input.slice(awaitEndPos, awaitEndPos + skipAfterUsing[0].length))) {
|
|
1920
|
+
return false;
|
|
1921
|
+
}
|
|
1922
|
+
}
|
|
1923
|
+
if (isFor) {
|
|
1924
|
+
var ofEndPos = next + 2, after$1;
|
|
1925
|
+
if (this.input.slice(next, ofEndPos) === "of") {
|
|
1926
|
+
if (ofEndPos === this.input.length || !isIdentifierChar(after$1 = this.input.charCodeAt(ofEndPos)) && !(after$1 > 55295 && after$1 < 56320)) {
|
|
1927
|
+
return false;
|
|
1928
|
+
}
|
|
1929
|
+
}
|
|
1930
|
+
}
|
|
1931
|
+
var ch = this.input.charCodeAt(next);
|
|
1932
|
+
return isIdentifierStart(ch, true) || ch === 92;
|
|
1933
|
+
};
|
|
1934
|
+
pp$8.isAwaitUsing = function(isFor) {
|
|
1935
|
+
return this.isUsingKeyword(true, isFor);
|
|
1936
|
+
};
|
|
1937
|
+
pp$8.isUsing = function(isFor) {
|
|
1938
|
+
return this.isUsingKeyword(false, isFor);
|
|
1939
|
+
};
|
|
1887
1940
|
pp$8.parseStatement = function(context, topLevel, exports) {
|
|
1888
1941
|
var starttype = this.type, node = this.startNode(), kind;
|
|
1889
1942
|
if (this.isLet(context)) {
|
|
@@ -1962,6 +2015,22 @@ pp$8.parseStatement = function(context, topLevel, exports) {
|
|
|
1962
2015
|
this.next();
|
|
1963
2016
|
return this.parseFunctionStatement(node, true, !context);
|
|
1964
2017
|
}
|
|
2018
|
+
var usingKind = this.isAwaitUsing(false) ? "await using" : this.isUsing(false) ? "using" : null;
|
|
2019
|
+
if (usingKind) {
|
|
2020
|
+
if (topLevel && this.options.sourceType === "script") {
|
|
2021
|
+
this.raise(this.start, "Using declaration cannot appear in the top level when source type is `script`");
|
|
2022
|
+
}
|
|
2023
|
+
if (usingKind === "await using") {
|
|
2024
|
+
if (!this.canAwait) {
|
|
2025
|
+
this.raise(this.start, "Await using cannot appear outside of async function");
|
|
2026
|
+
}
|
|
2027
|
+
this.next();
|
|
2028
|
+
}
|
|
2029
|
+
this.next();
|
|
2030
|
+
this.parseVar(node, false, usingKind);
|
|
2031
|
+
this.semicolon();
|
|
2032
|
+
return this.finishNode(node, "VariableDeclaration");
|
|
2033
|
+
}
|
|
1965
2034
|
var maybeName = this.value, expr = this.parseExpression();
|
|
1966
2035
|
if (starttype === types$1.name && expr.type === "Identifier" && this.eat(types$1.colon)) {
|
|
1967
2036
|
return this.parseLabeledStatement(node, maybeName, expr, context);
|
|
@@ -2035,34 +2104,35 @@ pp$8.parseForStatement = function(node) {
|
|
|
2035
2104
|
this.next();
|
|
2036
2105
|
this.parseVar(init$1, true, kind);
|
|
2037
2106
|
this.finishNode(init$1, "VariableDeclaration");
|
|
2038
|
-
|
|
2039
|
-
if (this.options.ecmaVersion >= 9) {
|
|
2040
|
-
if (this.type === types$1._in) {
|
|
2041
|
-
if (awaitAt > -1) {
|
|
2042
|
-
this.unexpected(awaitAt);
|
|
2043
|
-
}
|
|
2044
|
-
} else {
|
|
2045
|
-
node.await = awaitAt > -1;
|
|
2046
|
-
}
|
|
2047
|
-
}
|
|
2048
|
-
return this.parseForIn(node, init$1);
|
|
2049
|
-
}
|
|
2050
|
-
if (awaitAt > -1) {
|
|
2051
|
-
this.unexpected(awaitAt);
|
|
2052
|
-
}
|
|
2053
|
-
return this.parseFor(node, init$1);
|
|
2107
|
+
return this.parseForAfterInit(node, init$1, awaitAt);
|
|
2054
2108
|
}
|
|
2055
2109
|
var startsWithLet = this.isContextual("let"), isForOf = false;
|
|
2110
|
+
var usingKind = this.isUsing(true) ? "using" : this.isAwaitUsing(true) ? "await using" : null;
|
|
2111
|
+
if (usingKind) {
|
|
2112
|
+
var init$2 = this.startNode();
|
|
2113
|
+
this.next();
|
|
2114
|
+
if (usingKind === "await using") {
|
|
2115
|
+
this.next();
|
|
2116
|
+
}
|
|
2117
|
+
this.parseVar(init$2, true, usingKind);
|
|
2118
|
+
this.finishNode(init$2, "VariableDeclaration");
|
|
2119
|
+
return this.parseForAfterInit(node, init$2, awaitAt);
|
|
2120
|
+
}
|
|
2121
|
+
var containsEsc = this.containsEsc;
|
|
2056
2122
|
var refDestructuringErrors = new DestructuringErrors();
|
|
2057
|
-
var
|
|
2123
|
+
var initPos = this.start;
|
|
2124
|
+
var init9 = awaitAt > -1 ? this.parseExprSubscripts(refDestructuringErrors, "await") : this.parseExpression(true, refDestructuringErrors);
|
|
2058
2125
|
if (this.type === types$1._in || (isForOf = this.options.ecmaVersion >= 6 && this.isContextual("of"))) {
|
|
2059
|
-
if (
|
|
2126
|
+
if (awaitAt > -1) {
|
|
2060
2127
|
if (this.type === types$1._in) {
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2128
|
+
this.unexpected(awaitAt);
|
|
2129
|
+
}
|
|
2130
|
+
node.await = true;
|
|
2131
|
+
} else if (isForOf && this.options.ecmaVersion >= 8) {
|
|
2132
|
+
if (init9.start === initPos && !containsEsc && init9.type === "Identifier" && init9.name === "async") {
|
|
2133
|
+
this.unexpected();
|
|
2134
|
+
} else if (this.options.ecmaVersion >= 9) {
|
|
2135
|
+
node.await = false;
|
|
2066
2136
|
}
|
|
2067
2137
|
}
|
|
2068
2138
|
if (startsWithLet && isForOf) {
|
|
@@ -2079,6 +2149,24 @@ pp$8.parseForStatement = function(node) {
|
|
|
2079
2149
|
}
|
|
2080
2150
|
return this.parseFor(node, init9);
|
|
2081
2151
|
};
|
|
2152
|
+
pp$8.parseForAfterInit = function(node, init9, awaitAt) {
|
|
2153
|
+
if ((this.type === types$1._in || this.options.ecmaVersion >= 6 && this.isContextual("of")) && init9.declarations.length === 1) {
|
|
2154
|
+
if (this.options.ecmaVersion >= 9) {
|
|
2155
|
+
if (this.type === types$1._in) {
|
|
2156
|
+
if (awaitAt > -1) {
|
|
2157
|
+
this.unexpected(awaitAt);
|
|
2158
|
+
}
|
|
2159
|
+
} else {
|
|
2160
|
+
node.await = awaitAt > -1;
|
|
2161
|
+
}
|
|
2162
|
+
}
|
|
2163
|
+
return this.parseForIn(node, init9);
|
|
2164
|
+
}
|
|
2165
|
+
if (awaitAt > -1) {
|
|
2166
|
+
this.unexpected(awaitAt);
|
|
2167
|
+
}
|
|
2168
|
+
return this.parseFor(node, init9);
|
|
2169
|
+
};
|
|
2082
2170
|
pp$8.parseFunctionStatement = function(node, isAsync, declarationPosition) {
|
|
2083
2171
|
this.next();
|
|
2084
2172
|
return this.parseFunction(node, FUNC_STATEMENT | (declarationPosition ? 0 : FUNC_HANGING_STATEMENT), false, isAsync);
|
|
@@ -2155,6 +2243,14 @@ pp$8.parseThrowStatement = function(node) {
|
|
|
2155
2243
|
return this.finishNode(node, "ThrowStatement");
|
|
2156
2244
|
};
|
|
2157
2245
|
var empty$1 = [];
|
|
2246
|
+
pp$8.parseCatchClauseParam = function() {
|
|
2247
|
+
var param = this.parseBindingAtom();
|
|
2248
|
+
var simple = param.type === "Identifier";
|
|
2249
|
+
this.enterScope(simple ? SCOPE_SIMPLE_CATCH : 0);
|
|
2250
|
+
this.checkLValPattern(param, simple ? BIND_SIMPLE_CATCH : BIND_LEXICAL);
|
|
2251
|
+
this.expect(types$1.parenR);
|
|
2252
|
+
return param;
|
|
2253
|
+
};
|
|
2158
2254
|
pp$8.parseTryStatement = function(node) {
|
|
2159
2255
|
this.next();
|
|
2160
2256
|
node.block = this.parseBlock();
|
|
@@ -2163,11 +2259,7 @@ pp$8.parseTryStatement = function(node) {
|
|
|
2163
2259
|
var clause = this.startNode();
|
|
2164
2260
|
this.next();
|
|
2165
2261
|
if (this.eat(types$1.parenL)) {
|
|
2166
|
-
clause.param = this.
|
|
2167
|
-
var simple = clause.param.type === "Identifier";
|
|
2168
|
-
this.enterScope(simple ? SCOPE_SIMPLE_CATCH : 0);
|
|
2169
|
-
this.checkLValPattern(clause.param, simple ? BIND_SIMPLE_CATCH : BIND_LEXICAL);
|
|
2170
|
-
this.expect(types$1.parenR);
|
|
2262
|
+
clause.param = this.parseCatchClauseParam();
|
|
2171
2263
|
} else {
|
|
2172
2264
|
if (this.options.ecmaVersion < 10) {
|
|
2173
2265
|
this.unexpected();
|
|
@@ -2185,9 +2277,9 @@ pp$8.parseTryStatement = function(node) {
|
|
|
2185
2277
|
}
|
|
2186
2278
|
return this.finishNode(node, "TryStatement");
|
|
2187
2279
|
};
|
|
2188
|
-
pp$8.parseVarStatement = function(node, kind) {
|
|
2280
|
+
pp$8.parseVarStatement = function(node, kind, allowMissingInitializer) {
|
|
2189
2281
|
this.next();
|
|
2190
|
-
this.parseVar(node, false, kind);
|
|
2282
|
+
this.parseVar(node, false, kind, allowMissingInitializer);
|
|
2191
2283
|
this.semicolon();
|
|
2192
2284
|
return this.finishNode(node, "VariableDeclaration");
|
|
2193
2285
|
};
|
|
@@ -2279,7 +2371,10 @@ pp$8.parseForIn = function(node, init9) {
|
|
|
2279
2371
|
var isForIn = this.type === types$1._in;
|
|
2280
2372
|
this.next();
|
|
2281
2373
|
if (init9.type === "VariableDeclaration" && init9.declarations[0].init != null && (!isForIn || this.options.ecmaVersion < 8 || this.strict || init9.kind !== "var" || init9.declarations[0].id.type !== "Identifier")) {
|
|
2282
|
-
this.raise(
|
|
2374
|
+
this.raise(
|
|
2375
|
+
init9.start,
|
|
2376
|
+
(isForIn ? "for-in" : "for-of") + " loop variable declaration may not have an initializer"
|
|
2377
|
+
);
|
|
2283
2378
|
}
|
|
2284
2379
|
node.left = init9;
|
|
2285
2380
|
node.right = isForIn ? this.parseExpression() : this.parseMaybeAssign();
|
|
@@ -2289,7 +2384,7 @@ pp$8.parseForIn = function(node, init9) {
|
|
|
2289
2384
|
this.labels.pop();
|
|
2290
2385
|
return this.finishNode(node, isForIn ? "ForInStatement" : "ForOfStatement");
|
|
2291
2386
|
};
|
|
2292
|
-
pp$8.parseVar = function(node, isFor, kind) {
|
|
2387
|
+
pp$8.parseVar = function(node, isFor, kind, allowMissingInitializer) {
|
|
2293
2388
|
node.declarations = [];
|
|
2294
2389
|
node.kind = kind;
|
|
2295
2390
|
for (; ; ) {
|
|
@@ -2297,9 +2392,11 @@ pp$8.parseVar = function(node, isFor, kind) {
|
|
|
2297
2392
|
this.parseVarId(decl, kind);
|
|
2298
2393
|
if (this.eat(types$1.eq)) {
|
|
2299
2394
|
decl.init = this.parseMaybeAssign(isFor);
|
|
2300
|
-
} else if (kind === "const" && !(this.type === types$1._in || this.options.ecmaVersion >= 6 && this.isContextual("of"))) {
|
|
2395
|
+
} else if (!allowMissingInitializer && kind === "const" && !(this.type === types$1._in || this.options.ecmaVersion >= 6 && this.isContextual("of"))) {
|
|
2301
2396
|
this.unexpected();
|
|
2302
|
-
} else if (
|
|
2397
|
+
} else if (!allowMissingInitializer && (kind === "using" || kind === "await using") && this.options.ecmaVersion >= 17 && this.type !== types$1._in && !this.isContextual("of")) {
|
|
2398
|
+
this.raise(this.lastTokEnd, "Missing initializer in " + kind + " declaration");
|
|
2399
|
+
} else if (!allowMissingInitializer && decl.id.type !== "Identifier" && !(isFor && (this.type === types$1._in || this.isContextual("of")))) {
|
|
2303
2400
|
this.raise(this.lastTokEnd, "Complex binding patterns require an initialization value");
|
|
2304
2401
|
} else {
|
|
2305
2402
|
decl.init = null;
|
|
@@ -2312,7 +2409,7 @@ pp$8.parseVar = function(node, isFor, kind) {
|
|
|
2312
2409
|
return node;
|
|
2313
2410
|
};
|
|
2314
2411
|
pp$8.parseVarId = function(decl, kind) {
|
|
2315
|
-
decl.id = this.parseBindingAtom();
|
|
2412
|
+
decl.id = kind === "using" || kind === "await using" ? this.parseIdent() : this.parseBindingAtom();
|
|
2316
2413
|
this.checkLValPattern(decl.id, kind === "var" ? BIND_VAR : BIND_LEXICAL, false);
|
|
2317
2414
|
};
|
|
2318
2415
|
var FUNC_STATEMENT = 1;
|
|
@@ -2372,7 +2469,7 @@ pp$8.parseClass = function(node, isStatement) {
|
|
|
2372
2469
|
classBody.body.push(element);
|
|
2373
2470
|
if (element.type === "MethodDefinition" && element.kind === "constructor") {
|
|
2374
2471
|
if (hadConstructor) {
|
|
2375
|
-
this.
|
|
2472
|
+
this.raiseRecoverable(element.start, "Duplicate constructor in the same class");
|
|
2376
2473
|
}
|
|
2377
2474
|
hadConstructor = true;
|
|
2378
2475
|
} else if (element.key && element.key.type === "PrivateIdentifier" && isPrivateNameConflicted(privateNameMap, element)) {
|
|
@@ -2495,11 +2592,9 @@ pp$8.parseClassField = function(field) {
|
|
|
2495
2592
|
this.raise(field.key.start, "Classes can't have a static field named 'prototype'");
|
|
2496
2593
|
}
|
|
2497
2594
|
if (this.eat(types$1.eq)) {
|
|
2498
|
-
|
|
2499
|
-
var inClassFieldInit = scope.inClassFieldInit;
|
|
2500
|
-
scope.inClassFieldInit = true;
|
|
2595
|
+
this.enterScope(SCOPE_CLASS_FIELD_INIT | SCOPE_SUPER);
|
|
2501
2596
|
field.value = this.parseMaybeAssign();
|
|
2502
|
-
|
|
2597
|
+
this.exitScope();
|
|
2503
2598
|
} else {
|
|
2504
2599
|
field.value = null;
|
|
2505
2600
|
}
|
|
@@ -2545,6 +2640,9 @@ pp$8.exitClassBody = function() {
|
|
|
2545
2640
|
var ref2 = this.privateNameStack.pop();
|
|
2546
2641
|
var declared = ref2.declared;
|
|
2547
2642
|
var used = ref2.used;
|
|
2643
|
+
if (!this.options.checkPrivateFields) {
|
|
2644
|
+
return;
|
|
2645
|
+
}
|
|
2548
2646
|
var len = this.privateNameStack.length;
|
|
2549
2647
|
var parent = len === 0 ? null : this.privateNameStack[len - 1];
|
|
2550
2648
|
for (var i = 0; i < used.length; ++i) {
|
|
@@ -2580,46 +2678,38 @@ function checkKeyName(node, name) {
|
|
|
2580
2678
|
var key = node.key;
|
|
2581
2679
|
return !computed && (key.type === "Identifier" && key.name === name || key.type === "Literal" && key.value === name);
|
|
2582
2680
|
}
|
|
2681
|
+
pp$8.parseExportAllDeclaration = function(node, exports) {
|
|
2682
|
+
if (this.options.ecmaVersion >= 11) {
|
|
2683
|
+
if (this.eatContextual("as")) {
|
|
2684
|
+
node.exported = this.parseModuleExportName();
|
|
2685
|
+
this.checkExport(exports, node.exported, this.lastTokStart);
|
|
2686
|
+
} else {
|
|
2687
|
+
node.exported = null;
|
|
2688
|
+
}
|
|
2689
|
+
}
|
|
2690
|
+
this.expectContextual("from");
|
|
2691
|
+
if (this.type !== types$1.string) {
|
|
2692
|
+
this.unexpected();
|
|
2693
|
+
}
|
|
2694
|
+
node.source = this.parseExprAtom();
|
|
2695
|
+
if (this.options.ecmaVersion >= 16) {
|
|
2696
|
+
node.attributes = this.parseWithClause();
|
|
2697
|
+
}
|
|
2698
|
+
this.semicolon();
|
|
2699
|
+
return this.finishNode(node, "ExportAllDeclaration");
|
|
2700
|
+
};
|
|
2583
2701
|
pp$8.parseExport = function(node, exports) {
|
|
2584
2702
|
this.next();
|
|
2585
2703
|
if (this.eat(types$1.star)) {
|
|
2586
|
-
|
|
2587
|
-
if (this.eatContextual("as")) {
|
|
2588
|
-
node.exported = this.parseModuleExportName();
|
|
2589
|
-
this.checkExport(exports, node.exported, this.lastTokStart);
|
|
2590
|
-
} else {
|
|
2591
|
-
node.exported = null;
|
|
2592
|
-
}
|
|
2593
|
-
}
|
|
2594
|
-
this.expectContextual("from");
|
|
2595
|
-
if (this.type !== types$1.string) {
|
|
2596
|
-
this.unexpected();
|
|
2597
|
-
}
|
|
2598
|
-
node.source = this.parseExprAtom();
|
|
2599
|
-
this.semicolon();
|
|
2600
|
-
return this.finishNode(node, "ExportAllDeclaration");
|
|
2704
|
+
return this.parseExportAllDeclaration(node, exports);
|
|
2601
2705
|
}
|
|
2602
2706
|
if (this.eat(types$1._default)) {
|
|
2603
2707
|
this.checkExport(exports, "default", this.lastTokStart);
|
|
2604
|
-
|
|
2605
|
-
if (this.type === types$1._function || (isAsync = this.isAsyncFunction())) {
|
|
2606
|
-
var fNode = this.startNode();
|
|
2607
|
-
this.next();
|
|
2608
|
-
if (isAsync) {
|
|
2609
|
-
this.next();
|
|
2610
|
-
}
|
|
2611
|
-
node.declaration = this.parseFunction(fNode, FUNC_STATEMENT | FUNC_NULLABLE_ID, false, isAsync);
|
|
2612
|
-
} else if (this.type === types$1._class) {
|
|
2613
|
-
var cNode = this.startNode();
|
|
2614
|
-
node.declaration = this.parseClass(cNode, "nullableID");
|
|
2615
|
-
} else {
|
|
2616
|
-
node.declaration = this.parseMaybeAssign();
|
|
2617
|
-
this.semicolon();
|
|
2618
|
-
}
|
|
2708
|
+
node.declaration = this.parseExportDefaultDeclaration();
|
|
2619
2709
|
return this.finishNode(node, "ExportDefaultDeclaration");
|
|
2620
2710
|
}
|
|
2621
2711
|
if (this.shouldParseExportStatement()) {
|
|
2622
|
-
node.declaration = this.
|
|
2712
|
+
node.declaration = this.parseExportDeclaration(node);
|
|
2623
2713
|
if (node.declaration.type === "VariableDeclaration") {
|
|
2624
2714
|
this.checkVariableExport(exports, node.declaration.declarations);
|
|
2625
2715
|
} else {
|
|
@@ -2627,6 +2717,9 @@ pp$8.parseExport = function(node, exports) {
|
|
|
2627
2717
|
}
|
|
2628
2718
|
node.specifiers = [];
|
|
2629
2719
|
node.source = null;
|
|
2720
|
+
if (this.options.ecmaVersion >= 16) {
|
|
2721
|
+
node.attributes = [];
|
|
2722
|
+
}
|
|
2630
2723
|
} else {
|
|
2631
2724
|
node.declaration = null;
|
|
2632
2725
|
node.specifiers = this.parseExportSpecifiers(exports);
|
|
@@ -2635,6 +2728,9 @@ pp$8.parseExport = function(node, exports) {
|
|
|
2635
2728
|
this.unexpected();
|
|
2636
2729
|
}
|
|
2637
2730
|
node.source = this.parseExprAtom();
|
|
2731
|
+
if (this.options.ecmaVersion >= 16) {
|
|
2732
|
+
node.attributes = this.parseWithClause();
|
|
2733
|
+
}
|
|
2638
2734
|
} else {
|
|
2639
2735
|
for (var i = 0, list = node.specifiers; i < list.length; i += 1) {
|
|
2640
2736
|
var spec = list[i];
|
|
@@ -2645,11 +2741,35 @@ pp$8.parseExport = function(node, exports) {
|
|
|
2645
2741
|
}
|
|
2646
2742
|
}
|
|
2647
2743
|
node.source = null;
|
|
2744
|
+
if (this.options.ecmaVersion >= 16) {
|
|
2745
|
+
node.attributes = [];
|
|
2746
|
+
}
|
|
2648
2747
|
}
|
|
2649
2748
|
this.semicolon();
|
|
2650
2749
|
}
|
|
2651
2750
|
return this.finishNode(node, "ExportNamedDeclaration");
|
|
2652
2751
|
};
|
|
2752
|
+
pp$8.parseExportDeclaration = function(node) {
|
|
2753
|
+
return this.parseStatement(null);
|
|
2754
|
+
};
|
|
2755
|
+
pp$8.parseExportDefaultDeclaration = function() {
|
|
2756
|
+
var isAsync;
|
|
2757
|
+
if (this.type === types$1._function || (isAsync = this.isAsyncFunction())) {
|
|
2758
|
+
var fNode = this.startNode();
|
|
2759
|
+
this.next();
|
|
2760
|
+
if (isAsync) {
|
|
2761
|
+
this.next();
|
|
2762
|
+
}
|
|
2763
|
+
return this.parseFunction(fNode, FUNC_STATEMENT | FUNC_NULLABLE_ID, false, isAsync);
|
|
2764
|
+
} else if (this.type === types$1._class) {
|
|
2765
|
+
var cNode = this.startNode();
|
|
2766
|
+
return this.parseClass(cNode, "nullableID");
|
|
2767
|
+
} else {
|
|
2768
|
+
var declaration = this.parseMaybeAssign();
|
|
2769
|
+
this.semicolon();
|
|
2770
|
+
return declaration;
|
|
2771
|
+
}
|
|
2772
|
+
};
|
|
2653
2773
|
pp$8.checkExport = function(exports, name, pos) {
|
|
2654
2774
|
if (!exports) {
|
|
2655
2775
|
return;
|
|
@@ -2684,8 +2804,6 @@ pp$8.checkPatternExport = function(exports, pat) {
|
|
|
2684
2804
|
this.checkPatternExport(exports, pat.left);
|
|
2685
2805
|
} else if (type === "RestElement") {
|
|
2686
2806
|
this.checkPatternExport(exports, pat.argument);
|
|
2687
|
-
} else if (type === "ParenthesizedExpression") {
|
|
2688
|
-
this.checkPatternExport(exports, pat.expression);
|
|
2689
2807
|
}
|
|
2690
2808
|
};
|
|
2691
2809
|
pp$8.checkVariableExport = function(exports, decls) {
|
|
@@ -2700,6 +2818,17 @@ pp$8.checkVariableExport = function(exports, decls) {
|
|
|
2700
2818
|
pp$8.shouldParseExportStatement = function() {
|
|
2701
2819
|
return this.type.keyword === "var" || this.type.keyword === "const" || this.type.keyword === "class" || this.type.keyword === "function" || this.isLet() || this.isAsyncFunction();
|
|
2702
2820
|
};
|
|
2821
|
+
pp$8.parseExportSpecifier = function(exports) {
|
|
2822
|
+
var node = this.startNode();
|
|
2823
|
+
node.local = this.parseModuleExportName();
|
|
2824
|
+
node.exported = this.eatContextual("as") ? this.parseModuleExportName() : node.local;
|
|
2825
|
+
this.checkExport(
|
|
2826
|
+
exports,
|
|
2827
|
+
node.exported,
|
|
2828
|
+
node.exported.start
|
|
2829
|
+
);
|
|
2830
|
+
return this.finishNode(node, "ExportSpecifier");
|
|
2831
|
+
};
|
|
2703
2832
|
pp$8.parseExportSpecifiers = function(exports) {
|
|
2704
2833
|
var nodes = [], first = true;
|
|
2705
2834
|
this.expect(types$1.braceL);
|
|
@@ -2712,11 +2841,7 @@ pp$8.parseExportSpecifiers = function(exports) {
|
|
|
2712
2841
|
} else {
|
|
2713
2842
|
first = false;
|
|
2714
2843
|
}
|
|
2715
|
-
|
|
2716
|
-
node.local = this.parseModuleExportName();
|
|
2717
|
-
node.exported = this.eatContextual("as") ? this.parseModuleExportName() : node.local;
|
|
2718
|
-
this.checkExport(exports, node.exported, node.exported.start);
|
|
2719
|
-
nodes.push(this.finishNode(node, "ExportSpecifier"));
|
|
2844
|
+
nodes.push(this.parseExportSpecifier(exports));
|
|
2720
2845
|
}
|
|
2721
2846
|
return nodes;
|
|
2722
2847
|
};
|
|
@@ -2730,27 +2855,48 @@ pp$8.parseImport = function(node) {
|
|
|
2730
2855
|
this.expectContextual("from");
|
|
2731
2856
|
node.source = this.type === types$1.string ? this.parseExprAtom() : this.unexpected();
|
|
2732
2857
|
}
|
|
2858
|
+
if (this.options.ecmaVersion >= 16) {
|
|
2859
|
+
node.attributes = this.parseWithClause();
|
|
2860
|
+
}
|
|
2733
2861
|
this.semicolon();
|
|
2734
2862
|
return this.finishNode(node, "ImportDeclaration");
|
|
2735
2863
|
};
|
|
2864
|
+
pp$8.parseImportSpecifier = function() {
|
|
2865
|
+
var node = this.startNode();
|
|
2866
|
+
node.imported = this.parseModuleExportName();
|
|
2867
|
+
if (this.eatContextual("as")) {
|
|
2868
|
+
node.local = this.parseIdent();
|
|
2869
|
+
} else {
|
|
2870
|
+
this.checkUnreserved(node.imported);
|
|
2871
|
+
node.local = node.imported;
|
|
2872
|
+
}
|
|
2873
|
+
this.checkLValSimple(node.local, BIND_LEXICAL);
|
|
2874
|
+
return this.finishNode(node, "ImportSpecifier");
|
|
2875
|
+
};
|
|
2876
|
+
pp$8.parseImportDefaultSpecifier = function() {
|
|
2877
|
+
var node = this.startNode();
|
|
2878
|
+
node.local = this.parseIdent();
|
|
2879
|
+
this.checkLValSimple(node.local, BIND_LEXICAL);
|
|
2880
|
+
return this.finishNode(node, "ImportDefaultSpecifier");
|
|
2881
|
+
};
|
|
2882
|
+
pp$8.parseImportNamespaceSpecifier = function() {
|
|
2883
|
+
var node = this.startNode();
|
|
2884
|
+
this.next();
|
|
2885
|
+
this.expectContextual("as");
|
|
2886
|
+
node.local = this.parseIdent();
|
|
2887
|
+
this.checkLValSimple(node.local, BIND_LEXICAL);
|
|
2888
|
+
return this.finishNode(node, "ImportNamespaceSpecifier");
|
|
2889
|
+
};
|
|
2736
2890
|
pp$8.parseImportSpecifiers = function() {
|
|
2737
2891
|
var nodes = [], first = true;
|
|
2738
2892
|
if (this.type === types$1.name) {
|
|
2739
|
-
|
|
2740
|
-
node.local = this.parseIdent();
|
|
2741
|
-
this.checkLValSimple(node.local, BIND_LEXICAL);
|
|
2742
|
-
nodes.push(this.finishNode(node, "ImportDefaultSpecifier"));
|
|
2893
|
+
nodes.push(this.parseImportDefaultSpecifier());
|
|
2743
2894
|
if (!this.eat(types$1.comma)) {
|
|
2744
2895
|
return nodes;
|
|
2745
2896
|
}
|
|
2746
2897
|
}
|
|
2747
2898
|
if (this.type === types$1.star) {
|
|
2748
|
-
|
|
2749
|
-
this.next();
|
|
2750
|
-
this.expectContextual("as");
|
|
2751
|
-
node$1.local = this.parseIdent();
|
|
2752
|
-
this.checkLValSimple(node$1.local, BIND_LEXICAL);
|
|
2753
|
-
nodes.push(this.finishNode(node$1, "ImportNamespaceSpecifier"));
|
|
2899
|
+
nodes.push(this.parseImportNamespaceSpecifier());
|
|
2754
2900
|
return nodes;
|
|
2755
2901
|
}
|
|
2756
2902
|
this.expect(types$1.braceL);
|
|
@@ -2763,19 +2909,47 @@ pp$8.parseImportSpecifiers = function() {
|
|
|
2763
2909
|
} else {
|
|
2764
2910
|
first = false;
|
|
2765
2911
|
}
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2912
|
+
nodes.push(this.parseImportSpecifier());
|
|
2913
|
+
}
|
|
2914
|
+
return nodes;
|
|
2915
|
+
};
|
|
2916
|
+
pp$8.parseWithClause = function() {
|
|
2917
|
+
var nodes = [];
|
|
2918
|
+
if (!this.eat(types$1._with)) {
|
|
2919
|
+
return nodes;
|
|
2920
|
+
}
|
|
2921
|
+
this.expect(types$1.braceL);
|
|
2922
|
+
var attributeKeys = {};
|
|
2923
|
+
var first = true;
|
|
2924
|
+
while (!this.eat(types$1.braceR)) {
|
|
2925
|
+
if (!first) {
|
|
2926
|
+
this.expect(types$1.comma);
|
|
2927
|
+
if (this.afterTrailingComma(types$1.braceR)) {
|
|
2928
|
+
break;
|
|
2929
|
+
}
|
|
2770
2930
|
} else {
|
|
2771
|
-
|
|
2772
|
-
|
|
2931
|
+
first = false;
|
|
2932
|
+
}
|
|
2933
|
+
var attr = this.parseImportAttribute();
|
|
2934
|
+
var keyName = attr.key.type === "Identifier" ? attr.key.name : attr.key.value;
|
|
2935
|
+
if (hasOwn(attributeKeys, keyName)) {
|
|
2936
|
+
this.raiseRecoverable(attr.key.start, "Duplicate attribute key '" + keyName + "'");
|
|
2773
2937
|
}
|
|
2774
|
-
|
|
2775
|
-
nodes.push(
|
|
2938
|
+
attributeKeys[keyName] = true;
|
|
2939
|
+
nodes.push(attr);
|
|
2776
2940
|
}
|
|
2777
2941
|
return nodes;
|
|
2778
2942
|
};
|
|
2943
|
+
pp$8.parseImportAttribute = function() {
|
|
2944
|
+
var node = this.startNode();
|
|
2945
|
+
node.key = this.type === types$1.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never");
|
|
2946
|
+
this.expect(types$1.colon);
|
|
2947
|
+
if (this.type !== types$1.string) {
|
|
2948
|
+
this.unexpected();
|
|
2949
|
+
}
|
|
2950
|
+
node.value = this.parseExprAtom();
|
|
2951
|
+
return this.finishNode(node, "ImportAttribute");
|
|
2952
|
+
};
|
|
2779
2953
|
pp$8.parseModuleExportName = function() {
|
|
2780
2954
|
if (this.options.ecmaVersion >= 13 && this.type === types$1.string) {
|
|
2781
2955
|
var stringLiteral = this.parseLiteral(this.value);
|
|
@@ -2912,7 +3086,7 @@ pp$7.parseBindingAtom = function() {
|
|
|
2912
3086
|
}
|
|
2913
3087
|
return this.parseIdent();
|
|
2914
3088
|
};
|
|
2915
|
-
pp$7.parseBindingList = function(close, allowEmpty, allowTrailingComma) {
|
|
3089
|
+
pp$7.parseBindingList = function(close, allowEmpty, allowTrailingComma, allowModifiers) {
|
|
2916
3090
|
var elts = [], first = true;
|
|
2917
3091
|
while (!this.eat(close)) {
|
|
2918
3092
|
if (first) {
|
|
@@ -2929,18 +3103,21 @@ pp$7.parseBindingList = function(close, allowEmpty, allowTrailingComma) {
|
|
|
2929
3103
|
this.parseBindingListItem(rest);
|
|
2930
3104
|
elts.push(rest);
|
|
2931
3105
|
if (this.type === types$1.comma) {
|
|
2932
|
-
this.
|
|
3106
|
+
this.raiseRecoverable(this.start, "Comma is not permitted after the rest element");
|
|
2933
3107
|
}
|
|
2934
3108
|
this.expect(close);
|
|
2935
3109
|
break;
|
|
2936
3110
|
} else {
|
|
2937
|
-
|
|
2938
|
-
this.parseBindingListItem(elem);
|
|
2939
|
-
elts.push(elem);
|
|
3111
|
+
elts.push(this.parseAssignableListItem(allowModifiers));
|
|
2940
3112
|
}
|
|
2941
3113
|
}
|
|
2942
3114
|
return elts;
|
|
2943
3115
|
};
|
|
3116
|
+
pp$7.parseAssignableListItem = function(allowModifiers) {
|
|
3117
|
+
var elem = this.parseMaybeDefault(this.start, this.startLoc);
|
|
3118
|
+
this.parseBindingListItem(elem);
|
|
3119
|
+
return elem;
|
|
3120
|
+
};
|
|
2944
3121
|
pp$7.parseBindingListItem = function(param) {
|
|
2945
3122
|
return param;
|
|
2946
3123
|
};
|
|
@@ -3142,6 +3319,12 @@ types$1._function.updateContext = types$1._class.updateContext = function(prevTy
|
|
|
3142
3319
|
}
|
|
3143
3320
|
this.exprAllowed = false;
|
|
3144
3321
|
};
|
|
3322
|
+
types$1.colon.updateContext = function() {
|
|
3323
|
+
if (this.curContext().token === "function") {
|
|
3324
|
+
this.context.pop();
|
|
3325
|
+
}
|
|
3326
|
+
this.exprAllowed = true;
|
|
3327
|
+
};
|
|
3145
3328
|
types$1.backQuote.updateContext = function() {
|
|
3146
3329
|
if (this.curContext() === types.q_tmpl) {
|
|
3147
3330
|
this.context.pop();
|
|
@@ -3374,7 +3557,7 @@ pp$5.parseMaybeUnary = function(refDestructuringErrors, sawUnary, incDec, forIni
|
|
|
3374
3557
|
this.checkExpressionErrors(refDestructuringErrors, true);
|
|
3375
3558
|
if (update) {
|
|
3376
3559
|
this.checkLValSimple(node.argument);
|
|
3377
|
-
} else if (this.strict && node.operator === "delete" && node.argument
|
|
3560
|
+
} else if (this.strict && node.operator === "delete" && isLocalVariableAccess(node.argument)) {
|
|
3378
3561
|
this.raiseRecoverable(node.start, "Deleting local variable in strict mode");
|
|
3379
3562
|
} else if (node.operator === "delete" && isPrivateFieldAccess(node.argument)) {
|
|
3380
3563
|
this.raiseRecoverable(node.start, "Private fields can not be deleted");
|
|
@@ -3383,7 +3566,7 @@ pp$5.parseMaybeUnary = function(refDestructuringErrors, sawUnary, incDec, forIni
|
|
|
3383
3566
|
}
|
|
3384
3567
|
expr = this.finishNode(node, update ? "UpdateExpression" : "UnaryExpression");
|
|
3385
3568
|
} else if (!sawUnary && this.type === types$1.privateId) {
|
|
3386
|
-
if (forInit || this.privateNameStack.length === 0) {
|
|
3569
|
+
if ((forInit || this.privateNameStack.length === 0) && this.options.checkPrivateFields) {
|
|
3387
3570
|
this.unexpected();
|
|
3388
3571
|
}
|
|
3389
3572
|
expr = this.parsePrivateIdent();
|
|
@@ -3415,8 +3598,11 @@ pp$5.parseMaybeUnary = function(refDestructuringErrors, sawUnary, incDec, forIni
|
|
|
3415
3598
|
return expr;
|
|
3416
3599
|
}
|
|
3417
3600
|
};
|
|
3601
|
+
function isLocalVariableAccess(node) {
|
|
3602
|
+
return node.type === "Identifier" || node.type === "ParenthesizedExpression" && isLocalVariableAccess(node.expression);
|
|
3603
|
+
}
|
|
3418
3604
|
function isPrivateFieldAccess(node) {
|
|
3419
|
-
return node.type === "MemberExpression" && node.property.type === "PrivateIdentifier" || node.type === "ChainExpression" && isPrivateFieldAccess(node.expression);
|
|
3605
|
+
return node.type === "MemberExpression" && node.property.type === "PrivateIdentifier" || node.type === "ChainExpression" && isPrivateFieldAccess(node.expression) || node.type === "ParenthesizedExpression" && isPrivateFieldAccess(node.expression);
|
|
3420
3606
|
}
|
|
3421
3607
|
pp$5.parseExprSubscripts = function(refDestructuringErrors, forInit) {
|
|
3422
3608
|
var startPos = this.start, startLoc = this.startLoc;
|
|
@@ -3457,6 +3643,12 @@ pp$5.parseSubscripts = function(base, startPos, startLoc, noCalls, forInit) {
|
|
|
3457
3643
|
base = element;
|
|
3458
3644
|
}
|
|
3459
3645
|
};
|
|
3646
|
+
pp$5.shouldParseAsyncArrow = function() {
|
|
3647
|
+
return !this.canInsertSemicolon() && this.eat(types$1.arrow);
|
|
3648
|
+
};
|
|
3649
|
+
pp$5.parseSubscriptAsyncArrow = function(startPos, startLoc, exprList, forInit) {
|
|
3650
|
+
return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, true, forInit);
|
|
3651
|
+
};
|
|
3460
3652
|
pp$5.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained, forInit) {
|
|
3461
3653
|
var optionalSupported = this.options.ecmaVersion >= 11;
|
|
3462
3654
|
var optional = optionalSupported && this.eat(types$1.questionDot);
|
|
@@ -3486,7 +3678,7 @@ pp$5.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArro
|
|
|
3486
3678
|
this.awaitPos = 0;
|
|
3487
3679
|
this.awaitIdentPos = 0;
|
|
3488
3680
|
var exprList = this.parseExprList(types$1.parenR, this.options.ecmaVersion >= 8, false, refDestructuringErrors);
|
|
3489
|
-
if (maybeAsyncArrow && !optional &&
|
|
3681
|
+
if (maybeAsyncArrow && !optional && this.shouldParseAsyncArrow()) {
|
|
3490
3682
|
this.checkPatternErrors(refDestructuringErrors, false);
|
|
3491
3683
|
this.checkYieldAwaitInDefaultParams();
|
|
3492
3684
|
if (this.awaitIdentPos > 0) {
|
|
@@ -3495,7 +3687,7 @@ pp$5.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArro
|
|
|
3495
3687
|
this.yieldPos = oldYieldPos;
|
|
3496
3688
|
this.awaitPos = oldAwaitPos;
|
|
3497
3689
|
this.awaitIdentPos = oldAwaitIdentPos;
|
|
3498
|
-
return this.
|
|
3690
|
+
return this.parseSubscriptAsyncArrow(startPos, startLoc, exprList, forInit);
|
|
3499
3691
|
}
|
|
3500
3692
|
this.checkExpressionErrors(refDestructuringErrors, true);
|
|
3501
3693
|
this.yieldPos = oldYieldPos || this.yieldPos;
|
|
@@ -3519,7 +3711,7 @@ pp$5.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArro
|
|
|
3519
3711
|
}
|
|
3520
3712
|
return base;
|
|
3521
3713
|
};
|
|
3522
|
-
pp$5.parseExprAtom = function(refDestructuringErrors, forInit) {
|
|
3714
|
+
pp$5.parseExprAtom = function(refDestructuringErrors, forInit, forNew) {
|
|
3523
3715
|
if (this.type === types$1.slash) {
|
|
3524
3716
|
this.readRegexp();
|
|
3525
3717
|
}
|
|
@@ -3609,39 +3801,62 @@ pp$5.parseExprAtom = function(refDestructuringErrors, forInit) {
|
|
|
3609
3801
|
return this.parseTemplate();
|
|
3610
3802
|
case types$1._import:
|
|
3611
3803
|
if (this.options.ecmaVersion >= 11) {
|
|
3612
|
-
return this.parseExprImport();
|
|
3804
|
+
return this.parseExprImport(forNew);
|
|
3613
3805
|
} else {
|
|
3614
3806
|
return this.unexpected();
|
|
3615
3807
|
}
|
|
3616
3808
|
default:
|
|
3617
|
-
this.
|
|
3809
|
+
return this.parseExprAtomDefault();
|
|
3618
3810
|
}
|
|
3619
3811
|
};
|
|
3620
|
-
pp$5.
|
|
3812
|
+
pp$5.parseExprAtomDefault = function() {
|
|
3813
|
+
this.unexpected();
|
|
3814
|
+
};
|
|
3815
|
+
pp$5.parseExprImport = function(forNew) {
|
|
3621
3816
|
var node = this.startNode();
|
|
3622
3817
|
if (this.containsEsc) {
|
|
3623
3818
|
this.raiseRecoverable(this.start, "Escape sequence in keyword import");
|
|
3624
3819
|
}
|
|
3625
|
-
|
|
3626
|
-
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
|
|
3633
|
-
|
|
3820
|
+
this.next();
|
|
3821
|
+
if (this.type === types$1.parenL && !forNew) {
|
|
3822
|
+
return this.parseDynamicImport(node);
|
|
3823
|
+
} else if (this.type === types$1.dot) {
|
|
3824
|
+
var meta2 = this.startNodeAt(node.start, node.loc && node.loc.start);
|
|
3825
|
+
meta2.name = "import";
|
|
3826
|
+
node.meta = this.finishNode(meta2, "Identifier");
|
|
3827
|
+
return this.parseImportMeta(node);
|
|
3828
|
+
} else {
|
|
3829
|
+
this.unexpected();
|
|
3634
3830
|
}
|
|
3635
3831
|
};
|
|
3636
3832
|
pp$5.parseDynamicImport = function(node) {
|
|
3637
3833
|
this.next();
|
|
3638
3834
|
node.source = this.parseMaybeAssign();
|
|
3639
|
-
if (
|
|
3640
|
-
|
|
3641
|
-
|
|
3642
|
-
this.
|
|
3835
|
+
if (this.options.ecmaVersion >= 16) {
|
|
3836
|
+
if (!this.eat(types$1.parenR)) {
|
|
3837
|
+
this.expect(types$1.comma);
|
|
3838
|
+
if (!this.afterTrailingComma(types$1.parenR)) {
|
|
3839
|
+
node.options = this.parseMaybeAssign();
|
|
3840
|
+
if (!this.eat(types$1.parenR)) {
|
|
3841
|
+
this.expect(types$1.comma);
|
|
3842
|
+
if (!this.afterTrailingComma(types$1.parenR)) {
|
|
3843
|
+
this.unexpected();
|
|
3844
|
+
}
|
|
3845
|
+
}
|
|
3846
|
+
} else {
|
|
3847
|
+
node.options = null;
|
|
3848
|
+
}
|
|
3643
3849
|
} else {
|
|
3644
|
-
|
|
3850
|
+
node.options = null;
|
|
3851
|
+
}
|
|
3852
|
+
} else {
|
|
3853
|
+
if (!this.eat(types$1.parenR)) {
|
|
3854
|
+
var errorPos = this.start;
|
|
3855
|
+
if (this.eat(types$1.comma) && this.eat(types$1.parenR)) {
|
|
3856
|
+
this.raiseRecoverable(errorPos, "Trailing comma is not allowed in import()");
|
|
3857
|
+
} else {
|
|
3858
|
+
this.unexpected(errorPos);
|
|
3859
|
+
}
|
|
3645
3860
|
}
|
|
3646
3861
|
}
|
|
3647
3862
|
return this.finishNode(node, "ImportExpression");
|
|
@@ -3666,7 +3881,7 @@ pp$5.parseLiteral = function(value) {
|
|
|
3666
3881
|
node.value = value;
|
|
3667
3882
|
node.raw = this.input.slice(this.start, this.end);
|
|
3668
3883
|
if (node.raw.charCodeAt(node.raw.length - 1) === 110) {
|
|
3669
|
-
node.bigint = node.raw.slice(0, -1).replace(/_/g, "");
|
|
3884
|
+
node.bigint = node.value != null ? node.value.toString() : node.raw.slice(0, -1).replace(/_/g, "");
|
|
3670
3885
|
}
|
|
3671
3886
|
this.next();
|
|
3672
3887
|
return this.finishNode(node, "Literal");
|
|
@@ -3677,6 +3892,9 @@ pp$5.parseParenExpression = function() {
|
|
|
3677
3892
|
this.expect(types$1.parenR);
|
|
3678
3893
|
return val;
|
|
3679
3894
|
};
|
|
3895
|
+
pp$5.shouldParseArrow = function(exprList) {
|
|
3896
|
+
return !this.canInsertSemicolon();
|
|
3897
|
+
};
|
|
3680
3898
|
pp$5.parseParenAndDistinguishExpression = function(canBeArrow, forInit) {
|
|
3681
3899
|
var startPos = this.start, startLoc = this.startLoc, val, allowTrailingComma = this.options.ecmaVersion >= 8;
|
|
3682
3900
|
if (this.options.ecmaVersion >= 6) {
|
|
@@ -3695,7 +3913,10 @@ pp$5.parseParenAndDistinguishExpression = function(canBeArrow, forInit) {
|
|
|
3695
3913
|
spreadStart = this.start;
|
|
3696
3914
|
exprList.push(this.parseParenItem(this.parseRestBinding()));
|
|
3697
3915
|
if (this.type === types$1.comma) {
|
|
3698
|
-
this.
|
|
3916
|
+
this.raiseRecoverable(
|
|
3917
|
+
this.start,
|
|
3918
|
+
"Comma is not permitted after the rest element"
|
|
3919
|
+
);
|
|
3699
3920
|
}
|
|
3700
3921
|
break;
|
|
3701
3922
|
} else {
|
|
@@ -3704,7 +3925,7 @@ pp$5.parseParenAndDistinguishExpression = function(canBeArrow, forInit) {
|
|
|
3704
3925
|
}
|
|
3705
3926
|
var innerEndPos = this.lastTokEnd, innerEndLoc = this.lastTokEndLoc;
|
|
3706
3927
|
this.expect(types$1.parenR);
|
|
3707
|
-
if (canBeArrow &&
|
|
3928
|
+
if (canBeArrow && this.shouldParseArrow(exprList) && this.eat(types$1.arrow)) {
|
|
3708
3929
|
this.checkPatternErrors(refDestructuringErrors, false);
|
|
3709
3930
|
this.checkYieldAwaitInDefaultParams();
|
|
3710
3931
|
this.yieldPos = oldYieldPos;
|
|
@@ -3750,9 +3971,12 @@ pp$5.parseNew = function() {
|
|
|
3750
3971
|
this.raiseRecoverable(this.start, "Escape sequence in keyword new");
|
|
3751
3972
|
}
|
|
3752
3973
|
var node = this.startNode();
|
|
3753
|
-
|
|
3754
|
-
if (this.options.ecmaVersion >= 6 && this.
|
|
3755
|
-
node.
|
|
3974
|
+
this.next();
|
|
3975
|
+
if (this.options.ecmaVersion >= 6 && this.type === types$1.dot) {
|
|
3976
|
+
var meta2 = this.startNodeAt(node.start, node.loc && node.loc.start);
|
|
3977
|
+
meta2.name = "new";
|
|
3978
|
+
node.meta = this.finishNode(meta2, "Identifier");
|
|
3979
|
+
this.next();
|
|
3756
3980
|
var containsEsc = this.containsEsc;
|
|
3757
3981
|
node.property = this.parseIdent(true);
|
|
3758
3982
|
if (node.property.name !== "target") {
|
|
@@ -3766,11 +3990,8 @@ pp$5.parseNew = function() {
|
|
|
3766
3990
|
}
|
|
3767
3991
|
return this.finishNode(node, "MetaProperty");
|
|
3768
3992
|
}
|
|
3769
|
-
var startPos = this.start, startLoc = this.startLoc
|
|
3770
|
-
node.callee = this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true, false);
|
|
3771
|
-
if (isImport && node.callee.type === "ImportExpression") {
|
|
3772
|
-
this.raise(startPos, "Cannot use new with import()");
|
|
3773
|
-
}
|
|
3993
|
+
var startPos = this.start, startLoc = this.startLoc;
|
|
3994
|
+
node.callee = this.parseSubscripts(this.parseExprAtom(null, false, true), startPos, startLoc, true, false);
|
|
3774
3995
|
if (this.eat(types$1.parenL)) {
|
|
3775
3996
|
node.arguments = this.parseExprList(types$1.parenR, this.options.ecmaVersion >= 8, false);
|
|
3776
3997
|
} else {
|
|
@@ -3786,7 +4007,7 @@ pp$5.parseTemplateElement = function(ref2) {
|
|
|
3786
4007
|
this.raiseRecoverable(this.start, "Bad escape sequence in untagged template literal");
|
|
3787
4008
|
}
|
|
3788
4009
|
elem.value = {
|
|
3789
|
-
raw: this.value,
|
|
4010
|
+
raw: this.value.replace(/\r\n?/g, "\n"),
|
|
3790
4011
|
cooked: null
|
|
3791
4012
|
};
|
|
3792
4013
|
} else {
|
|
@@ -3852,7 +4073,7 @@ pp$5.parseProperty = function(isPattern, refDestructuringErrors) {
|
|
|
3852
4073
|
if (isPattern) {
|
|
3853
4074
|
prop.argument = this.parseIdent(false);
|
|
3854
4075
|
if (this.type === types$1.comma) {
|
|
3855
|
-
this.
|
|
4076
|
+
this.raiseRecoverable(this.start, "Comma is not permitted after the rest element");
|
|
3856
4077
|
}
|
|
3857
4078
|
return this.finishNode(prop, "RestElement");
|
|
3858
4079
|
}
|
|
@@ -3885,6 +4106,25 @@ pp$5.parseProperty = function(isPattern, refDestructuringErrors) {
|
|
|
3885
4106
|
this.parsePropertyValue(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc);
|
|
3886
4107
|
return this.finishNode(prop, "Property");
|
|
3887
4108
|
};
|
|
4109
|
+
pp$5.parseGetterSetter = function(prop) {
|
|
4110
|
+
var kind = prop.key.name;
|
|
4111
|
+
this.parsePropertyName(prop);
|
|
4112
|
+
prop.value = this.parseMethod(false);
|
|
4113
|
+
prop.kind = kind;
|
|
4114
|
+
var paramCount = prop.kind === "get" ? 0 : 1;
|
|
4115
|
+
if (prop.value.params.length !== paramCount) {
|
|
4116
|
+
var start = prop.value.start;
|
|
4117
|
+
if (prop.kind === "get") {
|
|
4118
|
+
this.raiseRecoverable(start, "getter should have no params");
|
|
4119
|
+
} else {
|
|
4120
|
+
this.raiseRecoverable(start, "setter should have exactly one param");
|
|
4121
|
+
}
|
|
4122
|
+
} else {
|
|
4123
|
+
if (prop.kind === "set" && prop.value.params[0].type === "RestElement") {
|
|
4124
|
+
this.raiseRecoverable(prop.value.params[0].start, "Setter cannot use rest params");
|
|
4125
|
+
}
|
|
4126
|
+
}
|
|
4127
|
+
};
|
|
3888
4128
|
pp$5.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc) {
|
|
3889
4129
|
if ((isGenerator || isAsync) && this.type === types$1.colon) {
|
|
3890
4130
|
this.unexpected();
|
|
@@ -3896,29 +4136,14 @@ pp$5.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startP
|
|
|
3896
4136
|
if (isPattern) {
|
|
3897
4137
|
this.unexpected();
|
|
3898
4138
|
}
|
|
3899
|
-
prop.kind = "init";
|
|
3900
4139
|
prop.method = true;
|
|
3901
4140
|
prop.value = this.parseMethod(isGenerator, isAsync);
|
|
4141
|
+
prop.kind = "init";
|
|
3902
4142
|
} else if (!isPattern && !containsEsc && this.options.ecmaVersion >= 5 && !prop.computed && prop.key.type === "Identifier" && (prop.key.name === "get" || prop.key.name === "set") && (this.type !== types$1.comma && this.type !== types$1.braceR && this.type !== types$1.eq)) {
|
|
3903
4143
|
if (isGenerator || isAsync) {
|
|
3904
4144
|
this.unexpected();
|
|
3905
4145
|
}
|
|
3906
|
-
|
|
3907
|
-
this.parsePropertyName(prop);
|
|
3908
|
-
prop.value = this.parseMethod(false);
|
|
3909
|
-
var paramCount = prop.kind === "get" ? 0 : 1;
|
|
3910
|
-
if (prop.value.params.length !== paramCount) {
|
|
3911
|
-
var start = prop.value.start;
|
|
3912
|
-
if (prop.kind === "get") {
|
|
3913
|
-
this.raiseRecoverable(start, "getter should have no params");
|
|
3914
|
-
} else {
|
|
3915
|
-
this.raiseRecoverable(start, "setter should have exactly one param");
|
|
3916
|
-
}
|
|
3917
|
-
} else {
|
|
3918
|
-
if (prop.kind === "set" && prop.value.params[0].type === "RestElement") {
|
|
3919
|
-
this.raiseRecoverable(prop.value.params[0].start, "Setter cannot use rest params");
|
|
3920
|
-
}
|
|
3921
|
-
}
|
|
4146
|
+
this.parseGetterSetter(prop);
|
|
3922
4147
|
} else if (this.options.ecmaVersion >= 6 && !prop.computed && prop.key.type === "Identifier") {
|
|
3923
4148
|
if (isGenerator || isAsync) {
|
|
3924
4149
|
this.unexpected();
|
|
@@ -3927,7 +4152,6 @@ pp$5.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startP
|
|
|
3927
4152
|
if (prop.key.name === "await" && !this.awaitIdentPos) {
|
|
3928
4153
|
this.awaitIdentPos = startPos;
|
|
3929
4154
|
}
|
|
3930
|
-
prop.kind = "init";
|
|
3931
4155
|
if (isPattern) {
|
|
3932
4156
|
prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key));
|
|
3933
4157
|
} else if (this.type === types$1.eq && refDestructuringErrors) {
|
|
@@ -3938,6 +4162,7 @@ pp$5.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startP
|
|
|
3938
4162
|
} else {
|
|
3939
4163
|
prop.value = this.copyNode(prop.key);
|
|
3940
4164
|
}
|
|
4165
|
+
prop.kind = "init";
|
|
3941
4166
|
prop.shorthand = true;
|
|
3942
4167
|
} else {
|
|
3943
4168
|
this.unexpected();
|
|
@@ -4087,7 +4312,7 @@ pp$5.checkUnreserved = function(ref2) {
|
|
|
4087
4312
|
if (this.inAsync && name === "await") {
|
|
4088
4313
|
this.raiseRecoverable(start, "Cannot use 'await' as identifier inside an async function");
|
|
4089
4314
|
}
|
|
4090
|
-
if (this.currentThisScope().
|
|
4315
|
+
if (!(this.currentThisScope().flags & SCOPE_VAR) && name === "arguments") {
|
|
4091
4316
|
this.raiseRecoverable(start, "Cannot use 'arguments' in class field initializer");
|
|
4092
4317
|
}
|
|
4093
4318
|
if (this.inClassStaticBlock && (name === "arguments" || name === "await")) {
|
|
@@ -4108,6 +4333,18 @@ pp$5.checkUnreserved = function(ref2) {
|
|
|
4108
4333
|
}
|
|
4109
4334
|
};
|
|
4110
4335
|
pp$5.parseIdent = function(liberal) {
|
|
4336
|
+
var node = this.parseIdentNode();
|
|
4337
|
+
this.next(!!liberal);
|
|
4338
|
+
this.finishNode(node, "Identifier");
|
|
4339
|
+
if (!liberal) {
|
|
4340
|
+
this.checkUnreserved(node);
|
|
4341
|
+
if (node.name === "await" && !this.awaitIdentPos) {
|
|
4342
|
+
this.awaitIdentPos = node.start;
|
|
4343
|
+
}
|
|
4344
|
+
}
|
|
4345
|
+
return node;
|
|
4346
|
+
};
|
|
4347
|
+
pp$5.parseIdentNode = function() {
|
|
4111
4348
|
var node = this.startNode();
|
|
4112
4349
|
if (this.type === types$1.name) {
|
|
4113
4350
|
node.name = this.value;
|
|
@@ -4116,17 +4353,10 @@ pp$5.parseIdent = function(liberal) {
|
|
|
4116
4353
|
if ((node.name === "class" || node.name === "function") && (this.lastTokEnd !== this.lastTokStart + 1 || this.input.charCodeAt(this.lastTokStart) !== 46)) {
|
|
4117
4354
|
this.context.pop();
|
|
4118
4355
|
}
|
|
4356
|
+
this.type = types$1.name;
|
|
4119
4357
|
} else {
|
|
4120
4358
|
this.unexpected();
|
|
4121
4359
|
}
|
|
4122
|
-
this.next(!!liberal);
|
|
4123
|
-
this.finishNode(node, "Identifier");
|
|
4124
|
-
if (!liberal) {
|
|
4125
|
-
this.checkUnreserved(node);
|
|
4126
|
-
if (node.name === "await" && !this.awaitIdentPos) {
|
|
4127
|
-
this.awaitIdentPos = node.start;
|
|
4128
|
-
}
|
|
4129
|
-
}
|
|
4130
4360
|
return node;
|
|
4131
4361
|
};
|
|
4132
4362
|
pp$5.parsePrivateIdent = function() {
|
|
@@ -4138,10 +4368,12 @@ pp$5.parsePrivateIdent = function() {
|
|
|
4138
4368
|
}
|
|
4139
4369
|
this.next();
|
|
4140
4370
|
this.finishNode(node, "PrivateIdentifier");
|
|
4141
|
-
if (this.
|
|
4142
|
-
this.
|
|
4143
|
-
|
|
4144
|
-
|
|
4371
|
+
if (this.options.checkPrivateFields) {
|
|
4372
|
+
if (this.privateNameStack.length === 0) {
|
|
4373
|
+
this.raise(node.start, "Private field '#" + node.name + "' must be declared in an enclosing class");
|
|
4374
|
+
} else {
|
|
4375
|
+
this.privateNameStack[this.privateNameStack.length - 1].used.push(node);
|
|
4376
|
+
}
|
|
4145
4377
|
}
|
|
4146
4378
|
return node;
|
|
4147
4379
|
};
|
|
@@ -4173,6 +4405,9 @@ var pp$4 = Parser.prototype;
|
|
|
4173
4405
|
pp$4.raise = function(pos, message) {
|
|
4174
4406
|
var loc = getLineInfo(this.input, pos);
|
|
4175
4407
|
message += " (" + loc.line + ":" + loc.column + ")";
|
|
4408
|
+
if (this.sourceFile) {
|
|
4409
|
+
message += " in " + this.sourceFile;
|
|
4410
|
+
}
|
|
4176
4411
|
var err = new SyntaxError(message);
|
|
4177
4412
|
err.pos = pos;
|
|
4178
4413
|
err.loc = loc;
|
|
@@ -4191,7 +4426,6 @@ var Scope = function Scope2(flags) {
|
|
|
4191
4426
|
this.var = [];
|
|
4192
4427
|
this.lexical = [];
|
|
4193
4428
|
this.functions = [];
|
|
4194
|
-
this.inClassFieldInit = false;
|
|
4195
4429
|
};
|
|
4196
4430
|
pp$3.enterScope = function(flags) {
|
|
4197
4431
|
this.scopeStack.push(new Scope(flags));
|
|
@@ -4253,7 +4487,7 @@ pp$3.currentScope = function() {
|
|
|
4253
4487
|
pp$3.currentVarScope = function() {
|
|
4254
4488
|
for (var i = this.scopeStack.length - 1; ; i--) {
|
|
4255
4489
|
var scope = this.scopeStack[i];
|
|
4256
|
-
if (scope.flags & SCOPE_VAR) {
|
|
4490
|
+
if (scope.flags & (SCOPE_VAR | SCOPE_CLASS_FIELD_INIT | SCOPE_CLASS_STATIC_BLOCK)) {
|
|
4257
4491
|
return scope;
|
|
4258
4492
|
}
|
|
4259
4493
|
}
|
|
@@ -4261,7 +4495,7 @@ pp$3.currentVarScope = function() {
|
|
|
4261
4495
|
pp$3.currentThisScope = function() {
|
|
4262
4496
|
for (var i = this.scopeStack.length - 1; ; i--) {
|
|
4263
4497
|
var scope = this.scopeStack[i];
|
|
4264
|
-
if (scope.flags & SCOPE_VAR && !(scope.flags & SCOPE_ARROW)) {
|
|
4498
|
+
if (scope.flags & (SCOPE_VAR | SCOPE_CLASS_FIELD_INIT | SCOPE_CLASS_STATIC_BLOCK) && !(scope.flags & SCOPE_ARROW)) {
|
|
4265
4499
|
return scope;
|
|
4266
4500
|
}
|
|
4267
4501
|
}
|
|
@@ -4311,6 +4545,7 @@ pp$2.copyNode = function(node) {
|
|
|
4311
4545
|
}
|
|
4312
4546
|
return newNode;
|
|
4313
4547
|
};
|
|
4548
|
+
var scriptValuesAddedInUnicode = "Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sunu Sunuwar Todhri Todr Tulu_Tigalari Tutg Unknown Zzzz";
|
|
4314
4549
|
var ecma9BinaryProperties = "ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS";
|
|
4315
4550
|
var ecma10BinaryProperties = ecma9BinaryProperties + " Extended_Pictographic";
|
|
4316
4551
|
var ecma11BinaryProperties = ecma10BinaryProperties;
|
|
@@ -4325,13 +4560,22 @@ var unicodeBinaryProperties = {
|
|
|
4325
4560
|
13: ecma13BinaryProperties,
|
|
4326
4561
|
14: ecma14BinaryProperties
|
|
4327
4562
|
};
|
|
4563
|
+
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";
|
|
4564
|
+
var unicodeBinaryPropertiesOfStrings = {
|
|
4565
|
+
9: "",
|
|
4566
|
+
10: "",
|
|
4567
|
+
11: "",
|
|
4568
|
+
12: "",
|
|
4569
|
+
13: "",
|
|
4570
|
+
14: ecma14BinaryPropertiesOfStrings
|
|
4571
|
+
};
|
|
4328
4572
|
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";
|
|
4329
4573
|
var ecma9ScriptValues = "Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb";
|
|
4330
4574
|
var ecma10ScriptValues = ecma9ScriptValues + " Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd";
|
|
4331
4575
|
var ecma11ScriptValues = ecma10ScriptValues + " Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho";
|
|
4332
4576
|
var ecma12ScriptValues = ecma11ScriptValues + " Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi";
|
|
4333
4577
|
var ecma13ScriptValues = ecma12ScriptValues + " Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith";
|
|
4334
|
-
var ecma14ScriptValues = ecma13ScriptValues + "
|
|
4578
|
+
var ecma14ScriptValues = ecma13ScriptValues + " " + scriptValuesAddedInUnicode;
|
|
4335
4579
|
var unicodeScriptValues = {
|
|
4336
4580
|
9: ecma9ScriptValues,
|
|
4337
4581
|
10: ecma10ScriptValues,
|
|
@@ -4344,6 +4588,7 @@ var data = {};
|
|
|
4344
4588
|
function buildUnicodeData(ecmaVersion) {
|
|
4345
4589
|
var d = data[ecmaVersion] = {
|
|
4346
4590
|
binary: wordsRegexp(unicodeBinaryProperties[ecmaVersion] + " " + unicodeGeneralCategoryValues),
|
|
4591
|
+
binaryOfStrings: wordsRegexp(unicodeBinaryPropertiesOfStrings[ecmaVersion]),
|
|
4347
4592
|
nonBinary: {
|
|
4348
4593
|
General_Category: wordsRegexp(unicodeGeneralCategoryValues),
|
|
4349
4594
|
Script: wordsRegexp(unicodeScriptValues[ecmaVersion])
|
|
@@ -4362,14 +4607,32 @@ var ecmaVersion;
|
|
|
4362
4607
|
var i;
|
|
4363
4608
|
var list;
|
|
4364
4609
|
var pp$1 = Parser.prototype;
|
|
4610
|
+
var BranchID = function BranchID2(parent, base) {
|
|
4611
|
+
this.parent = parent;
|
|
4612
|
+
this.base = base || this;
|
|
4613
|
+
};
|
|
4614
|
+
BranchID.prototype.separatedFrom = function separatedFrom(alt) {
|
|
4615
|
+
for (var self = this; self; self = self.parent) {
|
|
4616
|
+
for (var other = alt; other; other = other.parent) {
|
|
4617
|
+
if (self.base === other.base && self !== other) {
|
|
4618
|
+
return true;
|
|
4619
|
+
}
|
|
4620
|
+
}
|
|
4621
|
+
}
|
|
4622
|
+
return false;
|
|
4623
|
+
};
|
|
4624
|
+
BranchID.prototype.sibling = function sibling() {
|
|
4625
|
+
return new BranchID(this.parent, this.base);
|
|
4626
|
+
};
|
|
4365
4627
|
var RegExpValidationState = function RegExpValidationState2(parser) {
|
|
4366
4628
|
this.parser = parser;
|
|
4367
|
-
this.validFlags = "gim" + (parser.options.ecmaVersion >= 6 ? "uy" : "") + (parser.options.ecmaVersion >= 9 ? "s" : "") + (parser.options.ecmaVersion >= 13 ? "d" : "");
|
|
4629
|
+
this.validFlags = "gim" + (parser.options.ecmaVersion >= 6 ? "uy" : "") + (parser.options.ecmaVersion >= 9 ? "s" : "") + (parser.options.ecmaVersion >= 13 ? "d" : "") + (parser.options.ecmaVersion >= 15 ? "v" : "");
|
|
4368
4630
|
this.unicodeProperties = data[parser.options.ecmaVersion >= 14 ? 14 : parser.options.ecmaVersion];
|
|
4369
4631
|
this.source = "";
|
|
4370
4632
|
this.flags = "";
|
|
4371
4633
|
this.start = 0;
|
|
4372
4634
|
this.switchU = false;
|
|
4635
|
+
this.switchV = false;
|
|
4373
4636
|
this.switchN = false;
|
|
4374
4637
|
this.pos = 0;
|
|
4375
4638
|
this.lastIntValue = 0;
|
|
@@ -4377,16 +4640,25 @@ var RegExpValidationState = function RegExpValidationState2(parser) {
|
|
|
4377
4640
|
this.lastAssertionIsQuantifiable = false;
|
|
4378
4641
|
this.numCapturingParens = 0;
|
|
4379
4642
|
this.maxBackReference = 0;
|
|
4380
|
-
this.groupNames =
|
|
4643
|
+
this.groupNames = /* @__PURE__ */ Object.create(null);
|
|
4381
4644
|
this.backReferenceNames = [];
|
|
4645
|
+
this.branchID = null;
|
|
4382
4646
|
};
|
|
4383
4647
|
RegExpValidationState.prototype.reset = function reset(start, pattern, flags) {
|
|
4648
|
+
var unicodeSets = flags.indexOf("v") !== -1;
|
|
4384
4649
|
var unicode = flags.indexOf("u") !== -1;
|
|
4385
4650
|
this.start = start | 0;
|
|
4386
4651
|
this.source = pattern + "";
|
|
4387
4652
|
this.flags = flags;
|
|
4388
|
-
|
|
4389
|
-
|
|
4653
|
+
if (unicodeSets && this.parser.options.ecmaVersion >= 15) {
|
|
4654
|
+
this.switchU = true;
|
|
4655
|
+
this.switchV = true;
|
|
4656
|
+
this.switchN = true;
|
|
4657
|
+
} else {
|
|
4658
|
+
this.switchU = unicode && this.parser.options.ecmaVersion >= 6;
|
|
4659
|
+
this.switchV = false;
|
|
4660
|
+
this.switchN = unicode && this.parser.options.ecmaVersion >= 9;
|
|
4661
|
+
}
|
|
4390
4662
|
};
|
|
4391
4663
|
RegExpValidationState.prototype.raise = function raise(message) {
|
|
4392
4664
|
this.parser.raiseRecoverable(this.start, "Invalid regular expression: /" + this.source + "/: " + message);
|
|
@@ -4444,9 +4716,26 @@ RegExpValidationState.prototype.eat = function eat(ch, forceU) {
|
|
|
4444
4716
|
}
|
|
4445
4717
|
return false;
|
|
4446
4718
|
};
|
|
4719
|
+
RegExpValidationState.prototype.eatChars = function eatChars(chs, forceU) {
|
|
4720
|
+
if (forceU === void 0)
|
|
4721
|
+
forceU = false;
|
|
4722
|
+
var pos = this.pos;
|
|
4723
|
+
for (var i = 0, list = chs; i < list.length; i += 1) {
|
|
4724
|
+
var ch = list[i];
|
|
4725
|
+
var current2 = this.at(pos, forceU);
|
|
4726
|
+
if (current2 === -1 || current2 !== ch) {
|
|
4727
|
+
return false;
|
|
4728
|
+
}
|
|
4729
|
+
pos = this.nextIndex(pos, forceU);
|
|
4730
|
+
}
|
|
4731
|
+
this.pos = pos;
|
|
4732
|
+
return true;
|
|
4733
|
+
};
|
|
4447
4734
|
pp$1.validateRegExpFlags = function(state) {
|
|
4448
4735
|
var validFlags = state.validFlags;
|
|
4449
4736
|
var flags = state.flags;
|
|
4737
|
+
var u = false;
|
|
4738
|
+
var v = false;
|
|
4450
4739
|
for (var i = 0; i < flags.length; i++) {
|
|
4451
4740
|
var flag = flags.charAt(i);
|
|
4452
4741
|
if (validFlags.indexOf(flag) === -1) {
|
|
@@ -4455,11 +4744,26 @@ pp$1.validateRegExpFlags = function(state) {
|
|
|
4455
4744
|
if (flags.indexOf(flag, i + 1) > -1) {
|
|
4456
4745
|
this.raise(state.start, "Duplicate regular expression flag");
|
|
4457
4746
|
}
|
|
4747
|
+
if (flag === "u") {
|
|
4748
|
+
u = true;
|
|
4749
|
+
}
|
|
4750
|
+
if (flag === "v") {
|
|
4751
|
+
v = true;
|
|
4752
|
+
}
|
|
4753
|
+
}
|
|
4754
|
+
if (this.options.ecmaVersion >= 15 && u && v) {
|
|
4755
|
+
this.raise(state.start, "Invalid regular expression flag");
|
|
4458
4756
|
}
|
|
4459
4757
|
};
|
|
4758
|
+
function hasProp(obj) {
|
|
4759
|
+
for (var _ in obj) {
|
|
4760
|
+
return true;
|
|
4761
|
+
}
|
|
4762
|
+
return false;
|
|
4763
|
+
}
|
|
4460
4764
|
pp$1.validateRegExpPattern = function(state) {
|
|
4461
4765
|
this.regexp_pattern(state);
|
|
4462
|
-
if (!state.switchN && this.options.ecmaVersion >= 9 && state.groupNames
|
|
4766
|
+
if (!state.switchN && this.options.ecmaVersion >= 9 && hasProp(state.groupNames)) {
|
|
4463
4767
|
state.switchN = true;
|
|
4464
4768
|
this.regexp_pattern(state);
|
|
4465
4769
|
}
|
|
@@ -4471,8 +4775,9 @@ pp$1.regexp_pattern = function(state) {
|
|
|
4471
4775
|
state.lastAssertionIsQuantifiable = false;
|
|
4472
4776
|
state.numCapturingParens = 0;
|
|
4473
4777
|
state.maxBackReference = 0;
|
|
4474
|
-
state.groupNames
|
|
4778
|
+
state.groupNames = /* @__PURE__ */ Object.create(null);
|
|
4475
4779
|
state.backReferenceNames.length = 0;
|
|
4780
|
+
state.branchID = null;
|
|
4476
4781
|
this.regexp_disjunction(state);
|
|
4477
4782
|
if (state.pos !== state.source.length) {
|
|
4478
4783
|
if (state.eat(41)) {
|
|
@@ -4487,16 +4792,26 @@ pp$1.regexp_pattern = function(state) {
|
|
|
4487
4792
|
}
|
|
4488
4793
|
for (var i = 0, list = state.backReferenceNames; i < list.length; i += 1) {
|
|
4489
4794
|
var name = list[i];
|
|
4490
|
-
if (state.groupNames
|
|
4795
|
+
if (!state.groupNames[name]) {
|
|
4491
4796
|
state.raise("Invalid named capture referenced");
|
|
4492
4797
|
}
|
|
4493
4798
|
}
|
|
4494
4799
|
};
|
|
4495
4800
|
pp$1.regexp_disjunction = function(state) {
|
|
4801
|
+
var trackDisjunction = this.options.ecmaVersion >= 16;
|
|
4802
|
+
if (trackDisjunction) {
|
|
4803
|
+
state.branchID = new BranchID(state.branchID, null);
|
|
4804
|
+
}
|
|
4496
4805
|
this.regexp_alternative(state);
|
|
4497
4806
|
while (state.eat(124)) {
|
|
4807
|
+
if (trackDisjunction) {
|
|
4808
|
+
state.branchID = state.branchID.sibling();
|
|
4809
|
+
}
|
|
4498
4810
|
this.regexp_alternative(state);
|
|
4499
4811
|
}
|
|
4812
|
+
if (trackDisjunction) {
|
|
4813
|
+
state.branchID = state.branchID.parent;
|
|
4814
|
+
}
|
|
4500
4815
|
if (this.regexp_eatQuantifier(state, true)) {
|
|
4501
4816
|
state.raise("Nothing to repeat");
|
|
4502
4817
|
}
|
|
@@ -4603,12 +4918,38 @@ pp$1.regexp_eatReverseSolidusAtomEscape = function(state) {
|
|
|
4603
4918
|
pp$1.regexp_eatUncapturingGroup = function(state) {
|
|
4604
4919
|
var start = state.pos;
|
|
4605
4920
|
if (state.eat(40)) {
|
|
4606
|
-
if (state.eat(63)
|
|
4607
|
-
this.
|
|
4608
|
-
|
|
4609
|
-
|
|
4921
|
+
if (state.eat(63)) {
|
|
4922
|
+
if (this.options.ecmaVersion >= 16) {
|
|
4923
|
+
var addModifiers = this.regexp_eatModifiers(state);
|
|
4924
|
+
var hasHyphen = state.eat(45);
|
|
4925
|
+
if (addModifiers || hasHyphen) {
|
|
4926
|
+
for (var i = 0; i < addModifiers.length; i++) {
|
|
4927
|
+
var modifier = addModifiers.charAt(i);
|
|
4928
|
+
if (addModifiers.indexOf(modifier, i + 1) > -1) {
|
|
4929
|
+
state.raise("Duplicate regular expression modifiers");
|
|
4930
|
+
}
|
|
4931
|
+
}
|
|
4932
|
+
if (hasHyphen) {
|
|
4933
|
+
var removeModifiers = this.regexp_eatModifiers(state);
|
|
4934
|
+
if (!addModifiers && !removeModifiers && state.current() === 58) {
|
|
4935
|
+
state.raise("Invalid regular expression modifiers");
|
|
4936
|
+
}
|
|
4937
|
+
for (var i$1 = 0; i$1 < removeModifiers.length; i$1++) {
|
|
4938
|
+
var modifier$1 = removeModifiers.charAt(i$1);
|
|
4939
|
+
if (removeModifiers.indexOf(modifier$1, i$1 + 1) > -1 || addModifiers.indexOf(modifier$1) > -1) {
|
|
4940
|
+
state.raise("Duplicate regular expression modifiers");
|
|
4941
|
+
}
|
|
4942
|
+
}
|
|
4943
|
+
}
|
|
4944
|
+
}
|
|
4945
|
+
}
|
|
4946
|
+
if (state.eat(58)) {
|
|
4947
|
+
this.regexp_disjunction(state);
|
|
4948
|
+
if (state.eat(41)) {
|
|
4949
|
+
return true;
|
|
4950
|
+
}
|
|
4951
|
+
state.raise("Unterminated group");
|
|
4610
4952
|
}
|
|
4611
|
-
state.raise("Unterminated group");
|
|
4612
4953
|
}
|
|
4613
4954
|
state.pos = start;
|
|
4614
4955
|
}
|
|
@@ -4630,6 +4971,18 @@ pp$1.regexp_eatCapturingGroup = function(state) {
|
|
|
4630
4971
|
}
|
|
4631
4972
|
return false;
|
|
4632
4973
|
};
|
|
4974
|
+
pp$1.regexp_eatModifiers = function(state) {
|
|
4975
|
+
var modifiers = "";
|
|
4976
|
+
var ch = 0;
|
|
4977
|
+
while ((ch = state.current()) !== -1 && isRegularExpressionModifier(ch)) {
|
|
4978
|
+
modifiers += codePointToString(ch);
|
|
4979
|
+
state.advance();
|
|
4980
|
+
}
|
|
4981
|
+
return modifiers;
|
|
4982
|
+
};
|
|
4983
|
+
function isRegularExpressionModifier(ch) {
|
|
4984
|
+
return ch === 105 || ch === 109 || ch === 115;
|
|
4985
|
+
}
|
|
4633
4986
|
pp$1.regexp_eatExtendedAtom = function(state) {
|
|
4634
4987
|
return state.eat(46) || this.regexp_eatReverseSolidusAtomEscape(state) || this.regexp_eatCharacterClass(state) || this.regexp_eatUncapturingGroup(state) || this.regexp_eatCapturingGroup(state) || this.regexp_eatInvalidBracedQuantifier(state) || this.regexp_eatExtendedPatternCharacter(state);
|
|
4635
4988
|
};
|
|
@@ -4669,14 +5022,28 @@ pp$1.regexp_eatExtendedPatternCharacter = function(state) {
|
|
|
4669
5022
|
};
|
|
4670
5023
|
pp$1.regexp_groupSpecifier = function(state) {
|
|
4671
5024
|
if (state.eat(63)) {
|
|
4672
|
-
if (this.regexp_eatGroupName(state)) {
|
|
4673
|
-
|
|
5025
|
+
if (!this.regexp_eatGroupName(state)) {
|
|
5026
|
+
state.raise("Invalid group");
|
|
5027
|
+
}
|
|
5028
|
+
var trackDisjunction = this.options.ecmaVersion >= 16;
|
|
5029
|
+
var known = state.groupNames[state.lastStringValue];
|
|
5030
|
+
if (known) {
|
|
5031
|
+
if (trackDisjunction) {
|
|
5032
|
+
for (var i = 0, list = known; i < list.length; i += 1) {
|
|
5033
|
+
var altID = list[i];
|
|
5034
|
+
if (!altID.separatedFrom(state.branchID)) {
|
|
5035
|
+
state.raise("Duplicate capture group name");
|
|
5036
|
+
}
|
|
5037
|
+
}
|
|
5038
|
+
} else {
|
|
4674
5039
|
state.raise("Duplicate capture group name");
|
|
4675
5040
|
}
|
|
4676
|
-
state.groupNames.push(state.lastStringValue);
|
|
4677
|
-
return;
|
|
4678
5041
|
}
|
|
4679
|
-
|
|
5042
|
+
if (trackDisjunction) {
|
|
5043
|
+
(known || (state.groupNames[state.lastStringValue] = [])).push(state.branchID);
|
|
5044
|
+
} else {
|
|
5045
|
+
state.groupNames[state.lastStringValue] = true;
|
|
5046
|
+
}
|
|
4680
5047
|
}
|
|
4681
5048
|
};
|
|
4682
5049
|
pp$1.regexp_eatGroupName = function(state) {
|
|
@@ -4903,22 +5270,30 @@ pp$1.regexp_eatDecimalEscape = function(state) {
|
|
|
4903
5270
|
}
|
|
4904
5271
|
return false;
|
|
4905
5272
|
};
|
|
5273
|
+
var CharSetNone = 0;
|
|
5274
|
+
var CharSetOk = 1;
|
|
5275
|
+
var CharSetString = 2;
|
|
4906
5276
|
pp$1.regexp_eatCharacterClassEscape = function(state) {
|
|
4907
5277
|
var ch = state.current();
|
|
4908
5278
|
if (isCharacterClassEscape(ch)) {
|
|
4909
5279
|
state.lastIntValue = -1;
|
|
4910
5280
|
state.advance();
|
|
4911
|
-
return
|
|
5281
|
+
return CharSetOk;
|
|
4912
5282
|
}
|
|
4913
|
-
|
|
5283
|
+
var negate = false;
|
|
5284
|
+
if (state.switchU && this.options.ecmaVersion >= 9 && ((negate = ch === 80) || ch === 112)) {
|
|
4914
5285
|
state.lastIntValue = -1;
|
|
4915
5286
|
state.advance();
|
|
4916
|
-
|
|
4917
|
-
|
|
5287
|
+
var result;
|
|
5288
|
+
if (state.eat(123) && (result = this.regexp_eatUnicodePropertyValueExpression(state)) && state.eat(125)) {
|
|
5289
|
+
if (negate && result === CharSetString) {
|
|
5290
|
+
state.raise("Invalid property name");
|
|
5291
|
+
}
|
|
5292
|
+
return result;
|
|
4918
5293
|
}
|
|
4919
5294
|
state.raise("Invalid property name");
|
|
4920
5295
|
}
|
|
4921
|
-
return
|
|
5296
|
+
return CharSetNone;
|
|
4922
5297
|
};
|
|
4923
5298
|
function isCharacterClassEscape(ch) {
|
|
4924
5299
|
return ch === 100 || ch === 68 || ch === 115 || ch === 83 || ch === 119 || ch === 87;
|
|
@@ -4930,16 +5305,15 @@ pp$1.regexp_eatUnicodePropertyValueExpression = function(state) {
|
|
|
4930
5305
|
if (this.regexp_eatUnicodePropertyValue(state)) {
|
|
4931
5306
|
var value = state.lastStringValue;
|
|
4932
5307
|
this.regexp_validateUnicodePropertyNameAndValue(state, name, value);
|
|
4933
|
-
return
|
|
5308
|
+
return CharSetOk;
|
|
4934
5309
|
}
|
|
4935
5310
|
}
|
|
4936
5311
|
state.pos = start;
|
|
4937
5312
|
if (this.regexp_eatLoneUnicodePropertyNameOrValue(state)) {
|
|
4938
5313
|
var nameOrValue = state.lastStringValue;
|
|
4939
|
-
this.regexp_validateUnicodePropertyNameOrValue(state, nameOrValue);
|
|
4940
|
-
return true;
|
|
5314
|
+
return this.regexp_validateUnicodePropertyNameOrValue(state, nameOrValue);
|
|
4941
5315
|
}
|
|
4942
|
-
return
|
|
5316
|
+
return CharSetNone;
|
|
4943
5317
|
};
|
|
4944
5318
|
pp$1.regexp_validateUnicodePropertyNameAndValue = function(state, name, value) {
|
|
4945
5319
|
if (!hasOwn(state.unicodeProperties.nonBinary, name)) {
|
|
@@ -4950,9 +5324,13 @@ pp$1.regexp_validateUnicodePropertyNameAndValue = function(state, name, value) {
|
|
|
4950
5324
|
}
|
|
4951
5325
|
};
|
|
4952
5326
|
pp$1.regexp_validateUnicodePropertyNameOrValue = function(state, nameOrValue) {
|
|
4953
|
-
if (
|
|
4954
|
-
|
|
5327
|
+
if (state.unicodeProperties.binary.test(nameOrValue)) {
|
|
5328
|
+
return CharSetOk;
|
|
5329
|
+
}
|
|
5330
|
+
if (state.switchV && state.unicodeProperties.binaryOfStrings.test(nameOrValue)) {
|
|
5331
|
+
return CharSetString;
|
|
4955
5332
|
}
|
|
5333
|
+
state.raise("Invalid property name");
|
|
4956
5334
|
};
|
|
4957
5335
|
pp$1.regexp_eatUnicodePropertyName = function(state) {
|
|
4958
5336
|
var ch = 0;
|
|
@@ -4983,16 +5361,29 @@ pp$1.regexp_eatLoneUnicodePropertyNameOrValue = function(state) {
|
|
|
4983
5361
|
};
|
|
4984
5362
|
pp$1.regexp_eatCharacterClass = function(state) {
|
|
4985
5363
|
if (state.eat(91)) {
|
|
4986
|
-
state.eat(94);
|
|
4987
|
-
this.
|
|
4988
|
-
if (state.eat(93)) {
|
|
4989
|
-
|
|
5364
|
+
var negate = state.eat(94);
|
|
5365
|
+
var result = this.regexp_classContents(state);
|
|
5366
|
+
if (!state.eat(93)) {
|
|
5367
|
+
state.raise("Unterminated character class");
|
|
5368
|
+
}
|
|
5369
|
+
if (negate && result === CharSetString) {
|
|
5370
|
+
state.raise("Negated character class may contain strings");
|
|
4990
5371
|
}
|
|
4991
|
-
|
|
5372
|
+
return true;
|
|
4992
5373
|
}
|
|
4993
5374
|
return false;
|
|
4994
5375
|
};
|
|
4995
|
-
pp$1.
|
|
5376
|
+
pp$1.regexp_classContents = function(state) {
|
|
5377
|
+
if (state.current() === 93) {
|
|
5378
|
+
return CharSetOk;
|
|
5379
|
+
}
|
|
5380
|
+
if (state.switchV) {
|
|
5381
|
+
return this.regexp_classSetExpression(state);
|
|
5382
|
+
}
|
|
5383
|
+
this.regexp_nonEmptyClassRanges(state);
|
|
5384
|
+
return CharSetOk;
|
|
5385
|
+
};
|
|
5386
|
+
pp$1.regexp_nonEmptyClassRanges = function(state) {
|
|
4996
5387
|
while (this.regexp_eatClassAtom(state)) {
|
|
4997
5388
|
var left = state.lastIntValue;
|
|
4998
5389
|
if (state.eat(45) && this.regexp_eatClassAtom(state)) {
|
|
@@ -5047,6 +5438,168 @@ pp$1.regexp_eatClassEscape = function(state) {
|
|
|
5047
5438
|
}
|
|
5048
5439
|
return this.regexp_eatCharacterClassEscape(state) || this.regexp_eatCharacterEscape(state);
|
|
5049
5440
|
};
|
|
5441
|
+
pp$1.regexp_classSetExpression = function(state) {
|
|
5442
|
+
var result = CharSetOk, subResult;
|
|
5443
|
+
if (this.regexp_eatClassSetRange(state))
|
|
5444
|
+
;
|
|
5445
|
+
else if (subResult = this.regexp_eatClassSetOperand(state)) {
|
|
5446
|
+
if (subResult === CharSetString) {
|
|
5447
|
+
result = CharSetString;
|
|
5448
|
+
}
|
|
5449
|
+
var start = state.pos;
|
|
5450
|
+
while (state.eatChars([38, 38])) {
|
|
5451
|
+
if (state.current() !== 38 && (subResult = this.regexp_eatClassSetOperand(state))) {
|
|
5452
|
+
if (subResult !== CharSetString) {
|
|
5453
|
+
result = CharSetOk;
|
|
5454
|
+
}
|
|
5455
|
+
continue;
|
|
5456
|
+
}
|
|
5457
|
+
state.raise("Invalid character in character class");
|
|
5458
|
+
}
|
|
5459
|
+
if (start !== state.pos) {
|
|
5460
|
+
return result;
|
|
5461
|
+
}
|
|
5462
|
+
while (state.eatChars([45, 45])) {
|
|
5463
|
+
if (this.regexp_eatClassSetOperand(state)) {
|
|
5464
|
+
continue;
|
|
5465
|
+
}
|
|
5466
|
+
state.raise("Invalid character in character class");
|
|
5467
|
+
}
|
|
5468
|
+
if (start !== state.pos) {
|
|
5469
|
+
return result;
|
|
5470
|
+
}
|
|
5471
|
+
} else {
|
|
5472
|
+
state.raise("Invalid character in character class");
|
|
5473
|
+
}
|
|
5474
|
+
for (; ; ) {
|
|
5475
|
+
if (this.regexp_eatClassSetRange(state)) {
|
|
5476
|
+
continue;
|
|
5477
|
+
}
|
|
5478
|
+
subResult = this.regexp_eatClassSetOperand(state);
|
|
5479
|
+
if (!subResult) {
|
|
5480
|
+
return result;
|
|
5481
|
+
}
|
|
5482
|
+
if (subResult === CharSetString) {
|
|
5483
|
+
result = CharSetString;
|
|
5484
|
+
}
|
|
5485
|
+
}
|
|
5486
|
+
};
|
|
5487
|
+
pp$1.regexp_eatClassSetRange = function(state) {
|
|
5488
|
+
var start = state.pos;
|
|
5489
|
+
if (this.regexp_eatClassSetCharacter(state)) {
|
|
5490
|
+
var left = state.lastIntValue;
|
|
5491
|
+
if (state.eat(45) && this.regexp_eatClassSetCharacter(state)) {
|
|
5492
|
+
var right = state.lastIntValue;
|
|
5493
|
+
if (left !== -1 && right !== -1 && left > right) {
|
|
5494
|
+
state.raise("Range out of order in character class");
|
|
5495
|
+
}
|
|
5496
|
+
return true;
|
|
5497
|
+
}
|
|
5498
|
+
state.pos = start;
|
|
5499
|
+
}
|
|
5500
|
+
return false;
|
|
5501
|
+
};
|
|
5502
|
+
pp$1.regexp_eatClassSetOperand = function(state) {
|
|
5503
|
+
if (this.regexp_eatClassSetCharacter(state)) {
|
|
5504
|
+
return CharSetOk;
|
|
5505
|
+
}
|
|
5506
|
+
return this.regexp_eatClassStringDisjunction(state) || this.regexp_eatNestedClass(state);
|
|
5507
|
+
};
|
|
5508
|
+
pp$1.regexp_eatNestedClass = function(state) {
|
|
5509
|
+
var start = state.pos;
|
|
5510
|
+
if (state.eat(91)) {
|
|
5511
|
+
var negate = state.eat(94);
|
|
5512
|
+
var result = this.regexp_classContents(state);
|
|
5513
|
+
if (state.eat(93)) {
|
|
5514
|
+
if (negate && result === CharSetString) {
|
|
5515
|
+
state.raise("Negated character class may contain strings");
|
|
5516
|
+
}
|
|
5517
|
+
return result;
|
|
5518
|
+
}
|
|
5519
|
+
state.pos = start;
|
|
5520
|
+
}
|
|
5521
|
+
if (state.eat(92)) {
|
|
5522
|
+
var result$1 = this.regexp_eatCharacterClassEscape(state);
|
|
5523
|
+
if (result$1) {
|
|
5524
|
+
return result$1;
|
|
5525
|
+
}
|
|
5526
|
+
state.pos = start;
|
|
5527
|
+
}
|
|
5528
|
+
return null;
|
|
5529
|
+
};
|
|
5530
|
+
pp$1.regexp_eatClassStringDisjunction = function(state) {
|
|
5531
|
+
var start = state.pos;
|
|
5532
|
+
if (state.eatChars([92, 113])) {
|
|
5533
|
+
if (state.eat(123)) {
|
|
5534
|
+
var result = this.regexp_classStringDisjunctionContents(state);
|
|
5535
|
+
if (state.eat(125)) {
|
|
5536
|
+
return result;
|
|
5537
|
+
}
|
|
5538
|
+
} else {
|
|
5539
|
+
state.raise("Invalid escape");
|
|
5540
|
+
}
|
|
5541
|
+
state.pos = start;
|
|
5542
|
+
}
|
|
5543
|
+
return null;
|
|
5544
|
+
};
|
|
5545
|
+
pp$1.regexp_classStringDisjunctionContents = function(state) {
|
|
5546
|
+
var result = this.regexp_classString(state);
|
|
5547
|
+
while (state.eat(124)) {
|
|
5548
|
+
if (this.regexp_classString(state) === CharSetString) {
|
|
5549
|
+
result = CharSetString;
|
|
5550
|
+
}
|
|
5551
|
+
}
|
|
5552
|
+
return result;
|
|
5553
|
+
};
|
|
5554
|
+
pp$1.regexp_classString = function(state) {
|
|
5555
|
+
var count = 0;
|
|
5556
|
+
while (this.regexp_eatClassSetCharacter(state)) {
|
|
5557
|
+
count++;
|
|
5558
|
+
}
|
|
5559
|
+
return count === 1 ? CharSetOk : CharSetString;
|
|
5560
|
+
};
|
|
5561
|
+
pp$1.regexp_eatClassSetCharacter = function(state) {
|
|
5562
|
+
var start = state.pos;
|
|
5563
|
+
if (state.eat(92)) {
|
|
5564
|
+
if (this.regexp_eatCharacterEscape(state) || this.regexp_eatClassSetReservedPunctuator(state)) {
|
|
5565
|
+
return true;
|
|
5566
|
+
}
|
|
5567
|
+
if (state.eat(98)) {
|
|
5568
|
+
state.lastIntValue = 8;
|
|
5569
|
+
return true;
|
|
5570
|
+
}
|
|
5571
|
+
state.pos = start;
|
|
5572
|
+
return false;
|
|
5573
|
+
}
|
|
5574
|
+
var ch = state.current();
|
|
5575
|
+
if (ch < 0 || ch === state.lookahead() && isClassSetReservedDoublePunctuatorCharacter(ch)) {
|
|
5576
|
+
return false;
|
|
5577
|
+
}
|
|
5578
|
+
if (isClassSetSyntaxCharacter(ch)) {
|
|
5579
|
+
return false;
|
|
5580
|
+
}
|
|
5581
|
+
state.advance();
|
|
5582
|
+
state.lastIntValue = ch;
|
|
5583
|
+
return true;
|
|
5584
|
+
};
|
|
5585
|
+
function isClassSetReservedDoublePunctuatorCharacter(ch) {
|
|
5586
|
+
return ch === 33 || ch >= 35 && ch <= 38 || ch >= 42 && ch <= 44 || ch === 46 || ch >= 58 && ch <= 64 || ch === 94 || ch === 96 || ch === 126;
|
|
5587
|
+
}
|
|
5588
|
+
function isClassSetSyntaxCharacter(ch) {
|
|
5589
|
+
return ch === 40 || ch === 41 || ch === 45 || ch === 47 || ch >= 91 && ch <= 93 || ch >= 123 && ch <= 125;
|
|
5590
|
+
}
|
|
5591
|
+
pp$1.regexp_eatClassSetReservedPunctuator = function(state) {
|
|
5592
|
+
var ch = state.current();
|
|
5593
|
+
if (isClassSetReservedPunctuator(ch)) {
|
|
5594
|
+
state.lastIntValue = ch;
|
|
5595
|
+
state.advance();
|
|
5596
|
+
return true;
|
|
5597
|
+
}
|
|
5598
|
+
return false;
|
|
5599
|
+
};
|
|
5600
|
+
function isClassSetReservedPunctuator(ch) {
|
|
5601
|
+
return ch === 33 || ch === 35 || ch === 37 || ch === 38 || ch === 44 || ch === 45 || ch >= 58 && ch <= 62 || ch === 64 || ch === 96 || ch === 126;
|
|
5602
|
+
}
|
|
5050
5603
|
pp$1.regexp_eatClassControlLetter = function(state) {
|
|
5051
5604
|
var ch = state.current();
|
|
5052
5605
|
if (isDecimalDigit(ch) || ch === 95) {
|
|
@@ -5238,7 +5791,14 @@ pp.skipBlockComment = function() {
|
|
|
5238
5791
|
}
|
|
5239
5792
|
}
|
|
5240
5793
|
if (this.options.onComment) {
|
|
5241
|
-
this.options.onComment(
|
|
5794
|
+
this.options.onComment(
|
|
5795
|
+
true,
|
|
5796
|
+
this.input.slice(start + 2, end),
|
|
5797
|
+
start,
|
|
5798
|
+
this.pos,
|
|
5799
|
+
startLoc,
|
|
5800
|
+
this.curPosition()
|
|
5801
|
+
);
|
|
5242
5802
|
}
|
|
5243
5803
|
};
|
|
5244
5804
|
pp.skipLineComment = function(startSkip) {
|
|
@@ -5249,7 +5809,14 @@ pp.skipLineComment = function(startSkip) {
|
|
|
5249
5809
|
ch = this.input.charCodeAt(++this.pos);
|
|
5250
5810
|
}
|
|
5251
5811
|
if (this.options.onComment) {
|
|
5252
|
-
this.options.onComment(
|
|
5812
|
+
this.options.onComment(
|
|
5813
|
+
false,
|
|
5814
|
+
this.input.slice(start + startSkip, this.pos),
|
|
5815
|
+
start,
|
|
5816
|
+
this.pos,
|
|
5817
|
+
startLoc,
|
|
5818
|
+
this.curPosition()
|
|
5819
|
+
);
|
|
5253
5820
|
}
|
|
5254
5821
|
};
|
|
5255
5822
|
pp.skipSpace = function() {
|
|
@@ -5827,6 +6394,16 @@ pp.readInvalidTemplateToken = function() {
|
|
|
5827
6394
|
}
|
|
5828
6395
|
case "`":
|
|
5829
6396
|
return this.finishToken(types$1.invalidTemplate, this.input.slice(this.start, this.pos));
|
|
6397
|
+
case "\r":
|
|
6398
|
+
if (this.input[this.pos + 1] === "\n") {
|
|
6399
|
+
++this.pos;
|
|
6400
|
+
}
|
|
6401
|
+
case "\n":
|
|
6402
|
+
case "\u2028":
|
|
6403
|
+
case "\u2029":
|
|
6404
|
+
++this.curLine;
|
|
6405
|
+
this.lineStart = this.pos + 1;
|
|
6406
|
+
break;
|
|
5830
6407
|
}
|
|
5831
6408
|
}
|
|
5832
6409
|
this.raise(this.start, "Unterminated template");
|
|
@@ -5864,11 +6441,17 @@ pp.readEscapedChar = function(inTemplate) {
|
|
|
5864
6441
|
case 56:
|
|
5865
6442
|
case 57:
|
|
5866
6443
|
if (this.strict) {
|
|
5867
|
-
this.invalidStringToken(
|
|
6444
|
+
this.invalidStringToken(
|
|
6445
|
+
this.pos - 1,
|
|
6446
|
+
"Invalid escape sequence"
|
|
6447
|
+
);
|
|
5868
6448
|
}
|
|
5869
6449
|
if (inTemplate) {
|
|
5870
6450
|
var codePos = this.pos - 1;
|
|
5871
|
-
this.invalidStringToken(
|
|
6451
|
+
this.invalidStringToken(
|
|
6452
|
+
codePos,
|
|
6453
|
+
"Invalid escape sequence in template string"
|
|
6454
|
+
);
|
|
5872
6455
|
}
|
|
5873
6456
|
default:
|
|
5874
6457
|
if (ch >= 48 && ch <= 55) {
|
|
@@ -5881,11 +6464,18 @@ pp.readEscapedChar = function(inTemplate) {
|
|
|
5881
6464
|
this.pos += octalStr.length - 1;
|
|
5882
6465
|
ch = this.input.charCodeAt(this.pos);
|
|
5883
6466
|
if ((octalStr !== "0" || ch === 56 || ch === 57) && (this.strict || inTemplate)) {
|
|
5884
|
-
this.invalidStringToken(
|
|
6467
|
+
this.invalidStringToken(
|
|
6468
|
+
this.pos - 1 - octalStr.length,
|
|
6469
|
+
inTemplate ? "Octal literal in template string" : "Octal literal in strict mode"
|
|
6470
|
+
);
|
|
5885
6471
|
}
|
|
5886
6472
|
return String.fromCharCode(octal);
|
|
5887
6473
|
}
|
|
5888
6474
|
if (isNewLine(ch)) {
|
|
6475
|
+
if (this.options.locations) {
|
|
6476
|
+
this.lineStart = this.pos;
|
|
6477
|
+
++this.curLine;
|
|
6478
|
+
}
|
|
5889
6479
|
return "";
|
|
5890
6480
|
}
|
|
5891
6481
|
return String.fromCharCode(ch);
|
|
@@ -5936,7 +6526,7 @@ pp.readWord = function() {
|
|
|
5936
6526
|
}
|
|
5937
6527
|
return this.finishToken(type, word);
|
|
5938
6528
|
};
|
|
5939
|
-
var version = "8.
|
|
6529
|
+
var version = "8.15.0";
|
|
5940
6530
|
Parser.acorn = {
|
|
5941
6531
|
Parser,
|
|
5942
6532
|
version,
|
|
@@ -6034,10 +6624,14 @@ var Parser_default = Parser.extend(function(Parser3) {
|
|
|
6034
6624
|
// node_modules/astring/dist/astring.mjs
|
|
6035
6625
|
var { stringify } = JSON;
|
|
6036
6626
|
if (!String.prototype.repeat) {
|
|
6037
|
-
throw new Error(
|
|
6627
|
+
throw new Error(
|
|
6628
|
+
"String.prototype.repeat is undefined, see https://github.com/davidbonnet/astring#installation"
|
|
6629
|
+
);
|
|
6038
6630
|
}
|
|
6039
6631
|
if (!String.prototype.endsWith) {
|
|
6040
|
-
throw new Error(
|
|
6632
|
+
throw new Error(
|
|
6633
|
+
"String.prototype.endsWith is undefined, see https://github.com/davidbonnet/astring#installation"
|
|
6634
|
+
);
|
|
6041
6635
|
}
|
|
6042
6636
|
var OPERATOR_PRECEDENCE = {
|
|
6043
6637
|
"||": 2,
|
|
@@ -6435,7 +7029,10 @@ var GENERATOR = {
|
|
|
6435
7029
|
state.write("debugger;", node);
|
|
6436
7030
|
},
|
|
6437
7031
|
FunctionDeclaration: FunctionDeclaration = function(node, state) {
|
|
6438
|
-
state.write(
|
|
7032
|
+
state.write(
|
|
7033
|
+
(node.async ? "async " : "") + (node.generator ? "function* " : "function ") + (node.id ? node.id.name : ""),
|
|
7034
|
+
node
|
|
7035
|
+
);
|
|
6439
7036
|
formatSequence(state, node.params);
|
|
6440
7037
|
state.write(" ");
|
|
6441
7038
|
this[node.body.type](node.body, state);
|
|
@@ -8394,7 +8991,11 @@ var Signal = class extends _EventTarget {
|
|
|
8394
8991
|
signal(name, type = "prop") {
|
|
8395
8992
|
let signal = this.signals.get(name);
|
|
8396
8993
|
if (!signal) {
|
|
8397
|
-
signal = new Signal(
|
|
8994
|
+
signal = new Signal(
|
|
8995
|
+
this,
|
|
8996
|
+
type,
|
|
8997
|
+
type === "object" ? name : _isTypeObject(this.state) ? Observer.get(this.state, name) : void 0
|
|
8998
|
+
);
|
|
8398
8999
|
this.signals.set(name, signal);
|
|
8399
9000
|
if (this.signals.size === 1) {
|
|
8400
9001
|
this.watchMode();
|
|
@@ -9259,7 +9860,12 @@ function compile(sourceType, astTools, source, functionParams = [], params = {})
|
|
|
9259
9860
|
} else if (isFunction) {
|
|
9260
9861
|
if (isSource) {
|
|
9261
9862
|
if (sourceIsProgram) {
|
|
9262
|
-
source = Node_default.funcExpr(
|
|
9863
|
+
source = Node_default.funcExpr(
|
|
9864
|
+
null,
|
|
9865
|
+
functionParams.map((param) => Node_default.identifier(param)),
|
|
9866
|
+
Node_default.blockStmt(liveMode ? [Node_default.literal("use live"), ...source.body] : source.body),
|
|
9867
|
+
isAsync
|
|
9868
|
+
);
|
|
9263
9869
|
source.isLiveFunction = originalProgram.isLiveProgram;
|
|
9264
9870
|
} else {
|
|
9265
9871
|
const body = ` ` + source.split(`
|
|
@@ -9655,7 +10261,7 @@ function containsNode(window2, a, b, crossRoots = false, testCache = null) {
|
|
|
9655
10261
|
const rootNodeB = b.getRootNode();
|
|
9656
10262
|
if (rootNodeA === rootNodeB)
|
|
9657
10263
|
return response(a.contains(b));
|
|
9658
|
-
if (crossRoots && rootNodeB
|
|
10264
|
+
if (crossRoots && isShadowRoot(rootNodeB))
|
|
9659
10265
|
return response(containsNode(window2, a, rootNodeB.host, crossRoots, testCache));
|
|
9660
10266
|
return response(false);
|
|
9661
10267
|
}
|
|
@@ -9711,7 +10317,7 @@ var Realtime = class {
|
|
|
9711
10317
|
} else {
|
|
9712
10318
|
args[0] = from_default(args[0], false);
|
|
9713
10319
|
}
|
|
9714
|
-
if (args[0].filter((x) => typeof x !== "string" && !(x instanceof DOMSpec) && !(x
|
|
10320
|
+
if (args[0].filter((x) => typeof x !== "string" && !(x instanceof DOMSpec) && !isNode(x)).length) {
|
|
9715
10321
|
throw new Error(`Argument #2 must be either a string or a Node object, or a list of those.`);
|
|
9716
10322
|
}
|
|
9717
10323
|
args[0] = args[0].map((s) => s instanceof DOMSpec ? s : new DOMSpec(s));
|
|
@@ -10089,10 +10695,12 @@ var DOMRealtime = class extends Realtime {
|
|
|
10089
10695
|
dispatch2.call(window2, registration, record, context);
|
|
10090
10696
|
}));
|
|
10091
10697
|
mo.observe(context, { childList: true, subtree: params.subtree && true });
|
|
10092
|
-
const disconnectable = {
|
|
10093
|
-
|
|
10094
|
-
|
|
10095
|
-
|
|
10698
|
+
const disconnectable = {
|
|
10699
|
+
disconnect() {
|
|
10700
|
+
registry2.delete(registration);
|
|
10701
|
+
mo.disconnect();
|
|
10702
|
+
}
|
|
10703
|
+
};
|
|
10096
10704
|
const signalGenerator = params.signalGenerator || params.lifecycleSignals && this.createSignalGenerator();
|
|
10097
10705
|
const registration = { context, spec, callback, params, signalGenerator, disconnectable };
|
|
10098
10706
|
const registry2 = this.registry(interceptionTiming);
|
|
@@ -10295,7 +10903,7 @@ function domInterception(timing, callback) {
|
|
|
10295
10903
|
_apiOriginals[DOMClassName][apiName] = _apiOriginal;
|
|
10296
10904
|
});
|
|
10297
10905
|
function method(...args) {
|
|
10298
|
-
const DOMClassName = Object.keys(_apiOriginals).find((name) => this
|
|
10906
|
+
const DOMClassName = Object.keys(_apiOriginals).find((name) => isNodeInterface(this, name) && apiName in _apiOriginals[name]);
|
|
10299
10907
|
const $apiOriginals = _apiOriginals[DOMClassName];
|
|
10300
10908
|
let exec2 = () => $apiOriginals[apiName].value.call(this, ...args);
|
|
10301
10909
|
if (webqit.realdom.domInterceptionNoRecurse.get(this) === apiName)
|
|
@@ -10354,17 +10962,17 @@ function domInterception(timing, callback) {
|
|
|
10354
10962
|
});
|
|
10355
10963
|
}
|
|
10356
10964
|
function setter(value) {
|
|
10357
|
-
const DOMClassName = Object.keys(_apiOriginals).find((name) => this
|
|
10965
|
+
const DOMClassName = Object.keys(_apiOriginals).find((name) => isNodeInterface(this, name) && apiName in _apiOriginals[name]);
|
|
10358
10966
|
const $apiOriginals = _apiOriginals[DOMClassName];
|
|
10359
10967
|
let exec2 = () => $apiOriginals[apiName].set.call(this, value);
|
|
10360
|
-
if (this
|
|
10968
|
+
if (isNodeInterface(this, "HTMLScriptElement") || webqit.realdom.domInterceptionNoRecurse.get(this) === apiName)
|
|
10361
10969
|
return exec2();
|
|
10362
10970
|
let exits = [], entrants = [], target = this;
|
|
10363
10971
|
if (["outerHTML", "outerText"].includes(apiName)) {
|
|
10364
10972
|
exits = [this];
|
|
10365
10973
|
target = this.parentNode;
|
|
10366
10974
|
} else {
|
|
10367
|
-
if (this
|
|
10975
|
+
if (isNodeInterface(this, "HTMLTemplateElement")) {
|
|
10368
10976
|
target = this.content;
|
|
10369
10977
|
exits = [...this.content.childNodes];
|
|
10370
10978
|
} else {
|
|
@@ -10380,18 +10988,18 @@ function domInterception(timing, callback) {
|
|
|
10380
10988
|
}
|
|
10381
10989
|
const temp = document.createElement(tempNodeName.includes("-") ? "div" : tempNodeName);
|
|
10382
10990
|
noRecurse(temp, apiName, () => temp[apiName] = value);
|
|
10383
|
-
entrants = this
|
|
10384
|
-
if (this
|
|
10991
|
+
entrants = isNodeInterface(this, "HTMLTemplateElement") ? [...temp.content.childNodes] : [...temp.childNodes];
|
|
10992
|
+
if (isNodeInterface(this, "HTMLTemplateElement") && this.hasAttribute("src") || isShadowRoot(this)) {
|
|
10385
10993
|
const getScripts = (nodes) => nodes.reduce((scripts, el) => {
|
|
10386
|
-
if (el
|
|
10994
|
+
if (isNodeInterface(el, "HTMLScriptElement"))
|
|
10387
10995
|
return scripts.concat(el);
|
|
10388
|
-
if (el
|
|
10996
|
+
if (isNodeInterface(el, "HTMLTemplateElement"))
|
|
10389
10997
|
return scripts.concat(getScripts([el.content]));
|
|
10390
10998
|
scripts = scripts.concat(getScripts([...el.querySelectorAll?.("template") || []].map((t) => t.content)));
|
|
10391
10999
|
return scripts.concat(...el.querySelectorAll?.("script") || []);
|
|
10392
11000
|
}, []);
|
|
10393
11001
|
for (const script of getScripts(entrants)) {
|
|
10394
|
-
if (this
|
|
11002
|
+
if (isShadowRoot(this)) {
|
|
10395
11003
|
script.setAttribute("data-handling", "manual");
|
|
10396
11004
|
continue;
|
|
10397
11005
|
}
|
|
@@ -10406,7 +11014,7 @@ function domInterception(timing, callback) {
|
|
|
10406
11014
|
noRecurse(value, "append", () => value.append(...entrants));
|
|
10407
11015
|
exec2 = () => noRecurse(this, "replaceWith", () => Element.prototype.replaceWith.call(this, value));
|
|
10408
11016
|
} else {
|
|
10409
|
-
if (this
|
|
11017
|
+
if (isNodeInterface(this, "HTMLTemplateElement")) {
|
|
10410
11018
|
exec2 = () => noRecurse(this.content, "replaceChildren", () => this.content.replaceChildren(...entrants));
|
|
10411
11019
|
} else {
|
|
10412
11020
|
exec2 = () => noRecurse(this, "replaceChildren", () => Element.prototype.replaceChildren.call(this, ...entrants));
|
|
@@ -10523,17 +11131,57 @@ function meta(name) {
|
|
|
10523
11131
|
if (_el = window2.document.querySelector(`meta[name="${name}"]`)) {
|
|
10524
11132
|
_content = (_el.content || "").split(";").filter((v) => v).reduce((_metaVars, directive) => {
|
|
10525
11133
|
const directiveSplit = directive.split("=").map((d) => d.trim());
|
|
10526
|
-
set_default(
|
|
11134
|
+
set_default(
|
|
11135
|
+
_metaVars,
|
|
11136
|
+
directiveSplit[0].split("."),
|
|
11137
|
+
directiveSplit[1] === "true" ? true : directiveSplit[1] === "false" ? false : isNumeric_default(directiveSplit[1]) ? parseInt(directiveSplit[1]) : directiveSplit[1]
|
|
11138
|
+
);
|
|
10527
11139
|
return _metaVars;
|
|
10528
11140
|
}, {});
|
|
10529
11141
|
}
|
|
10530
|
-
return {
|
|
10531
|
-
|
|
10532
|
-
|
|
10533
|
-
|
|
10534
|
-
|
|
10535
|
-
|
|
10536
|
-
|
|
11142
|
+
return {
|
|
11143
|
+
get name() {
|
|
11144
|
+
return name;
|
|
11145
|
+
},
|
|
11146
|
+
get content() {
|
|
11147
|
+
return _el.content;
|
|
11148
|
+
},
|
|
11149
|
+
json() {
|
|
11150
|
+
return JSON.parse(JSON.stringify(_content));
|
|
11151
|
+
}
|
|
11152
|
+
};
|
|
11153
|
+
}
|
|
11154
|
+
function isNode(value) {
|
|
11155
|
+
return value !== null && typeof value === "object" && typeof value.nodeType === "number" && typeof value.nodeName === "string";
|
|
11156
|
+
}
|
|
11157
|
+
function isElement(value) {
|
|
11158
|
+
return value?.nodeType === 1;
|
|
11159
|
+
}
|
|
11160
|
+
function isShadowRoot(value) {
|
|
11161
|
+
return value?.nodeType === 11 && Object.prototype.toString.call(value) === "[object ShadowRoot]";
|
|
11162
|
+
}
|
|
11163
|
+
function isDocument(value) {
|
|
11164
|
+
return value?.nodeType === 9 && Object.prototype.toString.call(value) === "[object Document]";
|
|
11165
|
+
}
|
|
11166
|
+
function isCharacterData(value) {
|
|
11167
|
+
const toStringValue = Object.prototype.toString.call(value);
|
|
11168
|
+
return toStringValue === "[object Text]" || toStringValue === "[object Comment]" || toStringValue === "[object CDATASection]" || toStringValue === "[object ProcessingInstruction]";
|
|
11169
|
+
}
|
|
11170
|
+
function isNodeInterface(value, interfaceName) {
|
|
11171
|
+
if (!isNode(value))
|
|
11172
|
+
return false;
|
|
11173
|
+
if (interfaceName === "ShadowRoot") {
|
|
11174
|
+
return isShadowRoot(value);
|
|
11175
|
+
HTMLUnknownElement;
|
|
11176
|
+
}
|
|
11177
|
+
const toStringValue = Object.prototype.toString.call(value);
|
|
11178
|
+
if (toStringValue === `[object ${interfaceName}]`)
|
|
11179
|
+
return true;
|
|
11180
|
+
if (interfaceName === "DocumentFragment" && isShadowRoot(value))
|
|
11181
|
+
return true;
|
|
11182
|
+
if (interfaceName === "CharacterData" && isCharacterData(value))
|
|
11183
|
+
return true;
|
|
11184
|
+
return (interfaceName === "Node" || interfaceName === "Element" || interfaceName === "HTMLElement") && isElement(value) || interfaceName === "Node" && isNode(value);
|
|
10537
11185
|
}
|
|
10538
11186
|
|
|
10539
11187
|
// node_modules/@webqit/util/str/toTitle.js
|
|
@@ -10759,7 +11407,7 @@ var _DOMContext = class {
|
|
|
10759
11407
|
return configs;
|
|
10760
11408
|
}
|
|
10761
11409
|
get name() {
|
|
10762
|
-
return
|
|
11410
|
+
return isDocument(this.host) || isShadowRoot(this.host) ? Infinity : this.host.getAttribute(this.configs.CONTEXT_API.attr.contextname);
|
|
10763
11411
|
}
|
|
10764
11412
|
subscribed(event) {
|
|
10765
11413
|
}
|
|
@@ -10959,7 +11607,7 @@ function getOwnNamespaceObject(node) {
|
|
|
10959
11607
|
if (!_wq2(node).has("namespace")) {
|
|
10960
11608
|
const namespaceObj = /* @__PURE__ */ Object.create(null);
|
|
10961
11609
|
_wq2(node).set("namespace", namespaceObj);
|
|
10962
|
-
const isDocumentRoot =
|
|
11610
|
+
const isDocumentRoot = isDocument(node) || isShadowRoot(node);
|
|
10963
11611
|
Object.defineProperty(namespaceObj, Symbol.toStringTag, {
|
|
10964
11612
|
get() {
|
|
10965
11613
|
return isDocumentRoot ? "RootNamespaceRegistry" : "NamespaceRegistry";
|
|
@@ -10970,7 +11618,7 @@ function getOwnNamespaceObject(node) {
|
|
|
10970
11618
|
}
|
|
10971
11619
|
function getOwnerNamespaceObject(node, forID = false) {
|
|
10972
11620
|
const window2 = this, { webqit: { oohtml: { configs: { NAMESPACED_HTML: config } } } } = window2;
|
|
10973
|
-
const isDocumentRoot =
|
|
11621
|
+
const isDocumentRoot = isDocument(node) || isShadowRoot(node);
|
|
10974
11622
|
return getOwnNamespaceObject.call(window2, isDocumentRoot ? node : (forID ? node.parentNode : node)?.closest?.(config.namespaceSelector) || node.getRootNode());
|
|
10975
11623
|
}
|
|
10976
11624
|
function getNamespaceUUID(namespaceObj) {
|
|
@@ -11250,12 +11898,14 @@ function exposeAPIs2(config) {
|
|
|
11250
11898
|
throw new Error(`The "Element" class already has a "${config.api.scripts}" property!`);
|
|
11251
11899
|
}
|
|
11252
11900
|
[window2.ShadowRoot.prototype, window2.Element.prototype].forEach((proto) => {
|
|
11253
|
-
Object.defineProperty(proto, config.api.scripts, {
|
|
11254
|
-
|
|
11255
|
-
scriptsMap.
|
|
11901
|
+
Object.defineProperty(proto, config.api.scripts, {
|
|
11902
|
+
get: function() {
|
|
11903
|
+
if (!scriptsMap.has(this)) {
|
|
11904
|
+
scriptsMap.set(this, []);
|
|
11905
|
+
}
|
|
11906
|
+
return scriptsMap.get(this);
|
|
11256
11907
|
}
|
|
11257
|
-
|
|
11258
|
-
} });
|
|
11908
|
+
});
|
|
11259
11909
|
});
|
|
11260
11910
|
Object.defineProperties(window2.HTMLScriptElement.prototype, {
|
|
11261
11911
|
scoped: {
|
|
@@ -11305,7 +11955,7 @@ async function execute(config, execHash) {
|
|
|
11305
11955
|
if (script.live) {
|
|
11306
11956
|
liveProgramHandle.abort();
|
|
11307
11957
|
}
|
|
11308
|
-
if (thisContext
|
|
11958
|
+
if (isElement(thisContext)) {
|
|
11309
11959
|
thisContext[config.api.scripts]?.splice(thisContext[config.api.scripts].indexOf(script, 1));
|
|
11310
11960
|
}
|
|
11311
11961
|
}, { id: "scoped-js:script-exits", subtree: "cross-roots", timing: "sync", generation: "exits" });
|
|
@@ -11609,7 +12259,7 @@ function compileInlineBindings(config, str) {
|
|
|
11609
12259
|
$existing__.delete( $key___ );
|
|
11610
12260
|
$exec__($itemNode__, '${config.BINDINGS_API.api.bind}', $itemBinding__ );
|
|
11611
12261
|
} else {
|
|
11612
|
-
$itemNode__ = ( Array.isArray( $import__.value ) ? $import__.value[ 0 ] : ( $import__.value
|
|
12262
|
+
$itemNode__ = ( Array.isArray( $import__.value ) ? $import__.value[ 0 ] : ( $import__.value?.nodeName === 'TEMPLATE' ? $import__.value.content.firstElementChild : $import__.value ) ).cloneNode( true );
|
|
11613
12263
|
$itemNode__.setAttribute( "${config.attr.itemIndex}", $key___ );
|
|
11614
12264
|
$exec__($itemNode__, '${config.BINDINGS_API.api.bind}', $itemBinding__ );
|
|
11615
12265
|
$exec__(this, 'appendChild', $itemNode__ );
|
|
@@ -11709,7 +12359,7 @@ function getBindings(config, node) {
|
|
|
11709
12359
|
const bindingsObj = /* @__PURE__ */ Object.create(null);
|
|
11710
12360
|
_wq2(node).set("bindings", bindingsObj);
|
|
11711
12361
|
Observer2.observe(bindingsObj, (mutations) => {
|
|
11712
|
-
if (node
|
|
12362
|
+
if (isElement(node)) {
|
|
11713
12363
|
const bindingsParse = parseBindingsAttr(node.getAttribute(config.attr.bindingsreflection) || "");
|
|
11714
12364
|
const bindingsParseBefore = new Map(bindingsParse);
|
|
11715
12365
|
for (const m of mutations) {
|
|
@@ -11750,12 +12400,16 @@ function exposeAPIs3(config) {
|
|
|
11750
12400
|
if (config.api.bindings in prototype) {
|
|
11751
12401
|
throw new Error(`The ${type} prototype already has a "${config.api.bindings}" API!`);
|
|
11752
12402
|
}
|
|
11753
|
-
Object.defineProperty(prototype, config.api.bind, {
|
|
11754
|
-
|
|
11755
|
-
|
|
11756
|
-
|
|
11757
|
-
|
|
11758
|
-
|
|
12403
|
+
Object.defineProperty(prototype, config.api.bind, {
|
|
12404
|
+
value: function(bindings, options = {}) {
|
|
12405
|
+
return applyBindings.call(window2, config, this, bindings, options);
|
|
12406
|
+
}
|
|
12407
|
+
});
|
|
12408
|
+
Object.defineProperty(prototype, config.api.bindings, {
|
|
12409
|
+
get: function() {
|
|
12410
|
+
return Observer2.proxy(getBindings.call(window2, config, this));
|
|
12411
|
+
}
|
|
12412
|
+
});
|
|
11759
12413
|
});
|
|
11760
12414
|
}
|
|
11761
12415
|
function applyBindings(config, target, bindings, { merge, diff, publish, namespace } = {}) {
|
|
@@ -12110,7 +12764,7 @@ function HTMLImportElement_default() {
|
|
|
12110
12764
|
};
|
|
12111
12765
|
class HTMLImportElement extends BaseElement {
|
|
12112
12766
|
static instance(node) {
|
|
12113
|
-
if (configs.HTML_IMPORTS.elements.import.includes("-") && node
|
|
12767
|
+
if (configs.HTML_IMPORTS.elements.import.includes("-") && node.nodeName === this.nodeName)
|
|
12114
12768
|
return node;
|
|
12115
12769
|
return _wq2(node).get("import::instance") || new this(node);
|
|
12116
12770
|
}
|
|
@@ -12135,7 +12789,7 @@ function HTMLImportElement_default() {
|
|
|
12135
12789
|
const moduleRef = priv.moduleRef.includes("#") ? priv.moduleRef : `${priv.moduleRef}#`;
|
|
12136
12790
|
const request = { ...HTMLImportsContext.createRequest(moduleRef), live: signal && true, signal, diff: !moduleRef.endsWith("#") };
|
|
12137
12791
|
parentNode[configs.CONTEXT_API.api.contexts].request(request, (response) => {
|
|
12138
|
-
callback((response
|
|
12792
|
+
callback((isNodeInterface(response, "HTMLTemplateElement") ? [...response.content.children] : Array.isArray(response) ? response : response && [response]) || []);
|
|
12139
12793
|
});
|
|
12140
12794
|
}, { live: true, timing: "sync", lifecycleSignals: true });
|
|
12141
12795
|
priv.autoDestroyRealtime = realdom.realtime(window2.document).track(parentNode, () => {
|
|
@@ -12162,6 +12816,7 @@ function HTMLImportElement_default() {
|
|
|
12162
12816
|
priv.slottedElements.add(slottedElement);
|
|
12163
12817
|
});
|
|
12164
12818
|
priv.originalsRemapped = true;
|
|
12819
|
+
priv.autoRestore();
|
|
12165
12820
|
});
|
|
12166
12821
|
};
|
|
12167
12822
|
priv.autoRestore = (callback = null) => {
|
|
@@ -12556,7 +13211,7 @@ function realtime6(config) {
|
|
|
12556
13211
|
const scopeSelector = style.scoped && (supportsHAS ? `:has(> style[rand-${sourceHash}])` : `[rand-${sourceHash}]`);
|
|
12557
13212
|
const supportsScope = style.scoped && window2.CSSScopeRule && false;
|
|
12558
13213
|
const scopeRoot = style.scoped && style.parentNode || style.getRootNode();
|
|
12559
|
-
if (scopeRoot
|
|
13214
|
+
if (isElement(scopeRoot)) {
|
|
12560
13215
|
scopeRoot[config.api.styleSheets].push(style);
|
|
12561
13216
|
if (!inBrowser)
|
|
12562
13217
|
return;
|