Legend:
- Unmodified
- Added
- Removed
-
imaps-frontend/node_modules/@babel/parser/lib/index.js
rd565449 r0c6b92a 140 140 IllegalLanguageModeDirective: "Illegal 'use strict' directive in function with non-simple parameter list.", 141 141 IllegalReturn: "'return' outside of function.", 142 ImportAttributesUseAssert: "The `assert` keyword in import attributes is deprecated and it has been replaced by the `with` keyword. You can enable the `deprecated AssertSyntax: true` option in the import attributesplugin to suppress this error.",142 ImportAttributesUseAssert: "The `assert` keyword in import attributes is deprecated and it has been replaced by the `with` keyword. You can enable the `deprecatedImportAssert` parser plugin to suppress this error.", 143 143 ImportBindingIsString: ({ 144 144 importName 145 145 }) => `A string literal cannot be used as an imported binding.\n- Did you mean \`import { "${importName}" as foo }\`?`, 146 ImportCallArgumentTrailingComma: "Trailing comma is disallowed inside import(...) arguments.", 147 ImportCallArity: ({ 148 maxArgumentCount 149 }) => `\`import()\` requires exactly ${maxArgumentCount === 1 ? "one argument" : "one or two arguments"}.`, 146 ImportCallArity: `\`import()\` requires exactly one or two arguments.`, 150 147 ImportCallNotNewExpression: "Cannot use new with import(...).", 151 148 ImportCallSpreadArgument: "`...` is not allowed in `import()`.", … … 346 343 }) { 347 344 const hasMissingPlugin = reasonCode === "MissingPlugin" || reasonCode === "MissingOneOfPlugins"; 345 { 346 const oldReasonCodes = { 347 AccessorCannotDeclareThisParameter: "AccesorCannotDeclareThisParameter", 348 AccessorCannotHaveTypeParameters: "AccesorCannotHaveTypeParameters", 349 ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference: "ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference", 350 SetAccessorCannotHaveOptionalParameter: "SetAccesorCannotHaveOptionalParameter", 351 SetAccessorCannotHaveRestParameter: "SetAccesorCannotHaveRestParameter", 352 SetAccessorCannotHaveReturnType: "SetAccesorCannotHaveReturnType" 353 }; 354 if (oldReasonCodes[reasonCode]) { 355 reasonCode = oldReasonCodes[reasonCode]; 356 } 357 } 348 358 return function constructor(loc, details) { 349 359 const error = new SyntaxError(); … … 661 671 const node = super.finishCallExpression(unfinished, optional); 662 672 if (node.callee.type === "Import") { 673 var _ref, _ref2; 663 674 node.type = "ImportExpression"; 664 675 node.source = node.arguments[0]; 665 if (this.hasPlugin("importAttributes") || this.hasPlugin("importAssertions")) { 666 var _ref, _ref2; 667 node.options = (_ref = node.arguments[1]) != null ? _ref : null; 668 node.attributes = (_ref2 = node.arguments[1]) != null ? _ref2 : null; 669 } 676 node.options = (_ref = node.arguments[1]) != null ? _ref : null; 677 node.attributes = (_ref2 = node.arguments[1]) != null ? _ref2 : null; 670 678 delete node.arguments; 671 679 delete node.callee; … … 1209 1217 startsExpr 1210 1218 }), 1219 placeholder: createToken("%%", { 1220 startsExpr: true 1221 }), 1211 1222 string: createToken("string", { 1212 1223 startsExpr … … 1235 1246 startsExpr: true 1236 1247 }), 1237 jsxTagEnd: createToken("jsxTagEnd"), 1238 placeholder: createToken("%%", { 1239 startsExpr: true 1240 }) 1248 jsxTagEnd: createToken("jsxTagEnd") 1241 1249 }; 1242 1250 function tokenIsIdentifier(token) { 1243 return token >= 93 && token <= 13 2;1251 return token >= 93 && token <= 133; 1244 1252 } 1245 1253 function tokenKeywordOrIdentifierIsKeyword(token) { … … 1247 1255 } 1248 1256 function tokenIsKeywordOrIdentifier(token) { 1249 return token >= 58 && token <= 13 2;1257 return token >= 58 && token <= 133; 1250 1258 } 1251 1259 function tokenIsLiteralPropertyName(token) { 1252 return token >= 58 && token <= 13 6;1260 return token >= 58 && token <= 137; 1253 1261 } 1254 1262 function tokenComesBeforeExpression(token) { … … 1314 1322 } 1315 1323 }; 1316 tokenTypes[14 2].updateContext = context => {1324 tokenTypes[143].updateContext = context => { 1317 1325 context.push(types.j_expr, types.j_oTag); 1318 1326 }; 1319 1327 } 1320 let 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-\u1c8 8\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7ca\ua7d0\ua7d1\ua7d3\ua7d5-\ua7d9\ua7f2-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc";1321 let 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\u0898-\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";1328 let 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"; 1329 let nonASCIIidentifierChars = "\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"; 1322 1330 const nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); 1323 1331 const nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]"); 1324 1332 nonASCIIidentifierStartChars = nonASCIIidentifierChars = null; 1325 const 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, 68, 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, 349, 41, 7, 1, 79, 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, 159, 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, 264, 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, 4026, 582, 8634, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 689, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 43, 8, 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, 757, 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];1326 const 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, 370, 1, 81, 2, 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, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 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, 406, 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, 9, 5351, 0, 7, 14, 13835, 9, 87, 9, 39, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4706, 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, 983, 6, 110, 6, 6, 9, 4759, 9, 787719, 239];1333 const 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]; 1334 const 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]; 1327 1335 function isInAstralSet(code, set) { 1328 1336 let pos = 0x10000; … … 1580 1588 this.ambiguousScriptDifferentAst = false; 1581 1589 } 1590 sourceToOffsetPos(sourcePos) { 1591 return sourcePos + this.startIndex; 1592 } 1593 offsetToSourcePos(offsetPos) { 1594 return offsetPos - this.startIndex; 1595 } 1582 1596 hasPlugin(pluginConfig) { 1583 1597 if (typeof pluginConfig === "string") { … … 1693 1707 start: commentStart 1694 1708 } = commentWS; 1695 if (this.input.charCodeAt( commentStart- 1) === 44) {1709 if (this.input.charCodeAt(this.offsetToSourcePos(commentStart) - 1) === 44) { 1696 1710 switch (node.type) { 1697 1711 case "ObjectExpression": … … 1842 1856 constructor() { 1843 1857 this.flags = 1024; 1858 this.startIndex = void 0; 1844 1859 this.curLine = void 0; 1845 1860 this.lineStart = void 0; … … 1858 1873 this.commentStack = []; 1859 1874 this.pos = 0; 1860 this.type = 1 39;1875 this.type = 140; 1861 1876 this.value = null; 1862 1877 this.start = 0; … … 1878 1893 strictMode, 1879 1894 sourceType, 1895 startIndex, 1880 1896 startLine, 1881 1897 startColumn 1882 1898 }) { 1883 1899 this.strict = strictMode === false ? false : strictMode === true ? true : sourceType === "module"; 1900 this.startIndex = startIndex; 1884 1901 this.curLine = startLine; 1885 1902 this.lineStart = -startColumn; 1886 this.startLoc = this.endLoc = new Position(startLine, startColumn, 0);1903 this.startLoc = this.endLoc = new Position(startLine, startColumn, startIndex); 1887 1904 } 1888 1905 get maybeInArrowParameters() { … … 1959 1976 } 1960 1977 curPosition() { 1961 return new Position(this.curLine, this.pos - this.lineStart, this.pos );1978 return new Position(this.curLine, this.pos - this.lineStart, this.pos + this.startIndex); 1962 1979 } 1963 1980 clone() { 1964 1981 const state = new State(); 1965 1982 state.flags = this.flags; 1983 state.startIndex = this.startIndex; 1966 1984 state.curLine = this.curLine; 1967 1985 state.lineStart = this.lineStart; … … 2281 2299 class Token { 2282 2300 constructor(state) { 2301 const startIndex = state.startIndex || 0; 2283 2302 this.type = state.type; 2284 2303 this.value = state.value; 2285 this.start = sta te.start;2286 this.end = sta te.end;2304 this.start = startIndex + state.start; 2305 this.end = startIndex + state.end; 2287 2306 this.loc = new SourceLocation(state.startLoc, state.endLoc); 2288 2307 } … … 2425 2444 if (!this.isLookahead) this.state.startLoc = this.state.curPosition(); 2426 2445 if (this.state.pos >= this.length) { 2427 this.finishToken(1 39);2446 this.finishToken(140); 2428 2447 return; 2429 2448 } … … 2448 2467 type: "CommentBlock", 2449 2468 value: this.input.slice(start + 2, end), 2450 start ,2451 end: end + commentEnd.length,2469 start: this.sourceToOffsetPos(start), 2470 end: this.sourceToOffsetPos(end + commentEnd.length), 2452 2471 loc: new SourceLocation(startLoc, this.state.curPosition()) 2453 2472 }; … … 2471 2490 type: "CommentLine", 2472 2491 value, 2473 start ,2474 end ,2492 start: this.sourceToOffsetPos(start), 2493 end: this.sourceToOffsetPos(end), 2475 2494 loc: new SourceLocation(startLoc, this.state.curPosition()) 2476 2495 }; … … 2557 2576 const end = this.state.pos; 2558 2577 const commentWhitespace = { 2559 start: spaceStart,2560 end ,2578 start: this.sourceToOffsetPos(spaceStart), 2579 end: this.sourceToOffsetPos(end), 2561 2580 comments, 2562 2581 leadingNode: null, … … 2603 2622 } else if (isIdentifierStart(next)) { 2604 2623 ++this.state.pos; 2605 this.finishToken(13 8, this.readWord1(next));2624 this.finishToken(139, this.readWord1(next)); 2606 2625 } else if (next === 92) { 2607 2626 ++this.state.pos; 2608 this.finishToken(13 8, this.readWord1());2627 this.finishToken(139, this.readWord1()); 2609 2628 } else { 2610 2629 this.finishOp(27, 1); … … 3018 3037 } 3019 3038 this.state.pos = pos; 3020 this.finishToken(13 7, {3039 this.finishToken(138, { 3021 3040 pattern: content, 3022 3041 flags: mods … … 3032 3051 } 3033 3052 readRadixNumber(radix) { 3053 const start = this.state.pos; 3034 3054 const startLoc = this.state.curPosition(); 3035 3055 let isBigInt = false; … … 3052 3072 } 3053 3073 if (isBigInt) { 3054 const str = this.input.slice(start Loc.index, this.state.pos).replace(/[_n]/g, "");3055 this.finishToken(13 5, str);3074 const str = this.input.slice(start, this.state.pos).replace(/[_n]/g, ""); 3075 this.finishToken(136, str); 3056 3076 return; 3057 3077 } 3058 this.finishToken(13 4, val);3078 this.finishToken(135, val); 3059 3079 } 3060 3080 readNumber(startsWithDot) { … … 3063 3083 let isFloat = false; 3064 3084 let isBigInt = false; 3065 let isDecimal = false;3066 3085 let hasExponent = false; 3067 3086 let isOctal = false; … … 3113 3132 } 3114 3133 ++this.state.pos; 3115 isDecimal = true;3134 var isDecimal = true; 3116 3135 } 3117 3136 if (isIdentifierStart(this.codePointAtPos(this.state.pos))) { … … 3120 3139 const str = this.input.slice(start, this.state.pos).replace(/[_mn]/g, ""); 3121 3140 if (isBigInt) { 3122 this.finishToken(135, str);3123 return;3124 }3125 if (isDecimal) {3126 3141 this.finishToken(136, str); 3127 3142 return; 3128 3143 } 3144 if (isDecimal) { 3145 this.finishToken(137, str); 3146 return; 3147 } 3129 3148 const val = isOctal ? parseInt(str, 8) : parseFloat(str); 3130 this.finishToken(13 4, val);3149 this.finishToken(135, val); 3131 3150 } 3132 3151 readCodePoint(throwOnInvalid) { … … 3148 3167 this.state.lineStart = lineStart; 3149 3168 this.state.curLine = curLine; 3150 this.finishToken(13 3, str);3169 this.finishToken(134, str); 3151 3170 } 3152 3171 readTemplateContinuation() { … … 3170 3189 this.state.curLine = curLine; 3171 3190 if (firstInvalidLoc) { 3172 this.state.firstInvalidTemplateEscapePos = new Position(firstInvalidLoc.curLine, firstInvalidLoc.pos - firstInvalidLoc.lineStart, firstInvalidLoc.pos);3191 this.state.firstInvalidTemplateEscapePos = new Position(firstInvalidLoc.curLine, firstInvalidLoc.pos - firstInvalidLoc.lineStart, this.sourceToOffsetPos(firstInvalidLoc.pos)); 3173 3192 } 3174 3193 if (this.input.codePointAt(pos) === 96) { … … 3558 3577 } 3559 3578 canInsertSemicolon() { 3560 return this.match(1 39) || this.match(8) || this.hasPrecedingLineBreak();3579 return this.match(140) || this.match(8) || this.hasPrecedingLineBreak(); 3561 3580 } 3562 3581 hasPrecedingLineBreak() { 3563 return hasNewLine(this.input, this. state.lastTokEndLoc.index, this.state.start);3582 return hasNewLine(this.input, this.offsetToSourcePos(this.state.lastTokEndLoc.index), this.state.start); 3564 3583 } 3565 3584 hasFollowingLineBreak() { … … 3962 3981 return this.getPluginOption("flow", "all") || this.flowPragma === "flow"; 3963 3982 } 3964 shouldParseEnums() {3965 return !!this.getPluginOption("flow", "enums");3966 }3967 3983 finishToken(type, val) { 3968 if (type !== 13 3&& type !== 13 && type !== 28) {3984 if (type !== 134 && type !== 13 && type !== 28) { 3969 3985 if (this.flowPragma === undefined) { 3970 3986 this.flowPragma = null; … … 4094 4110 flowParseDeclareModule(node) { 4095 4111 this.scope.enter(0); 4096 if (this.match(13 3)) {4112 if (this.match(134)) { 4097 4113 node.id = super.parseExprAtom(); 4098 4114 } else { … … 4321 4337 node.params = []; 4322 4338 this.state.inType = true; 4323 if (this.match(47) || this.match(14 2)) {4339 if (this.match(47) || this.match(143)) { 4324 4340 this.next(); 4325 4341 } else { … … 4395 4411 } 4396 4412 flowParseObjectPropertyKey() { 4397 return this.match(13 4) || this.match(133) ? super.parseExprAtom() : this.parseIdentifier(true);4413 return this.match(135) || this.match(134) ? super.parseExprAtom() : this.parseIdentifier(true); 4398 4414 } 4399 4415 flowParseObjectTypeIndexer(node, isStatic, variance) { … … 4839 4855 return this.finishNode(node, "FunctionTypeAnnotation"); 4840 4856 } 4841 case 13 3:4857 case 134: 4842 4858 return this.parseLiteral(this.state.value, "StringLiteralTypeAnnotation"); 4843 4859 case 85: … … 4849 4865 if (this.state.value === "-") { 4850 4866 this.next(); 4851 if (this.match(13 4)) {4867 if (this.match(135)) { 4852 4868 return this.parseLiteralAtNode(-this.state.value, "NumberLiteralTypeAnnotation", node); 4853 4869 } 4854 if (this.match(13 5)) {4870 if (this.match(136)) { 4855 4871 return this.parseLiteralAtNode(-this.state.value, "BigIntLiteralTypeAnnotation", node); 4856 4872 } … … 4859 4875 this.unexpected(); 4860 4876 return; 4861 case 13 4:4877 case 135: 4862 4878 return this.parseLiteral(this.state.value, "NumberLiteralTypeAnnotation"); 4863 case 13 5:4879 case 136: 4864 4880 return this.parseLiteral(this.state.value, "BigIntLiteralTypeAnnotation"); 4865 4881 case 88: … … 5031 5047 return this.flowParseInterface(node); 5032 5048 } 5033 } else if (this. shouldParseEnums() && this.isContextual(126)) {5049 } else if (this.isContextual(126)) { 5034 5050 const node = this.startNode(); 5035 5051 this.next(); … … 5064 5080 type 5065 5081 } = this.state; 5066 if (t okenIsFlowInterfaceOrTypeOrOpaque(type) || this.shouldParseEnums() && type === 126) {5082 if (type === 126 || tokenIsFlowInterfaceOrTypeOrOpaque(type)) { 5067 5083 return !this.state.containsEsc; 5068 5084 } … … 5073 5089 type 5074 5090 } = this.state; 5075 if (t okenIsFlowInterfaceOrTypeOrOpaque(type) || this.shouldParseEnums() && type === 126) {5091 if (type === 126 || tokenIsFlowInterfaceOrTypeOrOpaque(type)) { 5076 5092 return this.state.containsEsc; 5077 5093 } … … 5079 5095 } 5080 5096 parseExportDefaultExpression() { 5081 if (this. shouldParseEnums() && this.isContextual(126)) {5097 if (this.isContextual(126)) { 5082 5098 const node = this.startNode(); 5083 5099 this.next(); … … 5181 5197 forwardNoArrowParamsConversionAt(node, parse) { 5182 5198 let result; 5183 if (this.state.noArrowParamsConversionAt.includes( node.start)) {5199 if (this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(node.start))) { 5184 5200 this.state.noArrowParamsConversionAt.push(this.state.start); 5185 5201 result = parse(); … … 5232 5248 this.next(); 5233 5249 return this.flowParseInterface(declarationNode); 5234 } else if (this. shouldParseEnums() && this.isContextual(126)) {5250 } else if (this.isContextual(126)) { 5235 5251 node.exportKind = "value"; 5236 5252 const declarationNode = this.startNode(); … … 5463 5479 return result; 5464 5480 } 5465 parse AssignableListItemTypes(param) {5481 parseFunctionParamType(param) { 5466 5482 if (this.eat(17)) { 5467 5483 if (param.type !== "Identifier") { … … 5614 5630 let state = null; 5615 5631 let jsx; 5616 if (this.hasPlugin("jsx") && (this.match(14 2) || this.match(47))) {5632 if (this.hasPlugin("jsx") && (this.match(143) || this.match(47))) { 5617 5633 state = this.state.clone(); 5618 5634 jsx = this.tryParse(() => super.parseMaybeAssign(refExpressionErrors, afterLeftParse), state); … … 5691 5707 } 5692 5708 setArrowFunctionParameters(node, params) { 5693 if (this.state.noArrowParamsConversionAt.includes( node.start)) {5709 if (this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(node.start))) { 5694 5710 node.params = params; 5695 5711 } else { … … 5698 5714 } 5699 5715 checkParams(node, allowDuplicates, isArrowFunction, strictModeChanged = true) { 5700 if (isArrowFunction && this.state.noArrowParamsConversionAt.includes( node.start)) {5716 if (isArrowFunction && this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(node.start))) { 5701 5717 return; 5702 5718 } … … 5709 5725 } 5710 5726 parseParenAndDistinguishExpression(canBeArrow) { 5711 return super.parseParenAndDistinguishExpression(canBeArrow && !this.state.noArrowAt.includes(this.s tate.start));5727 return super.parseParenAndDistinguishExpression(canBeArrow && !this.state.noArrowAt.includes(this.sourceToOffsetPos(this.state.start))); 5712 5728 } 5713 5729 parseSubscripts(base, startLoc, noCalls) { … … 5716 5732 const node = this.startNodeAt(startLoc); 5717 5733 node.callee = base; 5718 node.arguments = super.parseCallExpressionArguments(11 , false);5734 node.arguments = super.parseCallExpressionArguments(11); 5719 5735 base = this.finishNode(node, "CallExpression"); 5720 5736 } else if (base.type === "Identifier" && base.name === "async" && this.match(47)) { … … 5748 5764 node.typeArguments = this.flowParseTypeParameterInstantiation(); 5749 5765 this.expect(10); 5750 node.arguments = this.parseCallExpressionArguments(11 , false);5766 node.arguments = this.parseCallExpressionArguments(11); 5751 5767 node.optional = true; 5752 5768 return this.finishCallExpression(node, true); … … 5757 5773 node.typeArguments = this.flowParseTypeParameterInstantiationCallOrNew(); 5758 5774 this.expect(10); 5759 node.arguments = super.parseCallExpressionArguments(11 , false);5775 node.arguments = super.parseCallExpressionArguments(11); 5760 5776 if (subscriptState.optionalChainMember) { 5761 5777 node.optional = false; … … 5873 5889 const endOfInit = () => this.match(12) || this.match(8); 5874 5890 switch (this.state.type) { 5875 case 13 4:5891 case 135: 5876 5892 { 5877 5893 const literal = this.parseNumericLiteral(this.state.value); … … 5888 5904 }; 5889 5905 } 5890 case 13 3:5906 case 134: 5891 5907 { 5892 5908 const literal = this.parseStringLiteral(this.state.value); … … 6493 6509 if (ch === 60 && this.state.canStartJSXElement) { 6494 6510 ++this.state.pos; 6495 this.finishToken(14 2);6511 this.finishToken(143); 6496 6512 } else { 6497 6513 super.getTokenFromCode(ch); … … 6500 6516 } 6501 6517 out += this.input.slice(chunkStart, this.state.pos); 6502 this.finishToken(14 1, out);6518 this.finishToken(142, out); 6503 6519 return; 6504 6520 case 38: … … 6556 6572 } 6557 6573 out += this.input.slice(chunkStart, this.state.pos++); 6558 this.finishToken(13 3, out);6574 this.finishToken(134, out); 6559 6575 } 6560 6576 jsxReadEntity() { … … 6596 6612 ch = this.input.charCodeAt(++this.state.pos); 6597 6613 } while (isIdentifierChar(ch) || ch === 45); 6598 this.finishToken(14 0, this.input.slice(start, this.state.pos));6614 this.finishToken(141, this.input.slice(start, this.state.pos)); 6599 6615 } 6600 6616 jsxParseIdentifier() { 6601 6617 const node = this.startNode(); 6602 if (this.match(14 0)) {6618 if (this.match(141)) { 6603 6619 node.name = this.state.value; 6604 6620 } else if (tokenIsKeyword(this.state.type)) { … … 6645 6661 } 6646 6662 return node; 6647 case 14 2:6648 case 13 3:6663 case 143: 6664 case 134: 6649 6665 return this.parseExprAtom(); 6650 6666 default: … … 6694 6710 jsxParseOpeningElementAt(startLoc) { 6695 6711 const node = this.startNodeAt(startLoc); 6696 if (this.eat(14 3)) {6712 if (this.eat(144)) { 6697 6713 return this.finishNode(node, "JSXOpeningFragment"); 6698 6714 } … … 6702 6718 jsxParseOpeningElementAfterName(node) { 6703 6719 const attributes = []; 6704 while (!this.match(56) && !this.match(14 3)) {6720 while (!this.match(56) && !this.match(144)) { 6705 6721 attributes.push(this.jsxParseAttribute()); 6706 6722 } 6707 6723 node.attributes = attributes; 6708 6724 node.selfClosing = this.eat(56); 6709 this.expect(14 3);6725 this.expect(144); 6710 6726 return this.finishNode(node, "JSXOpeningElement"); 6711 6727 } 6712 6728 jsxParseClosingElementAt(startLoc) { 6713 6729 const node = this.startNodeAt(startLoc); 6714 if (this.eat(14 3)) {6730 if (this.eat(144)) { 6715 6731 return this.finishNode(node, "JSXClosingFragment"); 6716 6732 } 6717 6733 node.name = this.jsxParseElementName(); 6718 this.expect(14 3);6734 this.expect(144); 6719 6735 return this.finishNode(node, "JSXClosingElement"); 6720 6736 } … … 6727 6743 contents: for (;;) { 6728 6744 switch (this.state.type) { 6729 case 14 2:6745 case 143: 6730 6746 startLoc = this.state.startLoc; 6731 6747 this.next(); … … 6736 6752 children.push(this.jsxParseElementAt(startLoc)); 6737 6753 break; 6738 case 14 1:6754 case 142: 6739 6755 children.push(this.parseLiteral(this.state.value, "JSXText")); 6740 6756 break; … … 6794 6810 } 6795 6811 parseExprAtom(refExpressionErrors) { 6796 if (this.match(14 2)) {6812 if (this.match(143)) { 6797 6813 return this.jsxParseElement(); 6798 6814 } else if (this.match(47) && this.input.charCodeAt(this.state.pos) !== 33) { 6799 this.replaceToken(14 2);6815 this.replaceToken(143); 6800 6816 return this.jsxParseElement(); 6801 6817 } else { … … 6820 6836 if (code === 62) { 6821 6837 ++this.state.pos; 6822 this.finishToken(14 3);6838 this.finishToken(144); 6823 6839 return; 6824 6840 } … … 6830 6846 if (code === 60 && this.state.canStartJSXElement && this.input.charCodeAt(this.state.pos + 1) !== 33) { 6831 6847 ++this.state.pos; 6832 this.finishToken(14 2);6848 this.finishToken(143); 6833 6849 return; 6834 6850 } … … 6840 6856 type 6841 6857 } = this.state; 6842 if (type === 56 && prevType === 14 2) {6858 if (type === 56 && prevType === 143) { 6843 6859 context.splice(-2, 2, types.j_cTag); 6844 6860 this.state.canStartJSXElement = false; 6845 } else if (type === 14 2) {6861 } else if (type === 143) { 6846 6862 context.push(types.j_oTag); 6847 } else if (type === 14 3) {6863 } else if (type === 144) { 6848 6864 const out = context[context.length - 1]; 6849 6865 if (out === types.j_oTag && prevType === 56 || out === types.j_cTag) { … … 7165 7181 break; 7166 7182 } else if (this.match(21)) { 7167 elts.push(this.parseAssignableListItemTypes(this.parseRestBinding(), flags)); 7183 let rest = this.parseRestBinding(); 7184 if (this.hasPlugin("flow") || flags & 2) { 7185 rest = this.parseFunctionParamType(rest); 7186 } 7187 elts.push(rest); 7168 7188 if (!this.checkCommaAfterRest(closeCharCode)) { 7169 7189 this.expect(close); … … 7198 7218 } 7199 7219 const prop = this.startNode(); 7200 if (type === 13 8) {7220 if (type === 139) { 7201 7221 this.expectPlugin("destructuringPrivate", startLoc); 7202 7222 this.classScope.usePrivateName(this.state.value, startLoc); … … 7210 7230 parseAssignableListItem(flags, decorators) { 7211 7231 const left = this.parseMaybeDefault(); 7212 this.parseAssignableListItemTypes(left, flags); 7232 if (this.hasPlugin("flow") || flags & 2) { 7233 this.parseFunctionParamType(left); 7234 } 7213 7235 const elt = this.parseMaybeDefault(left.loc.start, left); 7214 7236 if (decorators.length) { … … 7217 7239 return elt; 7218 7240 } 7219 parse AssignableListItemTypes(param, flags) {7241 parseFunctionParamType(param) { 7220 7242 return param; 7221 7243 } … … 7376 7398 propertyName 7377 7399 }) => `Property '${propertyName}' cannot have an initializer because it is marked abstract.`, 7378 AccesorCannotDeclareThisParameter: "'get' and 'set' accessors cannot declare 'this' parameters.",7379 AccesorCannotHaveTypeParameters: "An accessor cannot have type parameters.",7380 7400 AccessorCannotBeOptional: "An 'accessor' property cannot be declared optional.", 7401 AccessorCannotDeclareThisParameter: "'get' and 'set' accessors cannot declare 'this' parameters.", 7402 AccessorCannotHaveTypeParameters: "An accessor cannot have type parameters.", 7381 7403 ClassMethodHasDeclare: "Class methods cannot have the 'declare' modifier.", 7382 7404 ClassMethodHasReadonly: "Class methods cannot have the 'readonly' modifier.", 7383 ConstInitia ilizerMustBeStringOrNumericLiteralOrLiteralEnumReference: "A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.",7405 ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference: "A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.", 7384 7406 ConstructorHasTypeParameters: "Type parameters cannot appear on a constructor declaration.", 7385 7407 DeclareAccessor: ({ … … 7440 7462 ReservedArrowTypeParam: "This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma, as in `<T,>() => ...`.", 7441 7463 ReservedTypeAssertion: "This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead.", 7442 SetAcces orCannotHaveOptionalParameter: "A 'set' accessor cannot have an optional parameter.",7443 SetAcces orCannotHaveRestParameter: "A 'set' accessor cannot have rest parameter.",7444 SetAcces orCannotHaveReturnType: "A 'set' accessor cannot have a return type annotation.",7464 SetAccessorCannotHaveOptionalParameter: "A 'set' accessor cannot have an optional parameter.", 7465 SetAccessorCannotHaveRestParameter: "A 'set' accessor cannot have rest parameter.", 7466 SetAccessorCannotHaveReturnType: "A 'set' accessor cannot have a return type annotation.", 7445 7467 SingleTypeParameterWithoutTrailingComma: ({ 7446 7468 typeParameterName … … 7520 7542 } 7521 7543 tsTokenCanFollowModifier() { 7522 return (this.match(0) || this.match(5) || this.match(55) || this.match(21) || this.match(138) || this.isLiteralPropertyName()) && !this.hasPrecedingLineBreak(); 7544 return this.match(0) || this.match(5) || this.match(55) || this.match(21) || this.match(139) || this.isLiteralPropertyName(); 7545 } 7546 tsNextTokenOnSameLineAndCanFollowModifier() { 7547 this.next(); 7548 if (this.hasPrecedingLineBreak()) { 7549 return false; 7550 } 7551 return this.tsTokenCanFollowModifier(); 7523 7552 } 7524 7553 tsNextTokenCanFollowModifier() { 7525 this.next(); 7526 return this.tsTokenCanFollowModifier(); 7554 if (this.match(106)) { 7555 this.next(); 7556 return this.tsTokenCanFollowModifier(); 7557 } 7558 return this.tsNextTokenOnSameLineAndCanFollowModifier(); 7527 7559 } 7528 7560 tsParseModifier(allowedModifiers, stopOnStartOfClassStaticBlock) { … … 7681 7713 this.expect(83); 7682 7714 this.expect(10); 7683 if (!this.match(13 3)) {7715 if (!this.match(134)) { 7684 7716 this.raise(TSErrors.UnsupportedImportTypeArgument, this.state.startLoc); 7685 7717 } 7686 7718 node.argument = super.parseExprAtom(); 7687 if (this.hasPlugin("importAttributes") || this.hasPlugin("importAssertions")) { 7719 if (this.eat(12) && !this.match(11)) { 7720 node.options = super.parseMaybeAssignAllowIn(); 7721 this.eat(12); 7722 } else { 7688 7723 node.options = null; 7689 }7690 if (this.eat(12)) {7691 this.expectImportAttributesPlugin();7692 if (!this.match(11)) {7693 node.options = super.parseMaybeAssignAllowIn();7694 this.eat(12);7695 }7696 7724 } 7697 7725 this.expect(11); … … 7763 7791 tsParseTypeParameters(parseModifiers) { 7764 7792 const node = this.startNode(); 7765 if (this.match(47) || this.match(14 2)) {7793 if (this.match(47) || this.match(143)) { 7766 7794 this.next(); 7767 7795 } else { … … 7849 7877 const method = nodeAny; 7850 7878 if (method.kind && this.match(47)) { 7851 this.raise(TSErrors.Acces orCannotHaveTypeParameters, this.state.curPosition());7879 this.raise(TSErrors.AccessorCannotHaveTypeParameters, this.state.curPosition()); 7852 7880 } 7853 7881 this.tsFillSignature(14, method); … … 7859 7887 this.raise(Errors.BadGetterArity, this.state.curPosition()); 7860 7888 if (this.isThisParam(method[paramsKey][0])) { 7861 this.raise(TSErrors.Acces orCannotDeclareThisParameter, this.state.curPosition());7889 this.raise(TSErrors.AccessorCannotDeclareThisParameter, this.state.curPosition()); 7862 7890 } 7863 7891 } … … 7868 7896 const firstParameter = method[paramsKey][0]; 7869 7897 if (this.isThisParam(firstParameter)) { 7870 this.raise(TSErrors.Acces orCannotDeclareThisParameter, this.state.curPosition());7898 this.raise(TSErrors.AccessorCannotDeclareThisParameter, this.state.curPosition()); 7871 7899 } 7872 7900 if (firstParameter.type === "Identifier" && firstParameter.optional) { 7873 this.raise(TSErrors.SetAcces orCannotHaveOptionalParameter, this.state.curPosition());7901 this.raise(TSErrors.SetAccessorCannotHaveOptionalParameter, this.state.curPosition()); 7874 7902 } 7875 7903 if (firstParameter.type === "RestElement") { 7876 this.raise(TSErrors.SetAcces orCannotHaveRestParameter, this.state.curPosition());7904 this.raise(TSErrors.SetAccessorCannotHaveRestParameter, this.state.curPosition()); 7877 7905 } 7878 7906 } 7879 7907 if (method[returnTypeKey]) { 7880 this.raise(TSErrors.SetAcces orCannotHaveReturnType, method[returnTypeKey]);7908 this.raise(TSErrors.SetAccessorCannotHaveReturnType, method[returnTypeKey]); 7881 7909 } 7882 7910 } else { … … 7951 7979 this.next(); 7952 7980 return this.match(58); 7953 }7954 tsParseMappedTypeParameter() {7955 const node = this.startNode();7956 node.name = this.tsParseTypeParameterName();7957 node.constraint = this.tsExpectThenParseType(58);7958 return this.finishNode(node, "TSTypeParameter");7959 7981 } 7960 7982 tsParseMappedType() { … … 7969 7991 } 7970 7992 this.expect(0); 7971 node.typeParameter = this.tsParseMappedTypeParameter(); 7993 { 7994 const typeParameter = this.startNode(); 7995 typeParameter.name = this.tsParseTypeParameterName(); 7996 typeParameter.constraint = this.tsExpectThenParseType(58); 7997 node.typeParameter = this.finishNode(typeParameter, "TSTypeParameter"); 7998 } 7972 7999 node.nameType = this.eatContextual(93) ? this.tsParseType() : null; 7973 8000 this.expect(3); … … 8088 8115 const node = this.startNode(); 8089 8116 switch (this.state.type) { 8117 case 135: 8118 case 136: 8090 8119 case 134: 8091 case 135:8092 case 133:8093 8120 case 85: 8094 8121 case 86: … … 8119 8146 tsParseNonArrayType() { 8120 8147 switch (this.state.type) { 8121 case 133:8122 8148 case 134: 8123 8149 case 135: 8150 case 136: 8124 8151 case 85: 8125 8152 case 86: … … 8129 8156 const node = this.startNode(); 8130 8157 const nextToken = this.lookahead(); 8131 if (nextToken.type !== 13 4 && nextToken.type !== 135) {8158 if (nextToken.type !== 135 && nextToken.type !== 136) { 8132 8159 this.unexpected(); 8133 8160 } … … 8535 8562 tsParseEnumMember() { 8536 8563 const node = this.startNode(); 8537 node.id = this.match(13 3) ? super.parseStringLiteral(this.state.value) : this.parseIdentifier(true);8564 node.id = this.match(134) ? super.parseStringLiteral(this.state.value) : this.parseIdentifier(true); 8538 8565 if (this.eat(29)) { 8539 8566 node.initializer = super.parseMaybeAssignAllowIn(); … … 8580 8607 tsParseAmbientExternalModuleDeclaration(node) { 8581 8608 if (this.isContextual(112)) { 8609 node.kind = "global"; 8582 8610 node.global = true; 8583 8611 node.id = this.parseIdentifier(); 8584 } else if (this.match(133)) { 8612 } else if (this.match(134)) { 8613 node.kind = "module"; 8585 8614 node.id = super.parseStringLiteral(this.state.value); 8586 8615 } else { … … 8621 8650 this.expectContextual(119); 8622 8651 this.expect(10); 8623 if (!this.match(13 3)) {8652 if (!this.match(134)) { 8624 8653 this.unexpected(); 8625 8654 } … … 8716 8745 this.prodParam.enter(0); 8717 8746 const mod = node; 8747 mod.kind = "global"; 8718 8748 mod.global = true; 8719 8749 mod.id = expr; … … 8737 8767 case "module": 8738 8768 if (this.tsCheckLineTerminator(next)) { 8739 if (this.match(13 3)) {8769 if (this.match(134)) { 8740 8770 return this.tsParseAmbientExternalModuleDeclaration(node); 8741 8771 } else if (tokenIsIdentifier(this.state.type)) { 8772 node.kind = "module"; 8742 8773 return this.tsParseModuleOrNamespaceDeclaration(node); 8743 8774 } … … 8746 8777 case "namespace": 8747 8778 if (this.tsCheckLineTerminator(next) && tokenIsIdentifier(this.state.type)) { 8779 node.kind = "namespace"; 8748 8780 return this.tsParseModuleOrNamespaceDeclaration(node); 8749 8781 } … … 8818 8850 } 8819 8851 const left = this.parseMaybeDefault(); 8820 this.parseAssignableListItemTypes(left, flags); 8852 if (flags & 2) { 8853 this.parseFunctionParamType(left); 8854 } 8821 8855 const elt = this.parseMaybeDefault(left.loc.start, left); 8822 8856 if (accessibility || readonly || override) { … … 8935 8969 const node = this.startNodeAt(startLoc); 8936 8970 node.callee = base; 8937 node.arguments = this.parseCallExpressionArguments(11 , false);8971 node.arguments = this.parseCallExpressionArguments(11); 8938 8972 this.tsCheckForInvalidTypeCasts(node.arguments); 8939 8973 node.typeParameters = typeArguments; … … 9027 9061 } 9028 9062 parseImport(node) { 9029 if (this.match(13 3)) {9063 if (this.match(134)) { 9030 9064 node.importKind = "value"; 9031 9065 return super.parseImport(node); … … 9107 9141 this.raise(TSErrors.InitializerNotAllowedInAmbientContext, init); 9108 9142 } else if (!isValidAmbientConstInitializer(init, this.hasPlugin("estree"))) { 9109 this.raise(TSErrors.ConstInitia ilizerMustBeStringOrNumericLiteralOrLiteralEnumReference, init);9143 this.raise(TSErrors.ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference, init); 9110 9144 } 9111 9145 } … … 9295 9329 } = node; 9296 9330 this.raise(TSErrors.AbstractPropertyHasInitializer, this.state.startLoc, { 9297 propertyName: key.type === "Identifier" && !node.computed ? key.name : `[${this.input.slice( key.start, key.end)}]`9331 propertyName: key.type === "Identifier" && !node.computed ? key.name : `[${this.input.slice(this.offsetToSourcePos(key.start), this.offsetToSourcePos(key.end))}]` 9298 9332 }); 9299 9333 } … … 9389 9423 let jsx; 9390 9424 let typeCast; 9391 if (this.hasPlugin("jsx") && (this.match(14 2) || this.match(47))) {9425 if (this.hasPlugin("jsx") && (this.match(143) || this.match(47))) { 9392 9426 state = this.state.clone(); 9393 9427 jsx = this.tryParse(() => super.parseMaybeAssign(refExpressionErrors, afterLeftParse), state); … … 9470 9504 return super.parseArrow(node); 9471 9505 } 9472 parseAssignableListItemTypes(param, flags) { 9473 if (!(flags & 2)) return param; 9506 parseFunctionParamType(param) { 9474 9507 if (this.eat(17)) { 9475 9508 param.optional = true; … … 9725 9758 } = method; 9726 9759 this.raise(TSErrors.AbstractMethodHasImplementation, method, { 9727 methodName: key.type === "Identifier" && !method.computed ? key.name : `[${this.input.slice( key.start, key.end)}]`9760 methodName: key.type === "Identifier" && !method.computed ? key.name : `[${this.input.slice(this.offsetToSourcePos(key.start), this.offsetToSourcePos(key.end))}]` 9728 9761 }); 9729 9762 } … … 9898 9931 var placeholders = superClass => class PlaceholdersParserMixin extends superClass { 9899 9932 parsePlaceholder(expectedNode) { 9900 if (this.match(1 44)) {9933 if (this.match(133)) { 9901 9934 const node = this.startNode(); 9902 9935 this.next(); … … 9904 9937 node.name = super.parseIdentifier(true); 9905 9938 this.assertNoSpace(); 9906 this.expect(1 44);9939 this.expect(133); 9907 9940 return this.finishPlaceholder(node, expectedNode); 9908 9941 } … … 9918 9951 getTokenFromCode(code) { 9919 9952 if (code === 37 && this.input.charCodeAt(this.state.pos + 1) === 37) { 9920 this.finishOp(1 44, 2);9953 this.finishOp(133, 2); 9921 9954 } else { 9922 9955 super.getTokenFromCode(code); … … 9952 9985 } 9953 9986 const nextToken = this.lookahead(); 9954 if (nextToken.type === 1 44) {9987 if (nextToken.type === 133) { 9955 9988 return true; 9956 9989 } … … 9990 10023 const placeholder = this.parsePlaceholder("Identifier"); 9991 10024 if (placeholder) { 9992 if (this.match(81) || this.match(1 44) || this.match(5)) {10025 if (this.match(81) || this.match(133) || this.match(5)) { 9993 10026 node.id = placeholder; 9994 10027 } else if (optionalId || !isStatement) { … … 10026 10059 const next = this.nextTokenStart(); 10027 10060 if (this.isUnparsedContextual(next, "from")) { 10028 if (this.input.startsWith(tokenLabelName(1 44), this.nextTokenStartSince(next + 4))) {10061 if (this.input.startsWith(tokenLabelName(133), this.nextTokenStartSince(next + 4))) { 10029 10062 return true; 10030 10063 } … … 10075 10108 } 10076 10109 assertNoSpace() { 10077 if (this.state.start > this. state.lastTokEndLoc.index) {10110 if (this.state.start > this.offsetToSourcePos(this.state.lastTokEndLoc.index)) { 10078 10111 this.raise(PlaceholderErrors.UnexpectedSpace, this.state.lastTokEndLoc); 10079 10112 } … … 10152 10185 if (pluginsMap.has("moduleAttributes")) { 10153 10186 { 10154 if (pluginsMap.has(" importAttributes") || pluginsMap.has("importAssertions")) {10155 throw new Error("Cannot combine importAssertions, importAttributesand moduleAttributes plugins.");10187 if (pluginsMap.has("deprecatedImportAssert") || pluginsMap.has("importAssertions")) { 10188 throw new Error("Cannot combine importAssertions, deprecatedImportAssert and moduleAttributes plugins."); 10156 10189 } 10157 10190 const moduleAttributesVersionPluginOption = pluginsMap.get("moduleAttributes").version; … … 10161 10194 } 10162 10195 } 10163 if (pluginsMap.has("importAttributes") && pluginsMap.has("importAssertions")) { 10164 throw new Error("Cannot combine importAssertions and importAttributes plugins."); 10196 if (pluginsMap.has("importAssertions")) { 10197 if (pluginsMap.has("deprecatedImportAssert")) { 10198 throw new Error("Cannot combine importAssertions and deprecatedImportAssert plugins."); 10199 } 10200 } 10201 if (!pluginsMap.has("deprecatedImportAssert") && pluginsMap.has("importAttributes") && pluginsMap.get("importAttributes").deprecatedAssertSyntax) { 10202 { 10203 pluginsMap.set("deprecatedImportAssert", {}); 10204 } 10165 10205 } 10166 10206 if (pluginsMap.has("recordAndTuple")) { … … 10193 10233 }; 10194 10234 const mixinPluginNames = Object.keys(mixinPlugins); 10195 const defaultOptions = { 10196 sourceType: "script", 10197 sourceFilename: undefined, 10198 startColumn: 0, 10199 startLine: 1, 10200 allowAwaitOutsideFunction: false, 10201 allowReturnOutsideFunction: false, 10202 allowNewTargetOutsideFunction: false, 10203 allowImportExportEverywhere: false, 10204 allowSuperOutsideMethod: false, 10205 allowUndeclaredExports: false, 10206 plugins: [], 10207 strictMode: null, 10208 ranges: false, 10209 tokens: false, 10210 createImportExpressions: false, 10211 createParenthesizedExpressions: false, 10212 errorRecovery: false, 10213 attachComment: true, 10214 annexB: true 10215 }; 10235 function createDefaultOptions() { 10236 return { 10237 sourceType: "script", 10238 sourceFilename: undefined, 10239 startIndex: 0, 10240 startColumn: 0, 10241 startLine: 1, 10242 allowAwaitOutsideFunction: false, 10243 allowReturnOutsideFunction: false, 10244 allowNewTargetOutsideFunction: false, 10245 allowImportExportEverywhere: false, 10246 allowSuperOutsideMethod: false, 10247 allowUndeclaredExports: false, 10248 plugins: [], 10249 strictMode: null, 10250 ranges: false, 10251 tokens: false, 10252 createImportExpressions: false, 10253 createParenthesizedExpressions: false, 10254 errorRecovery: false, 10255 attachComment: true, 10256 annexB: true 10257 }; 10258 } 10216 10259 function getOptions(opts) { 10260 const options = createDefaultOptions(); 10217 10261 if (opts == null) { 10218 return Object.assign({}, defaultOptions);10262 return options; 10219 10263 } 10220 10264 if (opts.annexB != null && opts.annexB !== false) { 10221 10265 throw new Error("The `annexB` option can only be set to `false`."); 10222 10266 } 10223 const options = {}; 10224 for (const key of Object.keys(defaultOptions)) { 10225 var _opts$key; 10226 options[key] = (_opts$key = opts[key]) != null ? _opts$key : defaultOptions[key]; 10267 for (const key of Object.keys(options)) { 10268 if (opts[key] != null) options[key] = opts[key]; 10269 } 10270 if (options.startLine === 1) { 10271 if (opts.startIndex == null && options.startColumn > 0) { 10272 options.startIndex = options.startColumn; 10273 } else if (opts.startColumn == null && options.startIndex > 0) { 10274 options.startColumn = options.startIndex; 10275 } 10276 } else if (opts.startColumn == null || opts.startIndex == null) { 10277 if (opts.startIndex != null) { 10278 throw new Error("With a `startLine > 1` you must also specify `startIndex` and `startColumn`."); 10279 } 10227 10280 } 10228 10281 return options; … … 10253 10306 } 10254 10307 shouldExitDescending(expr, potentialArrowAt) { 10255 return expr.type === "ArrowFunctionExpression" && expr.start=== potentialArrowAt;10308 return expr.type === "ArrowFunctionExpression" && this.offsetToSourcePos(expr.start) === potentialArrowAt; 10256 10309 } 10257 10310 getExpression() { … … 10259 10312 this.nextToken(); 10260 10313 const expr = this.parseExpression(); 10261 if (!this.match(1 39)) {10314 if (!this.match(140)) { 10262 10315 this.unexpected(); 10263 10316 } … … 10379 10432 } 10380 10433 parseMaybeUnaryOrPrivate(refExpressionErrors) { 10381 return this.match(13 8) ? this.parsePrivateName() : this.parseMaybeUnary(refExpressionErrors);10434 return this.match(139) ? this.parsePrivateName() : this.parseMaybeUnary(refExpressionErrors); 10382 10435 } 10383 10436 parseExprOps(refExpressionErrors) { … … 10618 10671 node.property = this.parseExpression(); 10619 10672 this.expect(3); 10620 } else if (this.match(13 8)) {10673 } else if (this.match(139)) { 10621 10674 if (base.type === "Super") { 10622 10675 this.raise(Errors.SuperPrivateField, startLoc); … … 10663 10716 node.arguments = this.parseCallExpressionArguments(11); 10664 10717 } else { 10665 node.arguments = this.parseCallExpressionArguments(11, base.type === "Import", base.type!== "Super", node, refExpressionErrors);10718 node.arguments = this.parseCallExpressionArguments(11, base.type !== "Super", node, refExpressionErrors); 10666 10719 } 10667 10720 let finishedNode = this.finishCallExpression(node, optionalChainMember); … … 10695 10748 } 10696 10749 atPossibleAsyncArrow(base) { 10697 return base.type === "Identifier" && base.name === "async" && this.state.lastTokEndLoc.index === base.end && !this.canInsertSemicolon() && base.end - base.start === 5 && base.start === this.state.potentialArrowAt; 10698 } 10699 expectImportAttributesPlugin() { 10700 if (!this.hasPlugin("importAssertions")) { 10701 this.expectPlugin("importAttributes"); 10702 } 10750 return base.type === "Identifier" && base.name === "async" && this.state.lastTokEndLoc.index === base.end && !this.canInsertSemicolon() && base.end - base.start === 5 && this.offsetToSourcePos(base.start) === this.state.potentialArrowAt; 10703 10751 } 10704 10752 finishCallExpression(node, optional) { 10705 10753 if (node.callee.type === "Import") { 10706 if (node.arguments.length === 2) {10707 {10708 if (!this.hasPlugin("moduleAttributes")) {10709 this.expectImportAttributesPlugin();10710 }10711 }10712 }10713 10754 if (node.arguments.length === 0 || node.arguments.length > 2) { 10714 this.raise(Errors.ImportCallArity, node, { 10715 maxArgumentCount: this.hasPlugin("importAttributes") || this.hasPlugin("importAssertions") || this.hasPlugin("moduleAttributes") ? 2 : 1 10716 }); 10755 this.raise(Errors.ImportCallArity, node); 10717 10756 } else { 10718 10757 for (const arg of node.arguments) { … … 10725 10764 return this.finishNode(node, optional ? "OptionalCallExpression" : "CallExpression"); 10726 10765 } 10727 parseCallExpressionArguments(close, dynamicImport,allowPlaceholder, nodeForExtra, refExpressionErrors) {10766 parseCallExpressionArguments(close, allowPlaceholder, nodeForExtra, refExpressionErrors) { 10728 10767 const elts = []; 10729 10768 let first = true; … … 10736 10775 this.expect(12); 10737 10776 if (this.match(close)) { 10738 if (dynamicImport && !this.hasPlugin("importAttributes") && !this.hasPlugin("importAssertions") && !this.hasPlugin("moduleAttributes")) {10739 this.raise(Errors.ImportCallArgumentTrailingComma, this.state.lastTokStartLoc);10740 }10741 10777 if (nodeForExtra) { 10742 10778 this.addTrailingCommaExtraToNode(nodeForExtra); … … 10810 10846 return this.parseRegExpLiteral(this.state.value); 10811 10847 } 10848 case 135: 10849 return this.parseNumericLiteral(this.state.value); 10850 case 136: 10851 return this.parseBigIntLiteral(this.state.value); 10812 10852 case 134: 10813 return this.parseNumericLiteral(this.state.value);10814 case 135:10815 return this.parseBigIntLiteral(this.state.value);10816 case 136:10817 return this.parseDecimalLiteral(this.state.value);10818 case 133:10819 10853 return this.parseStringLiteral(this.state.value); 10820 10854 case 84: … … 10870 10904 } 10871 10905 } 10872 case 13 8:10906 case 139: 10873 10907 { 10874 10908 this.raise(Errors.PrivateInExpectedIn, this.state.startLoc, { … … 10912 10946 } 10913 10947 default: 10948 if (type === 137) { 10949 return this.parseDecimalLiteral(this.state.value); 10950 } 10914 10951 if (tokenIsIdentifier(type)) { 10915 10952 if (this.isContextual(127) && this.lookaheadInLineCharCode() === 123) { … … 11098 11135 parseLiteralAtNode(value, type, node) { 11099 11136 this.addExtra(node, "rawValue", value); 11100 this.addExtra(node, "raw", this.input.slice( node.start, this.state.end));11137 this.addExtra(node, "raw", this.input.slice(this.offsetToSourcePos(node.start), this.state.end)); 11101 11138 node.value = value; 11102 11139 this.next(); … … 11121 11158 parseRegExpLiteral(value) { 11122 11159 const node = this.startNode(); 11123 this.addExtra(node, "raw", this.input.slice( node.start, this.state.end));11160 this.addExtra(node, "raw", this.input.slice(this.offsetToSourcePos(node.start), this.state.end)); 11124 11161 node.pattern = value.pattern; 11125 11162 node.flags = value.flags; … … 11492 11529 } else { 11493 11530 switch (type) { 11494 case 13 4:11531 case 135: 11495 11532 key = this.parseNumericLiteral(value); 11496 11533 break; 11497 case 13 3:11534 case 134: 11498 11535 key = this.parseStringLiteral(value); 11499 11536 break; 11500 case 13 5:11537 case 136: 11501 11538 key = this.parseBigIntLiteral(value); 11502 11539 break; 11503 case 136: 11504 key = this.parseDecimalLiteral(value); 11505 break; 11506 case 138: 11540 case 139: 11507 11541 { 11508 11542 const privateKeyLoc = this.state.startLoc; … … 11518 11552 } 11519 11553 default: 11554 if (type === 137) { 11555 key = this.parseDecimalLiteral(value); 11556 break; 11557 } 11520 11558 this.unexpected(); 11521 11559 } 11522 11560 } 11523 11561 prop.key = key; 11524 if (type !== 13 8) {11562 if (type !== 139) { 11525 11563 prop.computed = false; 11526 11564 } … … 11776 11814 type 11777 11815 } = this.state; 11778 return type === 53 || type === 10 || type === 0 || tokenIsTemplate(type) || type === 102 && !this.state.containsEsc || type === 13 7|| type === 56 || this.hasPlugin("v8intrinsic") && type === 54;11816 return type === 53 || type === 10 || type === 0 || tokenIsTemplate(type) || type === 102 && !this.state.containsEsc || type === 138 || type === 56 || this.hasPlugin("v8intrinsic") && type === 54; 11779 11817 } 11780 11818 parseYield() { … … 11788 11826 switch (this.state.type) { 11789 11827 case 13: 11790 case 1 39:11828 case 140: 11791 11829 case 8: 11792 11830 case 11: … … 11807 11845 this.next(); 11808 11846 node.source = this.parseMaybeAssignAllowIn(); 11809 if (this.hasPlugin("importAttributes") || this.hasPlugin("importAssertions")) { 11810 node.options = null; 11811 } 11847 node.options = null; 11812 11848 if (this.eat(12)) { 11813 this.expectImportAttributesPlugin();11814 11849 if (!this.match(11)) { 11815 11850 node.options = this.parseMaybeAssignAllowIn(); 11816 this.eat(12); 11851 if (this.eat(12) && !this.match(11)) { 11852 do { 11853 this.parseMaybeAssignAllowIn(); 11854 } while (this.eat(12) && !this.match(11)); 11855 this.raise(Errors.ImportCallArity, node); 11856 } 11817 11857 } 11818 11858 } … … 11970 12010 const loneSurrogate = /[\uD800-\uDFFF]/u; 11971 12011 const keywordRelationalOperator = /in(?:stanceof)?/y; 11972 function babel7CompatTokens(tokens, input ) {12012 function babel7CompatTokens(tokens, input, startIndex) { 11973 12013 for (let i = 0; i < tokens.length; i++) { 11974 12014 const token = tokens[i]; … … 11978 12018 if (typeof type === "number") { 11979 12019 { 11980 if (type === 13 8) {12020 if (type === 139) { 11981 12021 const { 11982 12022 loc, … … 12015 12055 const backquoteEndLoc = createPositionWithColumnOffset(loc.start, 1); 12016 12056 let startToken; 12017 if (input.charCodeAt(start ) === 96) {12057 if (input.charCodeAt(start - startIndex) === 96) { 12018 12058 startToken = new Token({ 12019 12059 type: getExportedToken(22), … … 12082 12122 file.comments = this.comments; 12083 12123 if (this.options.tokens) { 12084 file.tokens = babel7CompatTokens(this.tokens, this.input );12124 file.tokens = babel7CompatTokens(this.tokens, this.input, this.startIndex); 12085 12125 } 12086 12126 return this.finishNode(file, "File"); 12087 12127 } 12088 parseProgram(program, end = 1 39, sourceType = this.options.sourceType) {12128 parseProgram(program, end = 140, sourceType = this.options.sourceType) { 12089 12129 program.sourceType = sourceType; 12090 12130 program.interpreter = this.parseInterpreterDirective(); … … 12101 12141 } 12102 12142 let finishedProgram; 12103 if (end === 1 39) {12143 if (end === 140) { 12104 12144 finishedProgram = this.finishNode(program, "Program"); 12105 12145 } else { … … 12115 12155 const directiveLiteral = directive.value; 12116 12156 const expressionValue = directiveLiteral.value; 12117 const raw = this.input.slice( directiveLiteral.start, directiveLiteral.end);12157 const raw = this.input.slice(this.offsetToSourcePos(directiveLiteral.start), this.offsetToSourcePos(directiveLiteral.end)); 12118 12158 const val = directiveLiteral.value = raw.slice(1, -1); 12119 12159 this.addExtra(directiveLiteral, "raw", raw); … … 12422 12462 const node = this.startNodeAt(startLoc); 12423 12463 node.object = expr; 12424 if (this.match(13 8)) {12464 if (this.match(139)) { 12425 12465 this.classScope.usePrivateName(this.state.value, this.state.startLoc); 12426 12466 node.property = this.parsePrivateName(); … … 12442 12482 const node = this.startNodeAtNode(expr); 12443 12483 node.callee = expr; 12444 node.arguments = this.parseCallExpressionArguments(11 , false);12484 node.arguments = this.parseCallExpressionArguments(11); 12445 12485 this.toReferencedList(node.arguments); 12446 12486 return this.finishNode(node, "CallExpression"); … … 12719 12759 const label = this.state.labels[i]; 12720 12760 if (label.statementStart === node.start) { 12721 label.statementStart = this.s tate.start;12761 label.statementStart = this.sourceToOffsetPos(this.state.start); 12722 12762 label.kind = kind; 12723 12763 } else { … … 12728 12768 name: maybeName, 12729 12769 kind: kind, 12730 statementStart: this.s tate.start12770 statementStart: this.sourceToOffsetPos(this.state.start) 12731 12771 }); 12732 12772 node.body = flags & 8 ? this.parseStatementOrSloppyAnnexBFunctionDeclaration(true) : this.parseStatement(); … … 13025 13065 if (this.eat(55)) { 13026 13066 method.kind = "method"; 13027 const isPrivateName = this.match(13 8);13067 const isPrivateName = this.match(139); 13028 13068 this.parseClassElementName(method); 13029 13069 if (isPrivateName) { … … 13076 13116 } 13077 13117 method.kind = "method"; 13078 const isPrivate = this.match(13 8);13118 const isPrivate = this.match(139); 13079 13119 this.parseClassElementName(method); 13080 13120 this.parsePostMemberNameModifiers(publicMember); … … 13090 13130 this.resetPreviousNodeTrailingComments(key); 13091 13131 method.kind = maybeContextualKw; 13092 const isPrivate = this.match(13 8);13132 const isPrivate = this.match(139); 13093 13133 this.parseClassElementName(publicMethod); 13094 13134 if (isPrivate) { … … 13104 13144 this.expectPlugin("decoratorAutoAccessors"); 13105 13145 this.resetPreviousNodeTrailingComments(key); 13106 const isPrivate = this.match(13 8);13146 const isPrivate = this.match(139); 13107 13147 this.parseClassElementName(publicProp); 13108 13148 this.pushClassAccessorProperty(classBody, accessorProp, isPrivate); … … 13122 13162 value 13123 13163 } = this.state; 13124 if ((type === 132 || type === 13 3) && member.static && value === "prototype") {13164 if ((type === 132 || type === 134) && member.static && value === "prototype") { 13125 13165 this.raise(Errors.StaticPrototype, this.state.startLoc); 13126 13166 } 13127 if (type === 13 8) {13167 if (type === 139) { 13128 13168 if (value === "constructor") { 13129 13169 this.raise(Errors.ConstructorClassPrivateField, this.state.startLoc); … … 13536 13576 } 13537 13577 const isMaybeTypeOnly = this.isContextual(130); 13538 const isString = this.match(13 3);13578 const isString = this.match(134); 13539 13579 const node = this.startNode(); 13540 13580 node.local = this.parseModuleExportName(); … … 13554 13594 } 13555 13595 parseModuleExportName() { 13556 if (this.match(13 3)) {13596 if (this.match(134)) { 13557 13597 const result = this.parseStringLiteral(this.state.value); 13558 13598 const surrogate = loneSurrogate.exec(result.value); … … 13673 13713 } 13674 13714 parseImport(node) { 13675 if (this.match(13 3)) {13715 if (this.match(134)) { 13676 13716 return this.parseImportSourceAndAttributes(node); 13677 13717 } … … 13698 13738 } 13699 13739 parseImportSource() { 13700 if (!this.match(13 3)) this.unexpected();13740 if (!this.match(134)) this.unexpected(); 13701 13741 return this.parseExprAtom(); 13702 13742 } … … 13727 13767 } 13728 13768 attrNames.add(keyName); 13729 if (this.match(13 3)) {13769 if (this.match(134)) { 13730 13770 node.key = this.parseStringLiteral(keyName); 13731 13771 } else { … … 13733 13773 } 13734 13774 this.expect(14); 13735 if (!this.match(13 3)) {13775 if (!this.match(134)) { 13736 13776 throw this.raise(Errors.ModuleAttributeInvalidValue, this.state.startLoc); 13737 13777 } … … 13758 13798 attributes.add(node.key.name); 13759 13799 this.expect(14); 13760 if (!this.match(13 3)) {13800 if (!this.match(134)) { 13761 13801 throw this.raise(Errors.ModuleAttributeInvalidValue, this.state.startLoc); 13762 13802 } … … 13768 13808 maybeParseImportAttributes(node) { 13769 13809 let attributes; 13770 let useWith = false; 13810 { 13811 var useWith = false; 13812 } 13771 13813 if (this.match(76)) { 13772 13814 if (this.hasPrecedingLineBreak() && this.lookaheadCharCode() === 40) { … … 13774 13816 } 13775 13817 this.next(); 13818 if (this.hasPlugin("moduleAttributes")) { 13819 attributes = this.parseModuleAttributes(); 13820 } else { 13821 attributes = this.parseImportAttributes(); 13822 } 13776 13823 { 13777 if (this.hasPlugin("moduleAttributes")) { 13778 attributes = this.parseModuleAttributes(); 13779 } else { 13780 this.expectImportAttributesPlugin(); 13781 attributes = this.parseImportAttributes(); 13782 } 13783 } 13784 useWith = true; 13824 useWith = true; 13825 } 13785 13826 } else if (this.isContextual(94) && !this.hasPrecedingLineBreak()) { 13786 if ( this.hasPlugin("importAttributes")) {13787 if (this.getPluginOption("importAttributes", "deprecatedAssertSyntax") !== true) {13788 this.raise(Errors.ImportAttributesUseAssert, this.state.startLoc);13789 }13827 if (!this.hasPlugin("deprecatedImportAssert") && !this.hasPlugin("importAssertions")) { 13828 this.raise(Errors.ImportAttributesUseAssert, this.state.startLoc); 13829 } 13830 if (!this.hasPlugin("importAssertions")) { 13790 13831 this.addExtra(node, "deprecatedAssertSyntax", true); 13791 } else {13792 this.expectOnePlugin(["importAttributes", "importAssertions"]);13793 13832 } 13794 13833 this.next(); 13795 13834 attributes = this.parseImportAttributes(); 13796 } else if (this.hasPlugin("importAttributes") || this.hasPlugin("importAssertions")){13835 } else { 13797 13836 attributes = []; 13798 } else {13799 if (this.hasPlugin("moduleAttributes")) {13800 attributes = [];13801 } else return;13802 13837 } 13803 13838 if (!useWith && this.hasPlugin("importAssertions")) { … … 13843 13878 } 13844 13879 const specifier = this.startNode(); 13845 const importedIsString = this.match(13 3);13880 const importedIsString = this.match(134); 13846 13881 const isMaybeTypeOnly = this.isContextual(130); 13847 13882 specifier.imported = this.parseModuleExportName(); … … 13881 13916 this.plugins = pluginsMap; 13882 13917 this.filename = options.sourceFilename; 13918 this.startIndex = options.startIndex; 13883 13919 } 13884 13920 getScopeHandler() {
Note:
See TracChangeset
for help on using the changeset viewer.