@putout/babel 2.1.0 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/index.d.ts +0 -1
- package/bundle/index.js +662 -1096
- package/package.json +4 -4
package/bundle/index.js
CHANGED
|
@@ -452,7 +452,7 @@ var __publicField = function(obj, key, value1) {
|
|
|
452
452
|
};
|
|
453
453
|
// node_modules/to-fast-properties/index.js
|
|
454
454
|
var require_to_fast_properties = __commonJS({
|
|
455
|
-
"node_modules/to-fast-properties/index.js": function(
|
|
455
|
+
"node_modules/to-fast-properties/index.js": function(exports2, module2) {
|
|
456
456
|
"use strict";
|
|
457
457
|
var fastProto = null;
|
|
458
458
|
function FastObject(o) {
|
|
@@ -475,7 +475,7 @@ var require_to_fast_properties = __commonJS({
|
|
|
475
475
|
});
|
|
476
476
|
// node_modules/@babel/highlight/node_modules/js-tokens/index.js
|
|
477
477
|
var require_js_tokens = __commonJS({
|
|
478
|
-
"node_modules/@babel/highlight/node_modules/js-tokens/index.js": function(
|
|
478
|
+
"node_modules/@babel/highlight/node_modules/js-tokens/index.js": function(exports2, module2) {
|
|
479
479
|
var Identifier2;
|
|
480
480
|
var JSXIdentifier2;
|
|
481
481
|
var JSXPunctuator;
|
|
@@ -1294,7 +1294,7 @@ var require_js_tokens = __commonJS({
|
|
|
1294
1294
|
});
|
|
1295
1295
|
// node_modules/jsesc/jsesc.js
|
|
1296
1296
|
var require_jsesc = __commonJS({
|
|
1297
|
-
"node_modules/jsesc/jsesc.js": function(
|
|
1297
|
+
"node_modules/jsesc/jsesc.js": function(exports2, module2) {
|
|
1298
1298
|
"use strict";
|
|
1299
1299
|
var object = {};
|
|
1300
1300
|
var hasOwnProperty = object.hasOwnProperty;
|
|
@@ -1515,7 +1515,7 @@ var require_jsesc = __commonJS({
|
|
|
1515
1515
|
if (lone) {
|
|
1516
1516
|
return fourHexEscape(hexadecimal(lone.charCodeAt(0), lowercaseHex));
|
|
1517
1517
|
}
|
|
1518
|
-
if (char == "\
|
|
1518
|
+
if (char == "\0" && !json && !regexDigit.test(string.charAt(index3 + 1))) {
|
|
1519
1519
|
return "\\0";
|
|
1520
1520
|
}
|
|
1521
1521
|
if (quoteChar) {
|
|
@@ -1553,7 +1553,7 @@ var require_jsesc = __commonJS({
|
|
|
1553
1553
|
});
|
|
1554
1554
|
// node_modules/ms/index.js
|
|
1555
1555
|
var require_ms = __commonJS({
|
|
1556
|
-
"node_modules/ms/index.js": function(
|
|
1556
|
+
"node_modules/ms/index.js": function(exports2, module2) {
|
|
1557
1557
|
var s = 1e3;
|
|
1558
1558
|
var m = s * 60;
|
|
1559
1559
|
var h = m * 60;
|
|
@@ -1664,7 +1664,7 @@ var require_ms = __commonJS({
|
|
|
1664
1664
|
});
|
|
1665
1665
|
// node_modules/debug/src/common.js
|
|
1666
1666
|
var require_common = __commonJS({
|
|
1667
|
-
"node_modules/debug/src/common.js": function(
|
|
1667
|
+
"node_modules/debug/src/common.js": function(exports2, module2) {
|
|
1668
1668
|
function setup2(env3) {
|
|
1669
1669
|
createDebug.debug = createDebug;
|
|
1670
1670
|
createDebug.default = createDebug;
|
|
@@ -1828,13 +1828,13 @@ var require_common = __commonJS({
|
|
|
1828
1828
|
});
|
|
1829
1829
|
// node_modules/debug/src/browser.js
|
|
1830
1830
|
var require_browser = __commonJS({
|
|
1831
|
-
"node_modules/debug/src/browser.js": function(
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1831
|
+
"node_modules/debug/src/browser.js": function(exports2, module2) {
|
|
1832
|
+
exports2.formatArgs = formatArgs;
|
|
1833
|
+
exports2.save = save;
|
|
1834
|
+
exports2.load = load;
|
|
1835
|
+
exports2.useColors = useColors;
|
|
1836
|
+
exports2.storage = localstorage();
|
|
1837
|
+
exports2.destroy = /* @__PURE__ */ function() {
|
|
1838
1838
|
var warned = false;
|
|
1839
1839
|
return function() {
|
|
1840
1840
|
if (!warned) {
|
|
@@ -1843,7 +1843,7 @@ var require_browser = __commonJS({
|
|
|
1843
1843
|
}
|
|
1844
1844
|
};
|
|
1845
1845
|
}();
|
|
1846
|
-
|
|
1846
|
+
exports2.colors = [
|
|
1847
1847
|
"#0000CC",
|
|
1848
1848
|
"#0000FF",
|
|
1849
1849
|
"#0033CC",
|
|
@@ -1954,20 +1954,20 @@ var require_browser = __commonJS({
|
|
|
1954
1954
|
});
|
|
1955
1955
|
args.splice(lastC, 0, c);
|
|
1956
1956
|
}
|
|
1957
|
-
|
|
1957
|
+
exports2.log = console.debug || console.log || function() {};
|
|
1958
1958
|
function save(namespaces) {
|
|
1959
1959
|
try {
|
|
1960
1960
|
if (namespaces) {
|
|
1961
|
-
|
|
1961
|
+
exports2.storage.setItem("debug", namespaces);
|
|
1962
1962
|
} else {
|
|
1963
|
-
|
|
1963
|
+
exports2.storage.removeItem("debug");
|
|
1964
1964
|
}
|
|
1965
1965
|
} catch (error) {}
|
|
1966
1966
|
}
|
|
1967
1967
|
function load() {
|
|
1968
1968
|
var r;
|
|
1969
1969
|
try {
|
|
1970
|
-
r =
|
|
1970
|
+
r = exports2.storage.getItem("debug");
|
|
1971
1971
|
} catch (error) {}
|
|
1972
1972
|
if (!r && typeof process !== "undefined" && "env" in process) {
|
|
1973
1973
|
r = process.env.DEBUG;
|
|
@@ -1979,7 +1979,7 @@ var require_browser = __commonJS({
|
|
|
1979
1979
|
return localStorage;
|
|
1980
1980
|
} catch (error) {}
|
|
1981
1981
|
}
|
|
1982
|
-
module2.exports = require_common()(
|
|
1982
|
+
module2.exports = require_common()(exports2);
|
|
1983
1983
|
var formatters = module2.exports.formatters;
|
|
1984
1984
|
formatters.j = function(v) {
|
|
1985
1985
|
try {
|
|
@@ -1992,7 +1992,7 @@ var require_browser = __commonJS({
|
|
|
1992
1992
|
});
|
|
1993
1993
|
// node_modules/has-flag/index.js
|
|
1994
1994
|
var require_has_flag = __commonJS({
|
|
1995
|
-
"node_modules/has-flag/index.js": function(
|
|
1995
|
+
"node_modules/has-flag/index.js": function(exports2, module2) {
|
|
1996
1996
|
"use strict";
|
|
1997
1997
|
module2.exports = function(flag) {
|
|
1998
1998
|
var argv = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : process.argv;
|
|
@@ -2005,7 +2005,7 @@ var require_has_flag = __commonJS({
|
|
|
2005
2005
|
});
|
|
2006
2006
|
// node_modules/supports-color/index.js
|
|
2007
2007
|
var require_supports_color = __commonJS({
|
|
2008
|
-
"node_modules/supports-color/index.js": function(
|
|
2008
|
+
"node_modules/supports-color/index.js": function(exports2, module2) {
|
|
2009
2009
|
"use strict";
|
|
2010
2010
|
var os3 = require("os");
|
|
2011
2011
|
var tty3 = require("tty");
|
|
@@ -2115,17 +2115,17 @@ var require_supports_color = __commonJS({
|
|
|
2115
2115
|
});
|
|
2116
2116
|
// node_modules/debug/src/node.js
|
|
2117
2117
|
var require_node = __commonJS({
|
|
2118
|
-
"node_modules/debug/src/node.js": function(
|
|
2118
|
+
"node_modules/debug/src/node.js": function(exports2, module2) {
|
|
2119
2119
|
var tty3 = require("tty");
|
|
2120
2120
|
var util = require("util");
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2121
|
+
exports2.init = init;
|
|
2122
|
+
exports2.log = log;
|
|
2123
|
+
exports2.formatArgs = formatArgs;
|
|
2124
|
+
exports2.save = save;
|
|
2125
|
+
exports2.load = load;
|
|
2126
|
+
exports2.useColors = useColors;
|
|
2127
|
+
exports2.destroy = util.deprecate(function() {}, "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
|
|
2128
|
+
exports2.colors = [
|
|
2129
2129
|
6,
|
|
2130
2130
|
2,
|
|
2131
2131
|
3,
|
|
@@ -2136,7 +2136,7 @@ var require_node = __commonJS({
|
|
|
2136
2136
|
try {
|
|
2137
2137
|
var supportsColor3 = require_supports_color();
|
|
2138
2138
|
if (supportsColor3 && (supportsColor3.stderr || supportsColor3).level >= 2) {
|
|
2139
|
-
|
|
2139
|
+
exports2.colors = [
|
|
2140
2140
|
20,
|
|
2141
2141
|
21,
|
|
2142
2142
|
26,
|
|
@@ -2216,7 +2216,7 @@ var require_node = __commonJS({
|
|
|
2216
2216
|
];
|
|
2217
2217
|
}
|
|
2218
2218
|
} catch (error) {}
|
|
2219
|
-
|
|
2219
|
+
exports2.inspectOpts = Object.keys(process.env).filter(function(key) {
|
|
2220
2220
|
return /^debug_/i.test(key);
|
|
2221
2221
|
}).reduce(function(obj, key) {
|
|
2222
2222
|
var prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, function(_, k) {
|
|
@@ -2236,7 +2236,7 @@ var require_node = __commonJS({
|
|
|
2236
2236
|
return obj;
|
|
2237
2237
|
}, {});
|
|
2238
2238
|
function useColors() {
|
|
2239
|
-
return "colors" in
|
|
2239
|
+
return "colors" in exports2.inspectOpts ? Boolean(exports2.inspectOpts.colors) : tty3.isatty(process.stderr.fd);
|
|
2240
2240
|
}
|
|
2241
2241
|
function formatArgs(args) {
|
|
2242
2242
|
var _this = this, name = _this.namespace, useColors2 = _this.useColors;
|
|
@@ -2251,7 +2251,7 @@ var require_node = __commonJS({
|
|
|
2251
2251
|
}
|
|
2252
2252
|
}
|
|
2253
2253
|
function getDate() {
|
|
2254
|
-
if (
|
|
2254
|
+
if (exports2.inspectOpts.hideDate) {
|
|
2255
2255
|
return "";
|
|
2256
2256
|
}
|
|
2257
2257
|
return /* @__PURE__ */ new Date().toISOString() + " ";
|
|
@@ -2275,12 +2275,12 @@ var require_node = __commonJS({
|
|
|
2275
2275
|
}
|
|
2276
2276
|
function init(debug2) {
|
|
2277
2277
|
debug2.inspectOpts = {};
|
|
2278
|
-
var keys = Object.keys(
|
|
2278
|
+
var keys = Object.keys(exports2.inspectOpts);
|
|
2279
2279
|
for(var i = 0; i < keys.length; i++){
|
|
2280
|
-
debug2.inspectOpts[keys[i]] =
|
|
2280
|
+
debug2.inspectOpts[keys[i]] = exports2.inspectOpts[keys[i]];
|
|
2281
2281
|
}
|
|
2282
2282
|
}
|
|
2283
|
-
module2.exports = require_common()(
|
|
2283
|
+
module2.exports = require_common()(exports2);
|
|
2284
2284
|
var formatters = module2.exports.formatters;
|
|
2285
2285
|
formatters.o = function(v) {
|
|
2286
2286
|
this.inspectOpts.colors = this.useColors;
|
|
@@ -2296,7 +2296,7 @@ var require_node = __commonJS({
|
|
|
2296
2296
|
});
|
|
2297
2297
|
// node_modules/debug/src/index.js
|
|
2298
2298
|
var require_src = __commonJS({
|
|
2299
|
-
"node_modules/debug/src/index.js": function(
|
|
2299
|
+
"node_modules/debug/src/index.js": function(exports2, module2) {
|
|
2300
2300
|
if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) {
|
|
2301
2301
|
module2.exports = require_browser();
|
|
2302
2302
|
} else {
|
|
@@ -2306,7 +2306,7 @@ var require_src = __commonJS({
|
|
|
2306
2306
|
});
|
|
2307
2307
|
// node_modules/globals/globals.json
|
|
2308
2308
|
var require_globals = __commonJS({
|
|
2309
|
-
"node_modules/globals/globals.json": function(
|
|
2309
|
+
"node_modules/globals/globals.json": function(exports2, module2) {
|
|
2310
2310
|
module2.exports = {
|
|
2311
2311
|
builtin: {
|
|
2312
2312
|
AggregateError: false,
|
|
@@ -4309,7 +4309,7 @@ var require_globals = __commonJS({
|
|
|
4309
4309
|
});
|
|
4310
4310
|
// node_modules/globals/index.js
|
|
4311
4311
|
var require_globals2 = __commonJS({
|
|
4312
|
-
"node_modules/globals/index.js": function(
|
|
4312
|
+
"node_modules/globals/index.js": function(exports2, module2) {
|
|
4313
4313
|
"use strict";
|
|
4314
4314
|
module2.exports = require_globals();
|
|
4315
4315
|
}
|
|
@@ -13539,9 +13539,6 @@ defineType$4("Program", {
|
|
|
13539
13539
|
"interpreter"
|
|
13540
13540
|
],
|
|
13541
13541
|
fields: {
|
|
13542
|
-
sourceFile: {
|
|
13543
|
-
validate: assertValueType("string")
|
|
13544
|
-
},
|
|
13545
13542
|
sourceType: {
|
|
13546
13543
|
validate: assertOneOf("script", "module"),
|
|
13547
13544
|
default: "script"
|
|
@@ -17554,8 +17551,7 @@ function program(body) {
|
|
|
17554
17551
|
body: body,
|
|
17555
17552
|
directives: directives,
|
|
17556
17553
|
sourceType: sourceType,
|
|
17557
|
-
interpreter: interpreter
|
|
17558
|
-
sourceFile: null
|
|
17554
|
+
interpreter: interpreter
|
|
17559
17555
|
});
|
|
17560
17556
|
}
|
|
17561
17557
|
function objectExpression(properties) {
|
|
@@ -21835,10 +21831,10 @@ var PipelineOperatorErrors = {
|
|
|
21835
21831
|
PrimaryTopicNotAllowed: "Topic reference was used in a lexical context without topic binding.",
|
|
21836
21832
|
PrimaryTopicRequiresSmartPipeline: 'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.'
|
|
21837
21833
|
};
|
|
21838
|
-
var _excluded
|
|
21834
|
+
var _excluded = [
|
|
21839
21835
|
"toMessage"
|
|
21840
21836
|
];
|
|
21841
|
-
var _excluded2
|
|
21837
|
+
var _excluded2 = [
|
|
21842
21838
|
"message"
|
|
21843
21839
|
];
|
|
21844
21840
|
function defineHidden(obj, key, value1) {
|
|
@@ -21849,9 +21845,8 @@ function defineHidden(obj, key, value1) {
|
|
|
21849
21845
|
});
|
|
21850
21846
|
}
|
|
21851
21847
|
function toParseErrorConstructor(_ref) {
|
|
21852
|
-
var toMessage = _ref.toMessage, properties = _objectWithoutPropertiesLoose(_ref, _excluded
|
|
21853
|
-
return function constructor(
|
|
21854
|
-
var loc = param.loc, details = param.details;
|
|
21848
|
+
var toMessage = _ref.toMessage, properties = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
21849
|
+
return function constructor(loc, details) {
|
|
21855
21850
|
var error = new SyntaxError();
|
|
21856
21851
|
Object.assign(error, properties, {
|
|
21857
21852
|
loc: loc,
|
|
@@ -21866,10 +21861,7 @@ function toParseErrorConstructor(_ref) {
|
|
|
21866
21861
|
var overrides = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
21867
21862
|
var _overrides_loc;
|
|
21868
21863
|
var _$_ref = (_overrides_loc = overrides.loc) !== null && _overrides_loc !== void 0 ? _overrides_loc : loc, line = _$_ref.line, column = _$_ref.column, index3 = _$_ref.index;
|
|
21869
|
-
return constructor({
|
|
21870
|
-
loc: new Position(line, column, index3),
|
|
21871
|
-
details: Object.assign({}, details, overrides.details)
|
|
21872
|
-
});
|
|
21864
|
+
return constructor(new Position(line, column, index3), Object.assign({}, details, overrides.details));
|
|
21873
21865
|
});
|
|
21874
21866
|
defineHidden(error, "details", details);
|
|
21875
21867
|
Object.defineProperty(error, "message", {
|
|
@@ -21907,7 +21899,7 @@ function ParseErrorEnum(argument, syntaxPlugin) {
|
|
|
21907
21899
|
}
|
|
21908
21900
|
} : typeof _$template === "function" ? {
|
|
21909
21901
|
message: _$template
|
|
21910
|
-
} : _$template, message = _ref2.message, rest = _objectWithoutPropertiesLoose(_ref2, _excluded2
|
|
21902
|
+
} : _$template, message = _ref2.message, rest = _objectWithoutPropertiesLoose(_ref2, _excluded2);
|
|
21911
21903
|
var toMessage = typeof message === "string" ? function() {
|
|
21912
21904
|
return message;
|
|
21913
21905
|
} : message;
|
|
@@ -22258,13 +22250,9 @@ var estree = function(superClass) {
|
|
|
22258
22250
|
key: "toAssignableObjectExpressionProp",
|
|
22259
22251
|
value: function toAssignableObjectExpressionProp(prop, isLast, isLHS) {
|
|
22260
22252
|
if (prop.kind === "get" || prop.kind === "set") {
|
|
22261
|
-
this.raise(Errors.PatternHasAccessor,
|
|
22262
|
-
at: prop.key
|
|
22263
|
-
});
|
|
22253
|
+
this.raise(Errors.PatternHasAccessor, prop.key);
|
|
22264
22254
|
} else if (prop.method) {
|
|
22265
|
-
this.raise(Errors.PatternHasMethod,
|
|
22266
|
-
at: prop.key
|
|
22267
|
-
});
|
|
22255
|
+
this.raise(Errors.PatternHasMethod, prop.key);
|
|
22268
22256
|
} else {
|
|
22269
22257
|
_get(_get_prototype_of(ESTreeParserMixin.prototype), "toAssignableObjectExpressionProp", this).call(this, prop, isLast, isLHS);
|
|
22270
22258
|
}
|
|
@@ -23975,9 +23963,9 @@ function canBeReservedWord(word) {
|
|
|
23975
23963
|
var Scope = function Scope(flags) {
|
|
23976
23964
|
"use strict";
|
|
23977
23965
|
_class_call_check(this, Scope);
|
|
23978
|
-
__publicField(this, "
|
|
23979
|
-
__publicField(this, "
|
|
23980
|
-
__publicField(this, "
|
|
23966
|
+
__publicField(this, "flags", 0);
|
|
23967
|
+
__publicField(this, "names", /* @__PURE__ */ new Map());
|
|
23968
|
+
__publicField(this, "firstLexicalName", "");
|
|
23981
23969
|
this.flags = flags;
|
|
23982
23970
|
};
|
|
23983
23971
|
var ScopeHandler = /*#__PURE__*/ function() {
|
|
@@ -24086,11 +24074,16 @@ var ScopeHandler = /*#__PURE__*/ function() {
|
|
|
24086
24074
|
var scope2 = this.currentScope();
|
|
24087
24075
|
if (bindingType & 8 || bindingType & 16) {
|
|
24088
24076
|
this.checkRedeclarationInScope(scope2, name, bindingType, loc);
|
|
24077
|
+
var type = scope2.names.get(name) || 0;
|
|
24089
24078
|
if (bindingType & 16) {
|
|
24090
|
-
|
|
24079
|
+
type = type | 4;
|
|
24091
24080
|
} else {
|
|
24092
|
-
scope2.
|
|
24081
|
+
if (!scope2.firstLexicalName) {
|
|
24082
|
+
scope2.firstLexicalName = name;
|
|
24083
|
+
}
|
|
24084
|
+
type = type | 2;
|
|
24093
24085
|
}
|
|
24086
|
+
scope2.names.set(name, type);
|
|
24094
24087
|
if (bindingType & 8) {
|
|
24095
24088
|
this.maybeExportDefined(scope2, name);
|
|
24096
24089
|
}
|
|
@@ -24098,7 +24091,7 @@ var ScopeHandler = /*#__PURE__*/ function() {
|
|
|
24098
24091
|
for(var i = this.scopeStack.length - 1; i >= 0; --i){
|
|
24099
24092
|
scope2 = this.scopeStack[i];
|
|
24100
24093
|
this.checkRedeclarationInScope(scope2, name, bindingType, loc);
|
|
24101
|
-
scope2.
|
|
24094
|
+
scope2.names.set(name, (scope2.names.get(name) || 0) | 1);
|
|
24102
24095
|
this.maybeExportDefined(scope2, name);
|
|
24103
24096
|
if (scope2.flags & 387) break;
|
|
24104
24097
|
}
|
|
@@ -24120,8 +24113,7 @@ var ScopeHandler = /*#__PURE__*/ function() {
|
|
|
24120
24113
|
key: "checkRedeclarationInScope",
|
|
24121
24114
|
value: function checkRedeclarationInScope(scope2, name, bindingType, loc) {
|
|
24122
24115
|
if (this.isRedeclaredInScope(scope2, name, bindingType)) {
|
|
24123
|
-
this.parser.raise(Errors.VarRedeclaration, {
|
|
24124
|
-
at: loc,
|
|
24116
|
+
this.parser.raise(Errors.VarRedeclaration, loc, {
|
|
24125
24117
|
identifierName: name
|
|
24126
24118
|
});
|
|
24127
24119
|
}
|
|
@@ -24132,12 +24124,13 @@ var ScopeHandler = /*#__PURE__*/ function() {
|
|
|
24132
24124
|
value: function isRedeclaredInScope(scope2, name, bindingType) {
|
|
24133
24125
|
if (!(bindingType & 1)) return false;
|
|
24134
24126
|
if (bindingType & 8) {
|
|
24135
|
-
return scope2.
|
|
24127
|
+
return scope2.names.has(name);
|
|
24136
24128
|
}
|
|
24129
|
+
var type = scope2.names.get(name);
|
|
24137
24130
|
if (bindingType & 16) {
|
|
24138
|
-
return
|
|
24131
|
+
return (type & 2) > 0 || !this.treatFunctionsAsVarInScope(scope2) && (type & 1) > 0;
|
|
24139
24132
|
}
|
|
24140
|
-
return
|
|
24133
|
+
return (type & 2) > 0 && !(scope2.flags & 8 && scope2.firstLexicalName === name) || !this.treatFunctionsAsVarInScope(scope2) && (type & 4) > 0;
|
|
24141
24134
|
}
|
|
24142
24135
|
},
|
|
24143
24136
|
{
|
|
@@ -24145,7 +24138,7 @@ var ScopeHandler = /*#__PURE__*/ function() {
|
|
|
24145
24138
|
value: function checkLocalExport(id) {
|
|
24146
24139
|
var name = id.name;
|
|
24147
24140
|
var topLevelScope = this.scopeStack[0];
|
|
24148
|
-
if (!topLevelScope.
|
|
24141
|
+
if (!topLevelScope.names.has(name)) {
|
|
24149
24142
|
this.undefinedExports.set(name, id.loc.start);
|
|
24150
24143
|
}
|
|
24151
24144
|
}
|
|
@@ -24228,8 +24221,9 @@ var FlowScopeHandler = /*#__PURE__*/ function(ScopeHandler) {
|
|
|
24228
24221
|
key: "isRedeclaredInScope",
|
|
24229
24222
|
value: function isRedeclaredInScope(scope2, name, bindingType) {
|
|
24230
24223
|
if (_get(_get_prototype_of(FlowScopeHandler.prototype), "isRedeclaredInScope", this).call(this, scope2, name, bindingType)) return true;
|
|
24231
|
-
if (bindingType & 2048) {
|
|
24232
|
-
|
|
24224
|
+
if (bindingType & 2048 && !scope2.declareFunctions.has(name)) {
|
|
24225
|
+
var type = scope2.names.get(name);
|
|
24226
|
+
return (type & 4) > 0 || (type & 2) > 0;
|
|
24233
24227
|
}
|
|
24234
24228
|
return false;
|
|
24235
24229
|
}
|
|
@@ -24349,7 +24343,10 @@ var CommentsParser = /*#__PURE__*/ function(BaseParser) {
|
|
|
24349
24343
|
key: "addComment",
|
|
24350
24344
|
value: function addComment(comment) {
|
|
24351
24345
|
if (this.filename) comment.loc.filename = this.filename;
|
|
24352
|
-
this.state.
|
|
24346
|
+
var commentsLen = this.state.commentsLen;
|
|
24347
|
+
if (this.comments.length != commentsLen) this.comments.length = commentsLen;
|
|
24348
|
+
this.comments.push(comment);
|
|
24349
|
+
this.state.commentsLen++;
|
|
24353
24350
|
}
|
|
24354
24351
|
},
|
|
24355
24352
|
{
|
|
@@ -24540,7 +24537,7 @@ var State = /*#__PURE__*/ function() {
|
|
|
24540
24537
|
"use strict";
|
|
24541
24538
|
function _State() {
|
|
24542
24539
|
_class_call_check(this, _State);
|
|
24543
|
-
__publicField(this, "
|
|
24540
|
+
__publicField(this, "flags", 1024);
|
|
24544
24541
|
__publicField(this, "curLine");
|
|
24545
24542
|
__publicField(this, "lineStart");
|
|
24546
24543
|
__publicField(this, "startLoc");
|
|
@@ -24549,21 +24546,12 @@ var State = /*#__PURE__*/ function() {
|
|
|
24549
24546
|
__publicField(this, "potentialArrowAt", -1);
|
|
24550
24547
|
__publicField(this, "noArrowAt", []);
|
|
24551
24548
|
__publicField(this, "noArrowParamsConversionAt", []);
|
|
24552
|
-
__publicField(this, "maybeInArrowParameters", false);
|
|
24553
|
-
__publicField(this, "inType", false);
|
|
24554
|
-
__publicField(this, "noAnonFunctionType", false);
|
|
24555
|
-
__publicField(this, "hasFlowComment", false);
|
|
24556
|
-
__publicField(this, "isAmbientContext", false);
|
|
24557
|
-
__publicField(this, "inAbstractClass", false);
|
|
24558
|
-
__publicField(this, "inDisallowConditionalTypesContext", false);
|
|
24559
24549
|
__publicField(this, "topicContext", {
|
|
24560
24550
|
maxNumOfResolvableTopics: 0,
|
|
24561
24551
|
maxTopicIndex: null
|
|
24562
24552
|
});
|
|
24563
|
-
__publicField(this, "soloAwait", false);
|
|
24564
|
-
__publicField(this, "inFSharpPipelineDirectBody", false);
|
|
24565
24553
|
__publicField(this, "labels", []);
|
|
24566
|
-
__publicField(this, "
|
|
24554
|
+
__publicField(this, "commentsLen", 0);
|
|
24567
24555
|
__publicField(this, "commentStack", []);
|
|
24568
24556
|
__publicField(this, "pos", 0);
|
|
24569
24557
|
__publicField(this, "type", 139);
|
|
@@ -24572,17 +24560,27 @@ var State = /*#__PURE__*/ function() {
|
|
|
24572
24560
|
__publicField(this, "end", 0);
|
|
24573
24561
|
__publicField(this, "lastTokEndLoc", null);
|
|
24574
24562
|
__publicField(this, "lastTokStartLoc", null);
|
|
24575
|
-
__publicField(this, "lastTokStart", 0);
|
|
24576
24563
|
__publicField(this, "context", [
|
|
24577
24564
|
types.brace
|
|
24578
24565
|
]);
|
|
24579
|
-
__publicField(this, "canStartJSXElement", true);
|
|
24580
|
-
__publicField(this, "containsEsc", false);
|
|
24581
24566
|
__publicField(this, "firstInvalidTemplateEscapePos", null);
|
|
24582
24567
|
__publicField(this, "strictErrors", /* @__PURE__ */ new Map());
|
|
24583
24568
|
__publicField(this, "tokensLength", 0);
|
|
24584
24569
|
}
|
|
24585
24570
|
_create_class(_State, [
|
|
24571
|
+
{
|
|
24572
|
+
key: "strict",
|
|
24573
|
+
get: function get() {
|
|
24574
|
+
return (this.flags & 1) > 0;
|
|
24575
|
+
},
|
|
24576
|
+
set: function set(value1) {
|
|
24577
|
+
if (value1) {
|
|
24578
|
+
this.flags |= 1;
|
|
24579
|
+
} else {
|
|
24580
|
+
this.flags &= ~1;
|
|
24581
|
+
}
|
|
24582
|
+
}
|
|
24583
|
+
},
|
|
24586
24584
|
{
|
|
24587
24585
|
key: "init",
|
|
24588
24586
|
value: function init(param) {
|
|
@@ -24593,6 +24591,149 @@ var State = /*#__PURE__*/ function() {
|
|
|
24593
24591
|
this.startLoc = this.endLoc = new Position(startLine, startColumn, 0);
|
|
24594
24592
|
}
|
|
24595
24593
|
},
|
|
24594
|
+
{
|
|
24595
|
+
key: "maybeInArrowParameters",
|
|
24596
|
+
get: function get() {
|
|
24597
|
+
return (this.flags & 2) > 0;
|
|
24598
|
+
},
|
|
24599
|
+
set: function set(value1) {
|
|
24600
|
+
if (value1) {
|
|
24601
|
+
this.flags |= 2;
|
|
24602
|
+
} else {
|
|
24603
|
+
this.flags &= ~2;
|
|
24604
|
+
}
|
|
24605
|
+
}
|
|
24606
|
+
},
|
|
24607
|
+
{
|
|
24608
|
+
key: "inType",
|
|
24609
|
+
get: function get() {
|
|
24610
|
+
return (this.flags & 4) > 0;
|
|
24611
|
+
},
|
|
24612
|
+
set: function set(value1) {
|
|
24613
|
+
if (value1) {
|
|
24614
|
+
this.flags |= 4;
|
|
24615
|
+
} else {
|
|
24616
|
+
this.flags &= ~4;
|
|
24617
|
+
}
|
|
24618
|
+
}
|
|
24619
|
+
},
|
|
24620
|
+
{
|
|
24621
|
+
key: "noAnonFunctionType",
|
|
24622
|
+
get: function get() {
|
|
24623
|
+
return (this.flags & 8) > 0;
|
|
24624
|
+
},
|
|
24625
|
+
set: function set(value1) {
|
|
24626
|
+
if (value1) {
|
|
24627
|
+
this.flags |= 8;
|
|
24628
|
+
} else {
|
|
24629
|
+
this.flags &= ~8;
|
|
24630
|
+
}
|
|
24631
|
+
}
|
|
24632
|
+
},
|
|
24633
|
+
{
|
|
24634
|
+
key: "hasFlowComment",
|
|
24635
|
+
get: function get() {
|
|
24636
|
+
return (this.flags & 16) > 0;
|
|
24637
|
+
},
|
|
24638
|
+
set: function set(value1) {
|
|
24639
|
+
if (value1) {
|
|
24640
|
+
this.flags |= 16;
|
|
24641
|
+
} else {
|
|
24642
|
+
this.flags &= ~16;
|
|
24643
|
+
}
|
|
24644
|
+
}
|
|
24645
|
+
},
|
|
24646
|
+
{
|
|
24647
|
+
key: "isAmbientContext",
|
|
24648
|
+
get: function get() {
|
|
24649
|
+
return (this.flags & 32) > 0;
|
|
24650
|
+
},
|
|
24651
|
+
set: function set(value1) {
|
|
24652
|
+
if (value1) {
|
|
24653
|
+
this.flags |= 32;
|
|
24654
|
+
} else {
|
|
24655
|
+
this.flags &= ~32;
|
|
24656
|
+
}
|
|
24657
|
+
}
|
|
24658
|
+
},
|
|
24659
|
+
{
|
|
24660
|
+
key: "inAbstractClass",
|
|
24661
|
+
get: function get() {
|
|
24662
|
+
return (this.flags & 64) > 0;
|
|
24663
|
+
},
|
|
24664
|
+
set: function set(value1) {
|
|
24665
|
+
if (value1) {
|
|
24666
|
+
this.flags |= 64;
|
|
24667
|
+
} else {
|
|
24668
|
+
this.flags &= ~64;
|
|
24669
|
+
}
|
|
24670
|
+
}
|
|
24671
|
+
},
|
|
24672
|
+
{
|
|
24673
|
+
key: "inDisallowConditionalTypesContext",
|
|
24674
|
+
get: function get() {
|
|
24675
|
+
return (this.flags & 128) > 0;
|
|
24676
|
+
},
|
|
24677
|
+
set: function set(value1) {
|
|
24678
|
+
if (value1) {
|
|
24679
|
+
this.flags |= 128;
|
|
24680
|
+
} else {
|
|
24681
|
+
this.flags &= ~128;
|
|
24682
|
+
}
|
|
24683
|
+
}
|
|
24684
|
+
},
|
|
24685
|
+
{
|
|
24686
|
+
key: "soloAwait",
|
|
24687
|
+
get: function get() {
|
|
24688
|
+
return (this.flags & 256) > 0;
|
|
24689
|
+
},
|
|
24690
|
+
set: function set(value1) {
|
|
24691
|
+
if (value1) {
|
|
24692
|
+
this.flags |= 256;
|
|
24693
|
+
} else {
|
|
24694
|
+
this.flags &= ~256;
|
|
24695
|
+
}
|
|
24696
|
+
}
|
|
24697
|
+
},
|
|
24698
|
+
{
|
|
24699
|
+
key: "inFSharpPipelineDirectBody",
|
|
24700
|
+
get: function get() {
|
|
24701
|
+
return (this.flags & 512) > 0;
|
|
24702
|
+
},
|
|
24703
|
+
set: function set(value1) {
|
|
24704
|
+
if (value1) {
|
|
24705
|
+
this.flags |= 512;
|
|
24706
|
+
} else {
|
|
24707
|
+
this.flags &= ~512;
|
|
24708
|
+
}
|
|
24709
|
+
}
|
|
24710
|
+
},
|
|
24711
|
+
{
|
|
24712
|
+
key: "canStartJSXElement",
|
|
24713
|
+
get: function get() {
|
|
24714
|
+
return (this.flags & 1024) > 0;
|
|
24715
|
+
},
|
|
24716
|
+
set: function set(value1) {
|
|
24717
|
+
if (value1) {
|
|
24718
|
+
this.flags |= 1024;
|
|
24719
|
+
} else {
|
|
24720
|
+
this.flags &= ~1024;
|
|
24721
|
+
}
|
|
24722
|
+
}
|
|
24723
|
+
},
|
|
24724
|
+
{
|
|
24725
|
+
key: "containsEsc",
|
|
24726
|
+
get: function get() {
|
|
24727
|
+
return (this.flags & 2048) > 0;
|
|
24728
|
+
},
|
|
24729
|
+
set: function set(value1) {
|
|
24730
|
+
if (value1) {
|
|
24731
|
+
this.flags |= 2048;
|
|
24732
|
+
} else {
|
|
24733
|
+
this.flags &= ~2048;
|
|
24734
|
+
}
|
|
24735
|
+
}
|
|
24736
|
+
},
|
|
24596
24737
|
{
|
|
24597
24738
|
key: "curPosition",
|
|
24598
24739
|
value: function curPosition() {
|
|
@@ -24601,17 +24742,32 @@ var State = /*#__PURE__*/ function() {
|
|
|
24601
24742
|
},
|
|
24602
24743
|
{
|
|
24603
24744
|
key: "clone",
|
|
24604
|
-
value: function clone(
|
|
24745
|
+
value: function clone() {
|
|
24605
24746
|
var state = new _State();
|
|
24606
|
-
|
|
24607
|
-
|
|
24608
|
-
|
|
24609
|
-
|
|
24610
|
-
|
|
24611
|
-
|
|
24612
|
-
|
|
24613
|
-
|
|
24614
|
-
|
|
24747
|
+
state.flags = this.flags;
|
|
24748
|
+
state.curLine = this.curLine;
|
|
24749
|
+
state.lineStart = this.lineStart;
|
|
24750
|
+
state.startLoc = this.startLoc;
|
|
24751
|
+
state.endLoc = this.endLoc;
|
|
24752
|
+
state.errors = this.errors.slice();
|
|
24753
|
+
state.potentialArrowAt = this.potentialArrowAt;
|
|
24754
|
+
state.noArrowAt = this.noArrowAt.slice();
|
|
24755
|
+
state.noArrowParamsConversionAt = this.noArrowParamsConversionAt.slice();
|
|
24756
|
+
state.topicContext = this.topicContext;
|
|
24757
|
+
state.labels = this.labels.slice();
|
|
24758
|
+
state.commentsLen = this.commentsLen;
|
|
24759
|
+
state.commentStack = this.commentStack.slice();
|
|
24760
|
+
state.pos = this.pos;
|
|
24761
|
+
state.type = this.type;
|
|
24762
|
+
state.value = this.value;
|
|
24763
|
+
state.start = this.start;
|
|
24764
|
+
state.end = this.end;
|
|
24765
|
+
state.lastTokEndLoc = this.lastTokEndLoc;
|
|
24766
|
+
state.lastTokStartLoc = this.lastTokStartLoc;
|
|
24767
|
+
state.context = this.context.slice();
|
|
24768
|
+
state.firstInvalidTemplateEscapePos = this.firstInvalidTemplateEscapePos;
|
|
24769
|
+
state.strictErrors = this.strictErrors;
|
|
24770
|
+
state.tokensLength = this.tokensLength;
|
|
24615
24771
|
return state;
|
|
24616
24772
|
}
|
|
24617
24773
|
}
|
|
@@ -24911,12 +25067,6 @@ function readCodePoint2(input, pos, lineStart, curLine, throwOnInvalid, errors)
|
|
|
24911
25067
|
pos: pos
|
|
24912
25068
|
};
|
|
24913
25069
|
}
|
|
24914
|
-
var _excluded = [
|
|
24915
|
-
"at"
|
|
24916
|
-
];
|
|
24917
|
-
var _excluded2 = [
|
|
24918
|
-
"at"
|
|
24919
|
-
];
|
|
24920
25070
|
function buildPosition(pos, lineStart, curLine) {
|
|
24921
25071
|
return new Position(curLine, pos - lineStart, pos);
|
|
24922
25072
|
}
|
|
@@ -24952,8 +25102,7 @@ var Tokenizer = /*#__PURE__*/ function(CommentsParser) {
|
|
|
24952
25102
|
__publicField(_assert_this_initialized(_this), "errorHandlers_readInt", {
|
|
24953
25103
|
invalidDigit: function(pos, lineStart, curLine, radix) {
|
|
24954
25104
|
if (!_this.options.errorRecovery) return false;
|
|
24955
|
-
_this.raise(Errors.InvalidDigit, {
|
|
24956
|
-
at: buildPosition(pos, lineStart, curLine),
|
|
25105
|
+
_this.raise(Errors.InvalidDigit, buildPosition(pos, lineStart, curLine), {
|
|
24957
25106
|
radix: radix
|
|
24958
25107
|
});
|
|
24959
25108
|
return true;
|
|
@@ -24967,28 +25116,23 @@ var Tokenizer = /*#__PURE__*/ function(CommentsParser) {
|
|
|
24967
25116
|
}));
|
|
24968
25117
|
__publicField(_assert_this_initialized(_this), "errorHandlers_readStringContents_string", Object.assign({}, _this.errorHandlers_readCodePoint, {
|
|
24969
25118
|
strictNumericEscape: function(pos, lineStart, curLine) {
|
|
24970
|
-
_this.recordStrictModeErrors(Errors.StrictNumericEscape,
|
|
24971
|
-
at: buildPosition(pos, lineStart, curLine)
|
|
24972
|
-
});
|
|
25119
|
+
_this.recordStrictModeErrors(Errors.StrictNumericEscape, buildPosition(pos, lineStart, curLine));
|
|
24973
25120
|
},
|
|
24974
25121
|
unterminated: function(pos, lineStart, curLine) {
|
|
24975
|
-
throw _this.raise(Errors.UnterminatedString,
|
|
24976
|
-
at: buildPosition(pos - 1, lineStart, curLine)
|
|
24977
|
-
});
|
|
25122
|
+
throw _this.raise(Errors.UnterminatedString, buildPosition(pos - 1, lineStart, curLine));
|
|
24978
25123
|
}
|
|
24979
25124
|
}));
|
|
24980
25125
|
__publicField(_assert_this_initialized(_this), "errorHandlers_readStringContents_template", Object.assign({}, _this.errorHandlers_readCodePoint, {
|
|
24981
25126
|
strictNumericEscape: _this.errorBuilder(Errors.StrictNumericEscape),
|
|
24982
25127
|
unterminated: function(pos, lineStart, curLine) {
|
|
24983
|
-
throw _this.raise(Errors.UnterminatedTemplate,
|
|
24984
|
-
at: buildPosition(pos, lineStart, curLine)
|
|
24985
|
-
});
|
|
25128
|
+
throw _this.raise(Errors.UnterminatedTemplate, buildPosition(pos, lineStart, curLine));
|
|
24986
25129
|
}
|
|
24987
25130
|
}));
|
|
24988
25131
|
_this.state = new State();
|
|
24989
25132
|
_this.state.init(options);
|
|
24990
25133
|
_this.input = input;
|
|
24991
25134
|
_this.length = input.length;
|
|
25135
|
+
_this.comments = [];
|
|
24992
25136
|
_this.isLookahead = false;
|
|
24993
25137
|
return _this;
|
|
24994
25138
|
}
|
|
@@ -25008,7 +25152,6 @@ var Tokenizer = /*#__PURE__*/ function(CommentsParser) {
|
|
|
25008
25152
|
if (this.options.tokens) {
|
|
25009
25153
|
this.pushToken(new Token(this.state));
|
|
25010
25154
|
}
|
|
25011
|
-
this.state.lastTokStart = this.state.start;
|
|
25012
25155
|
this.state.lastTokEndLoc = this.state.endLoc;
|
|
25013
25156
|
this.state.lastTokStartLoc = this.state.startLoc;
|
|
25014
25157
|
this.nextToken();
|
|
@@ -25124,9 +25267,7 @@ var Tokenizer = /*#__PURE__*/ function(CommentsParser) {
|
|
|
25124
25267
|
if (strict) {
|
|
25125
25268
|
this.state.strictErrors.forEach(function(param) {
|
|
25126
25269
|
var _$_param = _sliced_to_array(param, 2), toParseError = _$_param[0], at = _$_param[1];
|
|
25127
|
-
return _this.raise(toParseError,
|
|
25128
|
-
at: at
|
|
25129
|
-
});
|
|
25270
|
+
return _this.raise(toParseError, at);
|
|
25130
25271
|
});
|
|
25131
25272
|
this.state.strictErrors.clear();
|
|
25132
25273
|
}
|
|
@@ -25159,9 +25300,7 @@ var Tokenizer = /*#__PURE__*/ function(CommentsParser) {
|
|
|
25159
25300
|
var start = this.state.pos;
|
|
25160
25301
|
var end = this.input.indexOf(commentEnd, start + 2);
|
|
25161
25302
|
if (end === -1) {
|
|
25162
|
-
throw this.raise(Errors.UnterminatedComment,
|
|
25163
|
-
at: this.state.curPosition()
|
|
25164
|
-
});
|
|
25303
|
+
throw this.raise(Errors.UnterminatedComment, this.state.curPosition());
|
|
25165
25304
|
}
|
|
25166
25305
|
this.state.pos = end + commentEnd.length;
|
|
25167
25306
|
lineBreakG.lastIndex = start + 2;
|
|
@@ -25328,16 +25467,12 @@ var Tokenizer = /*#__PURE__*/ function(CommentsParser) {
|
|
|
25328
25467
|
var nextPos = this.state.pos + 1;
|
|
25329
25468
|
var next = this.codePointAtPos(nextPos);
|
|
25330
25469
|
if (next >= 48 && next <= 57) {
|
|
25331
|
-
throw this.raise(Errors.UnexpectedDigitAfterHash,
|
|
25332
|
-
at: this.state.curPosition()
|
|
25333
|
-
});
|
|
25470
|
+
throw this.raise(Errors.UnexpectedDigitAfterHash, this.state.curPosition());
|
|
25334
25471
|
}
|
|
25335
25472
|
if (next === 123 || next === 91 && this.hasPlugin("recordAndTuple")) {
|
|
25336
25473
|
this.expectPlugin("recordAndTuple");
|
|
25337
25474
|
if (this.getPluginOption("recordAndTuple", "syntaxType") === "bar") {
|
|
25338
|
-
throw this.raise(next === 123 ? Errors.RecordExpressionHashIncorrectStartSyntaxType : Errors.TupleExpressionHashIncorrectStartSyntaxType,
|
|
25339
|
-
at: this.state.curPosition()
|
|
25340
|
-
});
|
|
25475
|
+
throw this.raise(next === 123 ? Errors.RecordExpressionHashIncorrectStartSyntaxType : Errors.TupleExpressionHashIncorrectStartSyntaxType, this.state.curPosition());
|
|
25341
25476
|
}
|
|
25342
25477
|
this.state.pos += 2;
|
|
25343
25478
|
if (next === 123) {
|
|
@@ -25437,9 +25572,7 @@ var Tokenizer = /*#__PURE__*/ function(CommentsParser) {
|
|
|
25437
25572
|
}
|
|
25438
25573
|
if (this.hasPlugin("recordAndTuple") && next === 125) {
|
|
25439
25574
|
if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") {
|
|
25440
|
-
throw this.raise(Errors.RecordExpressionBarIncorrectEndSyntaxType,
|
|
25441
|
-
at: this.state.curPosition()
|
|
25442
|
-
});
|
|
25575
|
+
throw this.raise(Errors.RecordExpressionBarIncorrectEndSyntaxType, this.state.curPosition());
|
|
25443
25576
|
}
|
|
25444
25577
|
this.state.pos += 2;
|
|
25445
25578
|
this.finishToken(9);
|
|
@@ -25447,9 +25580,7 @@ var Tokenizer = /*#__PURE__*/ function(CommentsParser) {
|
|
|
25447
25580
|
}
|
|
25448
25581
|
if (this.hasPlugin("recordAndTuple") && next === 93) {
|
|
25449
25582
|
if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") {
|
|
25450
|
-
throw this.raise(Errors.TupleExpressionBarIncorrectEndSyntaxType,
|
|
25451
|
-
at: this.state.curPosition()
|
|
25452
|
-
});
|
|
25583
|
+
throw this.raise(Errors.TupleExpressionBarIncorrectEndSyntaxType, this.state.curPosition());
|
|
25453
25584
|
}
|
|
25454
25585
|
this.state.pos += 2;
|
|
25455
25586
|
this.finishToken(4);
|
|
@@ -25621,9 +25752,7 @@ var Tokenizer = /*#__PURE__*/ function(CommentsParser) {
|
|
|
25621
25752
|
case 91:
|
|
25622
25753
|
if (this.hasPlugin("recordAndTuple") && this.input.charCodeAt(this.state.pos + 1) === 124) {
|
|
25623
25754
|
if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") {
|
|
25624
|
-
throw this.raise(Errors.TupleExpressionBarIncorrectStartSyntaxType,
|
|
25625
|
-
at: this.state.curPosition()
|
|
25626
|
-
});
|
|
25755
|
+
throw this.raise(Errors.TupleExpressionBarIncorrectStartSyntaxType, this.state.curPosition());
|
|
25627
25756
|
}
|
|
25628
25757
|
this.state.pos += 2;
|
|
25629
25758
|
this.finishToken(2);
|
|
@@ -25639,9 +25768,7 @@ var Tokenizer = /*#__PURE__*/ function(CommentsParser) {
|
|
|
25639
25768
|
case 123:
|
|
25640
25769
|
if (this.hasPlugin("recordAndTuple") && this.input.charCodeAt(this.state.pos + 1) === 124) {
|
|
25641
25770
|
if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") {
|
|
25642
|
-
throw this.raise(Errors.RecordExpressionBarIncorrectStartSyntaxType,
|
|
25643
|
-
at: this.state.curPosition()
|
|
25644
|
-
});
|
|
25771
|
+
throw this.raise(Errors.RecordExpressionBarIncorrectStartSyntaxType, this.state.curPosition());
|
|
25645
25772
|
}
|
|
25646
25773
|
this.state.pos += 2;
|
|
25647
25774
|
this.finishToken(6);
|
|
@@ -25745,8 +25872,7 @@ var Tokenizer = /*#__PURE__*/ function(CommentsParser) {
|
|
|
25745
25872
|
return;
|
|
25746
25873
|
}
|
|
25747
25874
|
}
|
|
25748
|
-
throw this.raise(Errors.InvalidOrUnexpectedToken, {
|
|
25749
|
-
at: this.state.curPosition(),
|
|
25875
|
+
throw this.raise(Errors.InvalidOrUnexpectedToken, this.state.curPosition(), {
|
|
25750
25876
|
unexpected: String.fromCodePoint(code2)
|
|
25751
25877
|
});
|
|
25752
25878
|
}
|
|
@@ -25768,15 +25894,11 @@ var Tokenizer = /*#__PURE__*/ function(CommentsParser) {
|
|
|
25768
25894
|
var pos = this.state.pos;
|
|
25769
25895
|
for(;; ++pos){
|
|
25770
25896
|
if (pos >= this.length) {
|
|
25771
|
-
throw this.raise(Errors.UnterminatedRegExp,
|
|
25772
|
-
at: createPositionWithColumnOffset(startLoc, 1)
|
|
25773
|
-
});
|
|
25897
|
+
throw this.raise(Errors.UnterminatedRegExp, createPositionWithColumnOffset(startLoc, 1));
|
|
25774
25898
|
}
|
|
25775
25899
|
var ch = this.input.charCodeAt(pos);
|
|
25776
25900
|
if (isNewLine(ch)) {
|
|
25777
|
-
throw this.raise(Errors.UnterminatedRegExp,
|
|
25778
|
-
at: createPositionWithColumnOffset(startLoc, 1)
|
|
25779
|
-
});
|
|
25901
|
+
throw this.raise(Errors.UnterminatedRegExp, createPositionWithColumnOffset(startLoc, 1));
|
|
25780
25902
|
}
|
|
25781
25903
|
if (escaped) {
|
|
25782
25904
|
escaped = false;
|
|
@@ -25803,26 +25925,18 @@ var Tokenizer = /*#__PURE__*/ function(CommentsParser) {
|
|
|
25803
25925
|
if (VALID_REGEX_FLAGS.has(cp)) {
|
|
25804
25926
|
if (cp === 118) {
|
|
25805
25927
|
if (mods.includes("u")) {
|
|
25806
|
-
this.raise(Errors.IncompatibleRegExpUVFlags,
|
|
25807
|
-
at: nextPos()
|
|
25808
|
-
});
|
|
25928
|
+
this.raise(Errors.IncompatibleRegExpUVFlags, nextPos());
|
|
25809
25929
|
}
|
|
25810
25930
|
} else if (cp === 117) {
|
|
25811
25931
|
if (mods.includes("v")) {
|
|
25812
|
-
this.raise(Errors.IncompatibleRegExpUVFlags,
|
|
25813
|
-
at: nextPos()
|
|
25814
|
-
});
|
|
25932
|
+
this.raise(Errors.IncompatibleRegExpUVFlags, nextPos());
|
|
25815
25933
|
}
|
|
25816
25934
|
}
|
|
25817
25935
|
if (mods.includes(char)) {
|
|
25818
|
-
this.raise(Errors.DuplicateRegExpFlags,
|
|
25819
|
-
at: nextPos()
|
|
25820
|
-
});
|
|
25936
|
+
this.raise(Errors.DuplicateRegExpFlags, nextPos());
|
|
25821
25937
|
}
|
|
25822
25938
|
} else if (isIdentifierChar2(cp) || cp === 92) {
|
|
25823
|
-
this.raise(Errors.MalformedRegExpFlags,
|
|
25824
|
-
at: nextPos()
|
|
25825
|
-
});
|
|
25939
|
+
this.raise(Errors.MalformedRegExpFlags, nextPos());
|
|
25826
25940
|
} else {
|
|
25827
25941
|
break;
|
|
25828
25942
|
}
|
|
@@ -25853,8 +25967,7 @@ var Tokenizer = /*#__PURE__*/ function(CommentsParser) {
|
|
|
25853
25967
|
this.state.pos += 2;
|
|
25854
25968
|
var val = this.readInt(radix);
|
|
25855
25969
|
if (val == null) {
|
|
25856
|
-
this.raise(Errors.InvalidDigit, {
|
|
25857
|
-
at: createPositionWithColumnOffset(startLoc, 2),
|
|
25970
|
+
this.raise(Errors.InvalidDigit, createPositionWithColumnOffset(startLoc, 2), {
|
|
25858
25971
|
radix: radix
|
|
25859
25972
|
});
|
|
25860
25973
|
}
|
|
@@ -25863,14 +25976,10 @@ var Tokenizer = /*#__PURE__*/ function(CommentsParser) {
|
|
|
25863
25976
|
++this.state.pos;
|
|
25864
25977
|
isBigInt = true;
|
|
25865
25978
|
} else if (next === 109) {
|
|
25866
|
-
throw this.raise(Errors.InvalidDecimal,
|
|
25867
|
-
at: startLoc
|
|
25868
|
-
});
|
|
25979
|
+
throw this.raise(Errors.InvalidDecimal, startLoc);
|
|
25869
25980
|
}
|
|
25870
25981
|
if (isIdentifierStart2(this.codePointAtPos(this.state.pos))) {
|
|
25871
|
-
throw this.raise(Errors.NumberIdentifier,
|
|
25872
|
-
at: this.state.curPosition()
|
|
25873
|
-
});
|
|
25982
|
+
throw this.raise(Errors.NumberIdentifier, this.state.curPosition());
|
|
25874
25983
|
}
|
|
25875
25984
|
if (isBigInt) {
|
|
25876
25985
|
var str = this.input.slice(startLoc.index, this.state.pos).replace(/[_n]/g, "");
|
|
@@ -25891,22 +26000,16 @@ var Tokenizer = /*#__PURE__*/ function(CommentsParser) {
|
|
|
25891
26000
|
var hasExponent = false;
|
|
25892
26001
|
var isOctal = false;
|
|
25893
26002
|
if (!startsWithDot && this.readInt(10) === null) {
|
|
25894
|
-
this.raise(Errors.InvalidNumber,
|
|
25895
|
-
at: this.state.curPosition()
|
|
25896
|
-
});
|
|
26003
|
+
this.raise(Errors.InvalidNumber, this.state.curPosition());
|
|
25897
26004
|
}
|
|
25898
26005
|
var hasLeadingZero = this.state.pos - start >= 2 && this.input.charCodeAt(start) === 48;
|
|
25899
26006
|
if (hasLeadingZero) {
|
|
25900
26007
|
var integer = this.input.slice(start, this.state.pos);
|
|
25901
|
-
this.recordStrictModeErrors(Errors.StrictOctalLiteral,
|
|
25902
|
-
at: startLoc
|
|
25903
|
-
});
|
|
26008
|
+
this.recordStrictModeErrors(Errors.StrictOctalLiteral, startLoc);
|
|
25904
26009
|
if (!this.state.strict) {
|
|
25905
26010
|
var underscorePos = integer.indexOf("_");
|
|
25906
26011
|
if (underscorePos > 0) {
|
|
25907
|
-
this.raise(Errors.ZeroDigitNumericSeparator,
|
|
25908
|
-
at: createPositionWithColumnOffset(startLoc, underscorePos)
|
|
25909
|
-
});
|
|
26012
|
+
this.raise(Errors.ZeroDigitNumericSeparator, createPositionWithColumnOffset(startLoc, underscorePos));
|
|
25910
26013
|
}
|
|
25911
26014
|
}
|
|
25912
26015
|
isOctal = hasLeadingZero && !/[89]/.test(integer);
|
|
@@ -25924,9 +26027,7 @@ var Tokenizer = /*#__PURE__*/ function(CommentsParser) {
|
|
|
25924
26027
|
++this.state.pos;
|
|
25925
26028
|
}
|
|
25926
26029
|
if (this.readInt(10) === null) {
|
|
25927
|
-
this.raise(Errors.InvalidOrMissingExponent,
|
|
25928
|
-
at: startLoc
|
|
25929
|
-
});
|
|
26030
|
+
this.raise(Errors.InvalidOrMissingExponent, startLoc);
|
|
25930
26031
|
}
|
|
25931
26032
|
isFloat = true;
|
|
25932
26033
|
hasExponent = true;
|
|
@@ -25934,9 +26035,7 @@ var Tokenizer = /*#__PURE__*/ function(CommentsParser) {
|
|
|
25934
26035
|
}
|
|
25935
26036
|
if (next === 110) {
|
|
25936
26037
|
if (isFloat || hasLeadingZero) {
|
|
25937
|
-
this.raise(Errors.InvalidBigIntLiteral,
|
|
25938
|
-
at: startLoc
|
|
25939
|
-
});
|
|
26038
|
+
this.raise(Errors.InvalidBigIntLiteral, startLoc);
|
|
25940
26039
|
}
|
|
25941
26040
|
++this.state.pos;
|
|
25942
26041
|
isBigInt = true;
|
|
@@ -25944,17 +26043,13 @@ var Tokenizer = /*#__PURE__*/ function(CommentsParser) {
|
|
|
25944
26043
|
if (next === 109) {
|
|
25945
26044
|
this.expectPlugin("decimal", this.state.curPosition());
|
|
25946
26045
|
if (hasExponent || hasLeadingZero) {
|
|
25947
|
-
this.raise(Errors.InvalidDecimal,
|
|
25948
|
-
at: startLoc
|
|
25949
|
-
});
|
|
26046
|
+
this.raise(Errors.InvalidDecimal, startLoc);
|
|
25950
26047
|
}
|
|
25951
26048
|
++this.state.pos;
|
|
25952
26049
|
isDecimal = true;
|
|
25953
26050
|
}
|
|
25954
26051
|
if (isIdentifierStart2(this.codePointAtPos(this.state.pos))) {
|
|
25955
|
-
throw this.raise(Errors.NumberIdentifier,
|
|
25956
|
-
at: this.state.curPosition()
|
|
25957
|
-
});
|
|
26052
|
+
throw this.raise(Errors.NumberIdentifier, this.state.curPosition());
|
|
25958
26053
|
}
|
|
25959
26054
|
var str = this.input.slice(start, this.state.pos).replace(/[_mn]/g, "");
|
|
25960
26055
|
if (isBigInt) {
|
|
@@ -26018,13 +26113,10 @@ var Tokenizer = /*#__PURE__*/ function(CommentsParser) {
|
|
|
26018
26113
|
},
|
|
26019
26114
|
{
|
|
26020
26115
|
key: "recordStrictModeErrors",
|
|
26021
|
-
value: function recordStrictModeErrors(toParseError,
|
|
26022
|
-
var at = param.at;
|
|
26116
|
+
value: function recordStrictModeErrors(toParseError, at) {
|
|
26023
26117
|
var index3 = at.index;
|
|
26024
26118
|
if (this.state.strict && !this.state.strictErrors.has(index3)) {
|
|
26025
|
-
this.raise(toParseError,
|
|
26026
|
-
at: at
|
|
26027
|
-
});
|
|
26119
|
+
this.raise(toParseError, at);
|
|
26028
26120
|
} else {
|
|
26029
26121
|
this.state.strictErrors.set(index3, [
|
|
26030
26122
|
toParseError,
|
|
@@ -26053,9 +26145,7 @@ var Tokenizer = /*#__PURE__*/ function(CommentsParser) {
|
|
|
26053
26145
|
var escStart = this.state.curPosition();
|
|
26054
26146
|
var identifierCheck = this.state.pos === start ? isIdentifierStart2 : isIdentifierChar2;
|
|
26055
26147
|
if (this.input.charCodeAt(++this.state.pos) !== 117) {
|
|
26056
|
-
this.raise(Errors.MissingUnicodeEscape,
|
|
26057
|
-
at: this.state.curPosition()
|
|
26058
|
-
});
|
|
26148
|
+
this.raise(Errors.MissingUnicodeEscape, this.state.curPosition());
|
|
26059
26149
|
chunkStart = this.state.pos - 1;
|
|
26060
26150
|
continue;
|
|
26061
26151
|
}
|
|
@@ -26063,9 +26153,7 @@ var Tokenizer = /*#__PURE__*/ function(CommentsParser) {
|
|
|
26063
26153
|
var esc = this.readCodePoint(true);
|
|
26064
26154
|
if (esc !== null) {
|
|
26065
26155
|
if (!identifierCheck(esc)) {
|
|
26066
|
-
this.raise(Errors.EscapedCharNotAnIdentifier,
|
|
26067
|
-
at: escStart
|
|
26068
|
-
});
|
|
26156
|
+
this.raise(Errors.EscapedCharNotAnIdentifier, escStart);
|
|
26069
26157
|
}
|
|
26070
26158
|
word += String.fromCodePoint(esc);
|
|
26071
26159
|
}
|
|
@@ -26094,8 +26182,7 @@ var Tokenizer = /*#__PURE__*/ function(CommentsParser) {
|
|
|
26094
26182
|
value: function checkKeywordEscapes() {
|
|
26095
26183
|
var type = this.state.type;
|
|
26096
26184
|
if (tokenIsKeyword(type) && this.state.containsEsc) {
|
|
26097
|
-
this.raise(Errors.InvalidEscapedReservedWord, {
|
|
26098
|
-
at: this.state.startLoc,
|
|
26185
|
+
this.raise(Errors.InvalidEscapedReservedWord, this.state.startLoc, {
|
|
26099
26186
|
reservedWord: tokenLabelName(type)
|
|
26100
26187
|
});
|
|
26101
26188
|
}
|
|
@@ -26103,13 +26190,10 @@ var Tokenizer = /*#__PURE__*/ function(CommentsParser) {
|
|
|
26103
26190
|
},
|
|
26104
26191
|
{
|
|
26105
26192
|
key: "raise",
|
|
26106
|
-
value: function raise(toParseError,
|
|
26107
|
-
var
|
|
26193
|
+
value: function raise(toParseError, at) {
|
|
26194
|
+
var details = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
26108
26195
|
var loc = _instanceof(at, Position) ? at : at.loc.start;
|
|
26109
|
-
var error = toParseError(
|
|
26110
|
-
loc: loc,
|
|
26111
|
-
details: details
|
|
26112
|
-
});
|
|
26196
|
+
var error = toParseError(loc, details);
|
|
26113
26197
|
if (!this.options.errorRecovery) throw error;
|
|
26114
26198
|
if (!this.isLookahead) this.state.errors.push(error);
|
|
26115
26199
|
return error;
|
|
@@ -26117,22 +26201,19 @@ var Tokenizer = /*#__PURE__*/ function(CommentsParser) {
|
|
|
26117
26201
|
},
|
|
26118
26202
|
{
|
|
26119
26203
|
key: "raiseOverwrite",
|
|
26120
|
-
value: function raiseOverwrite(toParseError,
|
|
26121
|
-
var
|
|
26204
|
+
value: function raiseOverwrite(toParseError, at) {
|
|
26205
|
+
var details = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
26122
26206
|
var loc = _instanceof(at, Position) ? at : at.loc.start;
|
|
26123
26207
|
var pos = loc.index;
|
|
26124
26208
|
var errors = this.state.errors;
|
|
26125
26209
|
for(var i = errors.length - 1; i >= 0; i--){
|
|
26126
26210
|
var error = errors[i];
|
|
26127
26211
|
if (error.loc.index === pos) {
|
|
26128
|
-
return errors[i] = toParseError(
|
|
26129
|
-
loc: loc,
|
|
26130
|
-
details: details
|
|
26131
|
-
});
|
|
26212
|
+
return errors[i] = toParseError(loc, details);
|
|
26132
26213
|
}
|
|
26133
26214
|
if (error.loc.index < pos) break;
|
|
26134
26215
|
}
|
|
26135
|
-
return this.raise(toParseError,
|
|
26216
|
+
return this.raise(toParseError, at, details);
|
|
26136
26217
|
}
|
|
26137
26218
|
},
|
|
26138
26219
|
{
|
|
@@ -26142,9 +26223,8 @@ var Tokenizer = /*#__PURE__*/ function(CommentsParser) {
|
|
|
26142
26223
|
{
|
|
26143
26224
|
key: "unexpected",
|
|
26144
26225
|
value: function unexpected(loc, type) {
|
|
26145
|
-
throw this.raise(Errors.UnexpectedToken, {
|
|
26146
|
-
expected: type ? tokenLabelName(type) : null
|
|
26147
|
-
at: loc != null ? loc : this.state.startLoc
|
|
26226
|
+
throw this.raise(Errors.UnexpectedToken, loc != null ? loc : this.state.startLoc, {
|
|
26227
|
+
expected: type ? tokenLabelName(type) : null
|
|
26148
26228
|
});
|
|
26149
26229
|
}
|
|
26150
26230
|
},
|
|
@@ -26154,8 +26234,7 @@ var Tokenizer = /*#__PURE__*/ function(CommentsParser) {
|
|
|
26154
26234
|
if (this.hasPlugin(pluginName)) {
|
|
26155
26235
|
return true;
|
|
26156
26236
|
}
|
|
26157
|
-
throw this.raise(Errors.MissingPlugin, {
|
|
26158
|
-
at: loc != null ? loc : this.state.startLoc,
|
|
26237
|
+
throw this.raise(Errors.MissingPlugin, loc != null ? loc : this.state.startLoc, {
|
|
26159
26238
|
missingPlugin: [
|
|
26160
26239
|
pluginName
|
|
26161
26240
|
]
|
|
@@ -26169,8 +26248,7 @@ var Tokenizer = /*#__PURE__*/ function(CommentsParser) {
|
|
|
26169
26248
|
if (!pluginNames.some(function(name) {
|
|
26170
26249
|
return _this.hasPlugin(name);
|
|
26171
26250
|
})) {
|
|
26172
|
-
throw this.raise(Errors.MissingOneOfPlugins, {
|
|
26173
|
-
at: this.state.startLoc,
|
|
26251
|
+
throw this.raise(Errors.MissingOneOfPlugins, this.state.startLoc, {
|
|
26174
26252
|
missingPlugin: pluginNames
|
|
26175
26253
|
});
|
|
26176
26254
|
}
|
|
@@ -26181,9 +26259,7 @@ var Tokenizer = /*#__PURE__*/ function(CommentsParser) {
|
|
|
26181
26259
|
value: function errorBuilder(error) {
|
|
26182
26260
|
var _this = this;
|
|
26183
26261
|
return function(pos, lineStart, curLine) {
|
|
26184
|
-
_this.raise(error,
|
|
26185
|
-
at: buildPosition(pos, lineStart, curLine)
|
|
26186
|
-
});
|
|
26262
|
+
_this.raise(error, buildPosition(pos, lineStart, curLine));
|
|
26187
26263
|
};
|
|
26188
26264
|
}
|
|
26189
26265
|
}
|
|
@@ -26233,8 +26309,7 @@ var ClassScopeHandler = /*#__PURE__*/ function() {
|
|
|
26233
26309
|
current.undefinedPrivateNames.set(name, loc);
|
|
26234
26310
|
}
|
|
26235
26311
|
} else {
|
|
26236
|
-
this.parser.raise(Errors.InvalidPrivateFieldResolution, {
|
|
26237
|
-
at: loc,
|
|
26312
|
+
this.parser.raise(Errors.InvalidPrivateFieldResolution, loc, {
|
|
26238
26313
|
identifierName: name
|
|
26239
26314
|
});
|
|
26240
26315
|
}
|
|
@@ -26274,8 +26349,7 @@ var ClassScopeHandler = /*#__PURE__*/ function() {
|
|
|
26274
26349
|
}
|
|
26275
26350
|
}
|
|
26276
26351
|
if (redefined) {
|
|
26277
|
-
this.parser.raise(Errors.PrivateNameRedeclaration, {
|
|
26278
|
-
at: loc,
|
|
26352
|
+
this.parser.raise(Errors.PrivateNameRedeclaration, loc, {
|
|
26279
26353
|
identifierName: name
|
|
26280
26354
|
});
|
|
26281
26355
|
}
|
|
@@ -26310,8 +26384,7 @@ var ClassScopeHandler = /*#__PURE__*/ function() {
|
|
|
26310
26384
|
if (classScope) {
|
|
26311
26385
|
classScope.undefinedPrivateNames.set(name, loc);
|
|
26312
26386
|
} else {
|
|
26313
|
-
this.parser.raise(Errors.InvalidPrivateFieldResolution, {
|
|
26314
|
-
at: loc,
|
|
26387
|
+
this.parser.raise(Errors.InvalidPrivateFieldResolution, loc, {
|
|
26315
26388
|
identifierName: name
|
|
26316
26389
|
});
|
|
26317
26390
|
}
|
|
@@ -26357,8 +26430,7 @@ var ArrowHeadParsingScope = /*#__PURE__*/ function(ExpressionScope) {
|
|
|
26357
26430
|
_create_class(ArrowHeadParsingScope, [
|
|
26358
26431
|
{
|
|
26359
26432
|
key: "recordDeclarationError",
|
|
26360
|
-
value: function recordDeclarationError(ParsingErrorClass,
|
|
26361
|
-
var at = param.at;
|
|
26433
|
+
value: function recordDeclarationError(ParsingErrorClass, at) {
|
|
26362
26434
|
var index3 = at.index;
|
|
26363
26435
|
this.declarationErrors.set(index3, [
|
|
26364
26436
|
ParsingErrorClass,
|
|
@@ -26406,11 +26478,8 @@ var ExpressionScopeHandler = /*#__PURE__*/ function() {
|
|
|
26406
26478
|
},
|
|
26407
26479
|
{
|
|
26408
26480
|
key: "recordParameterInitializerError",
|
|
26409
|
-
value: function recordParameterInitializerError(toParseError,
|
|
26410
|
-
var
|
|
26411
|
-
var origin = {
|
|
26412
|
-
at: node.loc.start
|
|
26413
|
-
};
|
|
26481
|
+
value: function recordParameterInitializerError(toParseError, node) {
|
|
26482
|
+
var origin = node.loc.start;
|
|
26414
26483
|
var stack = this.stack;
|
|
26415
26484
|
var i = stack.length - 1;
|
|
26416
26485
|
var scope2 = stack[i];
|
|
@@ -26427,13 +26496,10 @@ var ExpressionScopeHandler = /*#__PURE__*/ function() {
|
|
|
26427
26496
|
},
|
|
26428
26497
|
{
|
|
26429
26498
|
key: "recordArrowParameterBindingError",
|
|
26430
|
-
value: function recordArrowParameterBindingError(error,
|
|
26431
|
-
var node = param.at;
|
|
26499
|
+
value: function recordArrowParameterBindingError(error, node) {
|
|
26432
26500
|
var stack = this.stack;
|
|
26433
26501
|
var scope2 = stack[stack.length - 1];
|
|
26434
|
-
var origin =
|
|
26435
|
-
at: node.loc.start
|
|
26436
|
-
};
|
|
26502
|
+
var origin = node.loc.start;
|
|
26437
26503
|
if (scope2.isCertainlyParameterDeclaration()) {
|
|
26438
26504
|
this.parser.raise(error, origin);
|
|
26439
26505
|
} else if (scope2.canBeArrowParameterDeclaration()) {
|
|
@@ -26445,16 +26511,13 @@ var ExpressionScopeHandler = /*#__PURE__*/ function() {
|
|
|
26445
26511
|
},
|
|
26446
26512
|
{
|
|
26447
26513
|
key: "recordAsyncArrowParametersError",
|
|
26448
|
-
value: function recordAsyncArrowParametersError(
|
|
26449
|
-
var at = param.at;
|
|
26514
|
+
value: function recordAsyncArrowParametersError(at) {
|
|
26450
26515
|
var stack = this.stack;
|
|
26451
26516
|
var i = stack.length - 1;
|
|
26452
26517
|
var scope2 = stack[i];
|
|
26453
26518
|
while(scope2.canBeArrowParameterDeclaration()){
|
|
26454
26519
|
if (scope2.type === 2) {
|
|
26455
|
-
scope2.recordDeclarationError(Errors.AwaitBindingIdentifier,
|
|
26456
|
-
at: at
|
|
26457
|
-
});
|
|
26520
|
+
scope2.recordDeclarationError(Errors.AwaitBindingIdentifier, at);
|
|
26458
26521
|
}
|
|
26459
26522
|
scope2 = stack[--i];
|
|
26460
26523
|
}
|
|
@@ -26469,9 +26532,7 @@ var ExpressionScopeHandler = /*#__PURE__*/ function() {
|
|
|
26469
26532
|
if (!currentScope.canBeArrowParameterDeclaration()) return;
|
|
26470
26533
|
currentScope.iterateErrors(function(param) {
|
|
26471
26534
|
var _$_param = _sliced_to_array(param, 2), toParseError = _$_param[0], loc = _$_param[1];
|
|
26472
|
-
_this.parser.raise(toParseError,
|
|
26473
|
-
at: loc
|
|
26474
|
-
});
|
|
26535
|
+
_this.parser.raise(toParseError, loc);
|
|
26475
26536
|
var i = stack.length - 2;
|
|
26476
26537
|
var scope2 = stack[i];
|
|
26477
26538
|
while(scope2.canBeArrowParameterDeclaration()){
|
|
@@ -26615,9 +26676,7 @@ var UtilParser = /*#__PURE__*/ function(Tokenizer) {
|
|
|
26615
26676
|
value: function expectContextual(token, toParseError) {
|
|
26616
26677
|
if (!this.eatContextual(token)) {
|
|
26617
26678
|
if (toParseError != null) {
|
|
26618
|
-
throw this.raise(toParseError,
|
|
26619
|
-
at: this.state.startLoc
|
|
26620
|
-
});
|
|
26679
|
+
throw this.raise(toParseError, this.state.startLoc);
|
|
26621
26680
|
}
|
|
26622
26681
|
this.unexpected(null, token);
|
|
26623
26682
|
}
|
|
@@ -26653,9 +26712,7 @@ var UtilParser = /*#__PURE__*/ function(Tokenizer) {
|
|
|
26653
26712
|
value: function semicolon() {
|
|
26654
26713
|
var allowAsi = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true;
|
|
26655
26714
|
if (allowAsi ? this.isLineTerminator() : this.eat(13)) return;
|
|
26656
|
-
this.raise(Errors.MissingSemicolon,
|
|
26657
|
-
at: this.state.lastTokEndLoc
|
|
26658
|
-
});
|
|
26715
|
+
this.raise(Errors.MissingSemicolon, this.state.lastTokEndLoc);
|
|
26659
26716
|
}
|
|
26660
26717
|
},
|
|
26661
26718
|
{
|
|
@@ -26731,19 +26788,13 @@ var UtilParser = /*#__PURE__*/ function(Tokenizer) {
|
|
|
26731
26788
|
return hasErrors;
|
|
26732
26789
|
}
|
|
26733
26790
|
if (shorthandAssignLoc != null) {
|
|
26734
|
-
this.raise(Errors.InvalidCoverInitializedName,
|
|
26735
|
-
at: shorthandAssignLoc
|
|
26736
|
-
});
|
|
26791
|
+
this.raise(Errors.InvalidCoverInitializedName, shorthandAssignLoc);
|
|
26737
26792
|
}
|
|
26738
26793
|
if (doubleProtoLoc != null) {
|
|
26739
|
-
this.raise(Errors.DuplicateProto,
|
|
26740
|
-
at: doubleProtoLoc
|
|
26741
|
-
});
|
|
26794
|
+
this.raise(Errors.DuplicateProto, doubleProtoLoc);
|
|
26742
26795
|
}
|
|
26743
26796
|
if (privateKeyLoc != null) {
|
|
26744
|
-
this.raise(Errors.UnexpectedPrivateField,
|
|
26745
|
-
at: privateKeyLoc
|
|
26746
|
-
});
|
|
26797
|
+
this.raise(Errors.UnexpectedPrivateField, privateKeyLoc);
|
|
26747
26798
|
}
|
|
26748
26799
|
if (optionalParametersLoc != null) {
|
|
26749
26800
|
this.unexpected(optionalParametersLoc);
|
|
@@ -26789,8 +26840,8 @@ var UtilParser = /*#__PURE__*/ function(Tokenizer) {
|
|
|
26789
26840
|
{
|
|
26790
26841
|
key: "initializeScopes",
|
|
26791
26842
|
value: function initializeScopes() {
|
|
26792
|
-
var inModule = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.options.sourceType === "module";
|
|
26793
26843
|
var _this = this;
|
|
26844
|
+
var inModule = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.options.sourceType === "module";
|
|
26794
26845
|
var oldLabels = this.state.labels;
|
|
26795
26846
|
this.state.labels = [];
|
|
26796
26847
|
var oldExportedIdentifiers = this.exportedIdentifiers;
|
|
@@ -26911,7 +26962,8 @@ var NodeUtils = /*#__PURE__*/ function(UtilParser) {
|
|
|
26911
26962
|
{
|
|
26912
26963
|
key: "startNode",
|
|
26913
26964
|
value: function startNode() {
|
|
26914
|
-
|
|
26965
|
+
var loc = this.state.startLoc;
|
|
26966
|
+
return new Node(this, loc.index, loc);
|
|
26915
26967
|
}
|
|
26916
26968
|
},
|
|
26917
26969
|
{
|
|
@@ -27184,10 +27236,8 @@ var flow = function(superClass) {
|
|
|
27184
27236
|
var moduloLoc = this.state.startLoc;
|
|
27185
27237
|
this.next();
|
|
27186
27238
|
this.expectContextual(110);
|
|
27187
|
-
if (this.state.
|
|
27188
|
-
this.raise(FlowErrors.UnexpectedSpaceBetweenModuloChecks,
|
|
27189
|
-
at: moduloLoc
|
|
27190
|
-
});
|
|
27239
|
+
if (this.state.lastTokStartLoc.index > moduloLoc.index + 1) {
|
|
27240
|
+
this.raise(FlowErrors.UnexpectedSpaceBetweenModuloChecks, moduloLoc);
|
|
27191
27241
|
}
|
|
27192
27242
|
if (this.eat(10)) {
|
|
27193
27243
|
node.value = _get(_get_prototype_of(FlowParserMixin.prototype), "parseExpression", this).call(this);
|
|
@@ -27272,9 +27322,7 @@ var flow = function(superClass) {
|
|
|
27272
27322
|
return this.flowParseDeclareModuleExports(node);
|
|
27273
27323
|
} else {
|
|
27274
27324
|
if (insideModule) {
|
|
27275
|
-
this.raise(FlowErrors.NestedDeclareModule,
|
|
27276
|
-
at: this.state.lastTokStartLoc
|
|
27277
|
-
});
|
|
27325
|
+
this.raise(FlowErrors.NestedDeclareModule, this.state.lastTokStartLoc);
|
|
27278
27326
|
}
|
|
27279
27327
|
return this.flowParseDeclareModule(node);
|
|
27280
27328
|
}
|
|
@@ -27319,9 +27367,7 @@ var flow = function(superClass) {
|
|
|
27319
27367
|
if (this.match(83)) {
|
|
27320
27368
|
this.next();
|
|
27321
27369
|
if (!this.isContextual(130) && !this.match(87)) {
|
|
27322
|
-
this.raise(FlowErrors.InvalidNonTypeImportInDeclareModule,
|
|
27323
|
-
at: this.state.lastTokStartLoc
|
|
27324
|
-
});
|
|
27370
|
+
this.raise(FlowErrors.InvalidNonTypeImportInDeclareModule, this.state.lastTokStartLoc);
|
|
27325
27371
|
}
|
|
27326
27372
|
_get(_get_prototype_of(FlowParserMixin.prototype), "parseImport", this).call(this, bodyNode2);
|
|
27327
27373
|
} else {
|
|
@@ -27338,21 +27384,15 @@ var flow = function(superClass) {
|
|
|
27338
27384
|
body.forEach(function(bodyElement) {
|
|
27339
27385
|
if (isEsModuleType(bodyElement)) {
|
|
27340
27386
|
if (kind === "CommonJS") {
|
|
27341
|
-
_this.raise(FlowErrors.AmbiguousDeclareModuleKind,
|
|
27342
|
-
at: bodyElement
|
|
27343
|
-
});
|
|
27387
|
+
_this.raise(FlowErrors.AmbiguousDeclareModuleKind, bodyElement);
|
|
27344
27388
|
}
|
|
27345
27389
|
kind = "ES";
|
|
27346
27390
|
} else if (bodyElement.type === "DeclareModuleExports") {
|
|
27347
27391
|
if (hasModuleExport) {
|
|
27348
|
-
_this.raise(FlowErrors.DuplicateDeclareModuleExports,
|
|
27349
|
-
at: bodyElement
|
|
27350
|
-
});
|
|
27392
|
+
_this.raise(FlowErrors.DuplicateDeclareModuleExports, bodyElement);
|
|
27351
27393
|
}
|
|
27352
27394
|
if (kind === "ES") {
|
|
27353
|
-
_this.raise(FlowErrors.AmbiguousDeclareModuleKind,
|
|
27354
|
-
at: bodyElement
|
|
27355
|
-
});
|
|
27395
|
+
_this.raise(FlowErrors.AmbiguousDeclareModuleKind, bodyElement);
|
|
27356
27396
|
}
|
|
27357
27397
|
kind = "CommonJS";
|
|
27358
27398
|
hasModuleExport = true;
|
|
@@ -27378,8 +27418,7 @@ var flow = function(superClass) {
|
|
|
27378
27418
|
} else {
|
|
27379
27419
|
if (this.match(75) || this.isLet() || (this.isContextual(130) || this.isContextual(129)) && !insideModule) {
|
|
27380
27420
|
var label = this.state.value;
|
|
27381
|
-
throw this.raise(FlowErrors.UnsupportedDeclareExportKind, {
|
|
27382
|
-
at: this.state.startLoc,
|
|
27421
|
+
throw this.raise(FlowErrors.UnsupportedDeclareExportKind, this.state.startLoc, {
|
|
27383
27422
|
unsupportedExportKind: label,
|
|
27384
27423
|
suggestion: exportSuggestions[label]
|
|
27385
27424
|
});
|
|
@@ -27501,9 +27540,7 @@ var flow = function(superClass) {
|
|
|
27501
27540
|
key: "checkNotUnderscore",
|
|
27502
27541
|
value: function checkNotUnderscore(word) {
|
|
27503
27542
|
if (word === "_") {
|
|
27504
|
-
this.raise(FlowErrors.UnexpectedReservedUnderscore,
|
|
27505
|
-
at: this.state.startLoc
|
|
27506
|
-
});
|
|
27543
|
+
this.raise(FlowErrors.UnexpectedReservedUnderscore, this.state.startLoc);
|
|
27507
27544
|
}
|
|
27508
27545
|
}
|
|
27509
27546
|
},
|
|
@@ -27511,8 +27548,7 @@ var flow = function(superClass) {
|
|
|
27511
27548
|
key: "checkReservedType",
|
|
27512
27549
|
value: function checkReservedType(word, startLoc, declaration) {
|
|
27513
27550
|
if (!reservedTypes.has(word)) return;
|
|
27514
|
-
this.raise(declaration ? FlowErrors.AssignReservedType : FlowErrors.UnexpectedReservedType, {
|
|
27515
|
-
at: startLoc,
|
|
27551
|
+
this.raise(declaration ? FlowErrors.AssignReservedType : FlowErrors.UnexpectedReservedType, startLoc, {
|
|
27516
27552
|
reservedType: word
|
|
27517
27553
|
});
|
|
27518
27554
|
}
|
|
@@ -27578,9 +27614,7 @@ var flow = function(superClass) {
|
|
|
27578
27614
|
node.default = this.flowParseType();
|
|
27579
27615
|
} else {
|
|
27580
27616
|
if (requireDefault) {
|
|
27581
|
-
this.raise(FlowErrors.MissingTypeParamDefault,
|
|
27582
|
-
at: nodeStartLoc
|
|
27583
|
-
});
|
|
27617
|
+
this.raise(FlowErrors.MissingTypeParamDefault, nodeStartLoc);
|
|
27584
27618
|
}
|
|
27585
27619
|
}
|
|
27586
27620
|
return this.finishNode(node, "TypeParameter");
|
|
@@ -27845,9 +27879,7 @@ var flow = function(superClass) {
|
|
|
27845
27879
|
}
|
|
27846
27880
|
this.flowObjectTypeSemicolon();
|
|
27847
27881
|
if (inexactStartLoc && !this.match(8) && !this.match(9)) {
|
|
27848
|
-
this.raise(FlowErrors.UnexpectedExplicitInexactInObject,
|
|
27849
|
-
at: inexactStartLoc
|
|
27850
|
-
});
|
|
27882
|
+
this.raise(FlowErrors.UnexpectedExplicitInexactInObject, inexactStartLoc);
|
|
27851
27883
|
}
|
|
27852
27884
|
}
|
|
27853
27885
|
this.expect(endDelim);
|
|
@@ -27866,33 +27898,23 @@ var flow = function(superClass) {
|
|
|
27866
27898
|
var isInexactToken = this.match(12) || this.match(13) || this.match(8) || this.match(9);
|
|
27867
27899
|
if (isInexactToken) {
|
|
27868
27900
|
if (!allowSpread) {
|
|
27869
|
-
this.raise(FlowErrors.InexactInsideNonObject,
|
|
27870
|
-
at: this.state.lastTokStartLoc
|
|
27871
|
-
});
|
|
27901
|
+
this.raise(FlowErrors.InexactInsideNonObject, this.state.lastTokStartLoc);
|
|
27872
27902
|
} else if (!allowInexact) {
|
|
27873
|
-
this.raise(FlowErrors.InexactInsideExact,
|
|
27874
|
-
at: this.state.lastTokStartLoc
|
|
27875
|
-
});
|
|
27903
|
+
this.raise(FlowErrors.InexactInsideExact, this.state.lastTokStartLoc);
|
|
27876
27904
|
}
|
|
27877
27905
|
if (variance2) {
|
|
27878
|
-
this.raise(FlowErrors.InexactVariance,
|
|
27879
|
-
at: variance2
|
|
27880
|
-
});
|
|
27906
|
+
this.raise(FlowErrors.InexactVariance, variance2);
|
|
27881
27907
|
}
|
|
27882
27908
|
return null;
|
|
27883
27909
|
}
|
|
27884
27910
|
if (!allowSpread) {
|
|
27885
|
-
this.raise(FlowErrors.UnexpectedSpreadType,
|
|
27886
|
-
at: this.state.lastTokStartLoc
|
|
27887
|
-
});
|
|
27911
|
+
this.raise(FlowErrors.UnexpectedSpreadType, this.state.lastTokStartLoc);
|
|
27888
27912
|
}
|
|
27889
27913
|
if (protoStartLoc != null) {
|
|
27890
27914
|
this.unexpected(protoStartLoc);
|
|
27891
27915
|
}
|
|
27892
27916
|
if (variance2) {
|
|
27893
|
-
this.raise(FlowErrors.SpreadVariance,
|
|
27894
|
-
at: variance2
|
|
27895
|
-
});
|
|
27917
|
+
this.raise(FlowErrors.SpreadVariance, variance2);
|
|
27896
27918
|
}
|
|
27897
27919
|
node.argument = this.flowParseType();
|
|
27898
27920
|
return this.finishNode(node, "ObjectTypeSpreadProperty");
|
|
@@ -27915,9 +27937,7 @@ var flow = function(superClass) {
|
|
|
27915
27937
|
this.flowCheckGetterSetterParams(node);
|
|
27916
27938
|
}
|
|
27917
27939
|
if (!allowSpread && node.key.name === "constructor" && node.value.this) {
|
|
27918
|
-
this.raise(FlowErrors.ThisParamBannedInConstructor,
|
|
27919
|
-
at: node.value.this
|
|
27920
|
-
});
|
|
27940
|
+
this.raise(FlowErrors.ThisParamBannedInConstructor, node.value.this);
|
|
27921
27941
|
}
|
|
27922
27942
|
} else {
|
|
27923
27943
|
if (kind !== "init") this.unexpected();
|
|
@@ -27939,19 +27959,13 @@ var flow = function(superClass) {
|
|
|
27939
27959
|
var paramCount = property.kind === "get" ? 0 : 1;
|
|
27940
27960
|
var length = property.value.params.length + (property.value.rest ? 1 : 0);
|
|
27941
27961
|
if (property.value.this) {
|
|
27942
|
-
this.raise(property.kind === "get" ? FlowErrors.GetterMayNotHaveThisParam : FlowErrors.SetterMayNotHaveThisParam,
|
|
27943
|
-
at: property.value.this
|
|
27944
|
-
});
|
|
27962
|
+
this.raise(property.kind === "get" ? FlowErrors.GetterMayNotHaveThisParam : FlowErrors.SetterMayNotHaveThisParam, property.value.this);
|
|
27945
27963
|
}
|
|
27946
27964
|
if (length !== paramCount) {
|
|
27947
|
-
this.raise(property.kind === "get" ? Errors.BadGetterArity : Errors.BadSetterArity,
|
|
27948
|
-
at: property
|
|
27949
|
-
});
|
|
27965
|
+
this.raise(property.kind === "get" ? Errors.BadGetterArity : Errors.BadSetterArity, property);
|
|
27950
27966
|
}
|
|
27951
27967
|
if (property.kind === "set" && property.value.rest) {
|
|
27952
|
-
this.raise(Errors.BadSetterRestParameter,
|
|
27953
|
-
at: property
|
|
27954
|
-
});
|
|
27968
|
+
this.raise(Errors.BadSetterRestParameter, property);
|
|
27955
27969
|
}
|
|
27956
27970
|
}
|
|
27957
27971
|
},
|
|
@@ -28024,17 +28038,13 @@ var flow = function(superClass) {
|
|
|
28024
28038
|
var isThis = this.state.type === 78;
|
|
28025
28039
|
if (lh.type === 14 || lh.type === 17) {
|
|
28026
28040
|
if (isThis && !first) {
|
|
28027
|
-
this.raise(FlowErrors.ThisParamMustBeFirst,
|
|
28028
|
-
at: node
|
|
28029
|
-
});
|
|
28041
|
+
this.raise(FlowErrors.ThisParamMustBeFirst, node);
|
|
28030
28042
|
}
|
|
28031
28043
|
name = this.parseIdentifier(isThis);
|
|
28032
28044
|
if (this.eat(17)) {
|
|
28033
28045
|
optional = true;
|
|
28034
28046
|
if (isThis) {
|
|
28035
|
-
this.raise(FlowErrors.ThisParamMayNotBeOptional,
|
|
28036
|
-
at: node
|
|
28037
|
-
});
|
|
28047
|
+
this.raise(FlowErrors.ThisParamMayNotBeOptional, node);
|
|
28038
28048
|
}
|
|
28039
28049
|
}
|
|
28040
28050
|
typeAnnotation2 = this.flowParseTypeInitialiser();
|
|
@@ -28205,9 +28215,7 @@ var flow = function(superClass) {
|
|
|
28205
28215
|
if (this.match(135)) {
|
|
28206
28216
|
return this.parseLiteralAtNode(-this.state.value, "BigIntLiteralTypeAnnotation", node);
|
|
28207
28217
|
}
|
|
28208
|
-
throw this.raise(FlowErrors.UnexpectedSubtractionOperand,
|
|
28209
|
-
at: this.state.startLoc
|
|
28210
|
-
});
|
|
28218
|
+
throw this.raise(FlowErrors.UnexpectedSubtractionOperand, this.state.startLoc);
|
|
28211
28219
|
}
|
|
28212
28220
|
this.unexpected();
|
|
28213
28221
|
return;
|
|
@@ -28403,8 +28411,8 @@ var flow = function(superClass) {
|
|
|
28403
28411
|
{
|
|
28404
28412
|
key: "parseFunctionBody",
|
|
28405
28413
|
value: function parseFunctionBody(node, allowExpressionBody) {
|
|
28406
|
-
var isMethod3 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
|
|
28407
28414
|
var _this = this;
|
|
28415
|
+
var isMethod3 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
|
|
28408
28416
|
if (allowExpressionBody) {
|
|
28409
28417
|
this.forwardNoArrowParamsConversionAt(node, function() {
|
|
28410
28418
|
return _get(_get_prototype_of(FlowParserMixin.prototype), "parseFunctionBody", _this).call(_this, node, true, isMethod3);
|
|
@@ -28533,9 +28541,7 @@ var flow = function(superClass) {
|
|
|
28533
28541
|
ref1 = _sliced_to_array(this.getArrowLikeExpressions(consequent), 2), valid = ref1[0], invalid = ref1[1], ref1;
|
|
28534
28542
|
}
|
|
28535
28543
|
if (failed && valid.length > 1) {
|
|
28536
|
-
this.raise(FlowErrors.AmbiguousConditionalArrow,
|
|
28537
|
-
at: state.startLoc
|
|
28538
|
-
});
|
|
28544
|
+
this.raise(FlowErrors.AmbiguousConditionalArrow, state.startLoc);
|
|
28539
28545
|
}
|
|
28540
28546
|
if (failed && valid.length === 1) {
|
|
28541
28547
|
this.state = state;
|
|
@@ -28737,13 +28743,9 @@ var flow = function(superClass) {
|
|
|
28737
28743
|
_get(_get_prototype_of(FlowParserMixin.prototype), "parseClassMember", this).call(this, classBody2, member, state);
|
|
28738
28744
|
if (member.declare) {
|
|
28739
28745
|
if (member.type !== "ClassProperty" && member.type !== "ClassPrivateProperty" && member.type !== "PropertyDefinition") {
|
|
28740
|
-
this.raise(FlowErrors.DeclareClassElement,
|
|
28741
|
-
at: startLoc
|
|
28742
|
-
});
|
|
28746
|
+
this.raise(FlowErrors.DeclareClassElement, startLoc);
|
|
28743
28747
|
} else if (member.value) {
|
|
28744
|
-
this.raise(FlowErrors.DeclareClassFieldInitializer,
|
|
28745
|
-
at: member.value
|
|
28746
|
-
});
|
|
28748
|
+
this.raise(FlowErrors.DeclareClassFieldInitializer, member.value);
|
|
28747
28749
|
}
|
|
28748
28750
|
}
|
|
28749
28751
|
}
|
|
@@ -28760,8 +28762,7 @@ var flow = function(superClass) {
|
|
|
28760
28762
|
var word = _get(_get_prototype_of(FlowParserMixin.prototype), "readWord1", this).call(this);
|
|
28761
28763
|
var fullWord = "@@" + word;
|
|
28762
28764
|
if (!this.isIterator(word) || !this.state.inType) {
|
|
28763
|
-
this.raise(Errors.InvalidIdentifier, {
|
|
28764
|
-
at: this.state.curPosition(),
|
|
28765
|
+
this.raise(Errors.InvalidIdentifier, this.state.curPosition(), {
|
|
28765
28766
|
identifierName: fullWord
|
|
28766
28767
|
});
|
|
28767
28768
|
}
|
|
@@ -28829,9 +28830,7 @@ var flow = function(superClass) {
|
|
|
28829
28830
|
var _expr_extra;
|
|
28830
28831
|
var expr = exprList[i];
|
|
28831
28832
|
if (expr && expr.type === "TypeCastExpression" && !((_expr_extra = expr.extra) === null || _expr_extra === void 0 ? void 0 : _expr_extra.parenthesized) && (exprList.length > 1 || !isParenthesizedExpr)) {
|
|
28832
|
-
this.raise(FlowErrors.TypeCastInPattern,
|
|
28833
|
-
at: expr.typeAnnotation
|
|
28834
|
-
});
|
|
28833
|
+
this.raise(FlowErrors.TypeCastInPattern, expr.typeAnnotation);
|
|
28835
28834
|
}
|
|
28836
28835
|
}
|
|
28837
28836
|
return exprList;
|
|
@@ -28903,16 +28902,12 @@ var flow = function(superClass) {
|
|
|
28903
28902
|
if (method.params && isConstructor) {
|
|
28904
28903
|
var params = method.params;
|
|
28905
28904
|
if (params.length > 0 && this.isThisParam(params[0])) {
|
|
28906
|
-
this.raise(FlowErrors.ThisParamBannedInConstructor,
|
|
28907
|
-
at: method
|
|
28908
|
-
});
|
|
28905
|
+
this.raise(FlowErrors.ThisParamBannedInConstructor, method);
|
|
28909
28906
|
}
|
|
28910
28907
|
} else if (method.type === "MethodDefinition" && isConstructor && method.value.params) {
|
|
28911
28908
|
var params1 = method.value.params;
|
|
28912
28909
|
if (params1.length > 0 && this.isThisParam(params1[0])) {
|
|
28913
|
-
this.raise(FlowErrors.ThisParamBannedInConstructor,
|
|
28914
|
-
at: method
|
|
28915
|
-
});
|
|
28910
|
+
this.raise(FlowErrors.ThisParamBannedInConstructor, method);
|
|
28916
28911
|
}
|
|
28917
28912
|
}
|
|
28918
28913
|
}
|
|
@@ -28961,13 +28956,9 @@ var flow = function(superClass) {
|
|
|
28961
28956
|
if (params.length > 0) {
|
|
28962
28957
|
var param = params[0];
|
|
28963
28958
|
if (this.isThisParam(param) && method.kind === "get") {
|
|
28964
|
-
this.raise(FlowErrors.GetterMayNotHaveThisParam,
|
|
28965
|
-
at: param
|
|
28966
|
-
});
|
|
28959
|
+
this.raise(FlowErrors.GetterMayNotHaveThisParam, param);
|
|
28967
28960
|
} else if (this.isThisParam(param)) {
|
|
28968
|
-
this.raise(FlowErrors.SetterMayNotHaveThisParam,
|
|
28969
|
-
at: param
|
|
28970
|
-
});
|
|
28961
|
+
this.raise(FlowErrors.SetterMayNotHaveThisParam, param);
|
|
28971
28962
|
}
|
|
28972
28963
|
}
|
|
28973
28964
|
}
|
|
@@ -29002,28 +28993,20 @@ var flow = function(superClass) {
|
|
|
29002
28993
|
value: function parseAssignableListItemTypes(param) {
|
|
29003
28994
|
if (this.eat(17)) {
|
|
29004
28995
|
if (param.type !== "Identifier") {
|
|
29005
|
-
this.raise(FlowErrors.PatternIsOptional,
|
|
29006
|
-
at: param
|
|
29007
|
-
});
|
|
28996
|
+
this.raise(FlowErrors.PatternIsOptional, param);
|
|
29008
28997
|
}
|
|
29009
28998
|
if (this.isThisParam(param)) {
|
|
29010
|
-
this.raise(FlowErrors.ThisParamMayNotBeOptional,
|
|
29011
|
-
at: param
|
|
29012
|
-
});
|
|
28999
|
+
this.raise(FlowErrors.ThisParamMayNotBeOptional, param);
|
|
29013
29000
|
}
|
|
29014
29001
|
param.optional = true;
|
|
29015
29002
|
}
|
|
29016
29003
|
if (this.match(14)) {
|
|
29017
29004
|
param.typeAnnotation = this.flowParseTypeAnnotation();
|
|
29018
29005
|
} else if (this.isThisParam(param)) {
|
|
29019
|
-
this.raise(FlowErrors.ThisParamAnnotationRequired,
|
|
29020
|
-
at: param
|
|
29021
|
-
});
|
|
29006
|
+
this.raise(FlowErrors.ThisParamAnnotationRequired, param);
|
|
29022
29007
|
}
|
|
29023
29008
|
if (this.match(29) && this.isThisParam(param)) {
|
|
29024
|
-
this.raise(FlowErrors.ThisParamNoDefault,
|
|
29025
|
-
at: param
|
|
29026
|
-
});
|
|
29009
|
+
this.raise(FlowErrors.ThisParamNoDefault, param);
|
|
29027
29010
|
}
|
|
29028
29011
|
this.resetEndLocation(param);
|
|
29029
29012
|
return param;
|
|
@@ -29034,9 +29017,7 @@ var flow = function(superClass) {
|
|
|
29034
29017
|
value: function parseMaybeDefault(startLoc, left) {
|
|
29035
29018
|
var node = _get(_get_prototype_of(FlowParserMixin.prototype), "parseMaybeDefault", this).call(this, startLoc, left);
|
|
29036
29019
|
if (node.type === "AssignmentPattern" && node.typeAnnotation && node.right.start < node.typeAnnotation.start) {
|
|
29037
|
-
this.raise(FlowErrors.TypeBeforeInitializer,
|
|
29038
|
-
at: node.typeAnnotation
|
|
29039
|
-
});
|
|
29020
|
+
this.raise(FlowErrors.TypeBeforeInitializer, node.typeAnnotation);
|
|
29040
29021
|
}
|
|
29041
29022
|
return node;
|
|
29042
29023
|
}
|
|
@@ -29046,9 +29027,7 @@ var flow = function(superClass) {
|
|
|
29046
29027
|
value: function checkImportReflection(node) {
|
|
29047
29028
|
_get(_get_prototype_of(FlowParserMixin.prototype), "checkImportReflection", this).call(this, node);
|
|
29048
29029
|
if (node.module && node.importKind !== "value") {
|
|
29049
|
-
this.raise(FlowErrors.ImportReflectionHasImportType,
|
|
29050
|
-
at: node.specifiers[0].loc.start
|
|
29051
|
-
});
|
|
29030
|
+
this.raise(FlowErrors.ImportReflectionHasImportType, node.specifiers[0].loc.start);
|
|
29052
29031
|
}
|
|
29053
29032
|
}
|
|
29054
29033
|
},
|
|
@@ -29116,8 +29095,7 @@ var flow = function(superClass) {
|
|
|
29116
29095
|
specifier.importKind = specifierTypeKind;
|
|
29117
29096
|
} else {
|
|
29118
29097
|
if (importedIsString) {
|
|
29119
|
-
throw this.raise(Errors.ImportBindingIsString, {
|
|
29120
|
-
at: specifier,
|
|
29098
|
+
throw this.raise(Errors.ImportBindingIsString, specifier, {
|
|
29121
29099
|
importName: firstIdent.value
|
|
29122
29100
|
});
|
|
29123
29101
|
}
|
|
@@ -29133,9 +29111,7 @@ var flow = function(superClass) {
|
|
|
29133
29111
|
}
|
|
29134
29112
|
var specifierIsTypeImport = hasTypeImportKind(specifier);
|
|
29135
29113
|
if (isInTypeOnlyImport && specifierIsTypeImport) {
|
|
29136
|
-
this.raise(FlowErrors.ImportTypeShorthandOnlyInPureImport,
|
|
29137
|
-
at: specifier
|
|
29138
|
-
});
|
|
29114
|
+
this.raise(FlowErrors.ImportTypeShorthandOnlyInPureImport, specifier);
|
|
29139
29115
|
}
|
|
29140
29116
|
if (isInTypeOnlyImport || specifierIsTypeImport) {
|
|
29141
29117
|
this.checkReservedType(specifier.local.name, specifier.local.loc.start, true);
|
|
@@ -29235,9 +29211,7 @@ var flow = function(superClass) {
|
|
|
29235
29211
|
if (arrow.node && this.maybeUnwrapTypeCastExpression(arrow.node).type === "ArrowFunctionExpression") {
|
|
29236
29212
|
if (!arrow.error && !arrow.aborted) {
|
|
29237
29213
|
if (arrow.node.async) {
|
|
29238
|
-
this.raise(FlowErrors.UnexpectedTypeParameterBeforeAsyncArrowFunction,
|
|
29239
|
-
at: typeParameters
|
|
29240
|
-
});
|
|
29214
|
+
this.raise(FlowErrors.UnexpectedTypeParameterBeforeAsyncArrowFunction, typeParameters);
|
|
29241
29215
|
}
|
|
29242
29216
|
return arrow.node;
|
|
29243
29217
|
}
|
|
@@ -29253,9 +29227,7 @@ var flow = function(superClass) {
|
|
|
29253
29227
|
}
|
|
29254
29228
|
if (jsx2 === null || jsx2 === void 0 ? void 0 : jsx2.thrown) throw jsx2.error;
|
|
29255
29229
|
if (arrow.thrown) throw arrow.error;
|
|
29256
|
-
throw this.raise(FlowErrors.UnexpectedTokenAfterTypeParameter,
|
|
29257
|
-
at: typeParameters
|
|
29258
|
-
});
|
|
29230
|
+
throw this.raise(FlowErrors.UnexpectedTokenAfterTypeParameter, typeParameters);
|
|
29259
29231
|
}
|
|
29260
29232
|
return _get(_get_prototype_of(FlowParserMixin.prototype), "parseMaybeAssign", this).call(this, refExpressionErrors, afterLeftParse);
|
|
29261
29233
|
}
|
|
@@ -29308,9 +29280,7 @@ var flow = function(superClass) {
|
|
|
29308
29280
|
}
|
|
29309
29281
|
for(var i = 0; i < node.params.length; i++){
|
|
29310
29282
|
if (this.isThisParam(node.params[i]) && i > 0) {
|
|
29311
|
-
this.raise(FlowErrors.ThisParamMustBeFirst,
|
|
29312
|
-
at: node.params[i]
|
|
29313
|
-
});
|
|
29283
|
+
this.raise(FlowErrors.ThisParamMustBeFirst, node.params[i]);
|
|
29314
29284
|
}
|
|
29315
29285
|
}
|
|
29316
29286
|
_get(_get_prototype_of(FlowParserMixin.prototype), "checkParams", this).call(this, node, allowDuplicates, isArrowFunction, strictModeChanged);
|
|
@@ -29445,9 +29415,7 @@ var flow = function(superClass) {
|
|
|
29445
29415
|
value: function parseTopLevel(file2, program3) {
|
|
29446
29416
|
var fileNode = _get(_get_prototype_of(FlowParserMixin.prototype), "parseTopLevel", this).call(this, file2, program3);
|
|
29447
29417
|
if (this.state.hasFlowComment) {
|
|
29448
|
-
this.raise(FlowErrors.UnterminatedFlowComment,
|
|
29449
|
-
at: this.state.curPosition()
|
|
29450
|
-
});
|
|
29418
|
+
this.raise(FlowErrors.UnterminatedFlowComment, this.state.curPosition());
|
|
29451
29419
|
}
|
|
29452
29420
|
return fileNode;
|
|
29453
29421
|
}
|
|
@@ -29457,9 +29425,7 @@ var flow = function(superClass) {
|
|
|
29457
29425
|
value: function skipBlockComment() {
|
|
29458
29426
|
if (this.hasPlugin("flowComments") && this.skipFlowComment()) {
|
|
29459
29427
|
if (this.state.hasFlowComment) {
|
|
29460
|
-
throw this.raise(FlowErrors.NestedFlowComment,
|
|
29461
|
-
at: this.state.startLoc
|
|
29462
|
-
});
|
|
29428
|
+
throw this.raise(FlowErrors.NestedFlowComment, this.state.startLoc);
|
|
29463
29429
|
}
|
|
29464
29430
|
this.hasFlowCommentCompletion();
|
|
29465
29431
|
var commentSkip = this.skipFlowComment();
|
|
@@ -29502,9 +29468,7 @@ var flow = function(superClass) {
|
|
|
29502
29468
|
value: function hasFlowCommentCompletion() {
|
|
29503
29469
|
var end = this.input.indexOf("*/", this.state.pos);
|
|
29504
29470
|
if (end === -1) {
|
|
29505
|
-
throw this.raise(Errors.UnterminatedComment,
|
|
29506
|
-
at: this.state.curPosition()
|
|
29507
|
-
});
|
|
29471
|
+
throw this.raise(Errors.UnterminatedComment, this.state.curPosition());
|
|
29508
29472
|
}
|
|
29509
29473
|
}
|
|
29510
29474
|
},
|
|
@@ -29512,8 +29476,7 @@ var flow = function(superClass) {
|
|
|
29512
29476
|
key: "flowEnumErrorBooleanMemberNotInitialized",
|
|
29513
29477
|
value: function flowEnumErrorBooleanMemberNotInitialized(loc, param) {
|
|
29514
29478
|
var enumName = param.enumName, memberName = param.memberName;
|
|
29515
|
-
this.raise(FlowErrors.EnumBooleanMemberNotInitialized, {
|
|
29516
|
-
at: loc,
|
|
29479
|
+
this.raise(FlowErrors.EnumBooleanMemberNotInitialized, loc, {
|
|
29517
29480
|
memberName: memberName,
|
|
29518
29481
|
enumName: enumName
|
|
29519
29482
|
});
|
|
@@ -29522,30 +29485,19 @@ var flow = function(superClass) {
|
|
|
29522
29485
|
{
|
|
29523
29486
|
key: "flowEnumErrorInvalidMemberInitializer",
|
|
29524
29487
|
value: function flowEnumErrorInvalidMemberInitializer(loc, enumContext) {
|
|
29525
|
-
return this.raise(!enumContext.explicitType ? FlowErrors.EnumInvalidMemberInitializerUnknownType : enumContext.explicitType === "symbol" ? FlowErrors.EnumInvalidMemberInitializerSymbolType : FlowErrors.EnumInvalidMemberInitializerPrimaryType,
|
|
29526
|
-
at: loc
|
|
29527
|
-
}, enumContext));
|
|
29488
|
+
return this.raise(!enumContext.explicitType ? FlowErrors.EnumInvalidMemberInitializerUnknownType : enumContext.explicitType === "symbol" ? FlowErrors.EnumInvalidMemberInitializerSymbolType : FlowErrors.EnumInvalidMemberInitializerPrimaryType, loc, enumContext);
|
|
29528
29489
|
}
|
|
29529
29490
|
},
|
|
29530
29491
|
{
|
|
29531
29492
|
key: "flowEnumErrorNumberMemberNotInitialized",
|
|
29532
|
-
value: function flowEnumErrorNumberMemberNotInitialized(loc,
|
|
29533
|
-
|
|
29534
|
-
this.raise(FlowErrors.EnumNumberMemberNotInitialized, {
|
|
29535
|
-
at: loc,
|
|
29536
|
-
enumName: enumName,
|
|
29537
|
-
memberName: memberName
|
|
29538
|
-
});
|
|
29493
|
+
value: function flowEnumErrorNumberMemberNotInitialized(loc, details) {
|
|
29494
|
+
this.raise(FlowErrors.EnumNumberMemberNotInitialized, loc, details);
|
|
29539
29495
|
}
|
|
29540
29496
|
},
|
|
29541
29497
|
{
|
|
29542
29498
|
key: "flowEnumErrorStringMemberInconsistentlyInitialized",
|
|
29543
|
-
value: function flowEnumErrorStringMemberInconsistentlyInitialized(node,
|
|
29544
|
-
|
|
29545
|
-
this.raise(FlowErrors.EnumStringMemberInconsistentlyInitialized, {
|
|
29546
|
-
at: node,
|
|
29547
|
-
enumName: enumName
|
|
29548
|
-
});
|
|
29499
|
+
value: function flowEnumErrorStringMemberInconsistentlyInitialized(node, details) {
|
|
29500
|
+
this.raise(FlowErrors.EnumStringMemberInconsistentlyInitialized, node, details);
|
|
29549
29501
|
}
|
|
29550
29502
|
},
|
|
29551
29503
|
{
|
|
@@ -29662,16 +29614,14 @@ var flow = function(superClass) {
|
|
|
29662
29614
|
continue;
|
|
29663
29615
|
}
|
|
29664
29616
|
if (/^[a-z]/.test(memberName)) {
|
|
29665
|
-
this.raise(FlowErrors.EnumInvalidMemberName, {
|
|
29666
|
-
at: id,
|
|
29617
|
+
this.raise(FlowErrors.EnumInvalidMemberName, id, {
|
|
29667
29618
|
memberName: memberName,
|
|
29668
29619
|
suggestion: memberName[0].toUpperCase() + memberName.slice(1),
|
|
29669
29620
|
enumName: enumName
|
|
29670
29621
|
});
|
|
29671
29622
|
}
|
|
29672
29623
|
if (seenNames.has(memberName)) {
|
|
29673
|
-
this.raise(FlowErrors.EnumDuplicateMemberName, {
|
|
29674
|
-
at: id,
|
|
29624
|
+
this.raise(FlowErrors.EnumDuplicateMemberName, id, {
|
|
29675
29625
|
memberName: memberName,
|
|
29676
29626
|
enumName: enumName
|
|
29677
29627
|
});
|
|
@@ -29798,16 +29748,14 @@ var flow = function(superClass) {
|
|
|
29798
29748
|
var enumName = param.enumName;
|
|
29799
29749
|
if (!this.eatContextual(102)) return null;
|
|
29800
29750
|
if (!tokenIsIdentifier(this.state.type)) {
|
|
29801
|
-
throw this.raise(FlowErrors.EnumInvalidExplicitTypeUnknownSupplied, {
|
|
29802
|
-
at: this.state.startLoc,
|
|
29751
|
+
throw this.raise(FlowErrors.EnumInvalidExplicitTypeUnknownSupplied, this.state.startLoc, {
|
|
29803
29752
|
enumName: enumName
|
|
29804
29753
|
});
|
|
29805
29754
|
}
|
|
29806
29755
|
var value1 = this.state.value;
|
|
29807
29756
|
this.next();
|
|
29808
29757
|
if (value1 !== "boolean" && value1 !== "number" && value1 !== "string" && value1 !== "symbol") {
|
|
29809
|
-
this.raise(FlowErrors.EnumInvalidExplicitType, {
|
|
29810
|
-
at: this.state.startLoc,
|
|
29758
|
+
this.raise(FlowErrors.EnumInvalidExplicitType, this.state.startLoc, {
|
|
29811
29759
|
enumName: enumName,
|
|
29812
29760
|
invalidEnumType: value1
|
|
29813
29761
|
});
|
|
@@ -29927,8 +29875,7 @@ var flow = function(superClass) {
|
|
|
29927
29875
|
this.expect(8);
|
|
29928
29876
|
return this.finishNode(node, "EnumNumberBody");
|
|
29929
29877
|
} else {
|
|
29930
|
-
this.raise(FlowErrors.EnumInconsistentMemberValues, {
|
|
29931
|
-
at: nameLoc,
|
|
29878
|
+
this.raise(FlowErrors.EnumInconsistentMemberValues, nameLoc, {
|
|
29932
29879
|
enumName: enumName
|
|
29933
29880
|
});
|
|
29934
29881
|
return empty();
|
|
@@ -30272,9 +30219,7 @@ var jsx = function(superClass) {
|
|
|
30272
30219
|
var chunkStart = this.state.pos;
|
|
30273
30220
|
for(;;){
|
|
30274
30221
|
if (this.state.pos >= this.length) {
|
|
30275
|
-
throw this.raise(JsxErrors.UnterminatedJsxContent,
|
|
30276
|
-
at: this.state.startLoc
|
|
30277
|
-
});
|
|
30222
|
+
throw this.raise(JsxErrors.UnterminatedJsxContent, this.state.startLoc);
|
|
30278
30223
|
}
|
|
30279
30224
|
var ch = this.input.charCodeAt(this.state.pos);
|
|
30280
30225
|
switch(ch){
|
|
@@ -30300,8 +30245,7 @@ var jsx = function(superClass) {
|
|
|
30300
30245
|
case 62:
|
|
30301
30246
|
case 125:
|
|
30302
30247
|
{
|
|
30303
|
-
this.raise(JsxErrors.UnexpectedToken, {
|
|
30304
|
-
at: this.state.curPosition(),
|
|
30248
|
+
this.raise(JsxErrors.UnexpectedToken, this.state.curPosition(), {
|
|
30305
30249
|
unexpected: this.input[this.state.pos],
|
|
30306
30250
|
HTMLEntity: ch === 125 ? "}" : ">"
|
|
30307
30251
|
});
|
|
@@ -30342,9 +30286,7 @@ var jsx = function(superClass) {
|
|
|
30342
30286
|
var chunkStart = ++this.state.pos;
|
|
30343
30287
|
for(;;){
|
|
30344
30288
|
if (this.state.pos >= this.length) {
|
|
30345
|
-
throw this.raise(Errors.UnterminatedString,
|
|
30346
|
-
at: this.state.startLoc
|
|
30347
|
-
});
|
|
30289
|
+
throw this.raise(Errors.UnterminatedString, this.state.startLoc);
|
|
30348
30290
|
}
|
|
30349
30291
|
var ch = this.input.charCodeAt(this.state.pos);
|
|
30350
30292
|
if (ch === quote) break;
|
|
@@ -30465,18 +30407,14 @@ var jsx = function(superClass) {
|
|
|
30465
30407
|
this.next();
|
|
30466
30408
|
node = this.jsxParseExpressionContainer(node, types.j_oTag);
|
|
30467
30409
|
if (node.expression.type === "JSXEmptyExpression") {
|
|
30468
|
-
this.raise(JsxErrors.AttributeIsEmpty,
|
|
30469
|
-
at: node
|
|
30470
|
-
});
|
|
30410
|
+
this.raise(JsxErrors.AttributeIsEmpty, node);
|
|
30471
30411
|
}
|
|
30472
30412
|
return node;
|
|
30473
30413
|
case 142:
|
|
30474
30414
|
case 133:
|
|
30475
30415
|
return this.parseExprAtom();
|
|
30476
30416
|
default:
|
|
30477
|
-
throw this.raise(JsxErrors.UnsupportedJsxValue,
|
|
30478
|
-
at: this.state.startLoc
|
|
30479
|
-
});
|
|
30417
|
+
throw this.raise(JsxErrors.UnsupportedJsxValue, this.state.startLoc);
|
|
30480
30418
|
}
|
|
30481
30419
|
}
|
|
30482
30420
|
},
|
|
@@ -30508,9 +30446,7 @@ var jsx = function(superClass) {
|
|
|
30508
30446
|
{
|
|
30509
30447
|
var _expression2_extra;
|
|
30510
30448
|
if (expression2.type === "SequenceExpression" && !((_expression2_extra = expression2.extra) === null || _expression2_extra === void 0 ? void 0 : _expression2_extra.parenthesized)) {
|
|
30511
|
-
this.raise(JsxErrors.UnexpectedSequenceExpression,
|
|
30512
|
-
at: expression2.expressions[1]
|
|
30513
|
-
});
|
|
30449
|
+
this.raise(JsxErrors.UnexpectedSequenceExpression, expression2.expressions[1]);
|
|
30514
30450
|
}
|
|
30515
30451
|
}
|
|
30516
30452
|
node.expression = expression2;
|
|
@@ -30615,18 +30551,14 @@ var jsx = function(superClass) {
|
|
|
30615
30551
|
}
|
|
30616
30552
|
}
|
|
30617
30553
|
if (isFragment(openingElement) && !isFragment(closingElement) && closingElement !== null) {
|
|
30618
|
-
this.raise(JsxErrors.MissingClosingTagFragment,
|
|
30619
|
-
at: closingElement
|
|
30620
|
-
});
|
|
30554
|
+
this.raise(JsxErrors.MissingClosingTagFragment, closingElement);
|
|
30621
30555
|
} else if (!isFragment(openingElement) && isFragment(closingElement)) {
|
|
30622
|
-
this.raise(JsxErrors.MissingClosingTagElement, {
|
|
30623
|
-
at: closingElement,
|
|
30556
|
+
this.raise(JsxErrors.MissingClosingTagElement, closingElement, {
|
|
30624
30557
|
openingTagName: getQualifiedJSXName(openingElement.name)
|
|
30625
30558
|
});
|
|
30626
30559
|
} else if (!isFragment(openingElement) && !isFragment(closingElement)) {
|
|
30627
30560
|
if (getQualifiedJSXName(closingElement.name) !== getQualifiedJSXName(openingElement.name)) {
|
|
30628
|
-
this.raise(JsxErrors.MissingClosingTagElement, {
|
|
30629
|
-
at: closingElement,
|
|
30561
|
+
this.raise(JsxErrors.MissingClosingTagElement, closingElement, {
|
|
30630
30562
|
openingTagName: getQualifiedJSXName(openingElement.name)
|
|
30631
30563
|
});
|
|
30632
30564
|
}
|
|
@@ -30641,9 +30573,7 @@ var jsx = function(superClass) {
|
|
|
30641
30573
|
}
|
|
30642
30574
|
node.children = children;
|
|
30643
30575
|
if (this.match(47)) {
|
|
30644
|
-
throw this.raise(JsxErrors.UnwrappedAdjacentJSXElements,
|
|
30645
|
-
at: this.state.startLoc
|
|
30646
|
-
});
|
|
30576
|
+
throw this.raise(JsxErrors.UnwrappedAdjacentJSXElements, this.state.startLoc);
|
|
30647
30577
|
}
|
|
30648
30578
|
return isFragment(openingElement) ? this.finishNode(node, "JSXFragment") : this.finishNode(node, "JSXElement");
|
|
30649
30579
|
}
|
|
@@ -30754,11 +30684,7 @@ var TypeScriptScope = /*#__PURE__*/ function(Scope) {
|
|
|
30754
30684
|
_this = _super.call.apply(_super, [
|
|
30755
30685
|
this
|
|
30756
30686
|
].concat(Array.prototype.slice.call(arguments)));
|
|
30757
|
-
__publicField(_assert_this_initialized(_this), "
|
|
30758
|
-
__publicField(_assert_this_initialized(_this), "enums", /* @__PURE__ */ new Set());
|
|
30759
|
-
__publicField(_assert_this_initialized(_this), "constEnums", /* @__PURE__ */ new Set());
|
|
30760
|
-
__publicField(_assert_this_initialized(_this), "classes", /* @__PURE__ */ new Set());
|
|
30761
|
-
__publicField(_assert_this_initialized(_this), "exportOnlyBindings", /* @__PURE__ */ new Set());
|
|
30687
|
+
__publicField(_assert_this_initialized(_this), "tsNames", /* @__PURE__ */ new Map());
|
|
30762
30688
|
return _this;
|
|
30763
30689
|
}
|
|
30764
30690
|
return TypeScriptScope;
|
|
@@ -30823,8 +30749,7 @@ var TypeScriptScopeHandler = /*#__PURE__*/ function(ScopeHandler) {
|
|
|
30823
30749
|
value: function declareName(name, bindingType, loc) {
|
|
30824
30750
|
if (bindingType & 4096) {
|
|
30825
30751
|
if (this.hasImport(name, true)) {
|
|
30826
|
-
this.parser.raise(Errors.VarRedeclaration, {
|
|
30827
|
-
at: loc,
|
|
30752
|
+
this.parser.raise(Errors.VarRedeclaration, loc, {
|
|
30828
30753
|
identifierName: name
|
|
30829
30754
|
});
|
|
30830
30755
|
}
|
|
@@ -30832,9 +30757,10 @@ var TypeScriptScopeHandler = /*#__PURE__*/ function(ScopeHandler) {
|
|
|
30832
30757
|
return;
|
|
30833
30758
|
}
|
|
30834
30759
|
var scope2 = this.currentScope();
|
|
30760
|
+
var type = scope2.tsNames.get(name) || 0;
|
|
30835
30761
|
if (bindingType & 1024) {
|
|
30836
30762
|
this.maybeExportDefined(scope2, name);
|
|
30837
|
-
scope2.
|
|
30763
|
+
scope2.tsNames.set(name, type | 16);
|
|
30838
30764
|
return;
|
|
30839
30765
|
}
|
|
30840
30766
|
_get(_get_prototype_of(TypeScriptScopeHandler.prototype), "declareName", this).call(this, name, bindingType, loc);
|
|
@@ -30843,34 +30769,40 @@ var TypeScriptScopeHandler = /*#__PURE__*/ function(ScopeHandler) {
|
|
|
30843
30769
|
this.checkRedeclarationInScope(scope2, name, bindingType, loc);
|
|
30844
30770
|
this.maybeExportDefined(scope2, name);
|
|
30845
30771
|
}
|
|
30846
|
-
|
|
30772
|
+
type = type | 1;
|
|
30773
|
+
}
|
|
30774
|
+
if (bindingType & 256) {
|
|
30775
|
+
type = type | 2;
|
|
30847
30776
|
}
|
|
30848
|
-
if (bindingType & 256) scope2.enums.add(name);
|
|
30849
30777
|
if (bindingType & 512) {
|
|
30850
|
-
|
|
30778
|
+
type = type | 4;
|
|
30851
30779
|
}
|
|
30852
|
-
if (bindingType & 128)
|
|
30780
|
+
if (bindingType & 128) {
|
|
30781
|
+
type = type | 8;
|
|
30782
|
+
}
|
|
30783
|
+
if (type) scope2.tsNames.set(name, type);
|
|
30853
30784
|
}
|
|
30854
30785
|
},
|
|
30855
30786
|
{
|
|
30856
30787
|
key: "isRedeclaredInScope",
|
|
30857
30788
|
value: function isRedeclaredInScope(scope2, name, bindingType) {
|
|
30858
|
-
|
|
30789
|
+
var type = scope2.tsNames.get(name);
|
|
30790
|
+
if ((type & 2) > 0) {
|
|
30859
30791
|
if (bindingType & 256) {
|
|
30860
30792
|
var isConst = !!(bindingType & 512);
|
|
30861
|
-
var wasConst =
|
|
30793
|
+
var wasConst = (type & 4) > 0;
|
|
30862
30794
|
return isConst !== wasConst;
|
|
30863
30795
|
}
|
|
30864
30796
|
return true;
|
|
30865
30797
|
}
|
|
30866
|
-
if (bindingType & 128 &&
|
|
30867
|
-
if (scope2.
|
|
30798
|
+
if (bindingType & 128 && (type & 8) > 0) {
|
|
30799
|
+
if (scope2.names.get(name) & 2) {
|
|
30868
30800
|
return !!(bindingType & 1);
|
|
30869
30801
|
} else {
|
|
30870
30802
|
return false;
|
|
30871
30803
|
}
|
|
30872
30804
|
}
|
|
30873
|
-
if (bindingType & 2 &&
|
|
30805
|
+
if (bindingType & 2 && (type & 1) > 0) {
|
|
30874
30806
|
return true;
|
|
30875
30807
|
}
|
|
30876
30808
|
return _get(_get_prototype_of(TypeScriptScopeHandler.prototype), "isRedeclaredInScope", this).call(this, scope2, name, bindingType);
|
|
@@ -30884,7 +30816,10 @@ var TypeScriptScopeHandler = /*#__PURE__*/ function(ScopeHandler) {
|
|
|
30884
30816
|
var len = this.scopeStack.length;
|
|
30885
30817
|
for(var i = len - 1; i >= 0; i--){
|
|
30886
30818
|
var scope2 = this.scopeStack[i];
|
|
30887
|
-
|
|
30819
|
+
var type = scope2.tsNames.get(name);
|
|
30820
|
+
if ((type & 1) > 0 || (type & 16) > 0) {
|
|
30821
|
+
return;
|
|
30822
|
+
}
|
|
30888
30823
|
}
|
|
30889
30824
|
_get(_get_prototype_of(TypeScriptScopeHandler.prototype), "checkLocalExport", this).call(this, id);
|
|
30890
30825
|
}
|
|
@@ -30917,18 +30852,12 @@ var LValParser = /*#__PURE__*/ function(NodeUtils) {
|
|
|
30917
30852
|
parenthesized = unwrapParenthesizedExpression(node);
|
|
30918
30853
|
if (isLHS) {
|
|
30919
30854
|
if (parenthesized.type === "Identifier") {
|
|
30920
|
-
this.expressionScope.recordArrowParameterBindingError(Errors.InvalidParenthesizedAssignment,
|
|
30921
|
-
at: node
|
|
30922
|
-
});
|
|
30855
|
+
this.expressionScope.recordArrowParameterBindingError(Errors.InvalidParenthesizedAssignment, node);
|
|
30923
30856
|
} else if (parenthesized.type !== "MemberExpression" && !this.isOptionalMemberExpression(parenthesized)) {
|
|
30924
|
-
this.raise(Errors.InvalidParenthesizedAssignment,
|
|
30925
|
-
at: node
|
|
30926
|
-
});
|
|
30857
|
+
this.raise(Errors.InvalidParenthesizedAssignment, node);
|
|
30927
30858
|
}
|
|
30928
30859
|
} else {
|
|
30929
|
-
this.raise(Errors.InvalidParenthesizedAssignment,
|
|
30930
|
-
at: node
|
|
30931
|
-
});
|
|
30860
|
+
this.raise(Errors.InvalidParenthesizedAssignment, node);
|
|
30932
30861
|
}
|
|
30933
30862
|
}
|
|
30934
30863
|
switch(node.type){
|
|
@@ -30946,9 +30875,7 @@ var LValParser = /*#__PURE__*/ function(NodeUtils) {
|
|
|
30946
30875
|
var isLast = i === last2;
|
|
30947
30876
|
this.toAssignableObjectExpressionProp(prop, isLast, isLHS);
|
|
30948
30877
|
if (isLast && prop.type === "RestElement" && ((_node_extra1 = node.extra) === null || _node_extra1 === void 0 ? void 0 : _node_extra1.trailingCommaLoc)) {
|
|
30949
|
-
this.raise(Errors.RestTrailingComma,
|
|
30950
|
-
at: node.extra.trailingCommaLoc
|
|
30951
|
-
});
|
|
30878
|
+
this.raise(Errors.RestTrailingComma, node.extra.trailingCommaLoc);
|
|
30952
30879
|
}
|
|
30953
30880
|
}
|
|
30954
30881
|
break;
|
|
@@ -30972,9 +30899,7 @@ var LValParser = /*#__PURE__*/ function(NodeUtils) {
|
|
|
30972
30899
|
break;
|
|
30973
30900
|
case "AssignmentExpression":
|
|
30974
30901
|
if (node.operator !== "=") {
|
|
30975
|
-
this.raise(Errors.MissingEqInAssignment,
|
|
30976
|
-
at: node.left.loc.end
|
|
30977
|
-
});
|
|
30902
|
+
this.raise(Errors.MissingEqInAssignment, node.left.loc.end);
|
|
30978
30903
|
}
|
|
30979
30904
|
node.type = "AssignmentPattern";
|
|
30980
30905
|
delete node.operator;
|
|
@@ -30990,18 +30915,14 @@ var LValParser = /*#__PURE__*/ function(NodeUtils) {
|
|
|
30990
30915
|
key: "toAssignableObjectExpressionProp",
|
|
30991
30916
|
value: function toAssignableObjectExpressionProp(prop, isLast, isLHS) {
|
|
30992
30917
|
if (prop.type === "ObjectMethod") {
|
|
30993
|
-
this.raise(prop.kind === "get" || prop.kind === "set" ? Errors.PatternHasAccessor : Errors.PatternHasMethod,
|
|
30994
|
-
at: prop.key
|
|
30995
|
-
});
|
|
30918
|
+
this.raise(prop.kind === "get" || prop.kind === "set" ? Errors.PatternHasAccessor : Errors.PatternHasMethod, prop.key);
|
|
30996
30919
|
} else if (prop.type === "SpreadElement") {
|
|
30997
30920
|
prop.type = "RestElement";
|
|
30998
30921
|
var arg = prop.argument;
|
|
30999
30922
|
this.checkToRestConversion(arg, false);
|
|
31000
30923
|
this.toAssignable(arg, isLHS);
|
|
31001
30924
|
if (!isLast) {
|
|
31002
|
-
this.raise(Errors.RestTrailingComma,
|
|
31003
|
-
at: prop
|
|
31004
|
-
});
|
|
30925
|
+
this.raise(Errors.RestTrailingComma, prop);
|
|
31005
30926
|
}
|
|
31006
30927
|
} else {
|
|
31007
30928
|
this.toAssignable(prop, isLHS);
|
|
@@ -31025,13 +30946,9 @@ var LValParser = /*#__PURE__*/ function(NodeUtils) {
|
|
|
31025
30946
|
}
|
|
31026
30947
|
if (elt.type === "RestElement") {
|
|
31027
30948
|
if (i < end) {
|
|
31028
|
-
this.raise(Errors.RestTrailingComma,
|
|
31029
|
-
at: elt
|
|
31030
|
-
});
|
|
30949
|
+
this.raise(Errors.RestTrailingComma, elt);
|
|
31031
30950
|
} else if (trailingCommaLoc) {
|
|
31032
|
-
this.raise(Errors.RestTrailingComma,
|
|
31033
|
-
at: trailingCommaLoc
|
|
31034
|
-
});
|
|
30951
|
+
this.raise(Errors.RestTrailingComma, trailingCommaLoc);
|
|
31035
30952
|
}
|
|
31036
30953
|
}
|
|
31037
30954
|
}
|
|
@@ -31169,9 +31086,7 @@ var LValParser = /*#__PURE__*/ function(NodeUtils) {
|
|
|
31169
31086
|
} else {
|
|
31170
31087
|
var decorators = [];
|
|
31171
31088
|
if (this.match(26) && this.hasPlugin("decorators")) {
|
|
31172
|
-
this.raise(Errors.UnsupportedParameterDecorator,
|
|
31173
|
-
at: this.state.startLoc
|
|
31174
|
-
});
|
|
31089
|
+
this.raise(Errors.UnsupportedParameterDecorator, this.state.startLoc);
|
|
31175
31090
|
}
|
|
31176
31091
|
while(this.match(26)){
|
|
31177
31092
|
decorators.push(this.parseDecorator());
|
|
@@ -31270,16 +31185,13 @@ var LValParser = /*#__PURE__*/ function(NodeUtils) {
|
|
|
31270
31185
|
if (isOptionalMemberExpression3) {
|
|
31271
31186
|
this.expectPlugin("optionalChainingAssign", expression2.loc.start);
|
|
31272
31187
|
if (ancestor.type !== "AssignmentExpression") {
|
|
31273
|
-
this.raise(Errors.InvalidLhsOptionalChaining, {
|
|
31274
|
-
at: expression2,
|
|
31188
|
+
this.raise(Errors.InvalidLhsOptionalChaining, expression2, {
|
|
31275
31189
|
ancestor: ancestor
|
|
31276
31190
|
});
|
|
31277
31191
|
}
|
|
31278
31192
|
}
|
|
31279
31193
|
if (binding !== 64) {
|
|
31280
|
-
this.raise(Errors.InvalidPropertyBindingPattern,
|
|
31281
|
-
at: expression2
|
|
31282
|
-
});
|
|
31194
|
+
this.raise(Errors.InvalidPropertyBindingPattern, expression2);
|
|
31283
31195
|
}
|
|
31284
31196
|
return;
|
|
31285
31197
|
}
|
|
@@ -31288,9 +31200,7 @@ var LValParser = /*#__PURE__*/ function(NodeUtils) {
|
|
|
31288
31200
|
var name = expression2.name;
|
|
31289
31201
|
if (checkClashes) {
|
|
31290
31202
|
if (checkClashes.has(name)) {
|
|
31291
|
-
this.raise(Errors.ParamDupe,
|
|
31292
|
-
at: expression2
|
|
31293
|
-
});
|
|
31203
|
+
this.raise(Errors.ParamDupe, expression2);
|
|
31294
31204
|
} else {
|
|
31295
31205
|
checkClashes.add(name);
|
|
31296
31206
|
}
|
|
@@ -31301,8 +31211,7 @@ var LValParser = /*#__PURE__*/ function(NodeUtils) {
|
|
|
31301
31211
|
if (validity === true) return;
|
|
31302
31212
|
if (validity === false) {
|
|
31303
31213
|
var ParseErrorClass = binding === 64 ? Errors.InvalidLhs : Errors.InvalidLhsBinding;
|
|
31304
|
-
this.raise(ParseErrorClass, {
|
|
31305
|
-
at: expression2,
|
|
31214
|
+
this.raise(ParseErrorClass, expression2, {
|
|
31306
31215
|
ancestor: ancestor
|
|
31307
31216
|
});
|
|
31308
31217
|
return;
|
|
@@ -31350,21 +31259,17 @@ var LValParser = /*#__PURE__*/ function(NodeUtils) {
|
|
|
31350
31259
|
var strictModeChanged = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
|
|
31351
31260
|
if (this.state.strict && (strictModeChanged ? isStrictBindReservedWord(at.name, this.inModule) : isStrictBindOnlyReservedWord(at.name))) {
|
|
31352
31261
|
if (bindingType === 64) {
|
|
31353
|
-
this.raise(Errors.StrictEvalArguments, {
|
|
31354
|
-
at: at,
|
|
31262
|
+
this.raise(Errors.StrictEvalArguments, at, {
|
|
31355
31263
|
referenceName: at.name
|
|
31356
31264
|
});
|
|
31357
31265
|
} else {
|
|
31358
|
-
this.raise(Errors.StrictEvalArgumentsBinding, {
|
|
31359
|
-
at: at,
|
|
31266
|
+
this.raise(Errors.StrictEvalArgumentsBinding, at, {
|
|
31360
31267
|
bindingName: at.name
|
|
31361
31268
|
});
|
|
31362
31269
|
}
|
|
31363
31270
|
}
|
|
31364
31271
|
if (bindingType & 8192 && at.name === "let") {
|
|
31365
|
-
this.raise(Errors.LetInLexicalBinding,
|
|
31366
|
-
at: at
|
|
31367
|
-
});
|
|
31272
|
+
this.raise(Errors.LetInLexicalBinding, at);
|
|
31368
31273
|
}
|
|
31369
31274
|
if (!(bindingType & 64)) {
|
|
31370
31275
|
this.declareNameFromIdentifier(at, bindingType);
|
|
@@ -31391,9 +31296,7 @@ var LValParser = /*#__PURE__*/ function(NodeUtils) {
|
|
|
31391
31296
|
case "ObjectExpression":
|
|
31392
31297
|
if (allowPattern) break;
|
|
31393
31298
|
default:
|
|
31394
|
-
this.raise(Errors.InvalidRestAssignmentPattern,
|
|
31395
|
-
at: node
|
|
31396
|
-
});
|
|
31299
|
+
this.raise(Errors.InvalidRestAssignmentPattern, node);
|
|
31397
31300
|
}
|
|
31398
31301
|
}
|
|
31399
31302
|
},
|
|
@@ -31403,9 +31306,7 @@ var LValParser = /*#__PURE__*/ function(NodeUtils) {
|
|
|
31403
31306
|
if (!this.match(12)) {
|
|
31404
31307
|
return false;
|
|
31405
31308
|
}
|
|
31406
|
-
this.raise(this.lookaheadCharCode() === close ? Errors.RestTrailingComma : Errors.ElementAfterRest,
|
|
31407
|
-
at: this.state.startLoc
|
|
31408
|
-
});
|
|
31309
|
+
this.raise(this.lookaheadCharCode() === close ? Errors.RestTrailingComma : Errors.ElementAfterRest, this.state.startLoc);
|
|
31409
31310
|
return true;
|
|
31410
31311
|
}
|
|
31411
31312
|
}
|
|
@@ -31670,12 +31571,11 @@ var typescript = function(superClass) {
|
|
|
31670
31571
|
{
|
|
31671
31572
|
key: "tsParseModifiers",
|
|
31672
31573
|
value: function tsParseModifiers(param, modified) {
|
|
31673
|
-
var allowedModifiers = param.allowedModifiers, disallowedModifiers = param.disallowedModifiers, stopOnStartOfClassStaticBlock = param.stopOnStartOfClassStaticBlock, _param_errorTemplate = param.errorTemplate, errorTemplate = _param_errorTemplate === void 0 ? TSErrors.InvalidModifierOnTypeMember : _param_errorTemplate;
|
|
31674
31574
|
var _this = this;
|
|
31575
|
+
var allowedModifiers = param.allowedModifiers, disallowedModifiers = param.disallowedModifiers, stopOnStartOfClassStaticBlock = param.stopOnStartOfClassStaticBlock, _param_errorTemplate = param.errorTemplate, errorTemplate = _param_errorTemplate === void 0 ? TSErrors.InvalidModifierOnTypeMember : _param_errorTemplate;
|
|
31675
31576
|
var enforceOrder = function(loc, modifier, before, after) {
|
|
31676
31577
|
if (modifier === before && modified[after]) {
|
|
31677
|
-
_this.raise(TSErrors.InvalidModifiersOrder, {
|
|
31678
|
-
at: loc,
|
|
31578
|
+
_this.raise(TSErrors.InvalidModifiersOrder, loc, {
|
|
31679
31579
|
orderedModifiers: [
|
|
31680
31580
|
before,
|
|
31681
31581
|
after
|
|
@@ -31685,8 +31585,7 @@ var typescript = function(superClass) {
|
|
|
31685
31585
|
};
|
|
31686
31586
|
var incompatible = function(loc, modifier, mod1, mod2) {
|
|
31687
31587
|
if (modified[mod1] && modifier === mod2 || modified[mod2] && modifier === mod1) {
|
|
31688
|
-
_this.raise(TSErrors.IncompatibleModifiers, {
|
|
31689
|
-
at: loc,
|
|
31588
|
+
_this.raise(TSErrors.IncompatibleModifiers, loc, {
|
|
31690
31589
|
modifiers: [
|
|
31691
31590
|
mod1,
|
|
31692
31591
|
mod2
|
|
@@ -31700,8 +31599,7 @@ var typescript = function(superClass) {
|
|
|
31700
31599
|
if (!modifier) break;
|
|
31701
31600
|
if (tsIsAccessModifier(modifier)) {
|
|
31702
31601
|
if (modified.accessibility) {
|
|
31703
|
-
this.raise(TSErrors.DuplicateAccessibilityModifier, {
|
|
31704
|
-
at: startLoc,
|
|
31602
|
+
this.raise(TSErrors.DuplicateAccessibilityModifier, startLoc, {
|
|
31705
31603
|
modifier: modifier
|
|
31706
31604
|
});
|
|
31707
31605
|
} else {
|
|
@@ -31712,8 +31610,7 @@ var typescript = function(superClass) {
|
|
|
31712
31610
|
}
|
|
31713
31611
|
} else if (tsIsVarianceAnnotations(modifier)) {
|
|
31714
31612
|
if (modified[modifier]) {
|
|
31715
|
-
this.raise(TSErrors.DuplicateModifier, {
|
|
31716
|
-
at: startLoc,
|
|
31613
|
+
this.raise(TSErrors.DuplicateModifier, startLoc, {
|
|
31717
31614
|
modifier: modifier
|
|
31718
31615
|
});
|
|
31719
31616
|
}
|
|
@@ -31721,8 +31618,7 @@ var typescript = function(superClass) {
|
|
|
31721
31618
|
enforceOrder(startLoc, modifier, "in", "out");
|
|
31722
31619
|
} else {
|
|
31723
31620
|
if (Object.hasOwnProperty.call(modified, modifier)) {
|
|
31724
|
-
this.raise(TSErrors.DuplicateModifier, {
|
|
31725
|
-
at: startLoc,
|
|
31621
|
+
this.raise(TSErrors.DuplicateModifier, startLoc, {
|
|
31726
31622
|
modifier: modifier
|
|
31727
31623
|
});
|
|
31728
31624
|
} else {
|
|
@@ -31736,8 +31632,7 @@ var typescript = function(superClass) {
|
|
|
31736
31632
|
modified[modifier] = true;
|
|
31737
31633
|
}
|
|
31738
31634
|
if (disallowedModifiers === null || disallowedModifiers === void 0 ? void 0 : disallowedModifiers.includes(modifier)) {
|
|
31739
|
-
this.raise(errorTemplate, {
|
|
31740
|
-
at: startLoc,
|
|
31635
|
+
this.raise(errorTemplate, startLoc, {
|
|
31741
31636
|
modifier: modifier
|
|
31742
31637
|
});
|
|
31743
31638
|
}
|
|
@@ -31792,7 +31687,7 @@ var typescript = function(superClass) {
|
|
|
31792
31687
|
}
|
|
31793
31688
|
result.push(element);
|
|
31794
31689
|
if (this.eat(12)) {
|
|
31795
|
-
trailingCommaPos = this.state.
|
|
31690
|
+
trailingCommaPos = this.state.lastTokStartLoc.index;
|
|
31796
31691
|
continue;
|
|
31797
31692
|
}
|
|
31798
31693
|
if (this.tsIsListTerminator(kind)) {
|
|
@@ -31835,9 +31730,7 @@ var typescript = function(superClass) {
|
|
|
31835
31730
|
this.expect(83);
|
|
31836
31731
|
this.expect(10);
|
|
31837
31732
|
if (!this.match(133)) {
|
|
31838
|
-
this.raise(TSErrors.UnsupportedImportTypeArgument,
|
|
31839
|
-
at: this.state.startLoc
|
|
31840
|
-
});
|
|
31733
|
+
this.raise(TSErrors.UnsupportedImportTypeArgument, this.state.startLoc);
|
|
31841
31734
|
}
|
|
31842
31735
|
node.argument = _get(_get_prototype_of(TypeScriptParserMixin.prototype), "parseExprAtom", this).call(this);
|
|
31843
31736
|
this.expect(11);
|
|
@@ -31943,9 +31836,7 @@ var typescript = function(superClass) {
|
|
|
31943
31836
|
};
|
|
31944
31837
|
node.params = this.tsParseBracketedList("TypeParametersOrArguments", this.tsParseTypeParameter.bind(this, parseModifiers), false, true, refTrailingCommaPos);
|
|
31945
31838
|
if (node.params.length === 0) {
|
|
31946
|
-
this.raise(TSErrors.EmptyTypeParameters,
|
|
31947
|
-
at: node
|
|
31948
|
-
});
|
|
31839
|
+
this.raise(TSErrors.EmptyTypeParameters, node);
|
|
31949
31840
|
}
|
|
31950
31841
|
if (refTrailingCommaPos.value !== -1) {
|
|
31951
31842
|
this.addExtra(node, "trailingComma", refTrailingCommaPos.value);
|
|
@@ -31979,8 +31870,7 @@ var typescript = function(superClass) {
|
|
|
31979
31870
|
var pattern = _step.value;
|
|
31980
31871
|
var type = pattern.type;
|
|
31981
31872
|
if (type === "AssignmentPattern" || type === "TSParameterProperty") {
|
|
31982
|
-
this.raise(TSErrors.UnsupportedSignatureParameterKind, {
|
|
31983
|
-
at: pattern,
|
|
31873
|
+
this.raise(TSErrors.UnsupportedSignatureParameterKind, pattern, {
|
|
31984
31874
|
type: type
|
|
31985
31875
|
});
|
|
31986
31876
|
}
|
|
@@ -32056,15 +31946,11 @@ var typescript = function(superClass) {
|
|
|
32056
31946
|
var nodeAny = node;
|
|
32057
31947
|
if (this.match(10) || this.match(47)) {
|
|
32058
31948
|
if (readonly) {
|
|
32059
|
-
this.raise(TSErrors.ReadonlyForMethodSignature,
|
|
32060
|
-
at: node
|
|
32061
|
-
});
|
|
31949
|
+
this.raise(TSErrors.ReadonlyForMethodSignature, node);
|
|
32062
31950
|
}
|
|
32063
31951
|
var method = nodeAny;
|
|
32064
31952
|
if (method.kind && this.match(47)) {
|
|
32065
|
-
this.raise(TSErrors.AccesorCannotHaveTypeParameters,
|
|
32066
|
-
at: this.state.curPosition()
|
|
32067
|
-
});
|
|
31953
|
+
this.raise(TSErrors.AccesorCannotHaveTypeParameters, this.state.curPosition());
|
|
32068
31954
|
}
|
|
32069
31955
|
this.tsFillSignature(14, method);
|
|
32070
31956
|
this.tsParseTypeMemberSemicolon();
|
|
@@ -32072,42 +31958,28 @@ var typescript = function(superClass) {
|
|
|
32072
31958
|
var returnTypeKey = "returnType";
|
|
32073
31959
|
if (method.kind === "get") {
|
|
32074
31960
|
if (method[paramsKey].length > 0) {
|
|
32075
|
-
this.raise(Errors.BadGetterArity,
|
|
32076
|
-
at: this.state.curPosition()
|
|
32077
|
-
});
|
|
31961
|
+
this.raise(Errors.BadGetterArity, this.state.curPosition());
|
|
32078
31962
|
if (this.isThisParam(method[paramsKey][0])) {
|
|
32079
|
-
this.raise(TSErrors.AccesorCannotDeclareThisParameter,
|
|
32080
|
-
at: this.state.curPosition()
|
|
32081
|
-
});
|
|
31963
|
+
this.raise(TSErrors.AccesorCannotDeclareThisParameter, this.state.curPosition());
|
|
32082
31964
|
}
|
|
32083
31965
|
}
|
|
32084
31966
|
} else if (method.kind === "set") {
|
|
32085
31967
|
if (method[paramsKey].length !== 1) {
|
|
32086
|
-
this.raise(Errors.BadSetterArity,
|
|
32087
|
-
at: this.state.curPosition()
|
|
32088
|
-
});
|
|
31968
|
+
this.raise(Errors.BadSetterArity, this.state.curPosition());
|
|
32089
31969
|
} else {
|
|
32090
31970
|
var firstParameter = method[paramsKey][0];
|
|
32091
31971
|
if (this.isThisParam(firstParameter)) {
|
|
32092
|
-
this.raise(TSErrors.AccesorCannotDeclareThisParameter,
|
|
32093
|
-
at: this.state.curPosition()
|
|
32094
|
-
});
|
|
31972
|
+
this.raise(TSErrors.AccesorCannotDeclareThisParameter, this.state.curPosition());
|
|
32095
31973
|
}
|
|
32096
31974
|
if (firstParameter.type === "Identifier" && firstParameter.optional) {
|
|
32097
|
-
this.raise(TSErrors.SetAccesorCannotHaveOptionalParameter,
|
|
32098
|
-
at: this.state.curPosition()
|
|
32099
|
-
});
|
|
31975
|
+
this.raise(TSErrors.SetAccesorCannotHaveOptionalParameter, this.state.curPosition());
|
|
32100
31976
|
}
|
|
32101
31977
|
if (firstParameter.type === "RestElement") {
|
|
32102
|
-
this.raise(TSErrors.SetAccesorCannotHaveRestParameter,
|
|
32103
|
-
at: this.state.curPosition()
|
|
32104
|
-
});
|
|
31978
|
+
this.raise(TSErrors.SetAccesorCannotHaveRestParameter, this.state.curPosition());
|
|
32105
31979
|
}
|
|
32106
31980
|
}
|
|
32107
31981
|
if (method[returnTypeKey]) {
|
|
32108
|
-
this.raise(TSErrors.SetAccesorCannotHaveReturnType,
|
|
32109
|
-
at: method[returnTypeKey]
|
|
32110
|
-
});
|
|
31982
|
+
this.raise(TSErrors.SetAccesorCannotHaveReturnType, method[returnTypeKey]);
|
|
32111
31983
|
}
|
|
32112
31984
|
} else {
|
|
32113
31985
|
method.kind = "method";
|
|
@@ -32252,9 +32124,7 @@ var typescript = function(superClass) {
|
|
|
32252
32124
|
node.elementTypes.forEach(function(elementNode) {
|
|
32253
32125
|
var type = elementNode.type;
|
|
32254
32126
|
if (seenOptionalElement && type !== "TSRestType" && type !== "TSOptionalType" && !(type === "TSNamedTupleMember" && elementNode.optional)) {
|
|
32255
|
-
_this.raise(TSErrors.OptionalTypeBeforeRequired,
|
|
32256
|
-
at: elementNode
|
|
32257
|
-
});
|
|
32127
|
+
_this.raise(TSErrors.OptionalTypeBeforeRequired, elementNode);
|
|
32258
32128
|
}
|
|
32259
32129
|
seenOptionalElement || (seenOptionalElement = type === "TSNamedTupleMember" && elementNode.optional || type === "TSOptionalType");
|
|
32260
32130
|
});
|
|
@@ -32308,16 +32178,12 @@ var typescript = function(superClass) {
|
|
|
32308
32178
|
labeledNode.elementType = type;
|
|
32309
32179
|
if (this.eat(17)) {
|
|
32310
32180
|
labeledNode.optional = true;
|
|
32311
|
-
this.raise(TSErrors.TupleOptionalAfterType,
|
|
32312
|
-
at: this.state.lastTokStartLoc
|
|
32313
|
-
});
|
|
32181
|
+
this.raise(TSErrors.TupleOptionalAfterType, this.state.lastTokStartLoc);
|
|
32314
32182
|
}
|
|
32315
32183
|
} else {
|
|
32316
32184
|
labeledNode = this.startNodeAtNode(type);
|
|
32317
32185
|
labeledNode.optional = optional;
|
|
32318
|
-
this.raise(TSErrors.InvalidTupleMemberLabel,
|
|
32319
|
-
at: type
|
|
32320
|
-
});
|
|
32186
|
+
this.raise(TSErrors.InvalidTupleMemberLabel, type);
|
|
32321
32187
|
labeledNode.label = type;
|
|
32322
32188
|
labeledNode.elementType = this.tsParseType();
|
|
32323
32189
|
}
|
|
@@ -32512,9 +32378,7 @@ var typescript = function(superClass) {
|
|
|
32512
32378
|
case "TSArrayType":
|
|
32513
32379
|
return;
|
|
32514
32380
|
default:
|
|
32515
|
-
this.raise(TSErrors.UnexpectedReadonly,
|
|
32516
|
-
at: node
|
|
32517
|
-
});
|
|
32381
|
+
this.raise(TSErrors.UnexpectedReadonly, node);
|
|
32518
32382
|
}
|
|
32519
32383
|
}
|
|
32520
32384
|
},
|
|
@@ -32733,8 +32597,7 @@ var typescript = function(superClass) {
|
|
|
32733
32597
|
return false;
|
|
32734
32598
|
}
|
|
32735
32599
|
if (containsEsc) {
|
|
32736
|
-
this.raise(Errors.InvalidEscapedReservedWord, {
|
|
32737
|
-
at: this.state.lastTokStartLoc,
|
|
32600
|
+
this.raise(Errors.InvalidEscapedReservedWord, this.state.lastTokStartLoc, {
|
|
32738
32601
|
reservedWord: "asserts"
|
|
32739
32602
|
});
|
|
32740
32603
|
}
|
|
@@ -32744,8 +32607,8 @@ var typescript = function(superClass) {
|
|
|
32744
32607
|
{
|
|
32745
32608
|
key: "tsParseTypeAnnotation",
|
|
32746
32609
|
value: function tsParseTypeAnnotation() {
|
|
32747
|
-
var eatColon = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true, t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this.startNode();
|
|
32748
32610
|
var _this = this;
|
|
32611
|
+
var eatColon = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true, t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this.startNode();
|
|
32749
32612
|
this.tsInType(function() {
|
|
32750
32613
|
if (eatColon) _this.expect(14);
|
|
32751
32614
|
t.typeAnnotation = _this.tsParseType();
|
|
@@ -32803,9 +32666,7 @@ var typescript = function(superClass) {
|
|
|
32803
32666
|
value: function tsParseTypeAssertion() {
|
|
32804
32667
|
var _this = this;
|
|
32805
32668
|
if (this.getPluginOption("typescript", "disallowAmbiguousJSXLike")) {
|
|
32806
|
-
this.raise(TSErrors.ReservedTypeAssertion,
|
|
32807
|
-
at: this.state.startLoc
|
|
32808
|
-
});
|
|
32669
|
+
this.raise(TSErrors.ReservedTypeAssertion, this.state.startLoc);
|
|
32809
32670
|
}
|
|
32810
32671
|
var node = this.startNode();
|
|
32811
32672
|
node.typeAnnotation = this.tsInType(function() {
|
|
@@ -32831,8 +32692,7 @@ var typescript = function(superClass) {
|
|
|
32831
32692
|
return _this.finishNode(node, "TSExpressionWithTypeArguments");
|
|
32832
32693
|
});
|
|
32833
32694
|
if (!delimitedList.length) {
|
|
32834
|
-
this.raise(TSErrors.EmptyHeritageClauseType, {
|
|
32835
|
-
at: originalStartLoc,
|
|
32695
|
+
this.raise(TSErrors.EmptyHeritageClauseType, originalStartLoc, {
|
|
32836
32696
|
token: token
|
|
32837
32697
|
});
|
|
32838
32698
|
}
|
|
@@ -32851,9 +32711,7 @@ var typescript = function(superClass) {
|
|
|
32851
32711
|
this.checkIdentifier(node.id, 130);
|
|
32852
32712
|
} else {
|
|
32853
32713
|
node.id = null;
|
|
32854
|
-
this.raise(TSErrors.MissingInterfaceName,
|
|
32855
|
-
at: this.state.startLoc
|
|
32856
|
-
});
|
|
32714
|
+
this.raise(TSErrors.MissingInterfaceName, this.state.startLoc);
|
|
32857
32715
|
}
|
|
32858
32716
|
node.typeParameters = this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers);
|
|
32859
32717
|
if (this.eat(81)) {
|
|
@@ -33054,9 +32912,7 @@ var typescript = function(superClass) {
|
|
|
33054
32912
|
this.expect(29);
|
|
33055
32913
|
var moduleReference = this.tsParseModuleReference();
|
|
33056
32914
|
if (node.importKind === "type" && moduleReference.type !== "TSExternalModuleReference") {
|
|
33057
|
-
this.raise(TSErrors.ImportAliasHasImportType,
|
|
33058
|
-
at: moduleReference
|
|
33059
|
-
});
|
|
32915
|
+
this.raise(TSErrors.ImportAliasHasImportType, moduleReference);
|
|
33060
32916
|
}
|
|
33061
32917
|
node.moduleReference = moduleReference;
|
|
33062
32918
|
this.semicolon();
|
|
@@ -33291,9 +33147,7 @@ var typescript = function(superClass) {
|
|
|
33291
33147
|
});
|
|
33292
33148
|
});
|
|
33293
33149
|
if (node.params.length === 0) {
|
|
33294
|
-
this.raise(TSErrors.EmptyTypeArguments,
|
|
33295
|
-
at: node
|
|
33296
|
-
});
|
|
33150
|
+
this.raise(TSErrors.EmptyTypeArguments, node);
|
|
33297
33151
|
} else if (!this.state.inType && this.curContext() === types.brace) {
|
|
33298
33152
|
this.reScan_lt_gt();
|
|
33299
33153
|
}
|
|
@@ -33332,9 +33186,7 @@ var typescript = function(superClass) {
|
|
|
33332
33186
|
var override = modified.override;
|
|
33333
33187
|
var readonly = modified.readonly;
|
|
33334
33188
|
if (!(flags & 4) && (accessibility || readonly || override)) {
|
|
33335
|
-
this.raise(TSErrors.UnexpectedParameterModifier,
|
|
33336
|
-
at: startLoc
|
|
33337
|
-
});
|
|
33189
|
+
this.raise(TSErrors.UnexpectedParameterModifier, startLoc);
|
|
33338
33190
|
}
|
|
33339
33191
|
var left = this.parseMaybeDefault();
|
|
33340
33192
|
this.parseAssignableListItemTypes(left, flags);
|
|
@@ -33348,9 +33200,7 @@ var typescript = function(superClass) {
|
|
|
33348
33200
|
if (readonly) pp.readonly = readonly;
|
|
33349
33201
|
if (override) pp.override = override;
|
|
33350
33202
|
if (elt.type !== "Identifier" && elt.type !== "AssignmentPattern") {
|
|
33351
|
-
this.raise(TSErrors.UnsupportedParameterPropertyKind,
|
|
33352
|
-
at: pp
|
|
33353
|
-
});
|
|
33203
|
+
this.raise(TSErrors.UnsupportedParameterPropertyKind, pp);
|
|
33354
33204
|
}
|
|
33355
33205
|
pp.parameter = elt;
|
|
33356
33206
|
return this.finishNode(pp, "TSParameterProperty");
|
|
@@ -33375,9 +33225,7 @@ var typescript = function(superClass) {
|
|
|
33375
33225
|
for(var _iterator = node.params[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
33376
33226
|
var param = _step.value;
|
|
33377
33227
|
if (param.type !== "Identifier" && param.optional && !this.state.isAmbientContext) {
|
|
33378
|
-
this.raise(TSErrors.PatternIsOptional,
|
|
33379
|
-
at: param
|
|
33380
|
-
});
|
|
33228
|
+
this.raise(TSErrors.PatternIsOptional, param);
|
|
33381
33229
|
}
|
|
33382
33230
|
}
|
|
33383
33231
|
} catch (err) {
|
|
@@ -33415,9 +33263,7 @@ var typescript = function(superClass) {
|
|
|
33415
33263
|
return this.finishNode(node, bodilessType);
|
|
33416
33264
|
}
|
|
33417
33265
|
if (bodilessType === "TSDeclareFunction" && this.state.isAmbientContext) {
|
|
33418
|
-
this.raise(TSErrors.DeclareFunctionHasImplementation,
|
|
33419
|
-
at: node
|
|
33420
|
-
});
|
|
33266
|
+
this.raise(TSErrors.DeclareFunctionHasImplementation, node);
|
|
33421
33267
|
if (node.declare) {
|
|
33422
33268
|
return _get(_get_prototype_of(TypeScriptParserMixin.prototype), "parseFunctionBodyAndFinish", this).call(this, node, bodilessType, isMethod3);
|
|
33423
33269
|
}
|
|
@@ -33442,9 +33288,7 @@ var typescript = function(superClass) {
|
|
|
33442
33288
|
var _this = this;
|
|
33443
33289
|
items.forEach(function(node) {
|
|
33444
33290
|
if ((node === null || node === void 0 ? void 0 : node.type) === "TSTypeCastExpression") {
|
|
33445
|
-
_this.raise(TSErrors.UnexpectedTypeAnnotation,
|
|
33446
|
-
at: node.typeAnnotation
|
|
33447
|
-
});
|
|
33291
|
+
_this.raise(TSErrors.UnexpectedTypeAnnotation, node.typeAnnotation);
|
|
33448
33292
|
}
|
|
33449
33293
|
});
|
|
33450
33294
|
}
|
|
@@ -33531,9 +33375,7 @@ var typescript = function(superClass) {
|
|
|
33531
33375
|
}
|
|
33532
33376
|
if (result) {
|
|
33533
33377
|
if (result.type === "TSInstantiationExpression" && (this.match(16) || this.match(18) && this.lookaheadCharCode() !== 40)) {
|
|
33534
|
-
this.raise(TSErrors.InvalidPropertyAccessAfterInstantiationExpression,
|
|
33535
|
-
at: this.state.startLoc
|
|
33536
|
-
});
|
|
33378
|
+
this.raise(TSErrors.InvalidPropertyAccessAfterInstantiationExpression, this.state.startLoc);
|
|
33537
33379
|
}
|
|
33538
33380
|
return result;
|
|
33539
33381
|
}
|
|
@@ -33565,8 +33407,7 @@ var typescript = function(superClass) {
|
|
|
33565
33407
|
_this.next();
|
|
33566
33408
|
if (_this.match(75)) {
|
|
33567
33409
|
if (isSatisfies) {
|
|
33568
|
-
_this.raise(Errors.UnexpectedKeyword, {
|
|
33569
|
-
at: _this.state.startLoc,
|
|
33410
|
+
_this.raise(Errors.UnexpectedKeyword, _this.state.startLoc, {
|
|
33570
33411
|
keyword: "const"
|
|
33571
33412
|
});
|
|
33572
33413
|
}
|
|
@@ -33594,9 +33435,7 @@ var typescript = function(superClass) {
|
|
|
33594
33435
|
value: function checkImportReflection(node) {
|
|
33595
33436
|
_get(_get_prototype_of(TypeScriptParserMixin.prototype), "checkImportReflection", this).call(this, node);
|
|
33596
33437
|
if (node.module && node.importKind !== "value") {
|
|
33597
|
-
this.raise(TSErrors.ImportReflectionHasImportType,
|
|
33598
|
-
at: node.specifiers[0].loc.start
|
|
33599
|
-
});
|
|
33438
|
+
this.raise(TSErrors.ImportReflectionHasImportType, node.specifiers[0].loc.start);
|
|
33600
33439
|
}
|
|
33601
33440
|
}
|
|
33602
33441
|
},
|
|
@@ -33648,9 +33487,7 @@ var typescript = function(superClass) {
|
|
|
33648
33487
|
importNode = _get(_get_prototype_of(TypeScriptParserMixin.prototype), "parseImport", this).call(this, node);
|
|
33649
33488
|
}
|
|
33650
33489
|
if (importNode.importKind === "type" && importNode.specifiers.length > 1 && importNode.specifiers[0].type === "ImportDefaultSpecifier") {
|
|
33651
|
-
this.raise(TSErrors.TypeImportCannotSpecifyDefaultAndNamed,
|
|
33652
|
-
at: importNode
|
|
33653
|
-
});
|
|
33490
|
+
this.raise(TSErrors.TypeImportCannotSpecifyDefaultAndNamed, importNode);
|
|
33654
33491
|
}
|
|
33655
33492
|
return importNode;
|
|
33656
33493
|
}
|
|
@@ -33719,13 +33556,9 @@ var typescript = function(superClass) {
|
|
|
33719
33556
|
var _step_value = _step.value, id = _step_value.id, init = _step_value.init;
|
|
33720
33557
|
if (!init) continue;
|
|
33721
33558
|
if (kind !== "const" || !!id.typeAnnotation) {
|
|
33722
|
-
this.raise(TSErrors.InitializerNotAllowedInAmbientContext,
|
|
33723
|
-
at: init
|
|
33724
|
-
});
|
|
33559
|
+
this.raise(TSErrors.InitializerNotAllowedInAmbientContext, init);
|
|
33725
33560
|
} else if (!isValidAmbientConstInitializer(init, this.hasPlugin("estree"))) {
|
|
33726
|
-
this.raise(TSErrors.ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference,
|
|
33727
|
-
at: init
|
|
33728
|
-
});
|
|
33561
|
+
this.raise(TSErrors.ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference, init);
|
|
33729
33562
|
}
|
|
33730
33563
|
}
|
|
33731
33564
|
} catch (err) {
|
|
@@ -33820,9 +33653,7 @@ var typescript = function(superClass) {
|
|
|
33820
33653
|
_this.next();
|
|
33821
33654
|
_this.next();
|
|
33822
33655
|
if (_this.tsHasSomeModifiers(member, modifiers)) {
|
|
33823
|
-
_this.raise(TSErrors.StaticBlockCannotHaveModifier,
|
|
33824
|
-
at: _this.state.curPosition()
|
|
33825
|
-
});
|
|
33656
|
+
_this.raise(TSErrors.StaticBlockCannotHaveModifier, _this.state.curPosition());
|
|
33826
33657
|
}
|
|
33827
33658
|
_get(_get_prototype_of(TypeScriptParserMixin.prototype), "parseClassStaticBlock", _this).call(_this, classBody2, member);
|
|
33828
33659
|
} else {
|
|
@@ -33843,38 +33674,27 @@ var typescript = function(superClass) {
|
|
|
33843
33674
|
if (idx) {
|
|
33844
33675
|
classBody2.body.push(idx);
|
|
33845
33676
|
if (member.abstract) {
|
|
33846
|
-
this.raise(TSErrors.IndexSignatureHasAbstract,
|
|
33847
|
-
at: member
|
|
33848
|
-
});
|
|
33677
|
+
this.raise(TSErrors.IndexSignatureHasAbstract, member);
|
|
33849
33678
|
}
|
|
33850
33679
|
if (member.accessibility) {
|
|
33851
|
-
this.raise(TSErrors.IndexSignatureHasAccessibility, {
|
|
33852
|
-
at: member,
|
|
33680
|
+
this.raise(TSErrors.IndexSignatureHasAccessibility, member, {
|
|
33853
33681
|
modifier: member.accessibility
|
|
33854
33682
|
});
|
|
33855
33683
|
}
|
|
33856
33684
|
if (member.declare) {
|
|
33857
|
-
this.raise(TSErrors.IndexSignatureHasDeclare,
|
|
33858
|
-
at: member
|
|
33859
|
-
});
|
|
33685
|
+
this.raise(TSErrors.IndexSignatureHasDeclare, member);
|
|
33860
33686
|
}
|
|
33861
33687
|
if (member.override) {
|
|
33862
|
-
this.raise(TSErrors.IndexSignatureHasOverride,
|
|
33863
|
-
at: member
|
|
33864
|
-
});
|
|
33688
|
+
this.raise(TSErrors.IndexSignatureHasOverride, member);
|
|
33865
33689
|
}
|
|
33866
33690
|
return;
|
|
33867
33691
|
}
|
|
33868
33692
|
if (!this.state.inAbstractClass && member.abstract) {
|
|
33869
|
-
this.raise(TSErrors.NonAbstractClassHasAbstractMethod,
|
|
33870
|
-
at: member
|
|
33871
|
-
});
|
|
33693
|
+
this.raise(TSErrors.NonAbstractClassHasAbstractMethod, member);
|
|
33872
33694
|
}
|
|
33873
33695
|
if (member.override) {
|
|
33874
33696
|
if (!state.hadSuperClass) {
|
|
33875
|
-
this.raise(TSErrors.OverrideNotInSubClass,
|
|
33876
|
-
at: member
|
|
33877
|
-
});
|
|
33697
|
+
this.raise(TSErrors.OverrideNotInSubClass, member);
|
|
33878
33698
|
}
|
|
33879
33699
|
}
|
|
33880
33700
|
_get(_get_prototype_of(TypeScriptParserMixin.prototype), "parseClassMemberWithIsStatic", this).call(this, classBody2, member, state, isStatic2);
|
|
@@ -33886,14 +33706,10 @@ var typescript = function(superClass) {
|
|
|
33886
33706
|
var optional = this.eat(17);
|
|
33887
33707
|
if (optional) methodOrProp.optional = true;
|
|
33888
33708
|
if (methodOrProp.readonly && this.match(10)) {
|
|
33889
|
-
this.raise(TSErrors.ClassMethodHasReadonly,
|
|
33890
|
-
at: methodOrProp
|
|
33891
|
-
});
|
|
33709
|
+
this.raise(TSErrors.ClassMethodHasReadonly, methodOrProp);
|
|
33892
33710
|
}
|
|
33893
33711
|
if (methodOrProp.declare && this.match(10)) {
|
|
33894
|
-
this.raise(TSErrors.ClassMethodHasDeclare,
|
|
33895
|
-
at: methodOrProp
|
|
33896
|
-
});
|
|
33712
|
+
this.raise(TSErrors.ClassMethodHasDeclare, methodOrProp);
|
|
33897
33713
|
}
|
|
33898
33714
|
}
|
|
33899
33715
|
},
|
|
@@ -33960,9 +33776,7 @@ var typescript = function(superClass) {
|
|
|
33960
33776
|
var startLoc = this.state.startLoc;
|
|
33961
33777
|
var isDeclare = this.eatContextual(125);
|
|
33962
33778
|
if (isDeclare && (this.isContextual(125) || !this.shouldParseExportDeclaration())) {
|
|
33963
|
-
throw this.raise(TSErrors.ExpectedAmbientAfterExportDeclare,
|
|
33964
|
-
at: this.state.startLoc
|
|
33965
|
-
});
|
|
33779
|
+
throw this.raise(TSErrors.ExpectedAmbientAfterExportDeclare, this.state.startLoc);
|
|
33966
33780
|
}
|
|
33967
33781
|
var isIdentifier6 = tokenIsIdentifier(this.state.type);
|
|
33968
33782
|
var declaration = isIdentifier6 && this.tsTryParseExportDeclaration() || _get(_get_prototype_of(TypeScriptParserMixin.prototype), "parseExportDeclaration", this).call(this, node);
|
|
@@ -34007,14 +33821,11 @@ var typescript = function(superClass) {
|
|
|
34007
33821
|
value: function parseClassProperty(node) {
|
|
34008
33822
|
this.parseClassPropertyAnnotation(node);
|
|
34009
33823
|
if (this.state.isAmbientContext && !(node.readonly && !node.typeAnnotation) && this.match(29)) {
|
|
34010
|
-
this.raise(TSErrors.DeclareClassFieldHasInitializer,
|
|
34011
|
-
at: this.state.startLoc
|
|
34012
|
-
});
|
|
33824
|
+
this.raise(TSErrors.DeclareClassFieldHasInitializer, this.state.startLoc);
|
|
34013
33825
|
}
|
|
34014
33826
|
if (node.abstract && this.match(29)) {
|
|
34015
33827
|
var key = node.key;
|
|
34016
|
-
this.raise(TSErrors.AbstractPropertyHasInitializer, {
|
|
34017
|
-
at: this.state.startLoc,
|
|
33828
|
+
this.raise(TSErrors.AbstractPropertyHasInitializer, this.state.startLoc, {
|
|
34018
33829
|
propertyName: key.type === "Identifier" && !node.computed ? key.name : "[".concat(this.input.slice(key.start, key.end), "]")
|
|
34019
33830
|
});
|
|
34020
33831
|
}
|
|
@@ -34025,13 +33836,10 @@ var typescript = function(superClass) {
|
|
|
34025
33836
|
key: "parseClassPrivateProperty",
|
|
34026
33837
|
value: function parseClassPrivateProperty(node) {
|
|
34027
33838
|
if (node.abstract) {
|
|
34028
|
-
this.raise(TSErrors.PrivateElementHasAbstract,
|
|
34029
|
-
at: node
|
|
34030
|
-
});
|
|
33839
|
+
this.raise(TSErrors.PrivateElementHasAbstract, node);
|
|
34031
33840
|
}
|
|
34032
33841
|
if (node.accessibility) {
|
|
34033
|
-
this.raise(TSErrors.PrivateElementHasAccessibility, {
|
|
34034
|
-
at: node,
|
|
33842
|
+
this.raise(TSErrors.PrivateElementHasAccessibility, node, {
|
|
34035
33843
|
modifier: node.accessibility
|
|
34036
33844
|
});
|
|
34037
33845
|
}
|
|
@@ -34044,9 +33852,7 @@ var typescript = function(superClass) {
|
|
|
34044
33852
|
value: function parseClassAccessorProperty(node) {
|
|
34045
33853
|
this.parseClassPropertyAnnotation(node);
|
|
34046
33854
|
if (node.optional) {
|
|
34047
|
-
this.raise(TSErrors.AccessorCannotBeOptional,
|
|
34048
|
-
at: node
|
|
34049
|
-
});
|
|
33855
|
+
this.raise(TSErrors.AccessorCannotBeOptional, node);
|
|
34050
33856
|
}
|
|
34051
33857
|
return _get(_get_prototype_of(TypeScriptParserMixin.prototype), "parseClassAccessorProperty", this).call(this, node);
|
|
34052
33858
|
}
|
|
@@ -34056,14 +33862,11 @@ var typescript = function(superClass) {
|
|
|
34056
33862
|
value: function pushClassMethod(classBody2, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) {
|
|
34057
33863
|
var typeParameters = this.tsTryParseTypeParameters(this.tsParseConstModifier);
|
|
34058
33864
|
if (typeParameters && isConstructor) {
|
|
34059
|
-
this.raise(TSErrors.ConstructorHasTypeParameters,
|
|
34060
|
-
at: typeParameters
|
|
34061
|
-
});
|
|
33865
|
+
this.raise(TSErrors.ConstructorHasTypeParameters, typeParameters);
|
|
34062
33866
|
}
|
|
34063
33867
|
var _method_declare = method.declare, declare = _method_declare === void 0 ? false : _method_declare, kind = method.kind;
|
|
34064
33868
|
if (declare && (kind === "get" || kind === "set")) {
|
|
34065
|
-
this.raise(TSErrors.DeclareAccessor, {
|
|
34066
|
-
at: method,
|
|
33869
|
+
this.raise(TSErrors.DeclareAccessor, method, {
|
|
34067
33870
|
kind: kind
|
|
34068
33871
|
});
|
|
34069
33872
|
}
|
|
@@ -34178,8 +33981,7 @@ var typescript = function(superClass) {
|
|
|
34178
33981
|
if (_this.hasPlugin("jsx") && expr.typeParameters.params.length === 1 && !((_expr_typeParameters_extra = expr.typeParameters.extra) === null || _expr_typeParameters_extra === void 0 ? void 0 : _expr_typeParameters_extra.trailingComma)) {
|
|
34179
33982
|
var parameter = expr.typeParameters.params[0];
|
|
34180
33983
|
if (!parameter.constraint) {
|
|
34181
|
-
_this.raise(TSErrors.SingleTypeParameterWithoutTrailingComma, {
|
|
34182
|
-
at: createPositionWithColumnOffset(parameter.loc.end, 1),
|
|
33984
|
+
_this.raise(TSErrors.SingleTypeParameterWithoutTrailingComma, createPositionWithColumnOffset(parameter.loc.end, 1), {
|
|
34183
33985
|
typeParameterName: parameter.name.name
|
|
34184
33986
|
});
|
|
34185
33987
|
}
|
|
@@ -34219,9 +34021,7 @@ var typescript = function(superClass) {
|
|
|
34219
34021
|
value: function reportReservedArrowTypeParam(node) {
|
|
34220
34022
|
var _node_extra;
|
|
34221
34023
|
if (node.params.length === 1 && !node.params[0].constraint && !((_node_extra = node.extra) === null || _node_extra === void 0 ? void 0 : _node_extra.trailingComma) && this.getPluginOption("typescript", "disallowAmbiguousJSXLike")) {
|
|
34222
|
-
this.raise(TSErrors.ReservedArrowTypeParam,
|
|
34223
|
-
at: node
|
|
34224
|
-
});
|
|
34024
|
+
this.raise(TSErrors.ReservedArrowTypeParam, node);
|
|
34225
34025
|
}
|
|
34226
34026
|
}
|
|
34227
34027
|
},
|
|
@@ -34292,13 +34092,9 @@ var typescript = function(superClass) {
|
|
|
34292
34092
|
case "TSNonNullExpression":
|
|
34293
34093
|
case "TSTypeAssertion":
|
|
34294
34094
|
if (isLHS) {
|
|
34295
|
-
this.expressionScope.recordArrowParameterBindingError(TSErrors.UnexpectedTypeCastInParameter,
|
|
34296
|
-
at: node
|
|
34297
|
-
});
|
|
34095
|
+
this.expressionScope.recordArrowParameterBindingError(TSErrors.UnexpectedTypeCastInParameter, node);
|
|
34298
34096
|
} else {
|
|
34299
|
-
this.raise(TSErrors.UnexpectedTypeCastInParameter,
|
|
34300
|
-
at: node
|
|
34301
|
-
});
|
|
34097
|
+
this.raise(TSErrors.UnexpectedTypeCastInParameter, node);
|
|
34302
34098
|
}
|
|
34303
34099
|
this.toAssignable(node.expression, isLHS);
|
|
34304
34100
|
break;
|
|
@@ -34415,9 +34211,7 @@ var typescript = function(superClass) {
|
|
|
34415
34211
|
value: function parseMaybeDefault(startLoc, left) {
|
|
34416
34212
|
var node = _get(_get_prototype_of(TypeScriptParserMixin.prototype), "parseMaybeDefault", this).call(this, startLoc, left);
|
|
34417
34213
|
if (node.type === "AssignmentPattern" && node.typeAnnotation && node.right.start < node.typeAnnotation.start) {
|
|
34418
|
-
this.raise(TSErrors.TypeAnnotationAfterAssign,
|
|
34419
|
-
at: node.typeAnnotation
|
|
34420
|
-
});
|
|
34214
|
+
this.raise(TSErrors.TypeAnnotationAfterAssign, node.typeAnnotation);
|
|
34421
34215
|
}
|
|
34422
34216
|
return node;
|
|
34423
34217
|
}
|
|
@@ -34575,9 +34369,7 @@ var typescript = function(superClass) {
|
|
|
34575
34369
|
} else if (this.isContextual(129)) {
|
|
34576
34370
|
if (!this.hasFollowingLineBreak()) {
|
|
34577
34371
|
node.abstract = true;
|
|
34578
|
-
this.raise(TSErrors.NonClassMethodPropertyHasAbstractModifer,
|
|
34579
|
-
at: node
|
|
34580
|
-
});
|
|
34372
|
+
this.raise(TSErrors.NonClassMethodPropertyHasAbstractModifer, node);
|
|
34581
34373
|
return this.tsParseInterfaceDeclaration(node);
|
|
34582
34374
|
}
|
|
34583
34375
|
} else {
|
|
@@ -34593,8 +34385,7 @@ var typescript = function(superClass) {
|
|
|
34593
34385
|
var hasBody = this.hasPlugin("estree") ? !!method.value.body : !!method.body;
|
|
34594
34386
|
if (hasBody) {
|
|
34595
34387
|
var key = method.key;
|
|
34596
|
-
this.raise(TSErrors.AbstractMethodHasImplementation, {
|
|
34597
|
-
at: method,
|
|
34388
|
+
this.raise(TSErrors.AbstractMethodHasImplementation, method, {
|
|
34598
34389
|
methodName: key.type === "Identifier" && !method.computed ? key.name : "[".concat(this.input.slice(key.start, key.end), "]")
|
|
34599
34390
|
});
|
|
34600
34391
|
}
|
|
@@ -34697,9 +34488,7 @@ var typescript = function(superClass) {
|
|
|
34697
34488
|
}
|
|
34698
34489
|
}
|
|
34699
34490
|
if (hasTypeSpecifier && isInTypeOnlyImportExport) {
|
|
34700
|
-
this.raise(isImport2 ? TSErrors.TypeModifierIsUsedInTypeImports : TSErrors.TypeModifierIsUsedInTypeExports,
|
|
34701
|
-
at: loc
|
|
34702
|
-
});
|
|
34491
|
+
this.raise(isImport2 ? TSErrors.TypeModifierIsUsedInTypeImports : TSErrors.TypeModifierIsUsedInTypeExports, loc);
|
|
34703
34492
|
}
|
|
34704
34493
|
node[leftOfAsKey] = leftOfAs;
|
|
34705
34494
|
node[rightOfAsKey] = rightOfAs;
|
|
@@ -34934,9 +34723,7 @@ var placeholders = function(superClass) {
|
|
|
34934
34723
|
node.body = this.finishPlaceholder(placeholder2, "ClassBody");
|
|
34935
34724
|
return this.finishNode(node, type);
|
|
34936
34725
|
} else {
|
|
34937
|
-
throw this.raise(PlaceholderErrors.ClassNameIsRequired,
|
|
34938
|
-
at: this.state.startLoc
|
|
34939
|
-
});
|
|
34726
|
+
throw this.raise(PlaceholderErrors.ClassNameIsRequired, this.state.startLoc);
|
|
34940
34727
|
}
|
|
34941
34728
|
} else {
|
|
34942
34729
|
this.parseClassId(node, isStatement5, optionalId);
|
|
@@ -35037,9 +34824,7 @@ var placeholders = function(superClass) {
|
|
|
35037
34824
|
key: "assertNoSpace",
|
|
35038
34825
|
value: function assertNoSpace() {
|
|
35039
34826
|
if (this.state.start > this.state.lastTokEndLoc.index) {
|
|
35040
|
-
this.raise(PlaceholderErrors.UnexpectedSpace,
|
|
35041
|
-
at: this.state.lastTokEndLoc
|
|
35042
|
-
});
|
|
34827
|
+
this.raise(PlaceholderErrors.UnexpectedSpace, this.state.lastTokEndLoc);
|
|
35043
34828
|
}
|
|
35044
34829
|
}
|
|
35045
34830
|
}
|
|
@@ -35316,9 +35101,7 @@ var ExpressionParser = /*#__PURE__*/ function(LValParser) {
|
|
|
35316
35101
|
var name = key.type === "Identifier" ? key.name : key.value;
|
|
35317
35102
|
if (name === "__proto__") {
|
|
35318
35103
|
if (isRecord) {
|
|
35319
|
-
this.raise(Errors.RecordNoProto,
|
|
35320
|
-
at: key
|
|
35321
|
-
});
|
|
35104
|
+
this.raise(Errors.RecordNoProto, key);
|
|
35322
35105
|
return;
|
|
35323
35106
|
}
|
|
35324
35107
|
if (protoRef.used) {
|
|
@@ -35327,9 +35110,7 @@ var ExpressionParser = /*#__PURE__*/ function(LValParser) {
|
|
|
35327
35110
|
refExpressionErrors.doubleProtoLoc = key.loc.start;
|
|
35328
35111
|
}
|
|
35329
35112
|
} else {
|
|
35330
|
-
this.raise(Errors.DuplicateProto,
|
|
35331
|
-
at: key
|
|
35332
|
-
});
|
|
35113
|
+
this.raise(Errors.DuplicateProto, key);
|
|
35333
35114
|
}
|
|
35334
35115
|
}
|
|
35335
35116
|
protoRef.used = true;
|
|
@@ -35352,7 +35133,7 @@ var ExpressionParser = /*#__PURE__*/ function(LValParser) {
|
|
|
35352
35133
|
this.unexpected();
|
|
35353
35134
|
}
|
|
35354
35135
|
this.finalizeRemainingComments();
|
|
35355
|
-
expr.comments = this.
|
|
35136
|
+
expr.comments = this.comments;
|
|
35356
35137
|
expr.errors = this.state.errors;
|
|
35357
35138
|
if (this.options.tokens) {
|
|
35358
35139
|
expr.tokens = this.tokens;
|
|
@@ -35529,8 +35310,7 @@ var ExpressionParser = /*#__PURE__*/ function(LValParser) {
|
|
|
35529
35310
|
if (this.isPrivateName(left)) {
|
|
35530
35311
|
var value1 = this.getPrivateNameSV(left);
|
|
35531
35312
|
if (minPrec >= tokenOperatorPrecedence(58) || !this.prodParam.hasIn || !this.match(58)) {
|
|
35532
|
-
this.raise(Errors.PrivateInExpectedIn, {
|
|
35533
|
-
at: left,
|
|
35313
|
+
this.raise(Errors.PrivateInExpectedIn, left, {
|
|
35534
35314
|
identifierName: value1
|
|
35535
35315
|
});
|
|
35536
35316
|
}
|
|
@@ -35563,18 +35343,14 @@ var ExpressionParser = /*#__PURE__*/ function(LValParser) {
|
|
|
35563
35343
|
}
|
|
35564
35344
|
])) {
|
|
35565
35345
|
if (this.state.type === 96 && this.prodParam.hasAwait) {
|
|
35566
|
-
throw this.raise(Errors.UnexpectedAwaitAfterPipelineBody,
|
|
35567
|
-
at: this.state.startLoc
|
|
35568
|
-
});
|
|
35346
|
+
throw this.raise(Errors.UnexpectedAwaitAfterPipelineBody, this.state.startLoc);
|
|
35569
35347
|
}
|
|
35570
35348
|
}
|
|
35571
35349
|
node.right = this.parseExprOpRightExpr(op, prec);
|
|
35572
35350
|
var finishedNode = this.finishNode(node, logical || coalesce ? "LogicalExpression" : "BinaryExpression");
|
|
35573
35351
|
var nextOp = this.state.type;
|
|
35574
35352
|
if (coalesce && (nextOp === 41 || nextOp === 42) || logical && nextOp === 40) {
|
|
35575
|
-
throw this.raise(Errors.MixingCoalesceWithLogical,
|
|
35576
|
-
at: this.state.startLoc
|
|
35577
|
-
});
|
|
35353
|
+
throw this.raise(Errors.MixingCoalesceWithLogical, this.state.startLoc);
|
|
35578
35354
|
}
|
|
35579
35355
|
return this.parseExprOp(finishedNode, leftStartLoc, minPrec);
|
|
35580
35356
|
}
|
|
@@ -35597,9 +35373,7 @@ var ExpressionParser = /*#__PURE__*/ function(LValParser) {
|
|
|
35597
35373
|
case "smart":
|
|
35598
35374
|
return this.withTopicBindingContext(function() {
|
|
35599
35375
|
if (_this.prodParam.hasYield && _this.isContextual(108)) {
|
|
35600
|
-
throw _this.raise(Errors.PipeBodyIsTighter,
|
|
35601
|
-
at: _this.state.startLoc
|
|
35602
|
-
});
|
|
35376
|
+
throw _this.raise(Errors.PipeBodyIsTighter, _this.state.startLoc);
|
|
35603
35377
|
}
|
|
35604
35378
|
return _this.parseSmartPipelineBodyInStyle(_this.parseExprOpBaseRightExpr(op, prec), startLoc);
|
|
35605
35379
|
});
|
|
@@ -35628,15 +35402,12 @@ var ExpressionParser = /*#__PURE__*/ function(LValParser) {
|
|
|
35628
35402
|
var body = this.parseMaybeAssign();
|
|
35629
35403
|
var requiredParentheses = UnparenthesizedPipeBodyDescriptions.has(body.type);
|
|
35630
35404
|
if (requiredParentheses && !((_body_extra = body.extra) === null || _body_extra === void 0 ? void 0 : _body_extra.parenthesized)) {
|
|
35631
|
-
this.raise(Errors.PipeUnparenthesizedBody, {
|
|
35632
|
-
at: startLoc,
|
|
35405
|
+
this.raise(Errors.PipeUnparenthesizedBody, startLoc, {
|
|
35633
35406
|
type: body.type
|
|
35634
35407
|
});
|
|
35635
35408
|
}
|
|
35636
35409
|
if (!this.topicReferenceWasUsedInCurrentContext()) {
|
|
35637
|
-
this.raise(Errors.PipeTopicUnused,
|
|
35638
|
-
at: startLoc
|
|
35639
|
-
});
|
|
35410
|
+
this.raise(Errors.PipeTopicUnused, startLoc);
|
|
35640
35411
|
}
|
|
35641
35412
|
return body;
|
|
35642
35413
|
}
|
|
@@ -35645,9 +35416,7 @@ var ExpressionParser = /*#__PURE__*/ function(LValParser) {
|
|
|
35645
35416
|
key: "checkExponentialAfterUnary",
|
|
35646
35417
|
value: function checkExponentialAfterUnary(node) {
|
|
35647
35418
|
if (this.match(57)) {
|
|
35648
|
-
this.raise(Errors.UnexpectedTokenUnaryExponentiation,
|
|
35649
|
-
at: node.argument
|
|
35650
|
-
});
|
|
35419
|
+
this.raise(Errors.UnexpectedTokenUnaryExponentiation, node.argument);
|
|
35651
35420
|
}
|
|
35652
35421
|
}
|
|
35653
35422
|
},
|
|
@@ -35677,13 +35446,9 @@ var ExpressionParser = /*#__PURE__*/ function(LValParser) {
|
|
|
35677
35446
|
if (this.state.strict && isDelete) {
|
|
35678
35447
|
var arg = node.argument;
|
|
35679
35448
|
if (arg.type === "Identifier") {
|
|
35680
|
-
this.raise(Errors.StrictDelete,
|
|
35681
|
-
at: node
|
|
35682
|
-
});
|
|
35449
|
+
this.raise(Errors.StrictDelete, node);
|
|
35683
35450
|
} else if (this.hasPropertyAsPrivateName(arg)) {
|
|
35684
|
-
this.raise(Errors.DeletePrivateField,
|
|
35685
|
-
at: node
|
|
35686
|
-
});
|
|
35451
|
+
this.raise(Errors.DeletePrivateField, node);
|
|
35687
35452
|
}
|
|
35688
35453
|
}
|
|
35689
35454
|
if (!update) {
|
|
@@ -35698,9 +35463,7 @@ var ExpressionParser = /*#__PURE__*/ function(LValParser) {
|
|
|
35698
35463
|
var type = this.state.type;
|
|
35699
35464
|
var startsExpr2 = this.hasPlugin("v8intrinsic") ? tokenCanStartExpression(type) : tokenCanStartExpression(type) && !this.match(54);
|
|
35700
35465
|
if (startsExpr2 && !this.isAmbiguousAwait()) {
|
|
35701
|
-
this.raiseOverwrite(Errors.AwaitNotInAsyncContext,
|
|
35702
|
-
at: startLoc
|
|
35703
|
-
});
|
|
35466
|
+
this.raiseOverwrite(Errors.AwaitNotInAsyncContext, startLoc);
|
|
35704
35467
|
return this.parseAwait(startLoc);
|
|
35705
35468
|
}
|
|
35706
35469
|
}
|
|
@@ -35772,9 +35535,7 @@ var ExpressionParser = /*#__PURE__*/ function(LValParser) {
|
|
|
35772
35535
|
var optional = false;
|
|
35773
35536
|
if (type === 18) {
|
|
35774
35537
|
if (noCalls) {
|
|
35775
|
-
this.raise(Errors.OptionalChainingNoNew,
|
|
35776
|
-
at: this.state.startLoc
|
|
35777
|
-
});
|
|
35538
|
+
this.raise(Errors.OptionalChainingNoNew, this.state.startLoc);
|
|
35778
35539
|
if (this.lookaheadCharCode() === 40) {
|
|
35779
35540
|
state.stop = true;
|
|
35780
35541
|
return base;
|
|
@@ -35807,9 +35568,7 @@ var ExpressionParser = /*#__PURE__*/ function(LValParser) {
|
|
|
35807
35568
|
this.expect(3);
|
|
35808
35569
|
} else if (this.match(138)) {
|
|
35809
35570
|
if (base.type === "Super") {
|
|
35810
|
-
this.raise(Errors.SuperPrivateField,
|
|
35811
|
-
at: startLoc
|
|
35812
|
-
});
|
|
35571
|
+
this.raise(Errors.SuperPrivateField, startLoc);
|
|
35813
35572
|
}
|
|
35814
35573
|
this.classScope.usePrivateName(this.state.value, this.state.startLoc);
|
|
35815
35574
|
node.property = this.parsePrivateName();
|
|
@@ -35888,9 +35647,7 @@ var ExpressionParser = /*#__PURE__*/ function(LValParser) {
|
|
|
35888
35647
|
node.tag = base;
|
|
35889
35648
|
node.quasi = this.parseTemplate(true);
|
|
35890
35649
|
if (state.optionalChainMember) {
|
|
35891
|
-
this.raise(Errors.OptionalChainingNoTemplate,
|
|
35892
|
-
at: startLoc
|
|
35893
|
-
});
|
|
35650
|
+
this.raise(Errors.OptionalChainingNoTemplate, startLoc);
|
|
35894
35651
|
}
|
|
35895
35652
|
return this.finishNode(node, "TaggedTemplateExpression");
|
|
35896
35653
|
}
|
|
@@ -35919,8 +35676,7 @@ var ExpressionParser = /*#__PURE__*/ function(LValParser) {
|
|
|
35919
35676
|
}
|
|
35920
35677
|
}
|
|
35921
35678
|
if (node.arguments.length === 0 || node.arguments.length > 2) {
|
|
35922
|
-
this.raise(Errors.ImportCallArity, {
|
|
35923
|
-
at: node,
|
|
35679
|
+
this.raise(Errors.ImportCallArity, node, {
|
|
35924
35680
|
maxArgumentCount: this.hasPlugin("importAttributes") || this.hasPlugin("importAssertions") || this.hasPlugin("moduleAttributes") ? 2 : 1
|
|
35925
35681
|
});
|
|
35926
35682
|
} else {
|
|
@@ -35929,9 +35685,7 @@ var ExpressionParser = /*#__PURE__*/ function(LValParser) {
|
|
|
35929
35685
|
for(var _iterator = node.arguments[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
35930
35686
|
var arg = _step.value;
|
|
35931
35687
|
if (arg.type === "SpreadElement") {
|
|
35932
|
-
this.raise(Errors.ImportCallSpreadArgument,
|
|
35933
|
-
at: arg
|
|
35934
|
-
});
|
|
35688
|
+
this.raise(Errors.ImportCallSpreadArgument, arg);
|
|
35935
35689
|
}
|
|
35936
35690
|
}
|
|
35937
35691
|
} catch (err) {
|
|
@@ -35967,9 +35721,7 @@ var ExpressionParser = /*#__PURE__*/ function(LValParser) {
|
|
|
35967
35721
|
this.expect(12);
|
|
35968
35722
|
if (this.match(close)) {
|
|
35969
35723
|
if (dynamicImport && !this.hasPlugin("importAttributes") && !this.hasPlugin("importAssertions") && !this.hasPlugin("moduleAttributes")) {
|
|
35970
|
-
this.raise(Errors.ImportCallArgumentTrailingComma,
|
|
35971
|
-
at: this.state.lastTokStartLoc
|
|
35972
|
-
});
|
|
35724
|
+
this.raise(Errors.ImportCallArgumentTrailingComma, this.state.lastTokStartLoc);
|
|
35973
35725
|
}
|
|
35974
35726
|
if (nodeForExtra) {
|
|
35975
35727
|
this.addTrailingCommaExtraToNode(nodeForExtra);
|
|
@@ -36035,9 +35787,7 @@ var ExpressionParser = /*#__PURE__*/ function(LValParser) {
|
|
|
36035
35787
|
return this.finishNode(node, "Import");
|
|
36036
35788
|
}
|
|
36037
35789
|
} else {
|
|
36038
|
-
this.raise(Errors.UnsupportedImport,
|
|
36039
|
-
at: this.state.lastTokStartLoc
|
|
36040
|
-
});
|
|
35790
|
+
this.raise(Errors.UnsupportedImport, this.state.lastTokStartLoc);
|
|
36041
35791
|
return this.finishNode(node, "Import");
|
|
36042
35792
|
}
|
|
36043
35793
|
case 78:
|
|
@@ -36111,15 +35861,12 @@ var ExpressionParser = /*#__PURE__*/ function(LValParser) {
|
|
|
36111
35861
|
if (callee.type === "MemberExpression") {
|
|
36112
35862
|
return this.finishNode(node, "BindExpression");
|
|
36113
35863
|
} else {
|
|
36114
|
-
throw this.raise(Errors.UnsupportedBind,
|
|
36115
|
-
at: callee
|
|
36116
|
-
});
|
|
35864
|
+
throw this.raise(Errors.UnsupportedBind, callee);
|
|
36117
35865
|
}
|
|
36118
35866
|
}
|
|
36119
35867
|
case 138:
|
|
36120
35868
|
{
|
|
36121
|
-
this.raise(Errors.PrivateInExpectedIn, {
|
|
36122
|
-
at: this.state.startLoc,
|
|
35869
|
+
this.raise(Errors.PrivateInExpectedIn, this.state.startLoc, {
|
|
36123
35870
|
identifierName: this.state.value
|
|
36124
35871
|
});
|
|
36125
35872
|
return this.parsePrivateName();
|
|
@@ -36232,15 +35979,12 @@ var ExpressionParser = /*#__PURE__*/ function(LValParser) {
|
|
|
36232
35979
|
if (this.testTopicReferenceConfiguration(pipeProposal, startLoc, tokenType)) {
|
|
36233
35980
|
var nodeType = pipeProposal === "smart" ? "PipelinePrimaryTopicReference" : "TopicReference";
|
|
36234
35981
|
if (!this.topicReferenceIsAllowedInCurrentContext()) {
|
|
36235
|
-
this.raise(pipeProposal === "smart" ? Errors.PrimaryTopicNotAllowed : Errors.PipeTopicUnbound,
|
|
36236
|
-
at: startLoc
|
|
36237
|
-
});
|
|
35982
|
+
this.raise(pipeProposal === "smart" ? Errors.PrimaryTopicNotAllowed : Errors.PipeTopicUnbound, startLoc);
|
|
36238
35983
|
}
|
|
36239
35984
|
this.registerTopicReference();
|
|
36240
35985
|
return this.finishNode(node, nodeType);
|
|
36241
35986
|
} else {
|
|
36242
|
-
throw this.raise(Errors.PipeTopicUnconfiguredToken, {
|
|
36243
|
-
at: startLoc,
|
|
35987
|
+
throw this.raise(Errors.PipeTopicUnconfiguredToken, startLoc, {
|
|
36244
35988
|
token: tokenLabelName(tokenType)
|
|
36245
35989
|
});
|
|
36246
35990
|
}
|
|
@@ -36262,9 +36006,7 @@ var ExpressionParser = /*#__PURE__*/ function(LValParser) {
|
|
|
36262
36006
|
case "smart":
|
|
36263
36007
|
return tokenType === 27;
|
|
36264
36008
|
default:
|
|
36265
|
-
throw this.raise(Errors.PipeTopicRequiresHackPipes,
|
|
36266
|
-
at: startLoc
|
|
36267
|
-
});
|
|
36009
|
+
throw this.raise(Errors.PipeTopicRequiresHackPipes, startLoc);
|
|
36268
36010
|
}
|
|
36269
36011
|
}
|
|
36270
36012
|
},
|
|
@@ -36277,9 +36019,7 @@ var ExpressionParser = /*#__PURE__*/ function(LValParser) {
|
|
|
36277
36019
|
];
|
|
36278
36020
|
this.prodParam.exit();
|
|
36279
36021
|
if (this.hasPrecedingLineBreak()) {
|
|
36280
|
-
this.raise(Errors.LineTerminatorBeforeArrow,
|
|
36281
|
-
at: this.state.curPosition()
|
|
36282
|
-
});
|
|
36022
|
+
this.raise(Errors.LineTerminatorBeforeArrow, this.state.curPosition());
|
|
36283
36023
|
}
|
|
36284
36024
|
this.expect(19);
|
|
36285
36025
|
return this.parseArrowExpression(node, params, true);
|
|
@@ -36313,18 +36053,12 @@ var ExpressionParser = /*#__PURE__*/ function(LValParser) {
|
|
|
36313
36053
|
var node = this.startNode();
|
|
36314
36054
|
this.next();
|
|
36315
36055
|
if (this.match(10) && !this.scope.allowDirectSuper && !this.options.allowSuperOutsideMethod) {
|
|
36316
|
-
this.raise(Errors.SuperNotAllowed,
|
|
36317
|
-
at: node
|
|
36318
|
-
});
|
|
36056
|
+
this.raise(Errors.SuperNotAllowed, node);
|
|
36319
36057
|
} else if (!this.scope.allowSuper && !this.options.allowSuperOutsideMethod) {
|
|
36320
|
-
this.raise(Errors.UnexpectedSuper,
|
|
36321
|
-
at: node
|
|
36322
|
-
});
|
|
36058
|
+
this.raise(Errors.UnexpectedSuper, node);
|
|
36323
36059
|
}
|
|
36324
36060
|
if (!this.match(10) && !this.match(0) && !this.match(16)) {
|
|
36325
|
-
this.raise(Errors.UnsupportedSuper,
|
|
36326
|
-
at: node
|
|
36327
|
-
});
|
|
36061
|
+
this.raise(Errors.UnsupportedSuper, node);
|
|
36328
36062
|
}
|
|
36329
36063
|
return this.finishNode(node, "Super");
|
|
36330
36064
|
}
|
|
@@ -36365,8 +36099,7 @@ var ExpressionParser = /*#__PURE__*/ function(LValParser) {
|
|
|
36365
36099
|
var containsEsc = this.state.containsEsc;
|
|
36366
36100
|
node.property = this.parseIdentifier(true);
|
|
36367
36101
|
if (node.property.name !== propertyName || containsEsc) {
|
|
36368
|
-
this.raise(Errors.UnsupportedMetaProperty, {
|
|
36369
|
-
at: node.property,
|
|
36102
|
+
this.raise(Errors.UnsupportedMetaProperty, node.property, {
|
|
36370
36103
|
target: meta.name,
|
|
36371
36104
|
onlyValidPropertyName: propertyName
|
|
36372
36105
|
});
|
|
@@ -36381,9 +36114,7 @@ var ExpressionParser = /*#__PURE__*/ function(LValParser) {
|
|
|
36381
36114
|
this.next();
|
|
36382
36115
|
if (this.isContextual(101)) {
|
|
36383
36116
|
if (!this.inModule) {
|
|
36384
|
-
this.raise(Errors.ImportMetaOutsideModule,
|
|
36385
|
-
at: id
|
|
36386
|
-
});
|
|
36117
|
+
this.raise(Errors.ImportMetaOutsideModule, id);
|
|
36387
36118
|
}
|
|
36388
36119
|
this.sawUnambiguousESM = true;
|
|
36389
36120
|
} else if (this.isContextual(105) || this.isContextual(97)) {
|
|
@@ -36391,8 +36122,7 @@ var ExpressionParser = /*#__PURE__*/ function(LValParser) {
|
|
|
36391
36122
|
if (!isSource) this.unexpected();
|
|
36392
36123
|
this.expectPlugin(isSource ? "sourcePhaseImports" : "deferredImportEvaluation");
|
|
36393
36124
|
if (!this.options.createImportExpressions) {
|
|
36394
|
-
throw this.raise(Errors.DynamicImportPhaseRequiresImportExpressions, {
|
|
36395
|
-
at: this.state.startLoc,
|
|
36125
|
+
throw this.raise(Errors.DynamicImportPhaseRequiresImportExpressions, this.state.startLoc, {
|
|
36396
36126
|
phase: this.state.value
|
|
36397
36127
|
});
|
|
36398
36128
|
}
|
|
@@ -36583,9 +36313,7 @@ var ExpressionParser = /*#__PURE__*/ function(LValParser) {
|
|
|
36583
36313
|
this.next();
|
|
36584
36314
|
var metaProp = this.parseMetaProperty(node, meta, "target");
|
|
36585
36315
|
if (!this.scope.inNonArrowFunction && !this.scope.inClass && !this.options.allowNewTargetOutsideFunction) {
|
|
36586
|
-
this.raise(Errors.UnexpectedNewTarget,
|
|
36587
|
-
at: metaProp
|
|
36588
|
-
});
|
|
36316
|
+
this.raise(Errors.UnexpectedNewTarget, metaProp);
|
|
36589
36317
|
}
|
|
36590
36318
|
return metaProp;
|
|
36591
36319
|
}
|
|
@@ -36613,9 +36341,7 @@ var ExpressionParser = /*#__PURE__*/ function(LValParser) {
|
|
|
36613
36341
|
var callee = this.parseNoCallExpr();
|
|
36614
36342
|
node.callee = callee;
|
|
36615
36343
|
if (isImport2 && (callee.type === "Import" || callee.type === "ImportExpression")) {
|
|
36616
|
-
this.raise(Errors.ImportCallNotNewExpression,
|
|
36617
|
-
at: callee
|
|
36618
|
-
});
|
|
36344
|
+
this.raise(Errors.ImportCallNotNewExpression, callee);
|
|
36619
36345
|
}
|
|
36620
36346
|
}
|
|
36621
36347
|
},
|
|
@@ -36627,9 +36353,7 @@ var ExpressionParser = /*#__PURE__*/ function(LValParser) {
|
|
|
36627
36353
|
var elem = this.startNodeAt(createPositionWithColumnOffset(startLoc, 1));
|
|
36628
36354
|
if (value1 === null) {
|
|
36629
36355
|
if (!isTagged) {
|
|
36630
|
-
this.raise(Errors.InvalidEscapeSequenceTemplate,
|
|
36631
|
-
at: createPositionWithColumnOffset(this.state.firstInvalidTemplateEscapePos, 1)
|
|
36632
|
-
});
|
|
36356
|
+
this.raise(Errors.InvalidEscapeSequenceTemplate, createPositionWithColumnOffset(this.state.firstInvalidTemplateEscapePos, 1));
|
|
36633
36357
|
}
|
|
36634
36358
|
}
|
|
36635
36359
|
var isTail = this.match(24);
|
|
@@ -36700,9 +36424,7 @@ var ExpressionParser = /*#__PURE__*/ function(LValParser) {
|
|
|
36700
36424
|
this.checkProto(prop, isRecord, propHash, refExpressionErrors);
|
|
36701
36425
|
}
|
|
36702
36426
|
if (isRecord && !this.isObjectProperty(prop) && prop.type !== "SpreadElement") {
|
|
36703
|
-
this.raise(Errors.InvalidRecordProperty,
|
|
36704
|
-
at: prop
|
|
36705
|
-
});
|
|
36427
|
+
this.raise(Errors.InvalidRecordProperty, prop);
|
|
36706
36428
|
}
|
|
36707
36429
|
if (prop.shorthand) {
|
|
36708
36430
|
this.addExtra(prop, "shorthand", true);
|
|
@@ -36723,7 +36445,7 @@ var ExpressionParser = /*#__PURE__*/ function(LValParser) {
|
|
|
36723
36445
|
{
|
|
36724
36446
|
key: "addTrailingCommaExtraToNode",
|
|
36725
36447
|
value: function addTrailingCommaExtraToNode(node) {
|
|
36726
|
-
this.addExtra(node, "trailingComma", this.state.
|
|
36448
|
+
this.addExtra(node, "trailingComma", this.state.lastTokStartLoc.index);
|
|
36727
36449
|
this.addExtra(node, "trailingCommaLoc", this.state.lastTokStartLoc, false);
|
|
36728
36450
|
}
|
|
36729
36451
|
},
|
|
@@ -36739,9 +36461,7 @@ var ExpressionParser = /*#__PURE__*/ function(LValParser) {
|
|
|
36739
36461
|
var decorators = [];
|
|
36740
36462
|
if (this.match(26)) {
|
|
36741
36463
|
if (this.hasPlugin("decorators")) {
|
|
36742
|
-
this.raise(Errors.UnsupportedPropertyDecorator,
|
|
36743
|
-
at: this.state.startLoc
|
|
36744
|
-
});
|
|
36464
|
+
this.raise(Errors.UnsupportedPropertyDecorator, this.state.startLoc);
|
|
36745
36465
|
}
|
|
36746
36466
|
while(this.match(26)){
|
|
36747
36467
|
decorators.push(this.parseDecorator());
|
|
@@ -36781,8 +36501,7 @@ var ExpressionParser = /*#__PURE__*/ function(LValParser) {
|
|
|
36781
36501
|
prop.kind = keyName;
|
|
36782
36502
|
if (this.match(55)) {
|
|
36783
36503
|
isGenerator = true;
|
|
36784
|
-
this.raise(Errors.AccessorIsGenerator, {
|
|
36785
|
-
at: this.state.curPosition(),
|
|
36504
|
+
this.raise(Errors.AccessorIsGenerator, this.state.curPosition(), {
|
|
36786
36505
|
kind: keyName
|
|
36787
36506
|
});
|
|
36788
36507
|
this.next();
|
|
@@ -36812,14 +36531,10 @@ var ExpressionParser = /*#__PURE__*/ function(LValParser) {
|
|
|
36812
36531
|
var paramCount = this.getGetterSetterExpectedParamCount(method);
|
|
36813
36532
|
var params = this.getObjectOrClassMethodParams(method);
|
|
36814
36533
|
if (params.length !== paramCount) {
|
|
36815
|
-
this.raise(method.kind === "get" ? Errors.BadGetterArity : Errors.BadSetterArity,
|
|
36816
|
-
at: method
|
|
36817
|
-
});
|
|
36534
|
+
this.raise(method.kind === "get" ? Errors.BadGetterArity : Errors.BadSetterArity, method);
|
|
36818
36535
|
}
|
|
36819
36536
|
if (method.kind === "set" && ((_params_ = params[params.length - 1]) === null || _params_ === void 0 ? void 0 : _params_.type) === "RestElement") {
|
|
36820
|
-
this.raise(Errors.BadSetterRestParameter,
|
|
36821
|
-
at: method
|
|
36822
|
-
});
|
|
36537
|
+
this.raise(Errors.BadSetterRestParameter, method);
|
|
36823
36538
|
}
|
|
36824
36539
|
}
|
|
36825
36540
|
},
|
|
@@ -36858,9 +36573,7 @@ var ExpressionParser = /*#__PURE__*/ function(LValParser) {
|
|
|
36858
36573
|
refExpressionErrors.shorthandAssignLoc = shorthandAssignLoc;
|
|
36859
36574
|
}
|
|
36860
36575
|
} else {
|
|
36861
|
-
this.raise(Errors.InvalidCoverInitializedName,
|
|
36862
|
-
at: shorthandAssignLoc
|
|
36863
|
-
});
|
|
36576
|
+
this.raise(Errors.InvalidCoverInitializedName, shorthandAssignLoc);
|
|
36864
36577
|
}
|
|
36865
36578
|
prop.value = this.parseMaybeDefault(startLoc, cloneIdentifier(prop.key));
|
|
36866
36579
|
} else {
|
|
@@ -36913,9 +36626,7 @@ var ExpressionParser = /*#__PURE__*/ function(LValParser) {
|
|
|
36913
36626
|
refExpressionErrors.privateKeyLoc = privateKeyLoc;
|
|
36914
36627
|
}
|
|
36915
36628
|
} else {
|
|
36916
|
-
this.raise(Errors.UnexpectedPrivateField,
|
|
36917
|
-
at: privateKeyLoc
|
|
36918
|
-
});
|
|
36629
|
+
this.raise(Errors.UnexpectedPrivateField, privateKeyLoc);
|
|
36919
36630
|
}
|
|
36920
36631
|
key = this.parsePrivateName();
|
|
36921
36632
|
break;
|
|
@@ -37011,8 +36722,8 @@ var ExpressionParser = /*#__PURE__*/ function(LValParser) {
|
|
|
37011
36722
|
{
|
|
37012
36723
|
key: "parseFunctionBody",
|
|
37013
36724
|
value: function parseFunctionBody(node, allowExpression) {
|
|
37014
|
-
var isMethod3 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
|
|
37015
36725
|
var _this = this;
|
|
36726
|
+
var isMethod3 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
|
|
37016
36727
|
var isExpression3 = allowExpression && !this.match(5);
|
|
37017
36728
|
this.expressionScope.enter(newExpressionScope());
|
|
37018
36729
|
if (isExpression3) {
|
|
@@ -37026,9 +36737,7 @@ var ExpressionParser = /*#__PURE__*/ function(LValParser) {
|
|
|
37026
36737
|
node.body = this.parseBlock(true, false, function(hasStrictModeDirective) {
|
|
37027
36738
|
var nonSimple = !_this.isSimpleParamList(node.params);
|
|
37028
36739
|
if (hasStrictModeDirective && nonSimple) {
|
|
37029
|
-
_this.raise(Errors.IllegalLanguageModeDirective,
|
|
37030
|
-
at: (node.kind === "method" || node.kind === "constructor") && !!node.key ? node.key.loc.end : node
|
|
37031
|
-
});
|
|
36740
|
+
_this.raise(Errors.IllegalLanguageModeDirective, (node.kind === "method" || node.kind === "constructor") && !!node.key ? node.key.loc.end : node);
|
|
37032
36741
|
}
|
|
37033
36742
|
var strictModeChanged = !oldStrict && _this.state.strict;
|
|
37034
36743
|
_this.checkParams(node, !_this.state.strict && !allowExpression && !isMethod3 && !nonSimple, allowExpression, strictModeChanged);
|
|
@@ -37121,8 +36830,7 @@ var ExpressionParser = /*#__PURE__*/ function(LValParser) {
|
|
|
37121
36830
|
var elt;
|
|
37122
36831
|
if (this.match(12)) {
|
|
37123
36832
|
if (!allowEmpty) {
|
|
37124
|
-
this.raise(Errors.UnexpectedToken, {
|
|
37125
|
-
at: this.state.curPosition(),
|
|
36833
|
+
this.raise(Errors.UnexpectedToken, this.state.curPosition(), {
|
|
37126
36834
|
unexpected: ","
|
|
37127
36835
|
});
|
|
37128
36836
|
}
|
|
@@ -37133,9 +36841,7 @@ var ExpressionParser = /*#__PURE__*/ function(LValParser) {
|
|
|
37133
36841
|
} else if (this.match(17)) {
|
|
37134
36842
|
this.expectPlugin("partialApplication");
|
|
37135
36843
|
if (!allowPlaceholder) {
|
|
37136
|
-
this.raise(Errors.UnexpectedArgumentPlaceholder,
|
|
37137
|
-
at: this.state.startLoc
|
|
37138
|
-
});
|
|
36844
|
+
this.raise(Errors.UnexpectedArgumentPlaceholder, this.state.startLoc);
|
|
37139
36845
|
}
|
|
37140
36846
|
var node = this.startNode();
|
|
37141
36847
|
this.next();
|
|
@@ -37194,47 +36900,35 @@ var ExpressionParser = /*#__PURE__*/ function(LValParser) {
|
|
|
37194
36900
|
return;
|
|
37195
36901
|
}
|
|
37196
36902
|
if (checkKeywords && isKeyword2(word)) {
|
|
37197
|
-
this.raise(Errors.UnexpectedKeyword, {
|
|
37198
|
-
at: startLoc,
|
|
36903
|
+
this.raise(Errors.UnexpectedKeyword, startLoc, {
|
|
37199
36904
|
keyword: word
|
|
37200
36905
|
});
|
|
37201
36906
|
return;
|
|
37202
36907
|
}
|
|
37203
36908
|
var reservedTest = !this.state.strict ? isReservedWord2 : isBinding3 ? isStrictBindReservedWord : isStrictReservedWord2;
|
|
37204
36909
|
if (reservedTest(word, this.inModule)) {
|
|
37205
|
-
this.raise(Errors.UnexpectedReservedWord, {
|
|
37206
|
-
at: startLoc,
|
|
36910
|
+
this.raise(Errors.UnexpectedReservedWord, startLoc, {
|
|
37207
36911
|
reservedWord: word
|
|
37208
36912
|
});
|
|
37209
36913
|
return;
|
|
37210
36914
|
} else if (word === "yield") {
|
|
37211
36915
|
if (this.prodParam.hasYield) {
|
|
37212
|
-
this.raise(Errors.YieldBindingIdentifier,
|
|
37213
|
-
at: startLoc
|
|
37214
|
-
});
|
|
36916
|
+
this.raise(Errors.YieldBindingIdentifier, startLoc);
|
|
37215
36917
|
return;
|
|
37216
36918
|
}
|
|
37217
36919
|
} else if (word === "await") {
|
|
37218
36920
|
if (this.prodParam.hasAwait) {
|
|
37219
|
-
this.raise(Errors.AwaitBindingIdentifier,
|
|
37220
|
-
at: startLoc
|
|
37221
|
-
});
|
|
36921
|
+
this.raise(Errors.AwaitBindingIdentifier, startLoc);
|
|
37222
36922
|
return;
|
|
37223
36923
|
}
|
|
37224
36924
|
if (this.scope.inStaticBlock) {
|
|
37225
|
-
this.raise(Errors.AwaitBindingIdentifierInStaticBlock,
|
|
37226
|
-
at: startLoc
|
|
37227
|
-
});
|
|
36925
|
+
this.raise(Errors.AwaitBindingIdentifierInStaticBlock, startLoc);
|
|
37228
36926
|
return;
|
|
37229
36927
|
}
|
|
37230
|
-
this.expressionScope.recordAsyncArrowParametersError(
|
|
37231
|
-
at: startLoc
|
|
37232
|
-
});
|
|
36928
|
+
this.expressionScope.recordAsyncArrowParametersError(startLoc);
|
|
37233
36929
|
} else if (word === "arguments") {
|
|
37234
36930
|
if (this.scope.inClassAndNotInNonArrowFunction) {
|
|
37235
|
-
this.raise(Errors.ArgumentsInClass,
|
|
37236
|
-
at: startLoc
|
|
37237
|
-
});
|
|
36931
|
+
this.raise(Errors.ArgumentsInClass, startLoc);
|
|
37238
36932
|
return;
|
|
37239
36933
|
}
|
|
37240
36934
|
}
|
|
@@ -37254,13 +36948,9 @@ var ExpressionParser = /*#__PURE__*/ function(LValParser) {
|
|
|
37254
36948
|
key: "parseAwait",
|
|
37255
36949
|
value: function parseAwait(startLoc) {
|
|
37256
36950
|
var node = this.startNodeAt(startLoc);
|
|
37257
|
-
this.expressionScope.recordParameterInitializerError(Errors.AwaitExpressionFormalParameter,
|
|
37258
|
-
at: node
|
|
37259
|
-
});
|
|
36951
|
+
this.expressionScope.recordParameterInitializerError(Errors.AwaitExpressionFormalParameter, node);
|
|
37260
36952
|
if (this.eat(55)) {
|
|
37261
|
-
this.raise(Errors.ObsoleteAwaitStar,
|
|
37262
|
-
at: node
|
|
37263
|
-
});
|
|
36953
|
+
this.raise(Errors.ObsoleteAwaitStar, node);
|
|
37264
36954
|
}
|
|
37265
36955
|
if (!this.scope.inFunction && !this.options.allowAwaitOutsideFunction) {
|
|
37266
36956
|
if (this.isAmbiguousAwait()) {
|
|
@@ -37287,9 +36977,7 @@ var ExpressionParser = /*#__PURE__*/ function(LValParser) {
|
|
|
37287
36977
|
key: "parseYield",
|
|
37288
36978
|
value: function parseYield() {
|
|
37289
36979
|
var node = this.startNode();
|
|
37290
|
-
this.expressionScope.recordParameterInitializerError(Errors.YieldInParameter,
|
|
37291
|
-
at: node
|
|
37292
|
-
});
|
|
36980
|
+
this.expressionScope.recordParameterInitializerError(Errors.YieldInParameter, node);
|
|
37293
36981
|
this.next();
|
|
37294
36982
|
var delegating = false;
|
|
37295
36983
|
var argument = null;
|
|
@@ -37343,9 +37031,7 @@ var ExpressionParser = /*#__PURE__*/ function(LValParser) {
|
|
|
37343
37031
|
}
|
|
37344
37032
|
])) {
|
|
37345
37033
|
if (left.type === "SequenceExpression") {
|
|
37346
|
-
this.raise(Errors.PipelineHeadSequenceExpression,
|
|
37347
|
-
at: leftStartLoc
|
|
37348
|
-
});
|
|
37034
|
+
this.raise(Errors.PipelineHeadSequenceExpression, leftStartLoc);
|
|
37349
37035
|
}
|
|
37350
37036
|
}
|
|
37351
37037
|
}
|
|
@@ -37382,14 +37068,10 @@ var ExpressionParser = /*#__PURE__*/ function(LValParser) {
|
|
|
37382
37068
|
key: "checkSmartPipeTopicBodyEarlyErrors",
|
|
37383
37069
|
value: function checkSmartPipeTopicBodyEarlyErrors(startLoc) {
|
|
37384
37070
|
if (this.match(19)) {
|
|
37385
|
-
throw this.raise(Errors.PipelineBodyNoArrow,
|
|
37386
|
-
at: this.state.startLoc
|
|
37387
|
-
});
|
|
37071
|
+
throw this.raise(Errors.PipelineBodyNoArrow, this.state.startLoc);
|
|
37388
37072
|
}
|
|
37389
37073
|
if (!this.topicReferenceWasUsedInCurrentContext()) {
|
|
37390
|
-
this.raise(Errors.PipelineTopicUnused,
|
|
37391
|
-
at: startLoc
|
|
37392
|
-
});
|
|
37074
|
+
this.raise(Errors.PipelineTopicUnused, startLoc);
|
|
37393
37075
|
}
|
|
37394
37076
|
}
|
|
37395
37077
|
},
|
|
@@ -37535,10 +37217,10 @@ var ExpressionParser = /*#__PURE__*/ function(LValParser) {
|
|
|
37535
37217
|
return ExpressionParser;
|
|
37536
37218
|
}(LValParser);
|
|
37537
37219
|
var loopLabel = {
|
|
37538
|
-
kind:
|
|
37220
|
+
kind: 1
|
|
37539
37221
|
};
|
|
37540
37222
|
var switchLabel = {
|
|
37541
|
-
kind:
|
|
37223
|
+
kind: 2
|
|
37542
37224
|
};
|
|
37543
37225
|
var loneSurrogate = RegExp("[\uD800-\uDFFF]", "u");
|
|
37544
37226
|
var keywordRelationalOperator = RegExp("in(?:stanceof)?", "y");
|
|
@@ -37565,7 +37247,7 @@ var StatementParser = /*#__PURE__*/ function(ExpressionParser) {
|
|
|
37565
37247
|
key: "parseTopLevel",
|
|
37566
37248
|
value: function parseTopLevel(file2, program3) {
|
|
37567
37249
|
file2.program = this.parseProgram(program3);
|
|
37568
|
-
file2.comments = this.
|
|
37250
|
+
file2.comments = this.comments;
|
|
37569
37251
|
if (this.options.tokens) {
|
|
37570
37252
|
file2.tokens = babel7CompatTokens(this.tokens, this.input);
|
|
37571
37253
|
}
|
|
@@ -37584,8 +37266,7 @@ var StatementParser = /*#__PURE__*/ function(ExpressionParser) {
|
|
|
37584
37266
|
try {
|
|
37585
37267
|
for(var _iterator = Array.from(this.scope.undefinedExports)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
37586
37268
|
var _step_value = _sliced_to_array(_step.value, 2), localName = _step_value[0], at = _step_value[1];
|
|
37587
|
-
this.raise(Errors.ModuleExportUndefined, {
|
|
37588
|
-
at: at,
|
|
37269
|
+
this.raise(Errors.ModuleExportUndefined, at, {
|
|
37589
37270
|
localName: localName
|
|
37590
37271
|
});
|
|
37591
37272
|
}
|
|
@@ -37784,9 +37465,7 @@ var StatementParser = /*#__PURE__*/ function(ExpressionParser) {
|
|
|
37784
37465
|
case 68:
|
|
37785
37466
|
if (this.lookaheadCharCode() === 46) break;
|
|
37786
37467
|
if (!allowFunctionDeclaration) {
|
|
37787
|
-
this.raise(this.state.strict ? Errors.StrictFunction : this.options.annexB ? Errors.SloppyFunctionAnnexB : Errors.SloppyFunction,
|
|
37788
|
-
at: this.state.startLoc
|
|
37789
|
-
});
|
|
37468
|
+
this.raise(this.state.strict ? Errors.StrictFunction : this.options.annexB ? Errors.SloppyFunctionAnnexB : Errors.SloppyFunction, this.state.startLoc);
|
|
37790
37469
|
}
|
|
37791
37470
|
return this.parseFunctionStatement(node, false, !allowDeclaration && allowFunctionDeclaration);
|
|
37792
37471
|
case 80:
|
|
@@ -37805,13 +37484,9 @@ var StatementParser = /*#__PURE__*/ function(ExpressionParser) {
|
|
|
37805
37484
|
case 96:
|
|
37806
37485
|
if (!this.state.containsEsc && this.startsAwaitUsing()) {
|
|
37807
37486
|
if (!this.isAwaitAllowed()) {
|
|
37808
|
-
this.raise(Errors.AwaitUsingNotInAsyncContext,
|
|
37809
|
-
at: node
|
|
37810
|
-
});
|
|
37487
|
+
this.raise(Errors.AwaitUsingNotInAsyncContext, node);
|
|
37811
37488
|
} else if (!allowDeclaration) {
|
|
37812
|
-
this.raise(Errors.UnexpectedLexicalDeclaration,
|
|
37813
|
-
at: node
|
|
37814
|
-
});
|
|
37489
|
+
this.raise(Errors.UnexpectedLexicalDeclaration, node);
|
|
37815
37490
|
}
|
|
37816
37491
|
this.next();
|
|
37817
37492
|
return this.parseVarStatement(node, "await using");
|
|
@@ -37823,13 +37498,9 @@ var StatementParser = /*#__PURE__*/ function(ExpressionParser) {
|
|
|
37823
37498
|
}
|
|
37824
37499
|
this.expectPlugin("explicitResourceManagement");
|
|
37825
37500
|
if (!this.scope.inModule && this.scope.inTopLevel) {
|
|
37826
|
-
this.raise(Errors.UnexpectedUsingDeclaration,
|
|
37827
|
-
at: this.state.startLoc
|
|
37828
|
-
});
|
|
37501
|
+
this.raise(Errors.UnexpectedUsingDeclaration, this.state.startLoc);
|
|
37829
37502
|
} else if (!allowDeclaration) {
|
|
37830
|
-
this.raise(Errors.UnexpectedLexicalDeclaration,
|
|
37831
|
-
at: this.state.startLoc
|
|
37832
|
-
});
|
|
37503
|
+
this.raise(Errors.UnexpectedLexicalDeclaration, this.state.startLoc);
|
|
37833
37504
|
}
|
|
37834
37505
|
return this.parseVarStatement(node, "using");
|
|
37835
37506
|
case 100:
|
|
@@ -37849,9 +37520,7 @@ var StatementParser = /*#__PURE__*/ function(ExpressionParser) {
|
|
|
37849
37520
|
case 75:
|
|
37850
37521
|
{
|
|
37851
37522
|
if (!allowDeclaration) {
|
|
37852
|
-
this.raise(Errors.UnexpectedLexicalDeclaration,
|
|
37853
|
-
at: this.state.startLoc
|
|
37854
|
-
});
|
|
37523
|
+
this.raise(Errors.UnexpectedLexicalDeclaration, this.state.startLoc);
|
|
37855
37524
|
}
|
|
37856
37525
|
}
|
|
37857
37526
|
case 74:
|
|
@@ -37877,9 +37546,7 @@ var StatementParser = /*#__PURE__*/ function(ExpressionParser) {
|
|
|
37877
37546
|
case 82:
|
|
37878
37547
|
{
|
|
37879
37548
|
if (!this.options.allowImportExportEverywhere && !topLevel) {
|
|
37880
|
-
this.raise(Errors.UnexpectedImportExport,
|
|
37881
|
-
at: this.state.startLoc
|
|
37882
|
-
});
|
|
37549
|
+
this.raise(Errors.UnexpectedImportExport, this.state.startLoc);
|
|
37883
37550
|
}
|
|
37884
37551
|
this.next();
|
|
37885
37552
|
var result;
|
|
@@ -37901,9 +37568,7 @@ var StatementParser = /*#__PURE__*/ function(ExpressionParser) {
|
|
|
37901
37568
|
{
|
|
37902
37569
|
if (this.isAsyncFunction()) {
|
|
37903
37570
|
if (!allowDeclaration) {
|
|
37904
|
-
this.raise(Errors.AsyncFunctionInSingleStatementContext,
|
|
37905
|
-
at: this.state.startLoc
|
|
37906
|
-
});
|
|
37571
|
+
this.raise(Errors.AsyncFunctionInSingleStatementContext, this.state.startLoc);
|
|
37907
37572
|
}
|
|
37908
37573
|
this.next();
|
|
37909
37574
|
return this.parseFunctionStatement(node, true, !allowDeclaration && allowFunctionDeclaration);
|
|
@@ -37923,9 +37588,7 @@ var StatementParser = /*#__PURE__*/ function(ExpressionParser) {
|
|
|
37923
37588
|
key: "assertModuleNodeAllowed",
|
|
37924
37589
|
value: function assertModuleNodeAllowed(node) {
|
|
37925
37590
|
if (!this.options.allowImportExportEverywhere && !this.inModule) {
|
|
37926
|
-
this.raise(Errors.ImportOutsideModule,
|
|
37927
|
-
at: node
|
|
37928
|
-
});
|
|
37591
|
+
this.raise(Errors.ImportOutsideModule, node);
|
|
37929
37592
|
}
|
|
37930
37593
|
}
|
|
37931
37594
|
},
|
|
@@ -37943,9 +37606,7 @@ var StatementParser = /*#__PURE__*/ function(ExpressionParser) {
|
|
|
37943
37606
|
if (classNode.decorators && classNode.decorators.length > 0) {
|
|
37944
37607
|
var _classNode_decorators;
|
|
37945
37608
|
if (typeof this.getPluginOption("decorators", "decoratorsBeforeExport") !== "boolean") {
|
|
37946
|
-
this.raise(Errors.DecoratorsBeforeAfterExport,
|
|
37947
|
-
at: classNode.decorators[0]
|
|
37948
|
-
});
|
|
37609
|
+
this.raise(Errors.DecoratorsBeforeAfterExport, classNode.decorators[0]);
|
|
37949
37610
|
}
|
|
37950
37611
|
(_classNode_decorators = classNode.decorators).unshift.apply(_classNode_decorators, _to_consumable_array(maybeDecorators));
|
|
37951
37612
|
} else {
|
|
@@ -37975,14 +37636,10 @@ var StatementParser = /*#__PURE__*/ function(ExpressionParser) {
|
|
|
37975
37636
|
this.unexpected();
|
|
37976
37637
|
}
|
|
37977
37638
|
if (!this.decoratorsEnabledBeforeExport()) {
|
|
37978
|
-
this.raise(Errors.DecoratorExportClass,
|
|
37979
|
-
at: this.state.startLoc
|
|
37980
|
-
});
|
|
37639
|
+
this.raise(Errors.DecoratorExportClass, this.state.startLoc);
|
|
37981
37640
|
}
|
|
37982
37641
|
} else if (!this.canHaveLeadingDecorator()) {
|
|
37983
|
-
throw this.raise(Errors.UnexpectedLeadingDecorator,
|
|
37984
|
-
at: this.state.startLoc
|
|
37985
|
-
});
|
|
37642
|
+
throw this.raise(Errors.UnexpectedLeadingDecorator, this.state.startLoc);
|
|
37986
37643
|
}
|
|
37987
37644
|
return decorators;
|
|
37988
37645
|
}
|
|
@@ -38008,9 +37665,7 @@ var StatementParser = /*#__PURE__*/ function(ExpressionParser) {
|
|
|
38008
37665
|
var paramsStartLoc = this.state.startLoc;
|
|
38009
37666
|
node.expression = this.parseMaybeDecoratorArguments(expr);
|
|
38010
37667
|
if (this.getPluginOption("decorators", "allowCallParenthesized") === false && node.expression !== expr) {
|
|
38011
|
-
this.raise(Errors.DecoratorArgumentsOutsideParentheses,
|
|
38012
|
-
at: paramsStartLoc
|
|
38013
|
-
});
|
|
37668
|
+
this.raise(Errors.DecoratorArgumentsOutsideParentheses, paramsStartLoc);
|
|
38014
37669
|
}
|
|
38015
37670
|
} else {
|
|
38016
37671
|
expr = this.parseIdentifier(false);
|
|
@@ -38068,14 +37723,15 @@ var StatementParser = /*#__PURE__*/ function(ExpressionParser) {
|
|
|
38068
37723
|
for(i = 0; i < this.state.labels.length; ++i){
|
|
38069
37724
|
var lab = this.state.labels[i];
|
|
38070
37725
|
if (node.label == null || lab.name === node.label.name) {
|
|
38071
|
-
if (lab.kind != null && (isBreak || lab.kind ===
|
|
37726
|
+
if (lab.kind != null && (isBreak || lab.kind === 1)) {
|
|
37727
|
+
break;
|
|
37728
|
+
}
|
|
38072
37729
|
if (node.label && isBreak) break;
|
|
38073
37730
|
}
|
|
38074
37731
|
}
|
|
38075
37732
|
if (i === this.state.labels.length) {
|
|
38076
37733
|
var type = isBreak ? "BreakStatement" : "ContinueStatement";
|
|
38077
|
-
this.raise(Errors.IllegalBreakContinue, {
|
|
38078
|
-
at: node,
|
|
37734
|
+
this.raise(Errors.IllegalBreakContinue, node, {
|
|
38079
37735
|
type: type
|
|
38080
37736
|
});
|
|
38081
37737
|
}
|
|
@@ -38142,9 +37798,7 @@ var StatementParser = /*#__PURE__*/ function(ExpressionParser) {
|
|
|
38142
37798
|
if (startsWithAwaitUsing) {
|
|
38143
37799
|
kind = "await using";
|
|
38144
37800
|
if (!this.isAwaitAllowed()) {
|
|
38145
|
-
this.raise(Errors.AwaitUsingNotInAsyncContext,
|
|
38146
|
-
at: this.state.startLoc
|
|
38147
|
-
});
|
|
37801
|
+
this.raise(Errors.AwaitUsingNotInAsyncContext, this.state.startLoc);
|
|
38148
37802
|
}
|
|
38149
37803
|
this.next();
|
|
38150
37804
|
} else {
|
|
@@ -38155,9 +37809,7 @@ var StatementParser = /*#__PURE__*/ function(ExpressionParser) {
|
|
|
38155
37809
|
var init2 = this.finishNode(initNode, "VariableDeclaration");
|
|
38156
37810
|
var isForIn = this.match(58);
|
|
38157
37811
|
if (isForIn && starsWithUsingDeclaration) {
|
|
38158
|
-
this.raise(Errors.ForInUsing,
|
|
38159
|
-
at: init2
|
|
38160
|
-
});
|
|
37812
|
+
this.raise(Errors.ForInUsing, init2);
|
|
38161
37813
|
}
|
|
38162
37814
|
if ((isForIn || this.isContextual(102)) && init2.declarations.length === 1) {
|
|
38163
37815
|
return this.parseForIn(node, init2, awaitAt);
|
|
@@ -38174,14 +37826,10 @@ var StatementParser = /*#__PURE__*/ function(ExpressionParser) {
|
|
|
38174
37826
|
var isForOf = this.isContextual(102);
|
|
38175
37827
|
if (isForOf) {
|
|
38176
37828
|
if (startsWithLet) {
|
|
38177
|
-
this.raise(Errors.ForOfLet,
|
|
38178
|
-
at: init
|
|
38179
|
-
});
|
|
37829
|
+
this.raise(Errors.ForOfLet, init);
|
|
38180
37830
|
}
|
|
38181
37831
|
if (awaitAt === null && startsWithAsync && init.type === "Identifier") {
|
|
38182
|
-
this.raise(Errors.ForOfAsync,
|
|
38183
|
-
at: init
|
|
38184
|
-
});
|
|
37832
|
+
this.raise(Errors.ForOfAsync, init);
|
|
38185
37833
|
}
|
|
38186
37834
|
}
|
|
38187
37835
|
if (isForOf || this.match(58)) {
|
|
@@ -38224,9 +37872,7 @@ var StatementParser = /*#__PURE__*/ function(ExpressionParser) {
|
|
|
38224
37872
|
key: "parseReturnStatement",
|
|
38225
37873
|
value: function parseReturnStatement(node) {
|
|
38226
37874
|
if (!this.prodParam.hasReturn && !this.options.allowReturnOutsideFunction) {
|
|
38227
|
-
this.raise(Errors.IllegalReturn,
|
|
38228
|
-
at: this.state.startLoc
|
|
38229
|
-
});
|
|
37875
|
+
this.raise(Errors.IllegalReturn, this.state.startLoc);
|
|
38230
37876
|
}
|
|
38231
37877
|
this.next();
|
|
38232
37878
|
if (this.isLineTerminator()) {
|
|
@@ -38259,9 +37905,7 @@ var StatementParser = /*#__PURE__*/ function(ExpressionParser) {
|
|
|
38259
37905
|
cur.test = this.parseExpression();
|
|
38260
37906
|
} else {
|
|
38261
37907
|
if (sawDefault) {
|
|
38262
|
-
this.raise(Errors.MultipleDefaultsInSwitch,
|
|
38263
|
-
at: this.state.lastTokStartLoc
|
|
38264
|
-
});
|
|
37908
|
+
this.raise(Errors.MultipleDefaultsInSwitch, this.state.lastTokStartLoc);
|
|
38265
37909
|
}
|
|
38266
37910
|
sawDefault = true;
|
|
38267
37911
|
cur.test = null;
|
|
@@ -38287,9 +37931,7 @@ var StatementParser = /*#__PURE__*/ function(ExpressionParser) {
|
|
|
38287
37931
|
value: function parseThrowStatement(node) {
|
|
38288
37932
|
this.next();
|
|
38289
37933
|
if (this.hasPrecedingLineBreak()) {
|
|
38290
|
-
this.raise(Errors.NewlineAfterThrow,
|
|
38291
|
-
at: this.state.lastTokEndLoc
|
|
38292
|
-
});
|
|
37934
|
+
this.raise(Errors.NewlineAfterThrow, this.state.lastTokEndLoc);
|
|
38293
37935
|
}
|
|
38294
37936
|
node.argument = this.parseExpression();
|
|
38295
37937
|
this.semicolon();
|
|
@@ -38336,9 +37978,7 @@ var StatementParser = /*#__PURE__*/ function(ExpressionParser) {
|
|
|
38336
37978
|
}
|
|
38337
37979
|
node.finalizer = this.eat(67) ? this.parseBlock() : null;
|
|
38338
37980
|
if (!node.handler && !node.finalizer) {
|
|
38339
|
-
this.raise(Errors.NoCatchOrFinally,
|
|
38340
|
-
at: node
|
|
38341
|
-
});
|
|
37981
|
+
this.raise(Errors.NoCatchOrFinally, node);
|
|
38342
37982
|
}
|
|
38343
37983
|
return this.finishNode(node, "TryStatement");
|
|
38344
37984
|
}
|
|
@@ -38372,9 +38012,7 @@ var StatementParser = /*#__PURE__*/ function(ExpressionParser) {
|
|
|
38372
38012
|
value: function parseWithStatement(node) {
|
|
38373
38013
|
var _this = this;
|
|
38374
38014
|
if (this.state.strict) {
|
|
38375
|
-
this.raise(Errors.StrictWith,
|
|
38376
|
-
at: this.state.startLoc
|
|
38377
|
-
});
|
|
38015
|
+
this.raise(Errors.StrictWith, this.state.startLoc);
|
|
38378
38016
|
}
|
|
38379
38017
|
this.next();
|
|
38380
38018
|
node.object = this.parseHeaderExpression();
|
|
@@ -38399,8 +38037,7 @@ var StatementParser = /*#__PURE__*/ function(ExpressionParser) {
|
|
|
38399
38037
|
for(var _iterator = this.state.labels[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
38400
38038
|
var label = _step.value;
|
|
38401
38039
|
if (label.name === maybeName) {
|
|
38402
|
-
this.raise(Errors.LabelRedeclaration, {
|
|
38403
|
-
at: expr,
|
|
38040
|
+
this.raise(Errors.LabelRedeclaration, expr, {
|
|
38404
38041
|
labelName: maybeName
|
|
38405
38042
|
});
|
|
38406
38043
|
}
|
|
@@ -38419,7 +38056,7 @@ var StatementParser = /*#__PURE__*/ function(ExpressionParser) {
|
|
|
38419
38056
|
}
|
|
38420
38057
|
}
|
|
38421
38058
|
}
|
|
38422
|
-
var kind = tokenIsLoop(this.state.type) ?
|
|
38059
|
+
var kind = tokenIsLoop(this.state.type) ? 1 : this.match(71) ? 2 : null;
|
|
38423
38060
|
for(var i = this.state.labels.length - 1; i >= 0; i--){
|
|
38424
38061
|
var label1 = this.state.labels[i];
|
|
38425
38062
|
if (label1.statementStart === node.start) {
|
|
@@ -38541,14 +38178,12 @@ var StatementParser = /*#__PURE__*/ function(ExpressionParser) {
|
|
|
38541
38178
|
node.await = awaitAt !== null;
|
|
38542
38179
|
}
|
|
38543
38180
|
if (init.type === "VariableDeclaration" && init.declarations[0].init != null && (!isForIn || !this.options.annexB || this.state.strict || init.kind !== "var" || init.declarations[0].id.type !== "Identifier")) {
|
|
38544
|
-
this.raise(Errors.ForInOfLoopInitializer, {
|
|
38545
|
-
at: init,
|
|
38181
|
+
this.raise(Errors.ForInOfLoopInitializer, init, {
|
|
38546
38182
|
type: isForIn ? "ForInStatement" : "ForOfStatement"
|
|
38547
38183
|
});
|
|
38548
38184
|
}
|
|
38549
38185
|
if (init.type === "AssignmentPattern") {
|
|
38550
|
-
this.raise(Errors.InvalidLhs, {
|
|
38551
|
-
at: init,
|
|
38186
|
+
this.raise(Errors.InvalidLhs, init, {
|
|
38552
38187
|
ancestor: {
|
|
38553
38188
|
type: "ForStatement"
|
|
38554
38189
|
}
|
|
@@ -38577,13 +38212,11 @@ var StatementParser = /*#__PURE__*/ function(ExpressionParser) {
|
|
|
38577
38212
|
decl.init = !this.eat(29) ? null : isFor3 ? this.parseMaybeAssignDisallowIn() : this.parseMaybeAssignAllowIn();
|
|
38578
38213
|
if (decl.init === null && !allowMissingInitializer) {
|
|
38579
38214
|
if (decl.id.type !== "Identifier" && !(isFor3 && (this.match(58) || this.isContextual(102)))) {
|
|
38580
|
-
this.raise(Errors.DeclarationMissingInitializer, {
|
|
38581
|
-
at: this.state.lastTokEndLoc,
|
|
38215
|
+
this.raise(Errors.DeclarationMissingInitializer, this.state.lastTokEndLoc, {
|
|
38582
38216
|
kind: "destructuring"
|
|
38583
38217
|
});
|
|
38584
38218
|
} else if (kind === "const" && !(this.match(58) || this.isContextual(102))) {
|
|
38585
|
-
this.raise(Errors.DeclarationMissingInitializer, {
|
|
38586
|
-
at: this.state.lastTokEndLoc,
|
|
38219
|
+
this.raise(Errors.DeclarationMissingInitializer, this.state.lastTokEndLoc, {
|
|
38587
38220
|
kind: "const"
|
|
38588
38221
|
});
|
|
38589
38222
|
}
|
|
@@ -38616,8 +38249,8 @@ var StatementParser = /*#__PURE__*/ function(ExpressionParser) {
|
|
|
38616
38249
|
{
|
|
38617
38250
|
key: "parseFunction",
|
|
38618
38251
|
value: function parseFunction(node) {
|
|
38619
|
-
var flags = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
|
|
38620
38252
|
var _this = this;
|
|
38253
|
+
var flags = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
|
|
38621
38254
|
var hangingDeclaration = flags & 2;
|
|
38622
38255
|
var isDeclaration3 = !!(flags & 1);
|
|
38623
38256
|
var requireId = isDeclaration3 && !(flags & 4);
|
|
@@ -38625,9 +38258,7 @@ var StatementParser = /*#__PURE__*/ function(ExpressionParser) {
|
|
|
38625
38258
|
this.initFunction(node, isAsync);
|
|
38626
38259
|
if (this.match(55)) {
|
|
38627
38260
|
if (hangingDeclaration) {
|
|
38628
|
-
this.raise(Errors.GeneratorInSingleStatementContext,
|
|
38629
|
-
at: this.state.startLoc
|
|
38630
|
-
});
|
|
38261
|
+
this.raise(Errors.GeneratorInSingleStatementContext, this.state.startLoc);
|
|
38631
38262
|
}
|
|
38632
38263
|
this.next();
|
|
38633
38264
|
node.generator = true;
|
|
@@ -38724,9 +38355,7 @@ var StatementParser = /*#__PURE__*/ function(ExpressionParser) {
|
|
|
38724
38355
|
while(!_this.match(8)){
|
|
38725
38356
|
if (_this.eat(13)) {
|
|
38726
38357
|
if (decorators.length > 0) {
|
|
38727
|
-
throw _this.raise(Errors.DecoratorSemicolon,
|
|
38728
|
-
at: _this.state.lastTokEndLoc
|
|
38729
|
-
});
|
|
38358
|
+
throw _this.raise(Errors.DecoratorSemicolon, _this.state.lastTokEndLoc);
|
|
38730
38359
|
}
|
|
38731
38360
|
continue;
|
|
38732
38361
|
}
|
|
@@ -38742,18 +38371,14 @@ var StatementParser = /*#__PURE__*/ function(ExpressionParser) {
|
|
|
38742
38371
|
}
|
|
38743
38372
|
_this.parseClassMember(classBody2, member, state);
|
|
38744
38373
|
if (member.kind === "constructor" && member.decorators && member.decorators.length > 0) {
|
|
38745
|
-
_this.raise(Errors.DecoratorConstructor,
|
|
38746
|
-
at: member
|
|
38747
|
-
});
|
|
38374
|
+
_this.raise(Errors.DecoratorConstructor, member);
|
|
38748
38375
|
}
|
|
38749
38376
|
}
|
|
38750
38377
|
});
|
|
38751
38378
|
this.state.strict = oldStrict;
|
|
38752
38379
|
this.next();
|
|
38753
38380
|
if (decorators.length) {
|
|
38754
|
-
throw this.raise(Errors.TrailingDecorator,
|
|
38755
|
-
at: this.state.startLoc
|
|
38756
|
-
});
|
|
38381
|
+
throw this.raise(Errors.TrailingDecorator, this.state.startLoc);
|
|
38757
38382
|
}
|
|
38758
38383
|
this.classScope.exit();
|
|
38759
38384
|
return this.finishNode(classBody2, "ClassBody");
|
|
@@ -38820,9 +38445,7 @@ var StatementParser = /*#__PURE__*/ function(ExpressionParser) {
|
|
|
38820
38445
|
return;
|
|
38821
38446
|
}
|
|
38822
38447
|
if (this.isNonstaticConstructor(publicMethod)) {
|
|
38823
|
-
this.raise(Errors.ConstructorIsGenerator,
|
|
38824
|
-
at: publicMethod.key
|
|
38825
|
-
});
|
|
38448
|
+
this.raise(Errors.ConstructorIsGenerator, publicMethod.key);
|
|
38826
38449
|
}
|
|
38827
38450
|
this.pushClassMethod(classBody2, publicMethod, true, false, false, false);
|
|
38828
38451
|
return;
|
|
@@ -38843,14 +38466,10 @@ var StatementParser = /*#__PURE__*/ function(ExpressionParser) {
|
|
|
38843
38466
|
if (isConstructor) {
|
|
38844
38467
|
publicMethod.kind = "constructor";
|
|
38845
38468
|
if (state.hadConstructor && !this.hasPlugin("typescript")) {
|
|
38846
|
-
this.raise(Errors.DuplicateConstructor,
|
|
38847
|
-
at: key
|
|
38848
|
-
});
|
|
38469
|
+
this.raise(Errors.DuplicateConstructor, key);
|
|
38849
38470
|
}
|
|
38850
38471
|
if (isConstructor && this.hasPlugin("typescript") && member.override) {
|
|
38851
|
-
this.raise(Errors.OverrideOnConstructor,
|
|
38852
|
-
at: key
|
|
38853
|
-
});
|
|
38472
|
+
this.raise(Errors.OverrideOnConstructor, key);
|
|
38854
38473
|
}
|
|
38855
38474
|
state.hadConstructor = true;
|
|
38856
38475
|
allowsDirectSuper = state.hadSuperClass;
|
|
@@ -38876,9 +38495,7 @@ var StatementParser = /*#__PURE__*/ function(ExpressionParser) {
|
|
|
38876
38495
|
this.pushClassPrivateMethod(classBody2, privateMethod, isGenerator, true);
|
|
38877
38496
|
} else {
|
|
38878
38497
|
if (this.isNonstaticConstructor(publicMethod)) {
|
|
38879
|
-
this.raise(Errors.ConstructorIsAsync,
|
|
38880
|
-
at: publicMethod.key
|
|
38881
|
-
});
|
|
38498
|
+
this.raise(Errors.ConstructorIsAsync, publicMethod.key);
|
|
38882
38499
|
}
|
|
38883
38500
|
this.pushClassMethod(classBody2, publicMethod, isGenerator, true, false, false);
|
|
38884
38501
|
}
|
|
@@ -38891,9 +38508,7 @@ var StatementParser = /*#__PURE__*/ function(ExpressionParser) {
|
|
|
38891
38508
|
this.pushClassPrivateMethod(classBody2, privateMethod, false, false);
|
|
38892
38509
|
} else {
|
|
38893
38510
|
if (this.isNonstaticConstructor(publicMethod)) {
|
|
38894
|
-
this.raise(Errors.ConstructorIsAccessor,
|
|
38895
|
-
at: publicMethod.key
|
|
38896
|
-
});
|
|
38511
|
+
this.raise(Errors.ConstructorIsAccessor, publicMethod.key);
|
|
38897
38512
|
}
|
|
38898
38513
|
this.pushClassMethod(classBody2, publicMethod, false, false, false, false);
|
|
38899
38514
|
}
|
|
@@ -38920,15 +38535,11 @@ var StatementParser = /*#__PURE__*/ function(ExpressionParser) {
|
|
|
38920
38535
|
value: function parseClassElementName(member) {
|
|
38921
38536
|
var _this_state = this.state, type = _this_state.type, value1 = _this_state.value;
|
|
38922
38537
|
if ((type === 132 || type === 133) && member.static && value1 === "prototype") {
|
|
38923
|
-
this.raise(Errors.StaticPrototype,
|
|
38924
|
-
at: this.state.startLoc
|
|
38925
|
-
});
|
|
38538
|
+
this.raise(Errors.StaticPrototype, this.state.startLoc);
|
|
38926
38539
|
}
|
|
38927
38540
|
if (type === 138) {
|
|
38928
38541
|
if (value1 === "constructor") {
|
|
38929
|
-
this.raise(Errors.ConstructorClassPrivateField,
|
|
38930
|
-
at: this.state.startLoc
|
|
38931
|
-
});
|
|
38542
|
+
this.raise(Errors.ConstructorClassPrivateField, this.state.startLoc);
|
|
38932
38543
|
}
|
|
38933
38544
|
var key = this.parsePrivateName();
|
|
38934
38545
|
member.key = key;
|
|
@@ -38952,9 +38563,7 @@ var StatementParser = /*#__PURE__*/ function(ExpressionParser) {
|
|
|
38952
38563
|
this.state.labels = oldLabels;
|
|
38953
38564
|
classBody2.body.push(this.finishNode(member, "StaticBlock"));
|
|
38954
38565
|
if ((_member_decorators = member.decorators) === null || _member_decorators === void 0 ? void 0 : _member_decorators.length) {
|
|
38955
|
-
this.raise(Errors.DecoratorStaticBlock,
|
|
38956
|
-
at: member
|
|
38957
|
-
});
|
|
38566
|
+
this.raise(Errors.DecoratorStaticBlock, member);
|
|
38958
38567
|
}
|
|
38959
38568
|
}
|
|
38960
38569
|
},
|
|
@@ -38962,9 +38571,7 @@ var StatementParser = /*#__PURE__*/ function(ExpressionParser) {
|
|
|
38962
38571
|
key: "pushClassProperty",
|
|
38963
38572
|
value: function pushClassProperty(classBody2, prop) {
|
|
38964
38573
|
if (!prop.computed && (prop.key.name === "constructor" || prop.key.value === "constructor")) {
|
|
38965
|
-
this.raise(Errors.ConstructorClassField,
|
|
38966
|
-
at: prop.key
|
|
38967
|
-
});
|
|
38574
|
+
this.raise(Errors.ConstructorClassField, prop.key);
|
|
38968
38575
|
}
|
|
38969
38576
|
classBody2.body.push(this.parseClassProperty(prop));
|
|
38970
38577
|
}
|
|
@@ -38983,9 +38590,7 @@ var StatementParser = /*#__PURE__*/ function(ExpressionParser) {
|
|
|
38983
38590
|
if (!isPrivate2 && !prop.computed) {
|
|
38984
38591
|
var key = prop.key;
|
|
38985
38592
|
if (key.name === "constructor" || key.value === "constructor") {
|
|
38986
|
-
this.raise(Errors.ConstructorClassField,
|
|
38987
|
-
at: key
|
|
38988
|
-
});
|
|
38593
|
+
this.raise(Errors.ConstructorClassField, key);
|
|
38989
38594
|
}
|
|
38990
38595
|
}
|
|
38991
38596
|
var node = this.parseClassAccessorProperty(prop);
|
|
@@ -39069,9 +38674,7 @@ var StatementParser = /*#__PURE__*/ function(ExpressionParser) {
|
|
|
39069
38674
|
if (optionalId || !isStatement5) {
|
|
39070
38675
|
node.id = null;
|
|
39071
38676
|
} else {
|
|
39072
|
-
throw this.raise(Errors.MissingClassName,
|
|
39073
|
-
at: this.state.startLoc
|
|
39074
|
-
});
|
|
38677
|
+
throw this.raise(Errors.MissingClassName, this.state.startLoc);
|
|
39075
38678
|
}
|
|
39076
38679
|
}
|
|
39077
38680
|
}
|
|
@@ -39095,9 +38698,7 @@ var StatementParser = /*#__PURE__*/ function(ExpressionParser) {
|
|
|
39095
38698
|
if (hasStar && !hasNamespace) {
|
|
39096
38699
|
if (hasDefault) this.unexpected();
|
|
39097
38700
|
if (decorators) {
|
|
39098
|
-
throw this.raise(Errors.UnsupportedDecoratorExport,
|
|
39099
|
-
at: node
|
|
39100
|
-
});
|
|
38701
|
+
throw this.raise(Errors.UnsupportedDecoratorExport, node);
|
|
39101
38702
|
}
|
|
39102
38703
|
this.parseExportFrom(node, true);
|
|
39103
38704
|
return this.finishNode(node, "ExportAllDeclaration");
|
|
@@ -39113,9 +38714,7 @@ var StatementParser = /*#__PURE__*/ function(ExpressionParser) {
|
|
|
39113
38714
|
if (isFromRequired || hasSpecifiers) {
|
|
39114
38715
|
hasDeclaration = false;
|
|
39115
38716
|
if (decorators) {
|
|
39116
|
-
throw this.raise(Errors.UnsupportedDecoratorExport,
|
|
39117
|
-
at: node
|
|
39118
|
-
});
|
|
38717
|
+
throw this.raise(Errors.UnsupportedDecoratorExport, node);
|
|
39119
38718
|
}
|
|
39120
38719
|
this.parseExportFrom(node, isFromRequired);
|
|
39121
38720
|
} else {
|
|
@@ -39128,9 +38727,7 @@ var StatementParser = /*#__PURE__*/ function(ExpressionParser) {
|
|
|
39128
38727
|
if (((_node2_declaration = node2.declaration) === null || _node2_declaration === void 0 ? void 0 : _node2_declaration.type) === "ClassDeclaration") {
|
|
39129
38728
|
this.maybeTakeDecorators(decorators, node2.declaration, node2);
|
|
39130
38729
|
} else if (decorators) {
|
|
39131
|
-
throw this.raise(Errors.UnsupportedDecoratorExport,
|
|
39132
|
-
at: node
|
|
39133
|
-
});
|
|
38730
|
+
throw this.raise(Errors.UnsupportedDecoratorExport, node);
|
|
39134
38731
|
}
|
|
39135
38732
|
return this.finishNode(node2, "ExportNamedDeclaration");
|
|
39136
38733
|
}
|
|
@@ -39141,9 +38738,7 @@ var StatementParser = /*#__PURE__*/ function(ExpressionParser) {
|
|
|
39141
38738
|
if (decl.type === "ClassDeclaration") {
|
|
39142
38739
|
this.maybeTakeDecorators(decorators, decl, node21);
|
|
39143
38740
|
} else if (decorators) {
|
|
39144
|
-
throw this.raise(Errors.UnsupportedDecoratorExport,
|
|
39145
|
-
at: node
|
|
39146
|
-
});
|
|
38741
|
+
throw this.raise(Errors.UnsupportedDecoratorExport, node);
|
|
39147
38742
|
}
|
|
39148
38743
|
this.checkExport(node21, true, true);
|
|
39149
38744
|
return this.finishNode(node21, "ExportDefaultDeclaration");
|
|
@@ -39245,16 +38840,12 @@ var StatementParser = /*#__PURE__*/ function(ExpressionParser) {
|
|
|
39245
38840
|
}
|
|
39246
38841
|
if (this.match(26)) {
|
|
39247
38842
|
if (this.hasPlugin("decorators") && this.getPluginOption("decorators", "decoratorsBeforeExport") === true) {
|
|
39248
|
-
this.raise(Errors.DecoratorBeforeExport,
|
|
39249
|
-
at: this.state.startLoc
|
|
39250
|
-
});
|
|
38843
|
+
this.raise(Errors.DecoratorBeforeExport, this.state.startLoc);
|
|
39251
38844
|
}
|
|
39252
38845
|
return this.parseClass(this.maybeTakeDecorators(this.parseDecorators(false), this.startNode()), true, true);
|
|
39253
38846
|
}
|
|
39254
38847
|
if (this.match(75) || this.match(74) || this.isLet()) {
|
|
39255
|
-
throw this.raise(Errors.UnsupportedDefaultExport,
|
|
39256
|
-
at: this.state.startLoc
|
|
39257
|
-
});
|
|
38848
|
+
throw this.raise(Errors.UnsupportedDefaultExport, this.state.startLoc);
|
|
39258
38849
|
}
|
|
39259
38850
|
var res = this.parseMaybeAssignAllowIn();
|
|
39260
38851
|
this.semicolon();
|
|
@@ -39329,9 +38920,7 @@ var StatementParser = /*#__PURE__*/ function(ExpressionParser) {
|
|
|
39329
38920
|
]);
|
|
39330
38921
|
if (this.hasPlugin("decorators")) {
|
|
39331
38922
|
if (this.getPluginOption("decorators", "decoratorsBeforeExport") === true) {
|
|
39332
|
-
this.raise(Errors.DecoratorBeforeExport,
|
|
39333
|
-
at: this.state.startLoc
|
|
39334
|
-
});
|
|
38923
|
+
this.raise(Errors.DecoratorBeforeExport, this.state.startLoc);
|
|
39335
38924
|
}
|
|
39336
38925
|
return true;
|
|
39337
38926
|
}
|
|
@@ -39350,9 +38939,7 @@ var StatementParser = /*#__PURE__*/ function(ExpressionParser) {
|
|
|
39350
38939
|
var _declaration_extra;
|
|
39351
38940
|
var declaration = node.declaration;
|
|
39352
38941
|
if (declaration.type === "Identifier" && declaration.name === "from" && declaration.end - declaration.start === 4 && !((_declaration_extra = declaration.extra) === null || _declaration_extra === void 0 ? void 0 : _declaration_extra.parenthesized)) {
|
|
39353
|
-
this.raise(Errors.ExportDefaultFromAsIdentifier,
|
|
39354
|
-
at: declaration
|
|
39355
|
-
});
|
|
38942
|
+
this.raise(Errors.ExportDefaultFromAsIdentifier, declaration);
|
|
39356
38943
|
}
|
|
39357
38944
|
}
|
|
39358
38945
|
} else if ((_node_specifiers = node.specifiers) === null || _node_specifiers === void 0 ? void 0 : _node_specifiers.length) {
|
|
@@ -39366,8 +38953,7 @@ var StatementParser = /*#__PURE__*/ function(ExpressionParser) {
|
|
|
39366
38953
|
if (!isFrom && specifier.local) {
|
|
39367
38954
|
var local = specifier.local;
|
|
39368
38955
|
if (local.type !== "Identifier") {
|
|
39369
|
-
this.raise(Errors.ExportBindingIsString, {
|
|
39370
|
-
at: specifier,
|
|
38956
|
+
this.raise(Errors.ExportBindingIsString, specifier, {
|
|
39371
38957
|
localName: local.value,
|
|
39372
38958
|
exportName: exportName
|
|
39373
38959
|
});
|
|
@@ -39485,12 +39071,9 @@ var StatementParser = /*#__PURE__*/ function(ExpressionParser) {
|
|
|
39485
39071
|
value: function checkDuplicateExports(node, exportName) {
|
|
39486
39072
|
if (this.exportedIdentifiers.has(exportName)) {
|
|
39487
39073
|
if (exportName === "default") {
|
|
39488
|
-
this.raise(Errors.DuplicateDefaultExport,
|
|
39489
|
-
at: node
|
|
39490
|
-
});
|
|
39074
|
+
this.raise(Errors.DuplicateDefaultExport, node);
|
|
39491
39075
|
} else {
|
|
39492
|
-
this.raise(Errors.DuplicateExport, {
|
|
39493
|
-
at: node,
|
|
39076
|
+
this.raise(Errors.DuplicateExport, node, {
|
|
39494
39077
|
exportName: exportName
|
|
39495
39078
|
});
|
|
39496
39079
|
}
|
|
@@ -39540,8 +39123,7 @@ var StatementParser = /*#__PURE__*/ function(ExpressionParser) {
|
|
|
39540
39123
|
var result = this.parseStringLiteral(this.state.value);
|
|
39541
39124
|
var surrogate = result.value.match(loneSurrogate);
|
|
39542
39125
|
if (surrogate) {
|
|
39543
|
-
this.raise(Errors.ModuleExportNameHasLoneSurrogate, {
|
|
39544
|
-
at: result,
|
|
39126
|
+
this.raise(Errors.ModuleExportNameHasLoneSurrogate, result, {
|
|
39545
39127
|
surrogateCharCode: surrogate[0].charCodeAt(0)
|
|
39546
39128
|
});
|
|
39547
39129
|
}
|
|
@@ -39569,27 +39151,19 @@ var StatementParser = /*#__PURE__*/ function(ExpressionParser) {
|
|
|
39569
39151
|
var singleBindingType = specifiers.length === 1 ? specifiers[0].type : null;
|
|
39570
39152
|
if (node.phase === "source") {
|
|
39571
39153
|
if (singleBindingType !== "ImportDefaultSpecifier") {
|
|
39572
|
-
this.raise(Errors.SourcePhaseImportRequiresDefault,
|
|
39573
|
-
at: specifiers[0].loc.start
|
|
39574
|
-
});
|
|
39154
|
+
this.raise(Errors.SourcePhaseImportRequiresDefault, specifiers[0].loc.start);
|
|
39575
39155
|
}
|
|
39576
39156
|
} else if (node.phase === "defer") {
|
|
39577
39157
|
if (singleBindingType !== "ImportNamespaceSpecifier") {
|
|
39578
|
-
this.raise(Errors.DeferImportRequiresNamespace,
|
|
39579
|
-
at: specifiers[0].loc.start
|
|
39580
|
-
});
|
|
39158
|
+
this.raise(Errors.DeferImportRequiresNamespace, specifiers[0].loc.start);
|
|
39581
39159
|
}
|
|
39582
39160
|
} else if (node.module) {
|
|
39583
39161
|
var _node_assertions;
|
|
39584
39162
|
if (singleBindingType !== "ImportDefaultSpecifier") {
|
|
39585
|
-
this.raise(Errors.ImportReflectionNotBinding,
|
|
39586
|
-
at: specifiers[0].loc.start
|
|
39587
|
-
});
|
|
39163
|
+
this.raise(Errors.ImportReflectionNotBinding, specifiers[0].loc.start);
|
|
39588
39164
|
}
|
|
39589
39165
|
if (((_node_assertions = node.assertions) === null || _node_assertions === void 0 ? void 0 : _node_assertions.length) > 0) {
|
|
39590
|
-
this.raise(Errors.ImportReflectionHasAssertion,
|
|
39591
|
-
at: node.specifiers[0].loc.start
|
|
39592
|
-
});
|
|
39166
|
+
this.raise(Errors.ImportReflectionHasAssertion, specifiers[0].loc.start);
|
|
39593
39167
|
}
|
|
39594
39168
|
}
|
|
39595
39169
|
}
|
|
@@ -39612,9 +39186,7 @@ var StatementParser = /*#__PURE__*/ function(ExpressionParser) {
|
|
|
39612
39186
|
}
|
|
39613
39187
|
});
|
|
39614
39188
|
if (nonDefaultNamedSpecifier !== void 0) {
|
|
39615
|
-
this.raise(Errors.ImportJSONBindingNotDefault,
|
|
39616
|
-
at: nonDefaultNamedSpecifier.loc.start
|
|
39617
|
-
});
|
|
39189
|
+
this.raise(Errors.ImportJSONBindingNotDefault, nonDefaultNamedSpecifier.loc.start);
|
|
39618
39190
|
}
|
|
39619
39191
|
}
|
|
39620
39192
|
}
|
|
@@ -39751,8 +39323,7 @@ var StatementParser = /*#__PURE__*/ function(ExpressionParser) {
|
|
|
39751
39323
|
var node = this.startNode();
|
|
39752
39324
|
var keyName = this.state.value;
|
|
39753
39325
|
if (attrNames.has(keyName)) {
|
|
39754
|
-
this.raise(Errors.ModuleAttributesWithDuplicateKeys, {
|
|
39755
|
-
at: this.state.startLoc,
|
|
39326
|
+
this.raise(Errors.ModuleAttributesWithDuplicateKeys, this.state.startLoc, {
|
|
39756
39327
|
key: keyName
|
|
39757
39328
|
});
|
|
39758
39329
|
}
|
|
@@ -39764,9 +39335,7 @@ var StatementParser = /*#__PURE__*/ function(ExpressionParser) {
|
|
|
39764
39335
|
}
|
|
39765
39336
|
this.expect(14);
|
|
39766
39337
|
if (!this.match(133)) {
|
|
39767
|
-
throw this.raise(Errors.ModuleAttributeInvalidValue,
|
|
39768
|
-
at: this.state.startLoc
|
|
39769
|
-
});
|
|
39338
|
+
throw this.raise(Errors.ModuleAttributeInvalidValue, this.state.startLoc);
|
|
39770
39339
|
}
|
|
39771
39340
|
node.value = this.parseStringLiteral(this.state.value);
|
|
39772
39341
|
attrs.push(this.finishNode(node, "ImportAttribute"));
|
|
@@ -39784,22 +39353,17 @@ var StatementParser = /*#__PURE__*/ function(ExpressionParser) {
|
|
|
39784
39353
|
var node = this.startNode();
|
|
39785
39354
|
node.key = this.parseIdentifier(true);
|
|
39786
39355
|
if (node.key.name !== "type") {
|
|
39787
|
-
this.raise(Errors.ModuleAttributeDifferentFromType,
|
|
39788
|
-
at: node.key
|
|
39789
|
-
});
|
|
39356
|
+
this.raise(Errors.ModuleAttributeDifferentFromType, node.key);
|
|
39790
39357
|
}
|
|
39791
39358
|
if (attributes.has(node.key.name)) {
|
|
39792
|
-
this.raise(Errors.ModuleAttributesWithDuplicateKeys, {
|
|
39793
|
-
at: node.key,
|
|
39359
|
+
this.raise(Errors.ModuleAttributesWithDuplicateKeys, node.key, {
|
|
39794
39360
|
key: node.key.name
|
|
39795
39361
|
});
|
|
39796
39362
|
}
|
|
39797
39363
|
attributes.add(node.key.name);
|
|
39798
39364
|
this.expect(14);
|
|
39799
39365
|
if (!this.match(133)) {
|
|
39800
|
-
throw this.raise(Errors.ModuleAttributeInvalidValue,
|
|
39801
|
-
at: this.state.startLoc
|
|
39802
|
-
});
|
|
39366
|
+
throw this.raise(Errors.ModuleAttributeInvalidValue, this.state.startLoc);
|
|
39803
39367
|
}
|
|
39804
39368
|
node.value = this.parseStringLiteral(this.state.value);
|
|
39805
39369
|
attrs.push(this.finishNode(node, "ImportAttribute"));
|
|
@@ -39825,9 +39389,7 @@ var StatementParser = /*#__PURE__*/ function(ExpressionParser) {
|
|
|
39825
39389
|
} else if (this.isContextual(94) && !this.hasPrecedingLineBreak()) {
|
|
39826
39390
|
if (this.hasPlugin("importAttributes")) {
|
|
39827
39391
|
if (this.getPluginOption("importAttributes", "deprecatedAssertSyntax") !== true) {
|
|
39828
|
-
this.raise(Errors.ImportAttributesUseAssert,
|
|
39829
|
-
at: this.state.startLoc
|
|
39830
|
-
});
|
|
39392
|
+
this.raise(Errors.ImportAttributesUseAssert, this.state.startLoc);
|
|
39831
39393
|
}
|
|
39832
39394
|
this.addExtra(node, "deprecatedAssertSyntax", true);
|
|
39833
39395
|
} else {
|
|
@@ -39886,9 +39448,7 @@ var StatementParser = /*#__PURE__*/ function(ExpressionParser) {
|
|
|
39886
39448
|
first = false;
|
|
39887
39449
|
} else {
|
|
39888
39450
|
if (this.eat(14)) {
|
|
39889
|
-
throw this.raise(Errors.DestructureNamedImport,
|
|
39890
|
-
at: this.state.startLoc
|
|
39891
|
-
});
|
|
39451
|
+
throw this.raise(Errors.DestructureNamedImport, this.state.startLoc);
|
|
39892
39452
|
}
|
|
39893
39453
|
this.expect(12);
|
|
39894
39454
|
if (this.eat(8)) break;
|
|
@@ -39910,8 +39470,7 @@ var StatementParser = /*#__PURE__*/ function(ExpressionParser) {
|
|
|
39910
39470
|
} else {
|
|
39911
39471
|
var imported = specifier.imported;
|
|
39912
39472
|
if (importedIsString) {
|
|
39913
|
-
throw this.raise(Errors.ImportBindingIsString, {
|
|
39914
|
-
at: specifier,
|
|
39473
|
+
throw this.raise(Errors.ImportBindingIsString, specifier, {
|
|
39915
39474
|
importName: imported.value
|
|
39916
39475
|
});
|
|
39917
39476
|
}
|
|
@@ -39964,6 +39523,7 @@ var Parser = /*#__PURE__*/ function(StatementParser) {
|
|
|
39964
39523
|
file2.errors = null;
|
|
39965
39524
|
this.parseTopLevel(file2, program3);
|
|
39966
39525
|
file2.errors = this.state.errors;
|
|
39526
|
+
file2.comments.length = this.state.commentsLen;
|
|
39967
39527
|
return file2;
|
|
39968
39528
|
}
|
|
39969
39529
|
}
|
|
@@ -51095,10 +50655,14 @@ var NodePath_ancestry = /* @__PURE__ */ Object.freeze({
|
|
|
51095
50655
|
var createFlowUnionType2 = lib_exports.createFlowUnionType, createTSUnionType2 = lib_exports.createTSUnionType, createUnionTypeAnnotation = lib_exports.createUnionTypeAnnotation, isFlowType2 = lib_exports.isFlowType, isTSType2 = lib_exports.isTSType;
|
|
51096
50656
|
function createUnionType(types2) {
|
|
51097
50657
|
{
|
|
51098
|
-
if (
|
|
50658
|
+
if (types2.every(function(v) {
|
|
50659
|
+
return isFlowType2(v);
|
|
50660
|
+
})) {
|
|
51099
50661
|
return createFlowUnionType2(types2);
|
|
51100
50662
|
}
|
|
51101
|
-
if (
|
|
50663
|
+
if (types2.every(function(v) {
|
|
50664
|
+
return isTSType2(v);
|
|
50665
|
+
})) {
|
|
51102
50666
|
return createTSUnionType2(types2);
|
|
51103
50667
|
}
|
|
51104
50668
|
}
|
|
@@ -53529,23 +53093,25 @@ function _removeFromScope() {
|
|
|
53529
53093
|
});
|
|
53530
53094
|
}
|
|
53531
53095
|
function _callRemovalHooks() {
|
|
53532
|
-
|
|
53533
|
-
|
|
53534
|
-
for(var _iterator = hooks[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
53535
|
-
var fn = _step.value;
|
|
53536
|
-
if (fn(this, this.parentPath)) return true;
|
|
53537
|
-
}
|
|
53538
|
-
} catch (err) {
|
|
53539
|
-
_didIteratorError = true;
|
|
53540
|
-
_iteratorError = err;
|
|
53541
|
-
} finally{
|
|
53096
|
+
if (this.parentPath) {
|
|
53097
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
53542
53098
|
try {
|
|
53543
|
-
|
|
53544
|
-
|
|
53099
|
+
for(var _iterator = hooks[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
53100
|
+
var fn = _step.value;
|
|
53101
|
+
if (fn(this, this.parentPath)) return true;
|
|
53545
53102
|
}
|
|
53103
|
+
} catch (err) {
|
|
53104
|
+
_didIteratorError = true;
|
|
53105
|
+
_iteratorError = err;
|
|
53546
53106
|
} finally{
|
|
53547
|
-
|
|
53548
|
-
|
|
53107
|
+
try {
|
|
53108
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
53109
|
+
_iterator.return();
|
|
53110
|
+
}
|
|
53111
|
+
} finally{
|
|
53112
|
+
if (_didIteratorError) {
|
|
53113
|
+
throw _iteratorError;
|
|
53114
|
+
}
|
|
53549
53115
|
}
|
|
53550
53116
|
}
|
|
53551
53117
|
}
|