mirror of
https://github.com/S2-/minifyfromhtml.git
synced 2025-08-02 12:00:03 +02:00
update modules
This commit is contained in:
68
node_modules/acorn/CHANGELOG.md
generated
vendored
68
node_modules/acorn/CHANGELOG.md
generated
vendored
@@ -1,9 +1,71 @@
|
||||
## 6.4.0 (2019-11-26)
|
||||
## 7.3.1 (2020-06-11)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Make the string in the `version` export match the actual library version.
|
||||
|
||||
## 7.3.0 (2020-06-11)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix a bug that caused parsing of object patterns with a property named `set` that had a default value to fail.
|
||||
|
||||
### New features
|
||||
|
||||
Add support for optional chaining (`?.`).
|
||||
|
||||
## 7.2.0 (2020-05-09)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix precedence issue in parsing of async arrow functions.
|
||||
|
||||
### New features
|
||||
|
||||
Add support for nullish coalescing.
|
||||
|
||||
Add support for `import.meta`.
|
||||
|
||||
Support `export * as ...` syntax.
|
||||
|
||||
Upgrade to Unicode 13.
|
||||
|
||||
## 6.4.1 (2020-03-09)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
More carefully check for valid UTF16 surrogate pairs in regexp validator.
|
||||
|
||||
## 7.1.1 (2020-03-01)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Treat `\8` and `\9` as invalid escapes in template strings.
|
||||
|
||||
Allow unicode escapes in property names that are keywords.
|
||||
|
||||
Don't error on an exponential operator expression as argument to `await`.
|
||||
|
||||
More carefully check for valid UTF16 surrogate pairs in regexp validator.
|
||||
|
||||
## 7.1.0 (2019-09-24)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Disallow trailing object literal commas when ecmaVersion is less than 5.
|
||||
|
||||
### New features
|
||||
|
||||
Add a static `acorn` property to the `Parser` class that contains the entire module interface, to allow plugins to access the instance of the library that they are acting on.
|
||||
|
||||
## 7.0.0 (2019-08-13)
|
||||
|
||||
### Breaking changes
|
||||
|
||||
Changes the node format for dynamic imports to use the `ImportExpression` node type, as defined in [ESTree](https://github.com/estree/estree/blob/master/es2020.md#importexpression).
|
||||
|
||||
Makes 10 (ES2019) the default value for the `ecmaVersion` option.
|
||||
|
||||
## 6.3.0 (2019-08-12)
|
||||
|
||||
### New features
|
||||
@@ -28,9 +90,9 @@ Disallow binding `let` in patterns.
|
||||
|
||||
### New features
|
||||
|
||||
Support bigint syntax with `ecmaVersion` >= 10.
|
||||
Support bigint syntax with `ecmaVersion` >= 11.
|
||||
|
||||
Support dynamic `import` syntax with `ecmaVersion` >= 10.
|
||||
Support dynamic `import` syntax with `ecmaVersion` >= 11.
|
||||
|
||||
Upgrade to Unicode version 12.
|
||||
|
||||
|
7
node_modules/acorn/README.md
generated
vendored
7
node_modules/acorn/README.md
generated
vendored
@@ -52,9 +52,10 @@ Options can be provided by passing a second argument, which should be
|
||||
an object containing any of these fields:
|
||||
|
||||
- **ecmaVersion**: Indicates the ECMAScript version to parse. Must be
|
||||
either 3, 5, 6 (2015), 7 (2016), 8 (2017), 9 (2018) or 10 (2019, partial
|
||||
support). This influences support for strict mode, the set of
|
||||
reserved words, and support for new syntax features. Default is 9.
|
||||
either 3, 5, 6 (2015), 7 (2016), 8 (2017), 9 (2018), 10 (2019) or 11
|
||||
(2020, partial support). This influences support for strict mode,
|
||||
the set of reserved words, and support for new syntax features.
|
||||
Default is 10.
|
||||
|
||||
**NOTE**: Only 'stage 4' (finalized) ECMAScript features are being
|
||||
implemented by Acorn. Other proposed new features can be implemented
|
||||
|
2
node_modules/acorn/dist/acorn.d.ts
generated
vendored
2
node_modules/acorn/dist/acorn.d.ts
generated
vendored
@@ -12,7 +12,7 @@ declare namespace acorn {
|
||||
}
|
||||
|
||||
interface Options {
|
||||
ecmaVersion?: 3 | 5 | 6 | 7 | 8 | 9 | 10 | 2015 | 2016 | 2017 | 2018 | 2019
|
||||
ecmaVersion?: 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020
|
||||
sourceType?: 'script' | 'module'
|
||||
onInsertedSemicolon?: (lastTokEnd: number, lastTokEndLoc?: Position) => void
|
||||
onTrailingComma?: (lastTokEnd: number, lastTokEndLoc?: Position) => void
|
||||
|
362
node_modules/acorn/dist/acorn.js
generated
vendored
362
node_modules/acorn/dist/acorn.js
generated
vendored
@@ -2,7 +2,7 @@
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
||||
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
||||
(global = global || self, factory(global.acorn = {}));
|
||||
}(this, function (exports) { 'use strict';
|
||||
}(this, (function (exports) { 'use strict';
|
||||
|
||||
// Reserved word lists for various dialects of the language
|
||||
|
||||
@@ -33,8 +33,8 @@
|
||||
// are only applied when a character is found to actually have a
|
||||
// code point above 128.
|
||||
// Generated by `bin/generate-identifier-regex.js`.
|
||||
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\u08a0-\u08b4\u08b6-\u08bd\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\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\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-\u170c\u170e-\u1711\u1720-\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-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\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-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fef\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7bf\ua7c2-\ua7c6\ua7f7-\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-\uab67\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";
|
||||
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\u08d3-\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\u0b56\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\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\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ecd\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-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\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-\u1df9\u1dfb-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\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";
|
||||
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\u08a0-\u08b4\u08b6-\u08c7\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\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\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-\u170c\u170e-\u1711\u1720-\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-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\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-\u9ffc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7bf\ua7c2-\ua7ca\ua7f5-\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";
|
||||
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\u08d3-\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\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\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-\u0ecd\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-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf\u1ac0\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-\u1df9\u1dfb-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\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";
|
||||
|
||||
var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]");
|
||||
var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]");
|
||||
@@ -48,10 +48,10 @@
|
||||
// generated by bin/generate-identifier-regex.js
|
||||
|
||||
// eslint-disable-next-line comma-spacing
|
||||
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,157,310,10,21,11,7,153,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,477,28,11,0,9,21,155,22,13,52,76,44,33,24,27,35,30,0,12,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,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,0,33,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,230,43,117,63,32,0,161,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,35,56,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,270,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,754,9486,286,50,2,18,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,2357,44,11,6,17,0,370,43,1301,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,42710,42,4148,12,221,3,5761,15,7472,3104,541];
|
||||
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,157,310,10,21,11,7,153,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,107,20,28,22,13,52,76,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,85,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,230,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,35,56,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,190,0,80,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,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,8952,286,50,2,18,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,2357,44,11,6,17,0,370,43,1301,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,42717,35,4148,12,221,3,5761,15,7472,3104,541,1507,4938];
|
||||
|
||||
// eslint-disable-next-line comma-spacing
|
||||
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,525,10,176,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,4,9,83,11,7,0,161,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,232,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,19306,9,135,4,60,6,26,9,1014,0,2,54,8,3,19723,1,5319,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,262,6,10,9,419,13,1495,6,110,6,6,9,792487,239];
|
||||
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,370,1,154,10,176,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,161,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,19306,9,135,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,5319,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,262,6,10,9,419,13,1495,6,110,6,6,9,4759,9,787719,239];
|
||||
|
||||
// This has a complexity linear to the value of the code. The
|
||||
// assumption is that looking up astral identifier characters is
|
||||
@@ -166,6 +166,7 @@
|
||||
colon: new TokenType(":", beforeExpr),
|
||||
dot: new TokenType("."),
|
||||
question: new TokenType("?", beforeExpr),
|
||||
questionDot: new TokenType("?."),
|
||||
arrow: new TokenType("=>", beforeExpr),
|
||||
template: new TokenType("template"),
|
||||
invalidTemplate: new TokenType("invalidTemplate"),
|
||||
@@ -204,6 +205,7 @@
|
||||
star: binop("*", 10),
|
||||
slash: binop("/", 10),
|
||||
starstar: new TokenType("**", {beforeExpr: true}),
|
||||
coalesce: binop("??", 1),
|
||||
|
||||
// Keyword token types.
|
||||
_break: kw("break"),
|
||||
@@ -320,8 +322,8 @@
|
||||
// either 3, 5, 6 (2015), 7 (2016), 8 (2017), 9 (2018), or 10
|
||||
// (2019). This influences support for strict mode, the set of
|
||||
// reserved words, and support for new syntax features. The default
|
||||
// is 9.
|
||||
ecmaVersion: 9,
|
||||
// is 10.
|
||||
ecmaVersion: 10,
|
||||
// `sourceType` indicates the mode the code should be parsed in.
|
||||
// Can be either `"script"` or `"module"`. This influences global
|
||||
// strict mode and parsing of `import` and `export` declarations.
|
||||
@@ -600,7 +602,14 @@
|
||||
start += skipWhiteSpace.exec(this.input)[0].length;
|
||||
var match = literal.exec(this.input.slice(start));
|
||||
if (!match) { return false }
|
||||
if ((match[1] || match[2]) === "use strict") { return true }
|
||||
if ((match[1] || match[2]) === "use strict") {
|
||||
skipWhiteSpace.lastIndex = start + match[0].length;
|
||||
var spaceAfter = skipWhiteSpace.exec(this.input), end = spaceAfter.index + spaceAfter[0].length;
|
||||
var next = this.input.charAt(end);
|
||||
return next === ";" || next === "}" ||
|
||||
(lineBreak.test(spaceAfter[0]) &&
|
||||
!(/[(`.[+\-/*%<>=,?^&]/.test(next) || next === "!" && this.input.charAt(end + 1) === "="))
|
||||
}
|
||||
start += match[0].length;
|
||||
|
||||
// Skip semicolon, if any.
|
||||
@@ -850,7 +859,7 @@
|
||||
skipWhiteSpace.lastIndex = this.pos;
|
||||
var skip = skipWhiteSpace.exec(this.input);
|
||||
var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next);
|
||||
if (nextCh === 40) // '('
|
||||
if (nextCh === 40 || nextCh === 46) // '(' or '.'
|
||||
{ return this.parseExpressionStatement(node, this.parseExpression()) }
|
||||
}
|
||||
|
||||
@@ -1150,17 +1159,19 @@
|
||||
// strict"` declarations when `allowStrict` is true (used for
|
||||
// function bodies).
|
||||
|
||||
pp$1.parseBlock = function(createNewLexicalScope, node) {
|
||||
pp$1.parseBlock = function(createNewLexicalScope, node, exitStrict) {
|
||||
if ( createNewLexicalScope === void 0 ) createNewLexicalScope = true;
|
||||
if ( node === void 0 ) node = this.startNode();
|
||||
|
||||
node.body = [];
|
||||
this.expect(types.braceL);
|
||||
if (createNewLexicalScope) { this.enterScope(0); }
|
||||
while (!this.eat(types.braceR)) {
|
||||
while (this.type !== types.braceR) {
|
||||
var stmt = this.parseStatement(null);
|
||||
node.body.push(stmt);
|
||||
}
|
||||
if (exitStrict) { this.strict = false; }
|
||||
this.next();
|
||||
if (createNewLexicalScope) { this.exitScope(); }
|
||||
return this.finishNode(node, "BlockStatement")
|
||||
};
|
||||
@@ -1311,7 +1322,7 @@
|
||||
var hadConstructor = false;
|
||||
classBody.body = [];
|
||||
this.expect(types.braceL);
|
||||
while (!this.eat(types.braceR)) {
|
||||
while (this.type !== types.braceR) {
|
||||
var element = this.parseClassElement(node.superClass !== null);
|
||||
if (element) {
|
||||
classBody.body.push(element);
|
||||
@@ -1321,8 +1332,9 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
node.body = this.finishNode(classBody, "ClassBody");
|
||||
this.strict = oldStrict;
|
||||
this.next();
|
||||
node.body = this.finishNode(classBody, "ClassBody");
|
||||
return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression")
|
||||
};
|
||||
|
||||
@@ -1410,6 +1422,14 @@
|
||||
this.next();
|
||||
// export * from '...'
|
||||
if (this.eat(types.star)) {
|
||||
if (this.options.ecmaVersion >= 11) {
|
||||
if (this.eatContextual("as")) {
|
||||
node.exported = this.parseIdent(true);
|
||||
this.checkExport(exports, node.exported.name, this.lastTokStart);
|
||||
} else {
|
||||
node.exported = null;
|
||||
}
|
||||
}
|
||||
this.expectContextual("from");
|
||||
if (this.type !== types.string) { this.unexpected(); }
|
||||
node.source = this.parseExprAtom();
|
||||
@@ -1686,6 +1706,10 @@
|
||||
this.toAssignable(node.expression, isBinding, refDestructuringErrors);
|
||||
break
|
||||
|
||||
case "ChainExpression":
|
||||
this.raiseRecoverable(node.start, "Optional chaining cannot appear in left-hand side");
|
||||
break
|
||||
|
||||
case "MemberExpression":
|
||||
if (!isBinding) { break }
|
||||
|
||||
@@ -1816,6 +1840,10 @@
|
||||
if (bindingType !== BIND_NONE && bindingType !== BIND_OUTSIDE) { this.declareName(expr.name, bindingType, expr.start); }
|
||||
break
|
||||
|
||||
case "ChainExpression":
|
||||
this.raiseRecoverable(expr.start, "Optional chaining cannot appear in left-hand side");
|
||||
break
|
||||
|
||||
case "MemberExpression":
|
||||
if (bindingType) { this.raiseRecoverable(expr.start, "Binding member expression"); }
|
||||
break
|
||||
@@ -1884,9 +1912,11 @@
|
||||
if (this.options.ecmaVersion >= 6) {
|
||||
if (name === "__proto__" && kind === "init") {
|
||||
if (propHash.proto) {
|
||||
if (refDestructuringErrors && refDestructuringErrors.doubleProto < 0) { refDestructuringErrors.doubleProto = key.start; }
|
||||
// Backwards-compat kludge. Can be removed in version 6.0
|
||||
else { this.raiseRecoverable(key.start, "Redefinition of __proto__ property"); }
|
||||
if (refDestructuringErrors) {
|
||||
if (refDestructuringErrors.doubleProto < 0)
|
||||
{ refDestructuringErrors.doubleProto = key.start; }
|
||||
// Backwards-compat kludge. Can be removed in version 6.0
|
||||
} else { this.raiseRecoverable(key.start, "Redefinition of __proto__ property"); }
|
||||
}
|
||||
propHash.proto = true;
|
||||
}
|
||||
@@ -1951,12 +1981,11 @@
|
||||
else { this.exprAllowed = false; }
|
||||
}
|
||||
|
||||
var ownDestructuringErrors = false, oldParenAssign = -1, oldTrailingComma = -1, oldShorthandAssign = -1;
|
||||
var ownDestructuringErrors = false, oldParenAssign = -1, oldTrailingComma = -1;
|
||||
if (refDestructuringErrors) {
|
||||
oldParenAssign = refDestructuringErrors.parenthesizedAssign;
|
||||
oldTrailingComma = refDestructuringErrors.trailingComma;
|
||||
oldShorthandAssign = refDestructuringErrors.shorthandAssign;
|
||||
refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = refDestructuringErrors.shorthandAssign = -1;
|
||||
refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = -1;
|
||||
} else {
|
||||
refDestructuringErrors = new DestructuringErrors;
|
||||
ownDestructuringErrors = true;
|
||||
@@ -1971,8 +2000,11 @@
|
||||
var node = this.startNodeAt(startPos, startLoc);
|
||||
node.operator = this.value;
|
||||
node.left = this.type === types.eq ? this.toAssignable(left, false, refDestructuringErrors) : left;
|
||||
if (!ownDestructuringErrors) { DestructuringErrors.call(refDestructuringErrors); }
|
||||
refDestructuringErrors.shorthandAssign = -1; // reset because shorthand default was used correctly
|
||||
if (!ownDestructuringErrors) {
|
||||
refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = refDestructuringErrors.doubleProto = -1;
|
||||
}
|
||||
if (refDestructuringErrors.shorthandAssign >= node.left.start)
|
||||
{ refDestructuringErrors.shorthandAssign = -1; } // reset because shorthand default was used correctly
|
||||
this.checkLVal(left);
|
||||
this.next();
|
||||
node.right = this.parseMaybeAssign(noIn);
|
||||
@@ -1982,7 +2014,6 @@
|
||||
}
|
||||
if (oldParenAssign > -1) { refDestructuringErrors.parenthesizedAssign = oldParenAssign; }
|
||||
if (oldTrailingComma > -1) { refDestructuringErrors.trailingComma = oldTrailingComma; }
|
||||
if (oldShorthandAssign > -1) { refDestructuringErrors.shorthandAssign = oldShorthandAssign; }
|
||||
return left
|
||||
};
|
||||
|
||||
@@ -2023,11 +2054,20 @@
|
||||
if (prec != null && (!noIn || this.type !== types._in)) {
|
||||
if (prec > minPrec) {
|
||||
var logical = this.type === types.logicalOR || this.type === types.logicalAND;
|
||||
var coalesce = this.type === types.coalesce;
|
||||
if (coalesce) {
|
||||
// Handle the precedence of `tt.coalesce` as equal to the range of logical expressions.
|
||||
// In other words, `node.right` shouldn't contain logical expressions in order to check the mixed error.
|
||||
prec = types.logicalAND.binop;
|
||||
}
|
||||
var op = this.value;
|
||||
this.next();
|
||||
var startPos = this.start, startLoc = this.startLoc;
|
||||
var right = this.parseExprOp(this.parseMaybeUnary(null, false), startPos, startLoc, prec, noIn);
|
||||
var node = this.buildBinary(leftStartPos, leftStartLoc, left, right, op, logical);
|
||||
var node = this.buildBinary(leftStartPos, leftStartLoc, left, right, op, logical || coalesce);
|
||||
if ((logical && this.type === types.coalesce) || (coalesce && (this.type === types.logicalOR || this.type === types.logicalAND))) {
|
||||
this.raiseRecoverable(this.start, "Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses");
|
||||
}
|
||||
return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, noIn)
|
||||
}
|
||||
}
|
||||
@@ -2087,8 +2127,8 @@
|
||||
pp$3.parseExprSubscripts = function(refDestructuringErrors) {
|
||||
var startPos = this.start, startLoc = this.startLoc;
|
||||
var expr = this.parseExprAtom(refDestructuringErrors);
|
||||
var skipArrowSubscripts = expr.type === "ArrowFunctionExpression" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== ")";
|
||||
if (this.checkExpressionErrors(refDestructuringErrors) || skipArrowSubscripts) { return expr }
|
||||
if (expr.type === "ArrowFunctionExpression" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== ")")
|
||||
{ return expr }
|
||||
var result = this.parseSubscripts(expr, startPos, startLoc);
|
||||
if (refDestructuringErrors && result.type === "MemberExpression") {
|
||||
if (refDestructuringErrors.parenthesizedAssign >= result.start) { refDestructuringErrors.parenthesizedAssign = -1; }
|
||||
@@ -2099,30 +2139,50 @@
|
||||
|
||||
pp$3.parseSubscripts = function(base, startPos, startLoc, noCalls) {
|
||||
var maybeAsyncArrow = this.options.ecmaVersion >= 8 && base.type === "Identifier" && base.name === "async" &&
|
||||
this.lastTokEnd === base.end && !this.canInsertSemicolon() && this.input.slice(base.start, base.end) === "async";
|
||||
this.lastTokEnd === base.end && !this.canInsertSemicolon() && base.end - base.start === 5 &&
|
||||
this.potentialArrowAt === base.start;
|
||||
var optionalChained = false;
|
||||
|
||||
while (true) {
|
||||
var element = this.parseSubscript(base, startPos, startLoc, noCalls, maybeAsyncArrow);
|
||||
if (element === base || element.type === "ArrowFunctionExpression") { return element }
|
||||
var element = this.parseSubscript(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained);
|
||||
|
||||
if (element.optional) { optionalChained = true; }
|
||||
if (element === base || element.type === "ArrowFunctionExpression") {
|
||||
if (optionalChained) {
|
||||
var chainNode = this.startNodeAt(startPos, startLoc);
|
||||
chainNode.expression = element;
|
||||
element = this.finishNode(chainNode, "ChainExpression");
|
||||
}
|
||||
return element
|
||||
}
|
||||
|
||||
base = element;
|
||||
}
|
||||
};
|
||||
|
||||
pp$3.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArrow) {
|
||||
pp$3.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained) {
|
||||
var optionalSupported = this.options.ecmaVersion >= 11;
|
||||
var optional = optionalSupported && this.eat(types.questionDot);
|
||||
if (noCalls && optional) { this.raise(this.lastTokStart, "Optional chaining cannot appear in the callee of new expressions"); }
|
||||
|
||||
var computed = this.eat(types.bracketL);
|
||||
if (computed || this.eat(types.dot)) {
|
||||
if (computed || (optional && this.type !== types.parenL && this.type !== types.backQuote) || this.eat(types.dot)) {
|
||||
var node = this.startNodeAt(startPos, startLoc);
|
||||
node.object = base;
|
||||
node.property = computed ? this.parseExpression() : this.parseIdent(this.options.allowReserved !== "never");
|
||||
node.computed = !!computed;
|
||||
if (computed) { this.expect(types.bracketR); }
|
||||
if (optionalSupported) {
|
||||
node.optional = optional;
|
||||
}
|
||||
base = this.finishNode(node, "MemberExpression");
|
||||
} else if (!noCalls && this.eat(types.parenL)) {
|
||||
var refDestructuringErrors = new DestructuringErrors, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;
|
||||
this.yieldPos = 0;
|
||||
this.awaitPos = 0;
|
||||
this.awaitIdentPos = 0;
|
||||
var exprList = this.parseExprList(types.parenR, this.options.ecmaVersion >= 8 && base.type !== "Import", false, refDestructuringErrors);
|
||||
if (maybeAsyncArrow && !this.canInsertSemicolon() && this.eat(types.arrow)) {
|
||||
var exprList = this.parseExprList(types.parenR, this.options.ecmaVersion >= 8, false, refDestructuringErrors);
|
||||
if (maybeAsyncArrow && !optional && !this.canInsertSemicolon() && this.eat(types.arrow)) {
|
||||
this.checkPatternErrors(refDestructuringErrors, false);
|
||||
this.checkYieldAwaitInDefaultParams();
|
||||
if (this.awaitIdentPos > 0)
|
||||
@@ -2139,18 +2199,14 @@
|
||||
var node$1 = this.startNodeAt(startPos, startLoc);
|
||||
node$1.callee = base;
|
||||
node$1.arguments = exprList;
|
||||
if (node$1.callee.type === "Import") {
|
||||
if (node$1.arguments.length !== 1) {
|
||||
this.raise(node$1.start, "import() requires exactly one argument");
|
||||
}
|
||||
|
||||
var importArg = node$1.arguments[0];
|
||||
if (importArg && importArg.type === "SpreadElement") {
|
||||
this.raise(importArg.start, "... is not allowed in import()");
|
||||
}
|
||||
if (optionalSupported) {
|
||||
node$1.optional = optional;
|
||||
}
|
||||
base = this.finishNode(node$1, "CallExpression");
|
||||
} else if (this.type === types.backQuote) {
|
||||
if (optional || optionalChained) {
|
||||
this.raise(this.start, "Optional chaining cannot appear in the tag of tagged template expressions");
|
||||
}
|
||||
var node$2 = this.startNodeAt(startPos, startLoc);
|
||||
node$2.tag = base;
|
||||
node$2.quasi = this.parseTemplate({isTagged: true});
|
||||
@@ -2183,7 +2239,7 @@
|
||||
// super [ Expression ]
|
||||
// super . IdentifierName
|
||||
// SuperCall:
|
||||
// super Arguments
|
||||
// super ( Arguments )
|
||||
if (this.type !== types.dot && this.type !== types.bracketL && this.type !== types.parenL)
|
||||
{ this.unexpected(); }
|
||||
return this.finishNode(node, "Super")
|
||||
@@ -2260,8 +2316,8 @@
|
||||
return this.parseTemplate()
|
||||
|
||||
case types._import:
|
||||
if (this.options.ecmaVersion > 10) {
|
||||
return this.parseDynamicImport()
|
||||
if (this.options.ecmaVersion >= 11) {
|
||||
return this.parseExprImport()
|
||||
} else {
|
||||
return this.unexpected()
|
||||
}
|
||||
@@ -2271,13 +2327,58 @@
|
||||
}
|
||||
};
|
||||
|
||||
pp$3.parseDynamicImport = function() {
|
||||
pp$3.parseExprImport = function() {
|
||||
var node = this.startNode();
|
||||
this.next();
|
||||
if (this.type !== types.parenL) {
|
||||
|
||||
// Consume `import` as an identifier for `import.meta`.
|
||||
// Because `this.parseIdent(true)` doesn't check escape sequences, it needs the check of `this.containsEsc`.
|
||||
if (this.containsEsc) { this.raiseRecoverable(this.start, "Escape sequence in keyword import"); }
|
||||
var meta = this.parseIdent(true);
|
||||
|
||||
switch (this.type) {
|
||||
case types.parenL:
|
||||
return this.parseDynamicImport(node)
|
||||
case types.dot:
|
||||
node.meta = meta;
|
||||
return this.parseImportMeta(node)
|
||||
default:
|
||||
this.unexpected();
|
||||
}
|
||||
return this.finishNode(node, "Import")
|
||||
};
|
||||
|
||||
pp$3.parseDynamicImport = function(node) {
|
||||
this.next(); // skip `(`
|
||||
|
||||
// Parse node.source.
|
||||
node.source = this.parseMaybeAssign();
|
||||
|
||||
// Verify ending.
|
||||
if (!this.eat(types.parenR)) {
|
||||
var errorPos = this.start;
|
||||
if (this.eat(types.comma) && this.eat(types.parenR)) {
|
||||
this.raiseRecoverable(errorPos, "Trailing comma is not allowed in import()");
|
||||
} else {
|
||||
this.unexpected(errorPos);
|
||||
}
|
||||
}
|
||||
|
||||
return this.finishNode(node, "ImportExpression")
|
||||
};
|
||||
|
||||
pp$3.parseImportMeta = function(node) {
|
||||
this.next(); // skip `.`
|
||||
|
||||
var containsEsc = this.containsEsc;
|
||||
node.property = this.parseIdent(true);
|
||||
|
||||
if (node.property.name !== "meta")
|
||||
{ this.raiseRecoverable(node.property.start, "The only valid meta property for import is 'import.meta'"); }
|
||||
if (containsEsc)
|
||||
{ this.raiseRecoverable(node.start, "'import.meta' must not contain escaped characters"); }
|
||||
if (this.options.sourceType !== "module")
|
||||
{ this.raiseRecoverable(node.start, "Cannot use 'import.meta' outside a module"); }
|
||||
|
||||
return this.finishNode(node, "MetaProperty")
|
||||
};
|
||||
|
||||
pp$3.parseLiteral = function(value) {
|
||||
@@ -2375,24 +2476,27 @@
|
||||
var empty$1 = [];
|
||||
|
||||
pp$3.parseNew = function() {
|
||||
if (this.containsEsc) { this.raiseRecoverable(this.start, "Escape sequence in keyword new"); }
|
||||
var node = this.startNode();
|
||||
var meta = this.parseIdent(true);
|
||||
if (this.options.ecmaVersion >= 6 && this.eat(types.dot)) {
|
||||
node.meta = meta;
|
||||
var containsEsc = this.containsEsc;
|
||||
node.property = this.parseIdent(true);
|
||||
if (node.property.name !== "target" || containsEsc)
|
||||
{ this.raiseRecoverable(node.property.start, "The only valid meta property for new is new.target"); }
|
||||
if (node.property.name !== "target")
|
||||
{ this.raiseRecoverable(node.property.start, "The only valid meta property for new is 'new.target'"); }
|
||||
if (containsEsc)
|
||||
{ this.raiseRecoverable(node.start, "'new.target' must not contain escaped characters"); }
|
||||
if (!this.inNonArrowFunction())
|
||||
{ this.raiseRecoverable(node.start, "new.target can only be used in functions"); }
|
||||
{ this.raiseRecoverable(node.start, "'new.target' can only be used in functions"); }
|
||||
return this.finishNode(node, "MetaProperty")
|
||||
}
|
||||
var startPos = this.start, startLoc = this.startLoc;
|
||||
var startPos = this.start, startLoc = this.startLoc, isImport = this.type === types._import;
|
||||
node.callee = this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true);
|
||||
if (this.options.ecmaVersion > 10 && node.callee.type === "Import") {
|
||||
this.raise(node.callee.start, "Cannot use new with import(...)");
|
||||
if (isImport && node.callee.type === "ImportExpression") {
|
||||
this.raise(startPos, "Cannot use new with import()");
|
||||
}
|
||||
if (this.eat(types.parenL)) { node.arguments = this.parseExprList(types.parenR, this.options.ecmaVersion >= 8 && node.callee.type !== "Import", false); }
|
||||
if (this.eat(types.parenL)) { node.arguments = this.parseExprList(types.parenR, this.options.ecmaVersion >= 8, false); }
|
||||
else { node.arguments = empty$1; }
|
||||
return this.finishNode(node, "NewExpression")
|
||||
};
|
||||
@@ -2457,7 +2561,7 @@
|
||||
while (!this.eat(types.braceR)) {
|
||||
if (!first) {
|
||||
this.expect(types.comma);
|
||||
if (this.afterTrailingComma(types.braceR)) { break }
|
||||
if (this.options.ecmaVersion >= 5 && this.afterTrailingComma(types.braceR)) { break }
|
||||
} else { first = false; }
|
||||
|
||||
var prop = this.parseProperty(isPattern, refDestructuringErrors);
|
||||
@@ -2533,7 +2637,7 @@
|
||||
} 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.comma && this.type !== types.braceR)) {
|
||||
(this.type !== types.comma && this.type !== types.braceR && this.type !== types.eq)) {
|
||||
if (isGenerator || isAsync) { this.unexpected(); }
|
||||
prop.kind = prop.key.name;
|
||||
this.parsePropertyName(prop);
|
||||
@@ -2668,16 +2772,14 @@
|
||||
// Add the params to varDeclaredNames to ensure that an error is thrown
|
||||
// if a let/const declaration in the function clashes with one of the params.
|
||||
this.checkParams(node, !oldStrict && !useStrict && !isArrowFunction && !isMethod && this.isSimpleParamList(node.params));
|
||||
node.body = this.parseBlock(false);
|
||||
// Ensure the function name isn't a forbidden identifier in strict mode, e.g. 'eval'
|
||||
if (this.strict && node.id) { this.checkLVal(node.id, BIND_OUTSIDE); }
|
||||
node.body = this.parseBlock(false, undefined, useStrict && !oldStrict);
|
||||
node.expression = false;
|
||||
this.adaptDirectivePrologue(node.body.body);
|
||||
this.labels = oldLabels;
|
||||
}
|
||||
this.exitScope();
|
||||
|
||||
// Ensure the function name isn't a forbidden identifier in strict mode, e.g. 'eval'
|
||||
if (this.strict && node.id) { this.checkLVal(node.id, BIND_OUTSIDE); }
|
||||
this.strict = oldStrict;
|
||||
};
|
||||
|
||||
pp$3.isSimpleParamList = function(params) {
|
||||
@@ -2775,7 +2877,7 @@
|
||||
} else {
|
||||
this.unexpected();
|
||||
}
|
||||
this.next();
|
||||
this.next(!!liberal);
|
||||
this.finishNode(node, "Identifier");
|
||||
if (!liberal) {
|
||||
this.checkUnreserved(node);
|
||||
@@ -2807,7 +2909,7 @@
|
||||
|
||||
var node = this.startNode();
|
||||
this.next();
|
||||
node.argument = this.parseMaybeUnary(null, true);
|
||||
node.argument = this.parseMaybeUnary(null, false);
|
||||
return this.finishNode(node, "AwaitExpression")
|
||||
};
|
||||
|
||||
@@ -3196,49 +3298,61 @@
|
||||
|
||||
// If u flag is given, this returns the code point at the index (it combines a surrogate pair).
|
||||
// Otherwise, this returns the code unit of the index (can be a part of a surrogate pair).
|
||||
RegExpValidationState.prototype.at = function at (i) {
|
||||
RegExpValidationState.prototype.at = function at (i, forceU) {
|
||||
if ( forceU === void 0 ) forceU = false;
|
||||
|
||||
var s = this.source;
|
||||
var l = s.length;
|
||||
if (i >= l) {
|
||||
return -1
|
||||
}
|
||||
var c = s.charCodeAt(i);
|
||||
if (!this.switchU || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l) {
|
||||
if (!(forceU || this.switchU) || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l) {
|
||||
return c
|
||||
}
|
||||
var next = s.charCodeAt(i + 1);
|
||||
return next >= 0xDC00 && next <= 0xDFFF ? (c << 10) + next - 0x35FDC00 : c
|
||||
};
|
||||
|
||||
RegExpValidationState.prototype.nextIndex = function nextIndex (i) {
|
||||
RegExpValidationState.prototype.nextIndex = function nextIndex (i, forceU) {
|
||||
if ( forceU === void 0 ) forceU = false;
|
||||
|
||||
var s = this.source;
|
||||
var l = s.length;
|
||||
if (i >= l) {
|
||||
return l
|
||||
}
|
||||
var c = s.charCodeAt(i), next;
|
||||
if (!this.switchU || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l ||
|
||||
if (!(forceU || this.switchU) || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l ||
|
||||
(next = s.charCodeAt(i + 1)) < 0xDC00 || next > 0xDFFF) {
|
||||
return i + 1
|
||||
}
|
||||
return i + 2
|
||||
};
|
||||
|
||||
RegExpValidationState.prototype.current = function current () {
|
||||
return this.at(this.pos)
|
||||
RegExpValidationState.prototype.current = function current (forceU) {
|
||||
if ( forceU === void 0 ) forceU = false;
|
||||
|
||||
return this.at(this.pos, forceU)
|
||||
};
|
||||
|
||||
RegExpValidationState.prototype.lookahead = function lookahead () {
|
||||
return this.at(this.nextIndex(this.pos))
|
||||
RegExpValidationState.prototype.lookahead = function lookahead (forceU) {
|
||||
if ( forceU === void 0 ) forceU = false;
|
||||
|
||||
return this.at(this.nextIndex(this.pos, forceU), forceU)
|
||||
};
|
||||
|
||||
RegExpValidationState.prototype.advance = function advance () {
|
||||
this.pos = this.nextIndex(this.pos);
|
||||
RegExpValidationState.prototype.advance = function advance (forceU) {
|
||||
if ( forceU === void 0 ) forceU = false;
|
||||
|
||||
this.pos = this.nextIndex(this.pos, forceU);
|
||||
};
|
||||
|
||||
RegExpValidationState.prototype.eat = function eat (ch) {
|
||||
if (this.current() === ch) {
|
||||
this.advance();
|
||||
RegExpValidationState.prototype.eat = function eat (ch, forceU) {
|
||||
if ( forceU === void 0 ) forceU = false;
|
||||
|
||||
if (this.current(forceU) === ch) {
|
||||
this.advance(forceU);
|
||||
return true
|
||||
}
|
||||
return false
|
||||
@@ -3309,7 +3423,7 @@
|
||||
if (state.eat(0x29 /* ) */)) {
|
||||
state.raise("Unmatched ')'");
|
||||
}
|
||||
if (state.eat(0x5D /* [ */) || state.eat(0x7D /* } */)) {
|
||||
if (state.eat(0x5D /* ] */) || state.eat(0x7D /* } */)) {
|
||||
state.raise("Lone quantifier brackets");
|
||||
}
|
||||
}
|
||||
@@ -3577,9 +3691,9 @@
|
||||
return false
|
||||
};
|
||||
|
||||
// GroupSpecifier[U] ::
|
||||
// GroupSpecifier ::
|
||||
// [empty]
|
||||
// `?` GroupName[?U]
|
||||
// `?` GroupName
|
||||
pp$8.regexp_groupSpecifier = function(state) {
|
||||
if (state.eat(0x3F /* ? */)) {
|
||||
if (this.regexp_eatGroupName(state)) {
|
||||
@@ -3593,8 +3707,8 @@
|
||||
}
|
||||
};
|
||||
|
||||
// GroupName[U] ::
|
||||
// `<` RegExpIdentifierName[?U] `>`
|
||||
// GroupName ::
|
||||
// `<` RegExpIdentifierName `>`
|
||||
// Note: this updates `state.lastStringValue` property with the eaten name.
|
||||
pp$8.regexp_eatGroupName = function(state) {
|
||||
state.lastStringValue = "";
|
||||
@@ -3607,9 +3721,9 @@
|
||||
return false
|
||||
};
|
||||
|
||||
// RegExpIdentifierName[U] ::
|
||||
// RegExpIdentifierStart[?U]
|
||||
// RegExpIdentifierName[?U] RegExpIdentifierPart[?U]
|
||||
// RegExpIdentifierName ::
|
||||
// RegExpIdentifierStart
|
||||
// RegExpIdentifierName RegExpIdentifierPart
|
||||
// Note: this updates `state.lastStringValue` property with the eaten name.
|
||||
pp$8.regexp_eatRegExpIdentifierName = function(state) {
|
||||
state.lastStringValue = "";
|
||||
@@ -3623,17 +3737,18 @@
|
||||
return false
|
||||
};
|
||||
|
||||
// RegExpIdentifierStart[U] ::
|
||||
// RegExpIdentifierStart ::
|
||||
// UnicodeIDStart
|
||||
// `$`
|
||||
// `_`
|
||||
// `\` RegExpUnicodeEscapeSequence[?U]
|
||||
// `\` RegExpUnicodeEscapeSequence[+U]
|
||||
pp$8.regexp_eatRegExpIdentifierStart = function(state) {
|
||||
var start = state.pos;
|
||||
var ch = state.current();
|
||||
state.advance();
|
||||
var forceU = this.options.ecmaVersion >= 11;
|
||||
var ch = state.current(forceU);
|
||||
state.advance(forceU);
|
||||
|
||||
if (ch === 0x5C /* \ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state)) {
|
||||
if (ch === 0x5C /* \ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU)) {
|
||||
ch = state.lastIntValue;
|
||||
}
|
||||
if (isRegExpIdentifierStart(ch)) {
|
||||
@@ -3648,19 +3763,20 @@
|
||||
return isIdentifierStart(ch, true) || ch === 0x24 /* $ */ || ch === 0x5F /* _ */
|
||||
}
|
||||
|
||||
// RegExpIdentifierPart[U] ::
|
||||
// RegExpIdentifierPart ::
|
||||
// UnicodeIDContinue
|
||||
// `$`
|
||||
// `_`
|
||||
// `\` RegExpUnicodeEscapeSequence[?U]
|
||||
// `\` RegExpUnicodeEscapeSequence[+U]
|
||||
// <ZWNJ>
|
||||
// <ZWJ>
|
||||
pp$8.regexp_eatRegExpIdentifierPart = function(state) {
|
||||
var start = state.pos;
|
||||
var ch = state.current();
|
||||
state.advance();
|
||||
var forceU = this.options.ecmaVersion >= 11;
|
||||
var ch = state.current(forceU);
|
||||
state.advance(forceU);
|
||||
|
||||
if (ch === 0x5C /* \ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state)) {
|
||||
if (ch === 0x5C /* \ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU)) {
|
||||
ch = state.lastIntValue;
|
||||
}
|
||||
if (isRegExpIdentifierPart(ch)) {
|
||||
@@ -3730,7 +3846,7 @@
|
||||
this.regexp_eatCControlLetter(state) ||
|
||||
this.regexp_eatZero(state) ||
|
||||
this.regexp_eatHexEscapeSequence(state) ||
|
||||
this.regexp_eatRegExpUnicodeEscapeSequence(state) ||
|
||||
this.regexp_eatRegExpUnicodeEscapeSequence(state, false) ||
|
||||
(!state.switchU && this.regexp_eatLegacyOctalEscapeSequence(state)) ||
|
||||
this.regexp_eatIdentityEscape(state)
|
||||
)
|
||||
@@ -3803,13 +3919,16 @@
|
||||
}
|
||||
|
||||
// https://www.ecma-international.org/ecma-262/8.0/#prod-RegExpUnicodeEscapeSequence
|
||||
pp$8.regexp_eatRegExpUnicodeEscapeSequence = function(state) {
|
||||
pp$8.regexp_eatRegExpUnicodeEscapeSequence = function(state, forceU) {
|
||||
if ( forceU === void 0 ) forceU = false;
|
||||
|
||||
var start = state.pos;
|
||||
var switchU = forceU || state.switchU;
|
||||
|
||||
if (state.eat(0x75 /* u */)) {
|
||||
if (this.regexp_eatFixedHexDigits(state, 4)) {
|
||||
var lead = state.lastIntValue;
|
||||
if (state.switchU && lead >= 0xD800 && lead <= 0xDBFF) {
|
||||
if (switchU && lead >= 0xD800 && lead <= 0xDBFF) {
|
||||
var leadSurrogateEnd = state.pos;
|
||||
if (state.eat(0x5C /* \ */) && state.eat(0x75 /* u */) && this.regexp_eatFixedHexDigits(state, 4)) {
|
||||
var trail = state.lastIntValue;
|
||||
@@ -3824,7 +3943,7 @@
|
||||
return true
|
||||
}
|
||||
if (
|
||||
state.switchU &&
|
||||
switchU &&
|
||||
state.eat(0x7B /* { */) &&
|
||||
this.regexp_eatHexDigits(state) &&
|
||||
state.eat(0x7D /* } */) &&
|
||||
@@ -3832,7 +3951,7 @@
|
||||
) {
|
||||
return true
|
||||
}
|
||||
if (state.switchU) {
|
||||
if (switchU) {
|
||||
state.raise("Invalid unicode escape");
|
||||
}
|
||||
state.pos = start;
|
||||
@@ -3998,7 +4117,7 @@
|
||||
if (state.eat(0x5B /* [ */)) {
|
||||
state.eat(0x5E /* ^ */);
|
||||
this.regexp_classRanges(state);
|
||||
if (state.eat(0x5D /* [ */)) {
|
||||
if (state.eat(0x5D /* ] */)) {
|
||||
return true
|
||||
}
|
||||
// Unreachable since it threw "unterminated regular expression" error before.
|
||||
@@ -4046,7 +4165,7 @@
|
||||
}
|
||||
|
||||
var ch = state.current();
|
||||
if (ch !== 0x5D /* [ */) {
|
||||
if (ch !== 0x5D /* ] */) {
|
||||
state.lastIntValue = ch;
|
||||
state.advance();
|
||||
return true
|
||||
@@ -4225,7 +4344,9 @@
|
||||
|
||||
// Move to the next token
|
||||
|
||||
pp$9.next = function() {
|
||||
pp$9.next = function(ignoreEscapeSequenceInKeyword) {
|
||||
if (!ignoreEscapeSequenceInKeyword && this.type.keyword && this.containsEsc)
|
||||
{ this.raiseRecoverable(this.start, "Escape sequence in keyword " + this.type.keyword); }
|
||||
if (this.options.onToken)
|
||||
{ this.options.onToken(new Token(this)); }
|
||||
|
||||
@@ -4486,6 +4607,18 @@
|
||||
return this.finishOp(code === 61 ? types.eq : types.prefix, 1)
|
||||
};
|
||||
|
||||
pp$9.readToken_question = function() { // '?'
|
||||
if (this.options.ecmaVersion >= 11) {
|
||||
var next = this.input.charCodeAt(this.pos + 1);
|
||||
if (next === 46) {
|
||||
var next2 = this.input.charCodeAt(this.pos + 2);
|
||||
if (next2 < 48 || next2 > 57) { return this.finishOp(types.questionDot, 2) }
|
||||
}
|
||||
if (next === 63) { return this.finishOp(types.coalesce, 2) }
|
||||
}
|
||||
return this.finishOp(types.question, 1)
|
||||
};
|
||||
|
||||
pp$9.getTokenFromCode = function(code) {
|
||||
switch (code) {
|
||||
// The interpretation of a dot depends on whether it is followed
|
||||
@@ -4503,7 +4636,6 @@
|
||||
case 123: ++this.pos; return this.finishToken(types.braceL)
|
||||
case 125: ++this.pos; return this.finishToken(types.braceR)
|
||||
case 58: ++this.pos; return this.finishToken(types.colon)
|
||||
case 63: ++this.pos; return this.finishToken(types.question)
|
||||
|
||||
case 96: // '`'
|
||||
if (this.options.ecmaVersion < 6) { break }
|
||||
@@ -4553,6 +4685,9 @@
|
||||
case 61: case 33: // '=!'
|
||||
return this.readToken_eq_excl(code)
|
||||
|
||||
case 63: // '?'
|
||||
return this.readToken_question()
|
||||
|
||||
case 126: // '~'
|
||||
return this.finishOp(types.prefix, 1)
|
||||
}
|
||||
@@ -4644,7 +4779,6 @@
|
||||
if (!startsWithDot && this.readInt(10) === null) { this.raise(start, "Invalid number"); }
|
||||
var octal = this.pos - start >= 2 && this.input.charCodeAt(start) === 48;
|
||||
if (octal && this.strict) { this.raise(start, "Invalid number"); }
|
||||
if (octal && /[89]/.test(this.input.slice(start, this.pos))) { octal = false; }
|
||||
var next = this.input.charCodeAt(this.pos);
|
||||
if (!octal && !startsWithDot && this.options.ecmaVersion >= 11 && next === 110) {
|
||||
var str$1 = this.input.slice(start, this.pos);
|
||||
@@ -4653,6 +4787,7 @@
|
||||
if (isIdentifierStart(this.fullCharCodeAtPos())) { this.raise(this.pos, "Identifier directly after number"); }
|
||||
return this.finishToken(types.num, val$1)
|
||||
}
|
||||
if (octal && /[89]/.test(this.input.slice(start, this.pos))) { octal = false; }
|
||||
if (next === 46 && !octal) { // '.'
|
||||
++this.pos;
|
||||
this.readInt(10);
|
||||
@@ -4827,6 +4962,18 @@
|
||||
case 10: // ' \n'
|
||||
if (this.options.locations) { this.lineStart = this.pos; ++this.curLine; }
|
||||
return ""
|
||||
case 56:
|
||||
case 57:
|
||||
if (inTemplate) {
|
||||
var codePos = this.pos - 1;
|
||||
|
||||
this.invalidStringToken(
|
||||
codePos,
|
||||
"Invalid escape sequence in template string"
|
||||
);
|
||||
|
||||
return null
|
||||
}
|
||||
default:
|
||||
if (ch >= 48 && ch <= 55) {
|
||||
var octalStr = this.input.substr(this.pos - 1, 3).match(/^[0-7]+/)[0];
|
||||
@@ -4906,7 +5053,6 @@
|
||||
var word = this.readWord1();
|
||||
var type = types.name;
|
||||
if (this.keywords.test(word)) {
|
||||
if (this.containsEsc) { this.raiseRecoverable(this.start, "Escape sequence in keyword " + word); }
|
||||
type = keywords$1[word];
|
||||
}
|
||||
return this.finishToken(type, word)
|
||||
@@ -4914,7 +5060,7 @@
|
||||
|
||||
// Acorn is a tiny, fast JavaScript parser written in JavaScript.
|
||||
|
||||
var version = "6.4.0";
|
||||
var version = "7.3.1";
|
||||
|
||||
Parser.acorn = {
|
||||
Parser: Parser,
|
||||
@@ -4989,4 +5135,4 @@
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
}));
|
||||
})));
|
||||
|
358
node_modules/acorn/dist/acorn.mjs
generated
vendored
358
node_modules/acorn/dist/acorn.mjs
generated
vendored
@@ -27,8 +27,8 @@ var keywordRelationalOperator = /^in(stanceof)?$/;
|
||||
// are only applied when a character is found to actually have a
|
||||
// code point above 128.
|
||||
// Generated by `bin/generate-identifier-regex.js`.
|
||||
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\u08a0-\u08b4\u08b6-\u08bd\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\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\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-\u170c\u170e-\u1711\u1720-\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-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\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-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fef\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7bf\ua7c2-\ua7c6\ua7f7-\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-\uab67\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";
|
||||
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\u08d3-\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\u0b56\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\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\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ecd\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-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\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-\u1df9\u1dfb-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\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";
|
||||
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\u08a0-\u08b4\u08b6-\u08c7\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\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\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-\u170c\u170e-\u1711\u1720-\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-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\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-\u9ffc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7bf\ua7c2-\ua7ca\ua7f5-\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";
|
||||
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\u08d3-\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\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\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-\u0ecd\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-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf\u1ac0\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-\u1df9\u1dfb-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\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";
|
||||
|
||||
var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]");
|
||||
var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]");
|
||||
@@ -42,10 +42,10 @@ nonASCIIidentifierStartChars = nonASCIIidentifierChars = null;
|
||||
// generated by bin/generate-identifier-regex.js
|
||||
|
||||
// eslint-disable-next-line comma-spacing
|
||||
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,157,310,10,21,11,7,153,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,477,28,11,0,9,21,155,22,13,52,76,44,33,24,27,35,30,0,12,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,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,0,33,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,230,43,117,63,32,0,161,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,35,56,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,270,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,754,9486,286,50,2,18,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,2357,44,11,6,17,0,370,43,1301,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,42710,42,4148,12,221,3,5761,15,7472,3104,541];
|
||||
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,157,310,10,21,11,7,153,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,107,20,28,22,13,52,76,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,85,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,230,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,35,56,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,190,0,80,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,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,8952,286,50,2,18,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,2357,44,11,6,17,0,370,43,1301,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,42717,35,4148,12,221,3,5761,15,7472,3104,541,1507,4938];
|
||||
|
||||
// eslint-disable-next-line comma-spacing
|
||||
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,525,10,176,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,4,9,83,11,7,0,161,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,232,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,19306,9,135,4,60,6,26,9,1014,0,2,54,8,3,19723,1,5319,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,262,6,10,9,419,13,1495,6,110,6,6,9,792487,239];
|
||||
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,370,1,154,10,176,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,161,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,19306,9,135,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,5319,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,262,6,10,9,419,13,1495,6,110,6,6,9,4759,9,787719,239];
|
||||
|
||||
// This has a complexity linear to the value of the code. The
|
||||
// assumption is that looking up astral identifier characters is
|
||||
@@ -160,6 +160,7 @@ var types = {
|
||||
colon: new TokenType(":", beforeExpr),
|
||||
dot: new TokenType("."),
|
||||
question: new TokenType("?", beforeExpr),
|
||||
questionDot: new TokenType("?."),
|
||||
arrow: new TokenType("=>", beforeExpr),
|
||||
template: new TokenType("template"),
|
||||
invalidTemplate: new TokenType("invalidTemplate"),
|
||||
@@ -198,6 +199,7 @@ var types = {
|
||||
star: binop("*", 10),
|
||||
slash: binop("/", 10),
|
||||
starstar: new TokenType("**", {beforeExpr: true}),
|
||||
coalesce: binop("??", 1),
|
||||
|
||||
// Keyword token types.
|
||||
_break: kw("break"),
|
||||
@@ -314,8 +316,8 @@ var defaultOptions = {
|
||||
// either 3, 5, 6 (2015), 7 (2016), 8 (2017), 9 (2018), or 10
|
||||
// (2019). This influences support for strict mode, the set of
|
||||
// reserved words, and support for new syntax features. The default
|
||||
// is 9.
|
||||
ecmaVersion: 9,
|
||||
// is 10.
|
||||
ecmaVersion: 10,
|
||||
// `sourceType` indicates the mode the code should be parsed in.
|
||||
// Can be either `"script"` or `"module"`. This influences global
|
||||
// strict mode and parsing of `import` and `export` declarations.
|
||||
@@ -594,7 +596,14 @@ pp.strictDirective = function(start) {
|
||||
start += skipWhiteSpace.exec(this.input)[0].length;
|
||||
var match = literal.exec(this.input.slice(start));
|
||||
if (!match) { return false }
|
||||
if ((match[1] || match[2]) === "use strict") { return true }
|
||||
if ((match[1] || match[2]) === "use strict") {
|
||||
skipWhiteSpace.lastIndex = start + match[0].length;
|
||||
var spaceAfter = skipWhiteSpace.exec(this.input), end = spaceAfter.index + spaceAfter[0].length;
|
||||
var next = this.input.charAt(end);
|
||||
return next === ";" || next === "}" ||
|
||||
(lineBreak.test(spaceAfter[0]) &&
|
||||
!(/[(`.[+\-/*%<>=,?^&]/.test(next) || next === "!" && this.input.charAt(end + 1) === "="))
|
||||
}
|
||||
start += match[0].length;
|
||||
|
||||
// Skip semicolon, if any.
|
||||
@@ -844,7 +853,7 @@ pp$1.parseStatement = function(context, topLevel, exports) {
|
||||
skipWhiteSpace.lastIndex = this.pos;
|
||||
var skip = skipWhiteSpace.exec(this.input);
|
||||
var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next);
|
||||
if (nextCh === 40) // '('
|
||||
if (nextCh === 40 || nextCh === 46) // '(' or '.'
|
||||
{ return this.parseExpressionStatement(node, this.parseExpression()) }
|
||||
}
|
||||
|
||||
@@ -1144,17 +1153,19 @@ pp$1.parseExpressionStatement = function(node, expr) {
|
||||
// strict"` declarations when `allowStrict` is true (used for
|
||||
// function bodies).
|
||||
|
||||
pp$1.parseBlock = function(createNewLexicalScope, node) {
|
||||
pp$1.parseBlock = function(createNewLexicalScope, node, exitStrict) {
|
||||
if ( createNewLexicalScope === void 0 ) createNewLexicalScope = true;
|
||||
if ( node === void 0 ) node = this.startNode();
|
||||
|
||||
node.body = [];
|
||||
this.expect(types.braceL);
|
||||
if (createNewLexicalScope) { this.enterScope(0); }
|
||||
while (!this.eat(types.braceR)) {
|
||||
while (this.type !== types.braceR) {
|
||||
var stmt = this.parseStatement(null);
|
||||
node.body.push(stmt);
|
||||
}
|
||||
if (exitStrict) { this.strict = false; }
|
||||
this.next();
|
||||
if (createNewLexicalScope) { this.exitScope(); }
|
||||
return this.finishNode(node, "BlockStatement")
|
||||
};
|
||||
@@ -1305,7 +1316,7 @@ pp$1.parseClass = function(node, isStatement) {
|
||||
var hadConstructor = false;
|
||||
classBody.body = [];
|
||||
this.expect(types.braceL);
|
||||
while (!this.eat(types.braceR)) {
|
||||
while (this.type !== types.braceR) {
|
||||
var element = this.parseClassElement(node.superClass !== null);
|
||||
if (element) {
|
||||
classBody.body.push(element);
|
||||
@@ -1315,8 +1326,9 @@ pp$1.parseClass = function(node, isStatement) {
|
||||
}
|
||||
}
|
||||
}
|
||||
node.body = this.finishNode(classBody, "ClassBody");
|
||||
this.strict = oldStrict;
|
||||
this.next();
|
||||
node.body = this.finishNode(classBody, "ClassBody");
|
||||
return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression")
|
||||
};
|
||||
|
||||
@@ -1404,6 +1416,14 @@ pp$1.parseExport = function(node, exports) {
|
||||
this.next();
|
||||
// export * from '...'
|
||||
if (this.eat(types.star)) {
|
||||
if (this.options.ecmaVersion >= 11) {
|
||||
if (this.eatContextual("as")) {
|
||||
node.exported = this.parseIdent(true);
|
||||
this.checkExport(exports, node.exported.name, this.lastTokStart);
|
||||
} else {
|
||||
node.exported = null;
|
||||
}
|
||||
}
|
||||
this.expectContextual("from");
|
||||
if (this.type !== types.string) { this.unexpected(); }
|
||||
node.source = this.parseExprAtom();
|
||||
@@ -1680,6 +1700,10 @@ pp$2.toAssignable = function(node, isBinding, refDestructuringErrors) {
|
||||
this.toAssignable(node.expression, isBinding, refDestructuringErrors);
|
||||
break
|
||||
|
||||
case "ChainExpression":
|
||||
this.raiseRecoverable(node.start, "Optional chaining cannot appear in left-hand side");
|
||||
break
|
||||
|
||||
case "MemberExpression":
|
||||
if (!isBinding) { break }
|
||||
|
||||
@@ -1810,6 +1834,10 @@ pp$2.checkLVal = function(expr, bindingType, checkClashes) {
|
||||
if (bindingType !== BIND_NONE && bindingType !== BIND_OUTSIDE) { this.declareName(expr.name, bindingType, expr.start); }
|
||||
break
|
||||
|
||||
case "ChainExpression":
|
||||
this.raiseRecoverable(expr.start, "Optional chaining cannot appear in left-hand side");
|
||||
break
|
||||
|
||||
case "MemberExpression":
|
||||
if (bindingType) { this.raiseRecoverable(expr.start, "Binding member expression"); }
|
||||
break
|
||||
@@ -1878,9 +1906,11 @@ pp$3.checkPropClash = function(prop, propHash, refDestructuringErrors) {
|
||||
if (this.options.ecmaVersion >= 6) {
|
||||
if (name === "__proto__" && kind === "init") {
|
||||
if (propHash.proto) {
|
||||
if (refDestructuringErrors && refDestructuringErrors.doubleProto < 0) { refDestructuringErrors.doubleProto = key.start; }
|
||||
// Backwards-compat kludge. Can be removed in version 6.0
|
||||
else { this.raiseRecoverable(key.start, "Redefinition of __proto__ property"); }
|
||||
if (refDestructuringErrors) {
|
||||
if (refDestructuringErrors.doubleProto < 0)
|
||||
{ refDestructuringErrors.doubleProto = key.start; }
|
||||
// Backwards-compat kludge. Can be removed in version 6.0
|
||||
} else { this.raiseRecoverable(key.start, "Redefinition of __proto__ property"); }
|
||||
}
|
||||
propHash.proto = true;
|
||||
}
|
||||
@@ -1945,12 +1975,11 @@ pp$3.parseMaybeAssign = function(noIn, refDestructuringErrors, afterLeftParse) {
|
||||
else { this.exprAllowed = false; }
|
||||
}
|
||||
|
||||
var ownDestructuringErrors = false, oldParenAssign = -1, oldTrailingComma = -1, oldShorthandAssign = -1;
|
||||
var ownDestructuringErrors = false, oldParenAssign = -1, oldTrailingComma = -1;
|
||||
if (refDestructuringErrors) {
|
||||
oldParenAssign = refDestructuringErrors.parenthesizedAssign;
|
||||
oldTrailingComma = refDestructuringErrors.trailingComma;
|
||||
oldShorthandAssign = refDestructuringErrors.shorthandAssign;
|
||||
refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = refDestructuringErrors.shorthandAssign = -1;
|
||||
refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = -1;
|
||||
} else {
|
||||
refDestructuringErrors = new DestructuringErrors;
|
||||
ownDestructuringErrors = true;
|
||||
@@ -1965,8 +1994,11 @@ pp$3.parseMaybeAssign = function(noIn, refDestructuringErrors, afterLeftParse) {
|
||||
var node = this.startNodeAt(startPos, startLoc);
|
||||
node.operator = this.value;
|
||||
node.left = this.type === types.eq ? this.toAssignable(left, false, refDestructuringErrors) : left;
|
||||
if (!ownDestructuringErrors) { DestructuringErrors.call(refDestructuringErrors); }
|
||||
refDestructuringErrors.shorthandAssign = -1; // reset because shorthand default was used correctly
|
||||
if (!ownDestructuringErrors) {
|
||||
refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = refDestructuringErrors.doubleProto = -1;
|
||||
}
|
||||
if (refDestructuringErrors.shorthandAssign >= node.left.start)
|
||||
{ refDestructuringErrors.shorthandAssign = -1; } // reset because shorthand default was used correctly
|
||||
this.checkLVal(left);
|
||||
this.next();
|
||||
node.right = this.parseMaybeAssign(noIn);
|
||||
@@ -1976,7 +2008,6 @@ pp$3.parseMaybeAssign = function(noIn, refDestructuringErrors, afterLeftParse) {
|
||||
}
|
||||
if (oldParenAssign > -1) { refDestructuringErrors.parenthesizedAssign = oldParenAssign; }
|
||||
if (oldTrailingComma > -1) { refDestructuringErrors.trailingComma = oldTrailingComma; }
|
||||
if (oldShorthandAssign > -1) { refDestructuringErrors.shorthandAssign = oldShorthandAssign; }
|
||||
return left
|
||||
};
|
||||
|
||||
@@ -2017,11 +2048,20 @@ pp$3.parseExprOp = function(left, leftStartPos, leftStartLoc, minPrec, noIn) {
|
||||
if (prec != null && (!noIn || this.type !== types._in)) {
|
||||
if (prec > minPrec) {
|
||||
var logical = this.type === types.logicalOR || this.type === types.logicalAND;
|
||||
var coalesce = this.type === types.coalesce;
|
||||
if (coalesce) {
|
||||
// Handle the precedence of `tt.coalesce` as equal to the range of logical expressions.
|
||||
// In other words, `node.right` shouldn't contain logical expressions in order to check the mixed error.
|
||||
prec = types.logicalAND.binop;
|
||||
}
|
||||
var op = this.value;
|
||||
this.next();
|
||||
var startPos = this.start, startLoc = this.startLoc;
|
||||
var right = this.parseExprOp(this.parseMaybeUnary(null, false), startPos, startLoc, prec, noIn);
|
||||
var node = this.buildBinary(leftStartPos, leftStartLoc, left, right, op, logical);
|
||||
var node = this.buildBinary(leftStartPos, leftStartLoc, left, right, op, logical || coalesce);
|
||||
if ((logical && this.type === types.coalesce) || (coalesce && (this.type === types.logicalOR || this.type === types.logicalAND))) {
|
||||
this.raiseRecoverable(this.start, "Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses");
|
||||
}
|
||||
return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, noIn)
|
||||
}
|
||||
}
|
||||
@@ -2081,8 +2121,8 @@ pp$3.parseMaybeUnary = function(refDestructuringErrors, sawUnary) {
|
||||
pp$3.parseExprSubscripts = function(refDestructuringErrors) {
|
||||
var startPos = this.start, startLoc = this.startLoc;
|
||||
var expr = this.parseExprAtom(refDestructuringErrors);
|
||||
var skipArrowSubscripts = expr.type === "ArrowFunctionExpression" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== ")";
|
||||
if (this.checkExpressionErrors(refDestructuringErrors) || skipArrowSubscripts) { return expr }
|
||||
if (expr.type === "ArrowFunctionExpression" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== ")")
|
||||
{ return expr }
|
||||
var result = this.parseSubscripts(expr, startPos, startLoc);
|
||||
if (refDestructuringErrors && result.type === "MemberExpression") {
|
||||
if (refDestructuringErrors.parenthesizedAssign >= result.start) { refDestructuringErrors.parenthesizedAssign = -1; }
|
||||
@@ -2093,30 +2133,50 @@ pp$3.parseExprSubscripts = function(refDestructuringErrors) {
|
||||
|
||||
pp$3.parseSubscripts = function(base, startPos, startLoc, noCalls) {
|
||||
var maybeAsyncArrow = this.options.ecmaVersion >= 8 && base.type === "Identifier" && base.name === "async" &&
|
||||
this.lastTokEnd === base.end && !this.canInsertSemicolon() && this.input.slice(base.start, base.end) === "async";
|
||||
this.lastTokEnd === base.end && !this.canInsertSemicolon() && base.end - base.start === 5 &&
|
||||
this.potentialArrowAt === base.start;
|
||||
var optionalChained = false;
|
||||
|
||||
while (true) {
|
||||
var element = this.parseSubscript(base, startPos, startLoc, noCalls, maybeAsyncArrow);
|
||||
if (element === base || element.type === "ArrowFunctionExpression") { return element }
|
||||
var element = this.parseSubscript(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained);
|
||||
|
||||
if (element.optional) { optionalChained = true; }
|
||||
if (element === base || element.type === "ArrowFunctionExpression") {
|
||||
if (optionalChained) {
|
||||
var chainNode = this.startNodeAt(startPos, startLoc);
|
||||
chainNode.expression = element;
|
||||
element = this.finishNode(chainNode, "ChainExpression");
|
||||
}
|
||||
return element
|
||||
}
|
||||
|
||||
base = element;
|
||||
}
|
||||
};
|
||||
|
||||
pp$3.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArrow) {
|
||||
pp$3.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained) {
|
||||
var optionalSupported = this.options.ecmaVersion >= 11;
|
||||
var optional = optionalSupported && this.eat(types.questionDot);
|
||||
if (noCalls && optional) { this.raise(this.lastTokStart, "Optional chaining cannot appear in the callee of new expressions"); }
|
||||
|
||||
var computed = this.eat(types.bracketL);
|
||||
if (computed || this.eat(types.dot)) {
|
||||
if (computed || (optional && this.type !== types.parenL && this.type !== types.backQuote) || this.eat(types.dot)) {
|
||||
var node = this.startNodeAt(startPos, startLoc);
|
||||
node.object = base;
|
||||
node.property = computed ? this.parseExpression() : this.parseIdent(this.options.allowReserved !== "never");
|
||||
node.computed = !!computed;
|
||||
if (computed) { this.expect(types.bracketR); }
|
||||
if (optionalSupported) {
|
||||
node.optional = optional;
|
||||
}
|
||||
base = this.finishNode(node, "MemberExpression");
|
||||
} else if (!noCalls && this.eat(types.parenL)) {
|
||||
var refDestructuringErrors = new DestructuringErrors, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;
|
||||
this.yieldPos = 0;
|
||||
this.awaitPos = 0;
|
||||
this.awaitIdentPos = 0;
|
||||
var exprList = this.parseExprList(types.parenR, this.options.ecmaVersion >= 8 && base.type !== "Import", false, refDestructuringErrors);
|
||||
if (maybeAsyncArrow && !this.canInsertSemicolon() && this.eat(types.arrow)) {
|
||||
var exprList = this.parseExprList(types.parenR, this.options.ecmaVersion >= 8, false, refDestructuringErrors);
|
||||
if (maybeAsyncArrow && !optional && !this.canInsertSemicolon() && this.eat(types.arrow)) {
|
||||
this.checkPatternErrors(refDestructuringErrors, false);
|
||||
this.checkYieldAwaitInDefaultParams();
|
||||
if (this.awaitIdentPos > 0)
|
||||
@@ -2133,18 +2193,14 @@ pp$3.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArro
|
||||
var node$1 = this.startNodeAt(startPos, startLoc);
|
||||
node$1.callee = base;
|
||||
node$1.arguments = exprList;
|
||||
if (node$1.callee.type === "Import") {
|
||||
if (node$1.arguments.length !== 1) {
|
||||
this.raise(node$1.start, "import() requires exactly one argument");
|
||||
}
|
||||
|
||||
var importArg = node$1.arguments[0];
|
||||
if (importArg && importArg.type === "SpreadElement") {
|
||||
this.raise(importArg.start, "... is not allowed in import()");
|
||||
}
|
||||
if (optionalSupported) {
|
||||
node$1.optional = optional;
|
||||
}
|
||||
base = this.finishNode(node$1, "CallExpression");
|
||||
} else if (this.type === types.backQuote) {
|
||||
if (optional || optionalChained) {
|
||||
this.raise(this.start, "Optional chaining cannot appear in the tag of tagged template expressions");
|
||||
}
|
||||
var node$2 = this.startNodeAt(startPos, startLoc);
|
||||
node$2.tag = base;
|
||||
node$2.quasi = this.parseTemplate({isTagged: true});
|
||||
@@ -2177,7 +2233,7 @@ pp$3.parseExprAtom = function(refDestructuringErrors) {
|
||||
// super [ Expression ]
|
||||
// super . IdentifierName
|
||||
// SuperCall:
|
||||
// super Arguments
|
||||
// super ( Arguments )
|
||||
if (this.type !== types.dot && this.type !== types.bracketL && this.type !== types.parenL)
|
||||
{ this.unexpected(); }
|
||||
return this.finishNode(node, "Super")
|
||||
@@ -2254,8 +2310,8 @@ pp$3.parseExprAtom = function(refDestructuringErrors) {
|
||||
return this.parseTemplate()
|
||||
|
||||
case types._import:
|
||||
if (this.options.ecmaVersion > 10) {
|
||||
return this.parseDynamicImport()
|
||||
if (this.options.ecmaVersion >= 11) {
|
||||
return this.parseExprImport()
|
||||
} else {
|
||||
return this.unexpected()
|
||||
}
|
||||
@@ -2265,13 +2321,58 @@ pp$3.parseExprAtom = function(refDestructuringErrors) {
|
||||
}
|
||||
};
|
||||
|
||||
pp$3.parseDynamicImport = function() {
|
||||
pp$3.parseExprImport = function() {
|
||||
var node = this.startNode();
|
||||
this.next();
|
||||
if (this.type !== types.parenL) {
|
||||
|
||||
// Consume `import` as an identifier for `import.meta`.
|
||||
// Because `this.parseIdent(true)` doesn't check escape sequences, it needs the check of `this.containsEsc`.
|
||||
if (this.containsEsc) { this.raiseRecoverable(this.start, "Escape sequence in keyword import"); }
|
||||
var meta = this.parseIdent(true);
|
||||
|
||||
switch (this.type) {
|
||||
case types.parenL:
|
||||
return this.parseDynamicImport(node)
|
||||
case types.dot:
|
||||
node.meta = meta;
|
||||
return this.parseImportMeta(node)
|
||||
default:
|
||||
this.unexpected();
|
||||
}
|
||||
return this.finishNode(node, "Import")
|
||||
};
|
||||
|
||||
pp$3.parseDynamicImport = function(node) {
|
||||
this.next(); // skip `(`
|
||||
|
||||
// Parse node.source.
|
||||
node.source = this.parseMaybeAssign();
|
||||
|
||||
// Verify ending.
|
||||
if (!this.eat(types.parenR)) {
|
||||
var errorPos = this.start;
|
||||
if (this.eat(types.comma) && this.eat(types.parenR)) {
|
||||
this.raiseRecoverable(errorPos, "Trailing comma is not allowed in import()");
|
||||
} else {
|
||||
this.unexpected(errorPos);
|
||||
}
|
||||
}
|
||||
|
||||
return this.finishNode(node, "ImportExpression")
|
||||
};
|
||||
|
||||
pp$3.parseImportMeta = function(node) {
|
||||
this.next(); // skip `.`
|
||||
|
||||
var containsEsc = this.containsEsc;
|
||||
node.property = this.parseIdent(true);
|
||||
|
||||
if (node.property.name !== "meta")
|
||||
{ this.raiseRecoverable(node.property.start, "The only valid meta property for import is 'import.meta'"); }
|
||||
if (containsEsc)
|
||||
{ this.raiseRecoverable(node.start, "'import.meta' must not contain escaped characters"); }
|
||||
if (this.options.sourceType !== "module")
|
||||
{ this.raiseRecoverable(node.start, "Cannot use 'import.meta' outside a module"); }
|
||||
|
||||
return this.finishNode(node, "MetaProperty")
|
||||
};
|
||||
|
||||
pp$3.parseLiteral = function(value) {
|
||||
@@ -2369,24 +2470,27 @@ pp$3.parseParenArrowList = function(startPos, startLoc, exprList) {
|
||||
var empty$1 = [];
|
||||
|
||||
pp$3.parseNew = function() {
|
||||
if (this.containsEsc) { this.raiseRecoverable(this.start, "Escape sequence in keyword new"); }
|
||||
var node = this.startNode();
|
||||
var meta = this.parseIdent(true);
|
||||
if (this.options.ecmaVersion >= 6 && this.eat(types.dot)) {
|
||||
node.meta = meta;
|
||||
var containsEsc = this.containsEsc;
|
||||
node.property = this.parseIdent(true);
|
||||
if (node.property.name !== "target" || containsEsc)
|
||||
{ this.raiseRecoverable(node.property.start, "The only valid meta property for new is new.target"); }
|
||||
if (node.property.name !== "target")
|
||||
{ this.raiseRecoverable(node.property.start, "The only valid meta property for new is 'new.target'"); }
|
||||
if (containsEsc)
|
||||
{ this.raiseRecoverable(node.start, "'new.target' must not contain escaped characters"); }
|
||||
if (!this.inNonArrowFunction())
|
||||
{ this.raiseRecoverable(node.start, "new.target can only be used in functions"); }
|
||||
{ this.raiseRecoverable(node.start, "'new.target' can only be used in functions"); }
|
||||
return this.finishNode(node, "MetaProperty")
|
||||
}
|
||||
var startPos = this.start, startLoc = this.startLoc;
|
||||
var startPos = this.start, startLoc = this.startLoc, isImport = this.type === types._import;
|
||||
node.callee = this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true);
|
||||
if (this.options.ecmaVersion > 10 && node.callee.type === "Import") {
|
||||
this.raise(node.callee.start, "Cannot use new with import(...)");
|
||||
if (isImport && node.callee.type === "ImportExpression") {
|
||||
this.raise(startPos, "Cannot use new with import()");
|
||||
}
|
||||
if (this.eat(types.parenL)) { node.arguments = this.parseExprList(types.parenR, this.options.ecmaVersion >= 8 && node.callee.type !== "Import", false); }
|
||||
if (this.eat(types.parenL)) { node.arguments = this.parseExprList(types.parenR, this.options.ecmaVersion >= 8, false); }
|
||||
else { node.arguments = empty$1; }
|
||||
return this.finishNode(node, "NewExpression")
|
||||
};
|
||||
@@ -2451,7 +2555,7 @@ pp$3.parseObj = function(isPattern, refDestructuringErrors) {
|
||||
while (!this.eat(types.braceR)) {
|
||||
if (!first) {
|
||||
this.expect(types.comma);
|
||||
if (this.afterTrailingComma(types.braceR)) { break }
|
||||
if (this.options.ecmaVersion >= 5 && this.afterTrailingComma(types.braceR)) { break }
|
||||
} else { first = false; }
|
||||
|
||||
var prop = this.parseProperty(isPattern, refDestructuringErrors);
|
||||
@@ -2527,7 +2631,7 @@ pp$3.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startP
|
||||
} 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.comma && this.type !== types.braceR)) {
|
||||
(this.type !== types.comma && this.type !== types.braceR && this.type !== types.eq)) {
|
||||
if (isGenerator || isAsync) { this.unexpected(); }
|
||||
prop.kind = prop.key.name;
|
||||
this.parsePropertyName(prop);
|
||||
@@ -2662,16 +2766,14 @@ pp$3.parseFunctionBody = function(node, isArrowFunction, isMethod) {
|
||||
// Add the params to varDeclaredNames to ensure that an error is thrown
|
||||
// if a let/const declaration in the function clashes with one of the params.
|
||||
this.checkParams(node, !oldStrict && !useStrict && !isArrowFunction && !isMethod && this.isSimpleParamList(node.params));
|
||||
node.body = this.parseBlock(false);
|
||||
// Ensure the function name isn't a forbidden identifier in strict mode, e.g. 'eval'
|
||||
if (this.strict && node.id) { this.checkLVal(node.id, BIND_OUTSIDE); }
|
||||
node.body = this.parseBlock(false, undefined, useStrict && !oldStrict);
|
||||
node.expression = false;
|
||||
this.adaptDirectivePrologue(node.body.body);
|
||||
this.labels = oldLabels;
|
||||
}
|
||||
this.exitScope();
|
||||
|
||||
// Ensure the function name isn't a forbidden identifier in strict mode, e.g. 'eval'
|
||||
if (this.strict && node.id) { this.checkLVal(node.id, BIND_OUTSIDE); }
|
||||
this.strict = oldStrict;
|
||||
};
|
||||
|
||||
pp$3.isSimpleParamList = function(params) {
|
||||
@@ -2769,7 +2871,7 @@ pp$3.parseIdent = function(liberal, isBinding) {
|
||||
} else {
|
||||
this.unexpected();
|
||||
}
|
||||
this.next();
|
||||
this.next(!!liberal);
|
||||
this.finishNode(node, "Identifier");
|
||||
if (!liberal) {
|
||||
this.checkUnreserved(node);
|
||||
@@ -2801,7 +2903,7 @@ pp$3.parseAwait = function() {
|
||||
|
||||
var node = this.startNode();
|
||||
this.next();
|
||||
node.argument = this.parseMaybeUnary(null, true);
|
||||
node.argument = this.parseMaybeUnary(null, false);
|
||||
return this.finishNode(node, "AwaitExpression")
|
||||
};
|
||||
|
||||
@@ -3190,49 +3292,61 @@ RegExpValidationState.prototype.raise = function raise (message) {
|
||||
|
||||
// If u flag is given, this returns the code point at the index (it combines a surrogate pair).
|
||||
// Otherwise, this returns the code unit of the index (can be a part of a surrogate pair).
|
||||
RegExpValidationState.prototype.at = function at (i) {
|
||||
RegExpValidationState.prototype.at = function at (i, forceU) {
|
||||
if ( forceU === void 0 ) forceU = false;
|
||||
|
||||
var s = this.source;
|
||||
var l = s.length;
|
||||
if (i >= l) {
|
||||
return -1
|
||||
}
|
||||
var c = s.charCodeAt(i);
|
||||
if (!this.switchU || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l) {
|
||||
if (!(forceU || this.switchU) || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l) {
|
||||
return c
|
||||
}
|
||||
var next = s.charCodeAt(i + 1);
|
||||
return next >= 0xDC00 && next <= 0xDFFF ? (c << 10) + next - 0x35FDC00 : c
|
||||
};
|
||||
|
||||
RegExpValidationState.prototype.nextIndex = function nextIndex (i) {
|
||||
RegExpValidationState.prototype.nextIndex = function nextIndex (i, forceU) {
|
||||
if ( forceU === void 0 ) forceU = false;
|
||||
|
||||
var s = this.source;
|
||||
var l = s.length;
|
||||
if (i >= l) {
|
||||
return l
|
||||
}
|
||||
var c = s.charCodeAt(i), next;
|
||||
if (!this.switchU || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l ||
|
||||
if (!(forceU || this.switchU) || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l ||
|
||||
(next = s.charCodeAt(i + 1)) < 0xDC00 || next > 0xDFFF) {
|
||||
return i + 1
|
||||
}
|
||||
return i + 2
|
||||
};
|
||||
|
||||
RegExpValidationState.prototype.current = function current () {
|
||||
return this.at(this.pos)
|
||||
RegExpValidationState.prototype.current = function current (forceU) {
|
||||
if ( forceU === void 0 ) forceU = false;
|
||||
|
||||
return this.at(this.pos, forceU)
|
||||
};
|
||||
|
||||
RegExpValidationState.prototype.lookahead = function lookahead () {
|
||||
return this.at(this.nextIndex(this.pos))
|
||||
RegExpValidationState.prototype.lookahead = function lookahead (forceU) {
|
||||
if ( forceU === void 0 ) forceU = false;
|
||||
|
||||
return this.at(this.nextIndex(this.pos, forceU), forceU)
|
||||
};
|
||||
|
||||
RegExpValidationState.prototype.advance = function advance () {
|
||||
this.pos = this.nextIndex(this.pos);
|
||||
RegExpValidationState.prototype.advance = function advance (forceU) {
|
||||
if ( forceU === void 0 ) forceU = false;
|
||||
|
||||
this.pos = this.nextIndex(this.pos, forceU);
|
||||
};
|
||||
|
||||
RegExpValidationState.prototype.eat = function eat (ch) {
|
||||
if (this.current() === ch) {
|
||||
this.advance();
|
||||
RegExpValidationState.prototype.eat = function eat (ch, forceU) {
|
||||
if ( forceU === void 0 ) forceU = false;
|
||||
|
||||
if (this.current(forceU) === ch) {
|
||||
this.advance(forceU);
|
||||
return true
|
||||
}
|
||||
return false
|
||||
@@ -3303,7 +3417,7 @@ pp$8.regexp_pattern = function(state) {
|
||||
if (state.eat(0x29 /* ) */)) {
|
||||
state.raise("Unmatched ')'");
|
||||
}
|
||||
if (state.eat(0x5D /* [ */) || state.eat(0x7D /* } */)) {
|
||||
if (state.eat(0x5D /* ] */) || state.eat(0x7D /* } */)) {
|
||||
state.raise("Lone quantifier brackets");
|
||||
}
|
||||
}
|
||||
@@ -3571,9 +3685,9 @@ pp$8.regexp_eatExtendedPatternCharacter = function(state) {
|
||||
return false
|
||||
};
|
||||
|
||||
// GroupSpecifier[U] ::
|
||||
// GroupSpecifier ::
|
||||
// [empty]
|
||||
// `?` GroupName[?U]
|
||||
// `?` GroupName
|
||||
pp$8.regexp_groupSpecifier = function(state) {
|
||||
if (state.eat(0x3F /* ? */)) {
|
||||
if (this.regexp_eatGroupName(state)) {
|
||||
@@ -3587,8 +3701,8 @@ pp$8.regexp_groupSpecifier = function(state) {
|
||||
}
|
||||
};
|
||||
|
||||
// GroupName[U] ::
|
||||
// `<` RegExpIdentifierName[?U] `>`
|
||||
// GroupName ::
|
||||
// `<` RegExpIdentifierName `>`
|
||||
// Note: this updates `state.lastStringValue` property with the eaten name.
|
||||
pp$8.regexp_eatGroupName = function(state) {
|
||||
state.lastStringValue = "";
|
||||
@@ -3601,9 +3715,9 @@ pp$8.regexp_eatGroupName = function(state) {
|
||||
return false
|
||||
};
|
||||
|
||||
// RegExpIdentifierName[U] ::
|
||||
// RegExpIdentifierStart[?U]
|
||||
// RegExpIdentifierName[?U] RegExpIdentifierPart[?U]
|
||||
// RegExpIdentifierName ::
|
||||
// RegExpIdentifierStart
|
||||
// RegExpIdentifierName RegExpIdentifierPart
|
||||
// Note: this updates `state.lastStringValue` property with the eaten name.
|
||||
pp$8.regexp_eatRegExpIdentifierName = function(state) {
|
||||
state.lastStringValue = "";
|
||||
@@ -3617,17 +3731,18 @@ pp$8.regexp_eatRegExpIdentifierName = function(state) {
|
||||
return false
|
||||
};
|
||||
|
||||
// RegExpIdentifierStart[U] ::
|
||||
// RegExpIdentifierStart ::
|
||||
// UnicodeIDStart
|
||||
// `$`
|
||||
// `_`
|
||||
// `\` RegExpUnicodeEscapeSequence[?U]
|
||||
// `\` RegExpUnicodeEscapeSequence[+U]
|
||||
pp$8.regexp_eatRegExpIdentifierStart = function(state) {
|
||||
var start = state.pos;
|
||||
var ch = state.current();
|
||||
state.advance();
|
||||
var forceU = this.options.ecmaVersion >= 11;
|
||||
var ch = state.current(forceU);
|
||||
state.advance(forceU);
|
||||
|
||||
if (ch === 0x5C /* \ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state)) {
|
||||
if (ch === 0x5C /* \ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU)) {
|
||||
ch = state.lastIntValue;
|
||||
}
|
||||
if (isRegExpIdentifierStart(ch)) {
|
||||
@@ -3642,19 +3757,20 @@ function isRegExpIdentifierStart(ch) {
|
||||
return isIdentifierStart(ch, true) || ch === 0x24 /* $ */ || ch === 0x5F /* _ */
|
||||
}
|
||||
|
||||
// RegExpIdentifierPart[U] ::
|
||||
// RegExpIdentifierPart ::
|
||||
// UnicodeIDContinue
|
||||
// `$`
|
||||
// `_`
|
||||
// `\` RegExpUnicodeEscapeSequence[?U]
|
||||
// `\` RegExpUnicodeEscapeSequence[+U]
|
||||
// <ZWNJ>
|
||||
// <ZWJ>
|
||||
pp$8.regexp_eatRegExpIdentifierPart = function(state) {
|
||||
var start = state.pos;
|
||||
var ch = state.current();
|
||||
state.advance();
|
||||
var forceU = this.options.ecmaVersion >= 11;
|
||||
var ch = state.current(forceU);
|
||||
state.advance(forceU);
|
||||
|
||||
if (ch === 0x5C /* \ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state)) {
|
||||
if (ch === 0x5C /* \ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU)) {
|
||||
ch = state.lastIntValue;
|
||||
}
|
||||
if (isRegExpIdentifierPart(ch)) {
|
||||
@@ -3724,7 +3840,7 @@ pp$8.regexp_eatCharacterEscape = function(state) {
|
||||
this.regexp_eatCControlLetter(state) ||
|
||||
this.regexp_eatZero(state) ||
|
||||
this.regexp_eatHexEscapeSequence(state) ||
|
||||
this.regexp_eatRegExpUnicodeEscapeSequence(state) ||
|
||||
this.regexp_eatRegExpUnicodeEscapeSequence(state, false) ||
|
||||
(!state.switchU && this.regexp_eatLegacyOctalEscapeSequence(state)) ||
|
||||
this.regexp_eatIdentityEscape(state)
|
||||
)
|
||||
@@ -3797,13 +3913,16 @@ function isControlLetter(ch) {
|
||||
}
|
||||
|
||||
// https://www.ecma-international.org/ecma-262/8.0/#prod-RegExpUnicodeEscapeSequence
|
||||
pp$8.regexp_eatRegExpUnicodeEscapeSequence = function(state) {
|
||||
pp$8.regexp_eatRegExpUnicodeEscapeSequence = function(state, forceU) {
|
||||
if ( forceU === void 0 ) forceU = false;
|
||||
|
||||
var start = state.pos;
|
||||
var switchU = forceU || state.switchU;
|
||||
|
||||
if (state.eat(0x75 /* u */)) {
|
||||
if (this.regexp_eatFixedHexDigits(state, 4)) {
|
||||
var lead = state.lastIntValue;
|
||||
if (state.switchU && lead >= 0xD800 && lead <= 0xDBFF) {
|
||||
if (switchU && lead >= 0xD800 && lead <= 0xDBFF) {
|
||||
var leadSurrogateEnd = state.pos;
|
||||
if (state.eat(0x5C /* \ */) && state.eat(0x75 /* u */) && this.regexp_eatFixedHexDigits(state, 4)) {
|
||||
var trail = state.lastIntValue;
|
||||
@@ -3818,7 +3937,7 @@ pp$8.regexp_eatRegExpUnicodeEscapeSequence = function(state) {
|
||||
return true
|
||||
}
|
||||
if (
|
||||
state.switchU &&
|
||||
switchU &&
|
||||
state.eat(0x7B /* { */) &&
|
||||
this.regexp_eatHexDigits(state) &&
|
||||
state.eat(0x7D /* } */) &&
|
||||
@@ -3826,7 +3945,7 @@ pp$8.regexp_eatRegExpUnicodeEscapeSequence = function(state) {
|
||||
) {
|
||||
return true
|
||||
}
|
||||
if (state.switchU) {
|
||||
if (switchU) {
|
||||
state.raise("Invalid unicode escape");
|
||||
}
|
||||
state.pos = start;
|
||||
@@ -3992,7 +4111,7 @@ pp$8.regexp_eatCharacterClass = function(state) {
|
||||
if (state.eat(0x5B /* [ */)) {
|
||||
state.eat(0x5E /* ^ */);
|
||||
this.regexp_classRanges(state);
|
||||
if (state.eat(0x5D /* [ */)) {
|
||||
if (state.eat(0x5D /* ] */)) {
|
||||
return true
|
||||
}
|
||||
// Unreachable since it threw "unterminated regular expression" error before.
|
||||
@@ -4040,7 +4159,7 @@ pp$8.regexp_eatClassAtom = function(state) {
|
||||
}
|
||||
|
||||
var ch = state.current();
|
||||
if (ch !== 0x5D /* [ */) {
|
||||
if (ch !== 0x5D /* ] */) {
|
||||
state.lastIntValue = ch;
|
||||
state.advance();
|
||||
return true
|
||||
@@ -4219,7 +4338,9 @@ var pp$9 = Parser.prototype;
|
||||
|
||||
// Move to the next token
|
||||
|
||||
pp$9.next = function() {
|
||||
pp$9.next = function(ignoreEscapeSequenceInKeyword) {
|
||||
if (!ignoreEscapeSequenceInKeyword && this.type.keyword && this.containsEsc)
|
||||
{ this.raiseRecoverable(this.start, "Escape sequence in keyword " + this.type.keyword); }
|
||||
if (this.options.onToken)
|
||||
{ this.options.onToken(new Token(this)); }
|
||||
|
||||
@@ -4480,6 +4601,18 @@ pp$9.readToken_eq_excl = function(code) { // '=!'
|
||||
return this.finishOp(code === 61 ? types.eq : types.prefix, 1)
|
||||
};
|
||||
|
||||
pp$9.readToken_question = function() { // '?'
|
||||
if (this.options.ecmaVersion >= 11) {
|
||||
var next = this.input.charCodeAt(this.pos + 1);
|
||||
if (next === 46) {
|
||||
var next2 = this.input.charCodeAt(this.pos + 2);
|
||||
if (next2 < 48 || next2 > 57) { return this.finishOp(types.questionDot, 2) }
|
||||
}
|
||||
if (next === 63) { return this.finishOp(types.coalesce, 2) }
|
||||
}
|
||||
return this.finishOp(types.question, 1)
|
||||
};
|
||||
|
||||
pp$9.getTokenFromCode = function(code) {
|
||||
switch (code) {
|
||||
// The interpretation of a dot depends on whether it is followed
|
||||
@@ -4497,7 +4630,6 @@ pp$9.getTokenFromCode = function(code) {
|
||||
case 123: ++this.pos; return this.finishToken(types.braceL)
|
||||
case 125: ++this.pos; return this.finishToken(types.braceR)
|
||||
case 58: ++this.pos; return this.finishToken(types.colon)
|
||||
case 63: ++this.pos; return this.finishToken(types.question)
|
||||
|
||||
case 96: // '`'
|
||||
if (this.options.ecmaVersion < 6) { break }
|
||||
@@ -4547,6 +4679,9 @@ pp$9.getTokenFromCode = function(code) {
|
||||
case 61: case 33: // '=!'
|
||||
return this.readToken_eq_excl(code)
|
||||
|
||||
case 63: // '?'
|
||||
return this.readToken_question()
|
||||
|
||||
case 126: // '~'
|
||||
return this.finishOp(types.prefix, 1)
|
||||
}
|
||||
@@ -4638,7 +4773,6 @@ pp$9.readNumber = function(startsWithDot) {
|
||||
if (!startsWithDot && this.readInt(10) === null) { this.raise(start, "Invalid number"); }
|
||||
var octal = this.pos - start >= 2 && this.input.charCodeAt(start) === 48;
|
||||
if (octal && this.strict) { this.raise(start, "Invalid number"); }
|
||||
if (octal && /[89]/.test(this.input.slice(start, this.pos))) { octal = false; }
|
||||
var next = this.input.charCodeAt(this.pos);
|
||||
if (!octal && !startsWithDot && this.options.ecmaVersion >= 11 && next === 110) {
|
||||
var str$1 = this.input.slice(start, this.pos);
|
||||
@@ -4647,6 +4781,7 @@ pp$9.readNumber = function(startsWithDot) {
|
||||
if (isIdentifierStart(this.fullCharCodeAtPos())) { this.raise(this.pos, "Identifier directly after number"); }
|
||||
return this.finishToken(types.num, val$1)
|
||||
}
|
||||
if (octal && /[89]/.test(this.input.slice(start, this.pos))) { octal = false; }
|
||||
if (next === 46 && !octal) { // '.'
|
||||
++this.pos;
|
||||
this.readInt(10);
|
||||
@@ -4821,6 +4956,18 @@ pp$9.readEscapedChar = function(inTemplate) {
|
||||
case 10: // ' \n'
|
||||
if (this.options.locations) { this.lineStart = this.pos; ++this.curLine; }
|
||||
return ""
|
||||
case 56:
|
||||
case 57:
|
||||
if (inTemplate) {
|
||||
var codePos = this.pos - 1;
|
||||
|
||||
this.invalidStringToken(
|
||||
codePos,
|
||||
"Invalid escape sequence in template string"
|
||||
);
|
||||
|
||||
return null
|
||||
}
|
||||
default:
|
||||
if (ch >= 48 && ch <= 55) {
|
||||
var octalStr = this.input.substr(this.pos - 1, 3).match(/^[0-7]+/)[0];
|
||||
@@ -4900,7 +5047,6 @@ pp$9.readWord = function() {
|
||||
var word = this.readWord1();
|
||||
var type = types.name;
|
||||
if (this.keywords.test(word)) {
|
||||
if (this.containsEsc) { this.raiseRecoverable(this.start, "Escape sequence in keyword " + word); }
|
||||
type = keywords$1[word];
|
||||
}
|
||||
return this.finishToken(type, word)
|
||||
@@ -4908,7 +5054,7 @@ pp$9.readWord = function() {
|
||||
|
||||
// Acorn is a tiny, fast JavaScript parser written in JavaScript.
|
||||
|
||||
var version = "6.4.0";
|
||||
var version = "7.3.1";
|
||||
|
||||
Parser.acorn = {
|
||||
Parser: Parser,
|
||||
|
2
node_modules/acorn/dist/acorn.mjs.d.ts
generated
vendored
Normal file
2
node_modules/acorn/dist/acorn.mjs.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
import * as acorn from "./acorn";
|
||||
export = acorn;
|
25
node_modules/acorn/package.json
generated
vendored
25
node_modules/acorn/package.json
generated
vendored
@@ -1,28 +1,28 @@
|
||||
{
|
||||
"_from": "acorn@6.4.1",
|
||||
"_id": "acorn@6.4.1",
|
||||
"_from": "acorn@^7.1.1",
|
||||
"_id": "acorn@7.3.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-ZVA9k326Nwrj3Cj9jlh3wGFutC2ZornPNARZwsNYqQYgN0EsV2d53w5RN/co65Ohn4sUAUtb1rSUAOD6XN9idA==",
|
||||
"_integrity": "sha512-tLc0wSnatxAQHVHUapaHdz72pi9KUyHjq5KyHjGg9Y8Ifdc79pTh2XvI6I1/chZbnM7QtNKzh66ooDogPZSleA==",
|
||||
"_location": "/acorn",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "acorn@6.4.1",
|
||||
"raw": "acorn@^7.1.1",
|
||||
"name": "acorn",
|
||||
"escapedName": "acorn",
|
||||
"rawSpec": "6.4.1",
|
||||
"rawSpec": "^7.1.1",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "6.4.1"
|
||||
"fetchSpec": "^7.1.1"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/acorn-globals",
|
||||
"/jsdom"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.1.tgz",
|
||||
"_shasum": "531e58ba3f51b9dacb9a6646ca4debf5b14ca474",
|
||||
"_spec": "acorn@6.4.1",
|
||||
"_where": "/home/s2/Code/minifyfromhtml/node_modules/jsdom",
|
||||
"_resolved": "https://registry.npmjs.org/acorn/-/acorn-7.3.1.tgz",
|
||||
"_shasum": "85010754db53c3fbaf3b9ea3e083aa5c5d147ffd",
|
||||
"_spec": "acorn@^7.1.1",
|
||||
"_where": "D:\\Projects\\minifyfromhtml\\node_modules\\jsdom",
|
||||
"bin": {
|
||||
"acorn": "bin/acorn"
|
||||
},
|
||||
@@ -63,5 +63,6 @@
|
||||
"scripts": {
|
||||
"prepare": "cd ..; npm run build:main && npm run build:bin"
|
||||
},
|
||||
"version": "6.4.1"
|
||||
"types": "dist/acorn.d.ts",
|
||||
"version": "7.3.1"
|
||||
}
|
||||
|
Reference in New Issue
Block a user