stacks 0.58.29 → 0.58.30
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/core/actions/dist/src/generate/lib-entries.js +3 -3
- package/core/actions/dist/src/helpers/lib-entries.js +3 -3
- package/core/actions/dist/src/lint/fix.js +1 -1
- package/core/actions/dist/src/upgrade.js +1 -1
- package/core/actions/package.json +1 -1
- package/core/actions/src/helpers/lib-entries.ts +3 -3
- package/core/actions/src/lint/fix.ts +1 -1
- package/core/ai/package.json +1 -1
- package/core/alias/package.json +1 -1
- package/core/analytics/package.json +1 -1
- package/core/api/package.json +1 -1
- package/core/arrays/package.json +1 -1
- package/core/auth/package.json +1 -1
- package/core/buddy/package.json +1 -1
- package/core/build/package.json +1 -1
- package/core/bun-create/bud/package.json +1 -1
- package/core/bun-create/buddy/package.json +1 -1
- package/core/bun-create/stack/package.json +1 -1
- package/core/bun-create/stacks/package.json +1 -1
- package/core/bun-create/stx/package.json +1 -1
- package/core/bun-plugin-yaml/dist/index.js +1 -1
- package/core/bun-plugin-yaml/package.json +1 -1
- package/core/bun-plugin-yaml/src/index.ts +1 -1
- package/core/cache/package.json +1 -1
- package/core/chat/package.json +1 -1
- package/core/cli/dist/index.js +1 -1
- package/core/cli/package.json +1 -1
- package/core/cloud/package.json +1 -1
- package/core/cloud/src/cloud/aws-sdk-layer/nodejs/package.json +1 -1
- package/core/cloud/src/runtime/example/lambda.ts +1 -1
- package/core/cloud/src/runtime/server.ts +1 -1
- package/core/collections/package.json +1 -1
- package/core/config/package.json +1 -1
- package/core/database/package.json +1 -1
- package/core/database/src/kysely-bun-worker/worker.ts +1 -1
- package/core/datetime/package.json +1 -1
- package/core/desktop/package.json +1 -1
- package/core/development/package.json +1 -1
- package/core/dns/package.json +1 -1
- package/core/docs/dist/index.js +559 -1042
- package/core/docs/package.json +1 -1
- package/core/email/package.json +1 -1
- package/core/enums/package.json +1 -1
- package/core/env/package.json +1 -1
- package/core/error-handling/package.json +1 -1
- package/core/eslint-config/package.json +2 -2
- package/core/events/package.json +1 -1
- package/core/faker/package.json +1 -1
- package/core/git/package.json +1 -1
- package/core/health/package.json +1 -1
- package/core/http/package.json +1 -1
- package/core/lint/package.json +1 -1
- package/core/logging/package.json +1 -1
- package/core/music/package.json +1 -1
- package/core/notifications/package.json +1 -1
- package/core/objects/package.json +1 -1
- package/core/orm/package.json +1 -1
- package/core/path/package.json +1 -1
- package/core/payments/package.json +1 -1
- package/core/push/package.json +1 -1
- package/core/query-builder/package.json +1 -1
- package/core/queue/package.json +1 -1
- package/core/raycast/package.json +1 -1
- package/core/realtime/package.json +1 -1
- package/core/repl/package.json +1 -1
- package/core/router/package.json +1 -1
- package/core/scheduler/package.json +1 -1
- package/core/search-engine/package.json +1 -1
- package/core/security/package.json +1 -1
- package/core/server/package.json +1 -1
- package/core/signals/package.json +1 -1
- package/core/slug/package.json +1 -1
- package/core/sms/package.json +1 -1
- package/core/storage/package.json +1 -1
- package/core/storage/src/files.ts +1 -1
- package/core/storage/src/zip.ts +1 -1
- package/core/strings/package.json +1 -1
- package/core/tables/package.json +1 -1
- package/core/testing/package.json +1 -1
- package/core/tinker/package.json +1 -1
- package/core/tunnel/package.json +1 -1
- package/core/types/package.json +1 -1
- package/core/types/src/cli.ts +2 -2
- package/core/ui/package.json +1 -1
- package/core/utils/dist/index.js +1 -1
- package/core/utils/package.json +1 -1
- package/core/validation/package.json +1 -1
- package/core/vite/dist/index.js +1 -1
- package/core/vite/package.json +1 -1
- package/core/whois/package.json +1 -1
- package/core/x-ray/package.json +1 -1
- package/core/zsh-buddy/package.json +1 -1
- package/ide/vscode/package.json +1 -1
- package/package.json +1 -1
package/core/docs/dist/index.js
CHANGED
|
@@ -1033,11 +1033,8 @@ var require_lib = __commonJS((exports) => {
|
|
|
1033
1033
|
var toParseErrorConstructor = function(_ref) {
|
|
1034
1034
|
let {
|
|
1035
1035
|
toMessage
|
|
1036
|
-
} = _ref, properties = _objectWithoutPropertiesLoose(_ref, _excluded
|
|
1037
|
-
return function constructor({
|
|
1038
|
-
loc,
|
|
1039
|
-
details
|
|
1040
|
-
}) {
|
|
1036
|
+
} = _ref, properties = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
1037
|
+
return function constructor(loc, details) {
|
|
1041
1038
|
const error = new SyntaxError;
|
|
1042
1039
|
Object.assign(error, properties, {
|
|
1043
1040
|
loc,
|
|
@@ -1055,10 +1052,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
1055
1052
|
column,
|
|
1056
1053
|
index
|
|
1057
1054
|
} = (_overrides$loc = overrides.loc) != null ? _overrides$loc : loc;
|
|
1058
|
-
return constructor({
|
|
1059
|
-
loc: new Position(line, column, index),
|
|
1060
|
-
details: Object.assign({}, details, overrides.details)
|
|
1061
|
-
});
|
|
1055
|
+
return constructor(new Position(line, column, index), Object.assign({}, details, overrides.details));
|
|
1062
1056
|
});
|
|
1063
1057
|
defineHidden(error, "details", details);
|
|
1064
1058
|
Object.defineProperty(error, "message", {
|
|
@@ -1091,7 +1085,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
1091
1085
|
message: template
|
|
1092
1086
|
} : template, {
|
|
1093
1087
|
message
|
|
1094
|
-
} = _ref2, rest = _objectWithoutPropertiesLoose(_ref2, _excluded2
|
|
1088
|
+
} = _ref2, rest = _objectWithoutPropertiesLoose(_ref2, _excluded2);
|
|
1095
1089
|
const toMessage = typeof message === "string" ? () => message : message;
|
|
1096
1090
|
ParseErrorConstructors[reasonCode] = toParseErrorConstructor(Object.assign({
|
|
1097
1091
|
code: "BABEL_PARSER_SYNTAX_ERROR",
|
|
@@ -2448,8 +2442,8 @@ var require_lib = __commonJS((exports) => {
|
|
|
2448
2442
|
PrimaryTopicNotAllowed: "Topic reference was used in a lexical context without topic binding.",
|
|
2449
2443
|
PrimaryTopicRequiresSmartPipeline: 'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.'
|
|
2450
2444
|
};
|
|
2451
|
-
var _excluded
|
|
2452
|
-
var _excluded2
|
|
2445
|
+
var _excluded = ["toMessage"];
|
|
2446
|
+
var _excluded2 = ["message"];
|
|
2453
2447
|
var Errors = Object.assign({}, ParseErrorEnum(ModuleErrors), ParseErrorEnum(StandardErrors), ParseErrorEnum(StrictModeErrors), ParseErrorEnum`pipelineOperator`(PipelineOperatorErrors));
|
|
2454
2448
|
var {
|
|
2455
2449
|
defineProperty
|
|
@@ -2679,13 +2673,9 @@ var require_lib = __commonJS((exports) => {
|
|
|
2679
2673
|
}
|
|
2680
2674
|
toAssignableObjectExpressionProp(prop, isLast, isLHS) {
|
|
2681
2675
|
if (prop.kind === "get" || prop.kind === "set") {
|
|
2682
|
-
this.raise(Errors.PatternHasAccessor,
|
|
2683
|
-
at: prop.key
|
|
2684
|
-
});
|
|
2676
|
+
this.raise(Errors.PatternHasAccessor, prop.key);
|
|
2685
2677
|
} else if (prop.method) {
|
|
2686
|
-
this.raise(Errors.PatternHasMethod,
|
|
2687
|
-
at: prop.key
|
|
2688
|
-
});
|
|
2678
|
+
this.raise(Errors.PatternHasMethod, prop.key);
|
|
2689
2679
|
} else {
|
|
2690
2680
|
super.toAssignableObjectExpressionProp(prop, isLast, isLHS);
|
|
2691
2681
|
}
|
|
@@ -3276,9 +3266,9 @@ var require_lib = __commonJS((exports) => {
|
|
|
3276
3266
|
|
|
3277
3267
|
class Scope {
|
|
3278
3268
|
constructor(flags) {
|
|
3279
|
-
this.
|
|
3280
|
-
this.
|
|
3281
|
-
this.
|
|
3269
|
+
this.flags = 0;
|
|
3270
|
+
this.names = new Map;
|
|
3271
|
+
this.firstLexicalName = "";
|
|
3282
3272
|
this.flags = flags;
|
|
3283
3273
|
}
|
|
3284
3274
|
}
|
|
@@ -3347,11 +3337,16 @@ var require_lib = __commonJS((exports) => {
|
|
|
3347
3337
|
let scope = this.currentScope();
|
|
3348
3338
|
if (bindingType & 8 || bindingType & 16) {
|
|
3349
3339
|
this.checkRedeclarationInScope(scope, name, bindingType, loc);
|
|
3340
|
+
let type = scope.names.get(name) || 0;
|
|
3350
3341
|
if (bindingType & 16) {
|
|
3351
|
-
|
|
3342
|
+
type = type | 4;
|
|
3352
3343
|
} else {
|
|
3353
|
-
scope.
|
|
3344
|
+
if (!scope.firstLexicalName) {
|
|
3345
|
+
scope.firstLexicalName = name;
|
|
3346
|
+
}
|
|
3347
|
+
type = type | 2;
|
|
3354
3348
|
}
|
|
3349
|
+
scope.names.set(name, type);
|
|
3355
3350
|
if (bindingType & 8) {
|
|
3356
3351
|
this.maybeExportDefined(scope, name);
|
|
3357
3352
|
}
|
|
@@ -3359,7 +3354,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
3359
3354
|
for (let i = this.scopeStack.length - 1;i >= 0; --i) {
|
|
3360
3355
|
scope = this.scopeStack[i];
|
|
3361
3356
|
this.checkRedeclarationInScope(scope, name, bindingType, loc);
|
|
3362
|
-
scope.
|
|
3357
|
+
scope.names.set(name, (scope.names.get(name) || 0) | 1);
|
|
3363
3358
|
this.maybeExportDefined(scope, name);
|
|
3364
3359
|
if (scope.flags & 387)
|
|
3365
3360
|
break;
|
|
@@ -3376,8 +3371,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
3376
3371
|
}
|
|
3377
3372
|
checkRedeclarationInScope(scope, name, bindingType, loc) {
|
|
3378
3373
|
if (this.isRedeclaredInScope(scope, name, bindingType)) {
|
|
3379
|
-
this.parser.raise(Errors.VarRedeclaration, {
|
|
3380
|
-
at: loc,
|
|
3374
|
+
this.parser.raise(Errors.VarRedeclaration, loc, {
|
|
3381
3375
|
identifierName: name
|
|
3382
3376
|
});
|
|
3383
3377
|
}
|
|
@@ -3386,19 +3380,20 @@ var require_lib = __commonJS((exports) => {
|
|
|
3386
3380
|
if (!(bindingType & 1))
|
|
3387
3381
|
return false;
|
|
3388
3382
|
if (bindingType & 8) {
|
|
3389
|
-
return scope.
|
|
3383
|
+
return scope.names.has(name);
|
|
3390
3384
|
}
|
|
3385
|
+
const type = scope.names.get(name);
|
|
3391
3386
|
if (bindingType & 16) {
|
|
3392
|
-
return
|
|
3387
|
+
return (type & 2) > 0 || !this.treatFunctionsAsVarInScope(scope) && (type & 1) > 0;
|
|
3393
3388
|
}
|
|
3394
|
-
return
|
|
3389
|
+
return (type & 2) > 0 && !(scope.flags & 8 && scope.firstLexicalName === name) || !this.treatFunctionsAsVarInScope(scope) && (type & 4) > 0;
|
|
3395
3390
|
}
|
|
3396
3391
|
checkLocalExport(id) {
|
|
3397
3392
|
const {
|
|
3398
3393
|
name
|
|
3399
3394
|
} = id;
|
|
3400
3395
|
const topLevelScope = this.scopeStack[0];
|
|
3401
|
-
if (!topLevelScope.
|
|
3396
|
+
if (!topLevelScope.names.has(name)) {
|
|
3402
3397
|
this.undefinedExports.set(name, id.loc.start);
|
|
3403
3398
|
}
|
|
3404
3399
|
}
|
|
@@ -3451,8 +3446,9 @@ var require_lib = __commonJS((exports) => {
|
|
|
3451
3446
|
isRedeclaredInScope(scope, name, bindingType) {
|
|
3452
3447
|
if (super.isRedeclaredInScope(scope, name, bindingType))
|
|
3453
3448
|
return true;
|
|
3454
|
-
if (bindingType & 2048) {
|
|
3455
|
-
|
|
3449
|
+
if (bindingType & 2048 && !scope.declareFunctions.has(name)) {
|
|
3450
|
+
const type = scope.names.get(name);
|
|
3451
|
+
return (type & 4) > 0 || (type & 2) > 0;
|
|
3456
3452
|
}
|
|
3457
3453
|
return false;
|
|
3458
3454
|
}
|
|
@@ -3495,7 +3491,13 @@ var require_lib = __commonJS((exports) => {
|
|
|
3495
3491
|
addComment(comment) {
|
|
3496
3492
|
if (this.filename)
|
|
3497
3493
|
comment.loc.filename = this.filename;
|
|
3498
|
-
|
|
3494
|
+
const {
|
|
3495
|
+
commentsLen
|
|
3496
|
+
} = this.state;
|
|
3497
|
+
if (this.comments.length != commentsLen)
|
|
3498
|
+
this.comments.length = commentsLen;
|
|
3499
|
+
this.comments.push(comment);
|
|
3500
|
+
this.state.commentsLen++;
|
|
3499
3501
|
}
|
|
3500
3502
|
processComment(node) {
|
|
3501
3503
|
const {
|
|
@@ -3649,7 +3651,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
3649
3651
|
|
|
3650
3652
|
class State {
|
|
3651
3653
|
constructor() {
|
|
3652
|
-
this.
|
|
3654
|
+
this.flags = 1024;
|
|
3653
3655
|
this.curLine = undefined;
|
|
3654
3656
|
this.lineStart = undefined;
|
|
3655
3657
|
this.startLoc = undefined;
|
|
@@ -3658,21 +3660,12 @@ var require_lib = __commonJS((exports) => {
|
|
|
3658
3660
|
this.potentialArrowAt = -1;
|
|
3659
3661
|
this.noArrowAt = [];
|
|
3660
3662
|
this.noArrowParamsConversionAt = [];
|
|
3661
|
-
this.maybeInArrowParameters = false;
|
|
3662
|
-
this.inType = false;
|
|
3663
|
-
this.noAnonFunctionType = false;
|
|
3664
|
-
this.hasFlowComment = false;
|
|
3665
|
-
this.isAmbientContext = false;
|
|
3666
|
-
this.inAbstractClass = false;
|
|
3667
|
-
this.inDisallowConditionalTypesContext = false;
|
|
3668
3663
|
this.topicContext = {
|
|
3669
3664
|
maxNumOfResolvableTopics: 0,
|
|
3670
3665
|
maxTopicIndex: null
|
|
3671
3666
|
};
|
|
3672
|
-
this.soloAwait = false;
|
|
3673
|
-
this.inFSharpPipelineDirectBody = false;
|
|
3674
3667
|
this.labels = [];
|
|
3675
|
-
this.
|
|
3668
|
+
this.commentsLen = 0;
|
|
3676
3669
|
this.commentStack = [];
|
|
3677
3670
|
this.pos = 0;
|
|
3678
3671
|
this.type = 139;
|
|
@@ -3681,14 +3674,21 @@ var require_lib = __commonJS((exports) => {
|
|
|
3681
3674
|
this.end = 0;
|
|
3682
3675
|
this.lastTokEndLoc = null;
|
|
3683
3676
|
this.lastTokStartLoc = null;
|
|
3684
|
-
this.lastTokStart = 0;
|
|
3685
3677
|
this.context = [types.brace];
|
|
3686
|
-
this.canStartJSXElement = true;
|
|
3687
|
-
this.containsEsc = false;
|
|
3688
3678
|
this.firstInvalidTemplateEscapePos = null;
|
|
3689
3679
|
this.strictErrors = new Map;
|
|
3690
3680
|
this.tokensLength = 0;
|
|
3691
3681
|
}
|
|
3682
|
+
get strict() {
|
|
3683
|
+
return (this.flags & 1) > 0;
|
|
3684
|
+
}
|
|
3685
|
+
set strict(value) {
|
|
3686
|
+
if (value) {
|
|
3687
|
+
this.flags |= 1;
|
|
3688
|
+
} else {
|
|
3689
|
+
this.flags &= ~1;
|
|
3690
|
+
}
|
|
3691
|
+
}
|
|
3692
3692
|
init({
|
|
3693
3693
|
strictMode,
|
|
3694
3694
|
sourceType,
|
|
@@ -3700,20 +3700,145 @@ var require_lib = __commonJS((exports) => {
|
|
|
3700
3700
|
this.lineStart = -startColumn;
|
|
3701
3701
|
this.startLoc = this.endLoc = new Position(startLine, startColumn, 0);
|
|
3702
3702
|
}
|
|
3703
|
+
get maybeInArrowParameters() {
|
|
3704
|
+
return (this.flags & 2) > 0;
|
|
3705
|
+
}
|
|
3706
|
+
set maybeInArrowParameters(value) {
|
|
3707
|
+
if (value) {
|
|
3708
|
+
this.flags |= 2;
|
|
3709
|
+
} else {
|
|
3710
|
+
this.flags &= ~2;
|
|
3711
|
+
}
|
|
3712
|
+
}
|
|
3713
|
+
get inType() {
|
|
3714
|
+
return (this.flags & 4) > 0;
|
|
3715
|
+
}
|
|
3716
|
+
set inType(value) {
|
|
3717
|
+
if (value) {
|
|
3718
|
+
this.flags |= 4;
|
|
3719
|
+
} else {
|
|
3720
|
+
this.flags &= ~4;
|
|
3721
|
+
}
|
|
3722
|
+
}
|
|
3723
|
+
get noAnonFunctionType() {
|
|
3724
|
+
return (this.flags & 8) > 0;
|
|
3725
|
+
}
|
|
3726
|
+
set noAnonFunctionType(value) {
|
|
3727
|
+
if (value) {
|
|
3728
|
+
this.flags |= 8;
|
|
3729
|
+
} else {
|
|
3730
|
+
this.flags &= ~8;
|
|
3731
|
+
}
|
|
3732
|
+
}
|
|
3733
|
+
get hasFlowComment() {
|
|
3734
|
+
return (this.flags & 16) > 0;
|
|
3735
|
+
}
|
|
3736
|
+
set hasFlowComment(value) {
|
|
3737
|
+
if (value) {
|
|
3738
|
+
this.flags |= 16;
|
|
3739
|
+
} else {
|
|
3740
|
+
this.flags &= ~16;
|
|
3741
|
+
}
|
|
3742
|
+
}
|
|
3743
|
+
get isAmbientContext() {
|
|
3744
|
+
return (this.flags & 32) > 0;
|
|
3745
|
+
}
|
|
3746
|
+
set isAmbientContext(value) {
|
|
3747
|
+
if (value) {
|
|
3748
|
+
this.flags |= 32;
|
|
3749
|
+
} else {
|
|
3750
|
+
this.flags &= ~32;
|
|
3751
|
+
}
|
|
3752
|
+
}
|
|
3753
|
+
get inAbstractClass() {
|
|
3754
|
+
return (this.flags & 64) > 0;
|
|
3755
|
+
}
|
|
3756
|
+
set inAbstractClass(value) {
|
|
3757
|
+
if (value) {
|
|
3758
|
+
this.flags |= 64;
|
|
3759
|
+
} else {
|
|
3760
|
+
this.flags &= ~64;
|
|
3761
|
+
}
|
|
3762
|
+
}
|
|
3763
|
+
get inDisallowConditionalTypesContext() {
|
|
3764
|
+
return (this.flags & 128) > 0;
|
|
3765
|
+
}
|
|
3766
|
+
set inDisallowConditionalTypesContext(value) {
|
|
3767
|
+
if (value) {
|
|
3768
|
+
this.flags |= 128;
|
|
3769
|
+
} else {
|
|
3770
|
+
this.flags &= ~128;
|
|
3771
|
+
}
|
|
3772
|
+
}
|
|
3773
|
+
get soloAwait() {
|
|
3774
|
+
return (this.flags & 256) > 0;
|
|
3775
|
+
}
|
|
3776
|
+
set soloAwait(value) {
|
|
3777
|
+
if (value) {
|
|
3778
|
+
this.flags |= 256;
|
|
3779
|
+
} else {
|
|
3780
|
+
this.flags &= ~256;
|
|
3781
|
+
}
|
|
3782
|
+
}
|
|
3783
|
+
get inFSharpPipelineDirectBody() {
|
|
3784
|
+
return (this.flags & 512) > 0;
|
|
3785
|
+
}
|
|
3786
|
+
set inFSharpPipelineDirectBody(value) {
|
|
3787
|
+
if (value) {
|
|
3788
|
+
this.flags |= 512;
|
|
3789
|
+
} else {
|
|
3790
|
+
this.flags &= ~512;
|
|
3791
|
+
}
|
|
3792
|
+
}
|
|
3793
|
+
get canStartJSXElement() {
|
|
3794
|
+
return (this.flags & 1024) > 0;
|
|
3795
|
+
}
|
|
3796
|
+
set canStartJSXElement(value) {
|
|
3797
|
+
if (value) {
|
|
3798
|
+
this.flags |= 1024;
|
|
3799
|
+
} else {
|
|
3800
|
+
this.flags &= ~1024;
|
|
3801
|
+
}
|
|
3802
|
+
}
|
|
3803
|
+
get containsEsc() {
|
|
3804
|
+
return (this.flags & 2048) > 0;
|
|
3805
|
+
}
|
|
3806
|
+
set containsEsc(value) {
|
|
3807
|
+
if (value) {
|
|
3808
|
+
this.flags |= 2048;
|
|
3809
|
+
} else {
|
|
3810
|
+
this.flags &= ~2048;
|
|
3811
|
+
}
|
|
3812
|
+
}
|
|
3703
3813
|
curPosition() {
|
|
3704
3814
|
return new Position(this.curLine, this.pos - this.lineStart, this.pos);
|
|
3705
3815
|
}
|
|
3706
|
-
clone(
|
|
3816
|
+
clone() {
|
|
3707
3817
|
const state = new State;
|
|
3708
|
-
|
|
3709
|
-
|
|
3710
|
-
|
|
3711
|
-
|
|
3712
|
-
|
|
3713
|
-
|
|
3714
|
-
|
|
3715
|
-
|
|
3716
|
-
|
|
3818
|
+
state.flags = this.flags;
|
|
3819
|
+
state.curLine = this.curLine;
|
|
3820
|
+
state.lineStart = this.lineStart;
|
|
3821
|
+
state.startLoc = this.startLoc;
|
|
3822
|
+
state.endLoc = this.endLoc;
|
|
3823
|
+
state.errors = this.errors.slice();
|
|
3824
|
+
state.potentialArrowAt = this.potentialArrowAt;
|
|
3825
|
+
state.noArrowAt = this.noArrowAt.slice();
|
|
3826
|
+
state.noArrowParamsConversionAt = this.noArrowParamsConversionAt.slice();
|
|
3827
|
+
state.topicContext = this.topicContext;
|
|
3828
|
+
state.labels = this.labels.slice();
|
|
3829
|
+
state.commentsLen = this.commentsLen;
|
|
3830
|
+
state.commentStack = this.commentStack.slice();
|
|
3831
|
+
state.pos = this.pos;
|
|
3832
|
+
state.type = this.type;
|
|
3833
|
+
state.value = this.value;
|
|
3834
|
+
state.start = this.start;
|
|
3835
|
+
state.end = this.end;
|
|
3836
|
+
state.lastTokEndLoc = this.lastTokEndLoc;
|
|
3837
|
+
state.lastTokStartLoc = this.lastTokStartLoc;
|
|
3838
|
+
state.context = this.context.slice();
|
|
3839
|
+
state.firstInvalidTemplateEscapePos = this.firstInvalidTemplateEscapePos;
|
|
3840
|
+
state.strictErrors = this.strictErrors;
|
|
3841
|
+
state.tokensLength = this.tokensLength;
|
|
3717
3842
|
return state;
|
|
3718
3843
|
}
|
|
3719
3844
|
}
|
|
@@ -3730,8 +3855,6 @@ var require_lib = __commonJS((exports) => {
|
|
|
3730
3855
|
dec: (ch) => ch >= 48 && ch <= 57,
|
|
3731
3856
|
hex: (ch) => ch >= 48 && ch <= 57 || ch >= 65 && ch <= 70 || ch >= 97 && ch <= 102
|
|
3732
3857
|
};
|
|
3733
|
-
var _excluded = ["at"];
|
|
3734
|
-
var _excluded2 = ["at"];
|
|
3735
3858
|
var VALID_REGEX_FLAGS = new Set([103, 109, 115, 105, 121, 117, 100, 118]);
|
|
3736
3859
|
|
|
3737
3860
|
class Token {
|
|
@@ -3753,8 +3876,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
3753
3876
|
invalidDigit: (pos, lineStart, curLine, radix) => {
|
|
3754
3877
|
if (!this.options.errorRecovery)
|
|
3755
3878
|
return false;
|
|
3756
|
-
this.raise(Errors.InvalidDigit, {
|
|
3757
|
-
at: buildPosition(pos, lineStart, curLine),
|
|
3879
|
+
this.raise(Errors.InvalidDigit, buildPosition(pos, lineStart, curLine), {
|
|
3758
3880
|
radix
|
|
3759
3881
|
});
|
|
3760
3882
|
return true;
|
|
@@ -3768,28 +3890,23 @@ var require_lib = __commonJS((exports) => {
|
|
|
3768
3890
|
});
|
|
3769
3891
|
this.errorHandlers_readStringContents_string = Object.assign({}, this.errorHandlers_readCodePoint, {
|
|
3770
3892
|
strictNumericEscape: (pos, lineStart, curLine) => {
|
|
3771
|
-
this.recordStrictModeErrors(Errors.StrictNumericEscape,
|
|
3772
|
-
at: buildPosition(pos, lineStart, curLine)
|
|
3773
|
-
});
|
|
3893
|
+
this.recordStrictModeErrors(Errors.StrictNumericEscape, buildPosition(pos, lineStart, curLine));
|
|
3774
3894
|
},
|
|
3775
3895
|
unterminated: (pos, lineStart, curLine) => {
|
|
3776
|
-
throw this.raise(Errors.UnterminatedString,
|
|
3777
|
-
at: buildPosition(pos - 1, lineStart, curLine)
|
|
3778
|
-
});
|
|
3896
|
+
throw this.raise(Errors.UnterminatedString, buildPosition(pos - 1, lineStart, curLine));
|
|
3779
3897
|
}
|
|
3780
3898
|
});
|
|
3781
3899
|
this.errorHandlers_readStringContents_template = Object.assign({}, this.errorHandlers_readCodePoint, {
|
|
3782
3900
|
strictNumericEscape: this.errorBuilder(Errors.StrictNumericEscape),
|
|
3783
3901
|
unterminated: (pos, lineStart, curLine) => {
|
|
3784
|
-
throw this.raise(Errors.UnterminatedTemplate,
|
|
3785
|
-
at: buildPosition(pos, lineStart, curLine)
|
|
3786
|
-
});
|
|
3902
|
+
throw this.raise(Errors.UnterminatedTemplate, buildPosition(pos, lineStart, curLine));
|
|
3787
3903
|
}
|
|
3788
3904
|
});
|
|
3789
3905
|
this.state = new State;
|
|
3790
3906
|
this.state.init(options);
|
|
3791
3907
|
this.input = input;
|
|
3792
3908
|
this.length = input.length;
|
|
3909
|
+
this.comments = [];
|
|
3793
3910
|
this.isLookahead = false;
|
|
3794
3911
|
}
|
|
3795
3912
|
pushToken(token) {
|
|
@@ -3802,7 +3919,6 @@ var require_lib = __commonJS((exports) => {
|
|
|
3802
3919
|
if (this.options.tokens) {
|
|
3803
3920
|
this.pushToken(new Token(this.state));
|
|
3804
3921
|
}
|
|
3805
|
-
this.state.lastTokStart = this.state.start;
|
|
3806
3922
|
this.state.lastTokEndLoc = this.state.endLoc;
|
|
3807
3923
|
this.state.lastTokStartLoc = this.state.startLoc;
|
|
3808
3924
|
this.nextToken();
|
|
@@ -3877,9 +3993,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
3877
3993
|
setStrict(strict) {
|
|
3878
3994
|
this.state.strict = strict;
|
|
3879
3995
|
if (strict) {
|
|
3880
|
-
this.state.strictErrors.forEach(([toParseError, at]) => this.raise(toParseError,
|
|
3881
|
-
at
|
|
3882
|
-
}));
|
|
3996
|
+
this.state.strictErrors.forEach(([toParseError, at]) => this.raise(toParseError, at));
|
|
3883
3997
|
this.state.strictErrors.clear();
|
|
3884
3998
|
}
|
|
3885
3999
|
}
|
|
@@ -3904,9 +4018,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
3904
4018
|
const start = this.state.pos;
|
|
3905
4019
|
const end = this.input.indexOf(commentEnd, start + 2);
|
|
3906
4020
|
if (end === -1) {
|
|
3907
|
-
throw this.raise(Errors.UnterminatedComment,
|
|
3908
|
-
at: this.state.curPosition()
|
|
3909
|
-
});
|
|
4021
|
+
throw this.raise(Errors.UnterminatedComment, this.state.curPosition());
|
|
3910
4022
|
}
|
|
3911
4023
|
this.state.pos = end + commentEnd.length;
|
|
3912
4024
|
lineBreakG.lastIndex = start + 2;
|
|
@@ -4066,16 +4178,12 @@ var require_lib = __commonJS((exports) => {
|
|
|
4066
4178
|
const nextPos = this.state.pos + 1;
|
|
4067
4179
|
const next = this.codePointAtPos(nextPos);
|
|
4068
4180
|
if (next >= 48 && next <= 57) {
|
|
4069
|
-
throw this.raise(Errors.UnexpectedDigitAfterHash,
|
|
4070
|
-
at: this.state.curPosition()
|
|
4071
|
-
});
|
|
4181
|
+
throw this.raise(Errors.UnexpectedDigitAfterHash, this.state.curPosition());
|
|
4072
4182
|
}
|
|
4073
4183
|
if (next === 123 || next === 91 && this.hasPlugin("recordAndTuple")) {
|
|
4074
4184
|
this.expectPlugin("recordAndTuple");
|
|
4075
4185
|
if (this.getPluginOption("recordAndTuple", "syntaxType") === "bar") {
|
|
4076
|
-
throw this.raise(next === 123 ? Errors.RecordExpressionHashIncorrectStartSyntaxType : Errors.TupleExpressionHashIncorrectStartSyntaxType,
|
|
4077
|
-
at: this.state.curPosition()
|
|
4078
|
-
});
|
|
4186
|
+
throw this.raise(next === 123 ? Errors.RecordExpressionHashIncorrectStartSyntaxType : Errors.TupleExpressionHashIncorrectStartSyntaxType, this.state.curPosition());
|
|
4079
4187
|
}
|
|
4080
4188
|
this.state.pos += 2;
|
|
4081
4189
|
if (next === 123) {
|
|
@@ -4162,9 +4270,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
4162
4270
|
}
|
|
4163
4271
|
if (this.hasPlugin("recordAndTuple") && next === 125) {
|
|
4164
4272
|
if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") {
|
|
4165
|
-
throw this.raise(Errors.RecordExpressionBarIncorrectEndSyntaxType,
|
|
4166
|
-
at: this.state.curPosition()
|
|
4167
|
-
});
|
|
4273
|
+
throw this.raise(Errors.RecordExpressionBarIncorrectEndSyntaxType, this.state.curPosition());
|
|
4168
4274
|
}
|
|
4169
4275
|
this.state.pos += 2;
|
|
4170
4276
|
this.finishToken(9);
|
|
@@ -4172,9 +4278,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
4172
4278
|
}
|
|
4173
4279
|
if (this.hasPlugin("recordAndTuple") && next === 93) {
|
|
4174
4280
|
if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") {
|
|
4175
|
-
throw this.raise(Errors.TupleExpressionBarIncorrectEndSyntaxType,
|
|
4176
|
-
at: this.state.curPosition()
|
|
4177
|
-
});
|
|
4281
|
+
throw this.raise(Errors.TupleExpressionBarIncorrectEndSyntaxType, this.state.curPosition());
|
|
4178
4282
|
}
|
|
4179
4283
|
this.state.pos += 2;
|
|
4180
4284
|
this.finishToken(4);
|
|
@@ -4320,9 +4424,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
4320
4424
|
case 91:
|
|
4321
4425
|
if (this.hasPlugin("recordAndTuple") && this.input.charCodeAt(this.state.pos + 1) === 124) {
|
|
4322
4426
|
if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") {
|
|
4323
|
-
throw this.raise(Errors.TupleExpressionBarIncorrectStartSyntaxType,
|
|
4324
|
-
at: this.state.curPosition()
|
|
4325
|
-
});
|
|
4427
|
+
throw this.raise(Errors.TupleExpressionBarIncorrectStartSyntaxType, this.state.curPosition());
|
|
4326
4428
|
}
|
|
4327
4429
|
this.state.pos += 2;
|
|
4328
4430
|
this.finishToken(2);
|
|
@@ -4338,9 +4440,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
4338
4440
|
case 123:
|
|
4339
4441
|
if (this.hasPlugin("recordAndTuple") && this.input.charCodeAt(this.state.pos + 1) === 124) {
|
|
4340
4442
|
if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") {
|
|
4341
|
-
throw this.raise(Errors.RecordExpressionBarIncorrectStartSyntaxType,
|
|
4342
|
-
at: this.state.curPosition()
|
|
4343
|
-
});
|
|
4443
|
+
throw this.raise(Errors.RecordExpressionBarIncorrectStartSyntaxType, this.state.curPosition());
|
|
4344
4444
|
}
|
|
4345
4445
|
this.state.pos += 2;
|
|
4346
4446
|
this.finishToken(6);
|
|
@@ -4443,8 +4543,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
4443
4543
|
return;
|
|
4444
4544
|
}
|
|
4445
4545
|
}
|
|
4446
|
-
throw this.raise(Errors.InvalidOrUnexpectedToken, {
|
|
4447
|
-
at: this.state.curPosition(),
|
|
4546
|
+
throw this.raise(Errors.InvalidOrUnexpectedToken, this.state.curPosition(), {
|
|
4448
4547
|
unexpected: String.fromCodePoint(code2)
|
|
4449
4548
|
});
|
|
4450
4549
|
}
|
|
@@ -4462,15 +4561,11 @@ var require_lib = __commonJS((exports) => {
|
|
|
4462
4561
|
} = this.state;
|
|
4463
4562
|
for (;; ++pos) {
|
|
4464
4563
|
if (pos >= this.length) {
|
|
4465
|
-
throw this.raise(Errors.UnterminatedRegExp,
|
|
4466
|
-
at: createPositionWithColumnOffset(startLoc, 1)
|
|
4467
|
-
});
|
|
4564
|
+
throw this.raise(Errors.UnterminatedRegExp, createPositionWithColumnOffset(startLoc, 1));
|
|
4468
4565
|
}
|
|
4469
4566
|
const ch = this.input.charCodeAt(pos);
|
|
4470
4567
|
if (isNewLine(ch)) {
|
|
4471
|
-
throw this.raise(Errors.UnterminatedRegExp,
|
|
4472
|
-
at: createPositionWithColumnOffset(startLoc, 1)
|
|
4473
|
-
});
|
|
4568
|
+
throw this.raise(Errors.UnterminatedRegExp, createPositionWithColumnOffset(startLoc, 1));
|
|
4474
4569
|
}
|
|
4475
4570
|
if (escaped) {
|
|
4476
4571
|
escaped = false;
|
|
@@ -4495,26 +4590,18 @@ var require_lib = __commonJS((exports) => {
|
|
|
4495
4590
|
if (VALID_REGEX_FLAGS.has(cp)) {
|
|
4496
4591
|
if (cp === 118) {
|
|
4497
4592
|
if (mods.includes("u")) {
|
|
4498
|
-
this.raise(Errors.IncompatibleRegExpUVFlags,
|
|
4499
|
-
at: nextPos()
|
|
4500
|
-
});
|
|
4593
|
+
this.raise(Errors.IncompatibleRegExpUVFlags, nextPos());
|
|
4501
4594
|
}
|
|
4502
4595
|
} else if (cp === 117) {
|
|
4503
4596
|
if (mods.includes("v")) {
|
|
4504
|
-
this.raise(Errors.IncompatibleRegExpUVFlags,
|
|
4505
|
-
at: nextPos()
|
|
4506
|
-
});
|
|
4597
|
+
this.raise(Errors.IncompatibleRegExpUVFlags, nextPos());
|
|
4507
4598
|
}
|
|
4508
4599
|
}
|
|
4509
4600
|
if (mods.includes(char)) {
|
|
4510
|
-
this.raise(Errors.DuplicateRegExpFlags,
|
|
4511
|
-
at: nextPos()
|
|
4512
|
-
});
|
|
4601
|
+
this.raise(Errors.DuplicateRegExpFlags, nextPos());
|
|
4513
4602
|
}
|
|
4514
4603
|
} else if (isIdentifierChar(cp) || cp === 92) {
|
|
4515
|
-
this.raise(Errors.MalformedRegExpFlags,
|
|
4516
|
-
at: nextPos()
|
|
4517
|
-
});
|
|
4604
|
+
this.raise(Errors.MalformedRegExpFlags, nextPos());
|
|
4518
4605
|
} else {
|
|
4519
4606
|
break;
|
|
4520
4607
|
}
|
|
@@ -4541,8 +4628,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
4541
4628
|
this.state.pos += 2;
|
|
4542
4629
|
const val = this.readInt(radix);
|
|
4543
4630
|
if (val == null) {
|
|
4544
|
-
this.raise(Errors.InvalidDigit, {
|
|
4545
|
-
at: createPositionWithColumnOffset(startLoc, 2),
|
|
4631
|
+
this.raise(Errors.InvalidDigit, createPositionWithColumnOffset(startLoc, 2), {
|
|
4546
4632
|
radix
|
|
4547
4633
|
});
|
|
4548
4634
|
}
|
|
@@ -4551,14 +4637,10 @@ var require_lib = __commonJS((exports) => {
|
|
|
4551
4637
|
++this.state.pos;
|
|
4552
4638
|
isBigInt = true;
|
|
4553
4639
|
} else if (next === 109) {
|
|
4554
|
-
throw this.raise(Errors.InvalidDecimal,
|
|
4555
|
-
at: startLoc
|
|
4556
|
-
});
|
|
4640
|
+
throw this.raise(Errors.InvalidDecimal, startLoc);
|
|
4557
4641
|
}
|
|
4558
4642
|
if (isIdentifierStart(this.codePointAtPos(this.state.pos))) {
|
|
4559
|
-
throw this.raise(Errors.NumberIdentifier,
|
|
4560
|
-
at: this.state.curPosition()
|
|
4561
|
-
});
|
|
4643
|
+
throw this.raise(Errors.NumberIdentifier, this.state.curPosition());
|
|
4562
4644
|
}
|
|
4563
4645
|
if (isBigInt) {
|
|
4564
4646
|
const str = this.input.slice(startLoc.index, this.state.pos).replace(/[_n]/g, "");
|
|
@@ -4576,22 +4658,16 @@ var require_lib = __commonJS((exports) => {
|
|
|
4576
4658
|
let hasExponent = false;
|
|
4577
4659
|
let isOctal = false;
|
|
4578
4660
|
if (!startsWithDot && this.readInt(10) === null) {
|
|
4579
|
-
this.raise(Errors.InvalidNumber,
|
|
4580
|
-
at: this.state.curPosition()
|
|
4581
|
-
});
|
|
4661
|
+
this.raise(Errors.InvalidNumber, this.state.curPosition());
|
|
4582
4662
|
}
|
|
4583
4663
|
const hasLeadingZero = this.state.pos - start >= 2 && this.input.charCodeAt(start) === 48;
|
|
4584
4664
|
if (hasLeadingZero) {
|
|
4585
4665
|
const integer = this.input.slice(start, this.state.pos);
|
|
4586
|
-
this.recordStrictModeErrors(Errors.StrictOctalLiteral,
|
|
4587
|
-
at: startLoc
|
|
4588
|
-
});
|
|
4666
|
+
this.recordStrictModeErrors(Errors.StrictOctalLiteral, startLoc);
|
|
4589
4667
|
if (!this.state.strict) {
|
|
4590
4668
|
const underscorePos = integer.indexOf("_");
|
|
4591
4669
|
if (underscorePos > 0) {
|
|
4592
|
-
this.raise(Errors.ZeroDigitNumericSeparator,
|
|
4593
|
-
at: createPositionWithColumnOffset(startLoc, underscorePos)
|
|
4594
|
-
});
|
|
4670
|
+
this.raise(Errors.ZeroDigitNumericSeparator, createPositionWithColumnOffset(startLoc, underscorePos));
|
|
4595
4671
|
}
|
|
4596
4672
|
}
|
|
4597
4673
|
isOctal = hasLeadingZero && !/[89]/.test(integer);
|
|
@@ -4609,9 +4685,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
4609
4685
|
++this.state.pos;
|
|
4610
4686
|
}
|
|
4611
4687
|
if (this.readInt(10) === null) {
|
|
4612
|
-
this.raise(Errors.InvalidOrMissingExponent,
|
|
4613
|
-
at: startLoc
|
|
4614
|
-
});
|
|
4688
|
+
this.raise(Errors.InvalidOrMissingExponent, startLoc);
|
|
4615
4689
|
}
|
|
4616
4690
|
isFloat = true;
|
|
4617
4691
|
hasExponent = true;
|
|
@@ -4619,9 +4693,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
4619
4693
|
}
|
|
4620
4694
|
if (next === 110) {
|
|
4621
4695
|
if (isFloat || hasLeadingZero) {
|
|
4622
|
-
this.raise(Errors.InvalidBigIntLiteral,
|
|
4623
|
-
at: startLoc
|
|
4624
|
-
});
|
|
4696
|
+
this.raise(Errors.InvalidBigIntLiteral, startLoc);
|
|
4625
4697
|
}
|
|
4626
4698
|
++this.state.pos;
|
|
4627
4699
|
isBigInt = true;
|
|
@@ -4629,17 +4701,13 @@ var require_lib = __commonJS((exports) => {
|
|
|
4629
4701
|
if (next === 109) {
|
|
4630
4702
|
this.expectPlugin("decimal", this.state.curPosition());
|
|
4631
4703
|
if (hasExponent || hasLeadingZero) {
|
|
4632
|
-
this.raise(Errors.InvalidDecimal,
|
|
4633
|
-
at: startLoc
|
|
4634
|
-
});
|
|
4704
|
+
this.raise(Errors.InvalidDecimal, startLoc);
|
|
4635
4705
|
}
|
|
4636
4706
|
++this.state.pos;
|
|
4637
4707
|
isDecimal = true;
|
|
4638
4708
|
}
|
|
4639
4709
|
if (isIdentifierStart(this.codePointAtPos(this.state.pos))) {
|
|
4640
|
-
throw this.raise(Errors.NumberIdentifier,
|
|
4641
|
-
at: this.state.curPosition()
|
|
4642
|
-
});
|
|
4710
|
+
throw this.raise(Errors.NumberIdentifier, this.state.curPosition());
|
|
4643
4711
|
}
|
|
4644
4712
|
const str = this.input.slice(start, this.state.pos).replace(/[_mn]/g, "");
|
|
4645
4713
|
if (isBigInt) {
|
|
@@ -4702,14 +4770,10 @@ var require_lib = __commonJS((exports) => {
|
|
|
4702
4770
|
this.finishToken(25, firstInvalidLoc ? null : opening + str + "${");
|
|
4703
4771
|
}
|
|
4704
4772
|
}
|
|
4705
|
-
recordStrictModeErrors(toParseError, {
|
|
4706
|
-
at
|
|
4707
|
-
}) {
|
|
4773
|
+
recordStrictModeErrors(toParseError, at) {
|
|
4708
4774
|
const index = at.index;
|
|
4709
4775
|
if (this.state.strict && !this.state.strictErrors.has(index)) {
|
|
4710
|
-
this.raise(toParseError,
|
|
4711
|
-
at
|
|
4712
|
-
});
|
|
4776
|
+
this.raise(toParseError, at);
|
|
4713
4777
|
} else {
|
|
4714
4778
|
this.state.strictErrors.set(index, [toParseError, at]);
|
|
4715
4779
|
}
|
|
@@ -4732,9 +4796,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
4732
4796
|
const escStart = this.state.curPosition();
|
|
4733
4797
|
const identifierCheck = this.state.pos === start ? isIdentifierStart : isIdentifierChar;
|
|
4734
4798
|
if (this.input.charCodeAt(++this.state.pos) !== 117) {
|
|
4735
|
-
this.raise(Errors.MissingUnicodeEscape,
|
|
4736
|
-
at: this.state.curPosition()
|
|
4737
|
-
});
|
|
4799
|
+
this.raise(Errors.MissingUnicodeEscape, this.state.curPosition());
|
|
4738
4800
|
chunkStart = this.state.pos - 1;
|
|
4739
4801
|
continue;
|
|
4740
4802
|
}
|
|
@@ -4742,9 +4804,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
4742
4804
|
const esc = this.readCodePoint(true);
|
|
4743
4805
|
if (esc !== null) {
|
|
4744
4806
|
if (!identifierCheck(esc)) {
|
|
4745
|
-
this.raise(Errors.EscapedCharNotAnIdentifier,
|
|
4746
|
-
at: escStart
|
|
4747
|
-
});
|
|
4807
|
+
this.raise(Errors.EscapedCharNotAnIdentifier, escStart);
|
|
4748
4808
|
}
|
|
4749
4809
|
word += String.fromCodePoint(esc);
|
|
4750
4810
|
}
|
|
@@ -4769,77 +4829,59 @@ var require_lib = __commonJS((exports) => {
|
|
|
4769
4829
|
type
|
|
4770
4830
|
} = this.state;
|
|
4771
4831
|
if (tokenIsKeyword(type) && this.state.containsEsc) {
|
|
4772
|
-
this.raise(Errors.InvalidEscapedReservedWord, {
|
|
4773
|
-
at: this.state.startLoc,
|
|
4832
|
+
this.raise(Errors.InvalidEscapedReservedWord, this.state.startLoc, {
|
|
4774
4833
|
reservedWord: tokenLabelName(type)
|
|
4775
4834
|
});
|
|
4776
4835
|
}
|
|
4777
4836
|
}
|
|
4778
|
-
raise(toParseError,
|
|
4779
|
-
const {
|
|
4780
|
-
at
|
|
4781
|
-
} = raiseProperties, details = _objectWithoutPropertiesLoose(raiseProperties, _excluded);
|
|
4837
|
+
raise(toParseError, at, details = {}) {
|
|
4782
4838
|
const loc = at instanceof Position ? at : at.loc.start;
|
|
4783
|
-
const error = toParseError(
|
|
4784
|
-
loc,
|
|
4785
|
-
details
|
|
4786
|
-
});
|
|
4839
|
+
const error = toParseError(loc, details);
|
|
4787
4840
|
if (!this.options.errorRecovery)
|
|
4788
4841
|
throw error;
|
|
4789
4842
|
if (!this.isLookahead)
|
|
4790
4843
|
this.state.errors.push(error);
|
|
4791
4844
|
return error;
|
|
4792
4845
|
}
|
|
4793
|
-
raiseOverwrite(toParseError,
|
|
4794
|
-
const {
|
|
4795
|
-
at
|
|
4796
|
-
} = raiseProperties, details = _objectWithoutPropertiesLoose(raiseProperties, _excluded2);
|
|
4846
|
+
raiseOverwrite(toParseError, at, details = {}) {
|
|
4797
4847
|
const loc = at instanceof Position ? at : at.loc.start;
|
|
4798
4848
|
const pos = loc.index;
|
|
4799
4849
|
const errors = this.state.errors;
|
|
4800
4850
|
for (let i = errors.length - 1;i >= 0; i--) {
|
|
4801
4851
|
const error = errors[i];
|
|
4802
4852
|
if (error.loc.index === pos) {
|
|
4803
|
-
return errors[i] = toParseError(
|
|
4804
|
-
loc,
|
|
4805
|
-
details
|
|
4806
|
-
});
|
|
4853
|
+
return errors[i] = toParseError(loc, details);
|
|
4807
4854
|
}
|
|
4808
4855
|
if (error.loc.index < pos)
|
|
4809
4856
|
break;
|
|
4810
4857
|
}
|
|
4811
|
-
return this.raise(toParseError,
|
|
4858
|
+
return this.raise(toParseError, at, details);
|
|
4812
4859
|
}
|
|
4813
4860
|
updateContext(prevType) {
|
|
4814
4861
|
}
|
|
4815
4862
|
unexpected(loc, type) {
|
|
4816
|
-
throw this.raise(Errors.UnexpectedToken, {
|
|
4817
|
-
expected: type ? tokenLabelName(type) : null
|
|
4818
|
-
at: loc != null ? loc : this.state.startLoc
|
|
4863
|
+
throw this.raise(Errors.UnexpectedToken, loc != null ? loc : this.state.startLoc, {
|
|
4864
|
+
expected: type ? tokenLabelName(type) : null
|
|
4819
4865
|
});
|
|
4820
4866
|
}
|
|
4821
4867
|
expectPlugin(pluginName, loc) {
|
|
4822
4868
|
if (this.hasPlugin(pluginName)) {
|
|
4823
4869
|
return true;
|
|
4824
4870
|
}
|
|
4825
|
-
throw this.raise(Errors.MissingPlugin, {
|
|
4826
|
-
at: loc != null ? loc : this.state.startLoc,
|
|
4871
|
+
throw this.raise(Errors.MissingPlugin, loc != null ? loc : this.state.startLoc, {
|
|
4827
4872
|
missingPlugin: [pluginName]
|
|
4828
4873
|
});
|
|
4829
4874
|
}
|
|
4830
4875
|
expectOnePlugin(pluginNames) {
|
|
4831
4876
|
if (!pluginNames.some((name) => this.hasPlugin(name))) {
|
|
4832
|
-
throw this.raise(Errors.MissingOneOfPlugins, {
|
|
4833
|
-
at: this.state.startLoc,
|
|
4877
|
+
throw this.raise(Errors.MissingOneOfPlugins, this.state.startLoc, {
|
|
4834
4878
|
missingPlugin: pluginNames
|
|
4835
4879
|
});
|
|
4836
4880
|
}
|
|
4837
4881
|
}
|
|
4838
4882
|
errorBuilder(error) {
|
|
4839
4883
|
return (pos, lineStart, curLine) => {
|
|
4840
|
-
this.raise(error,
|
|
4841
|
-
at: buildPosition(pos, lineStart, curLine)
|
|
4842
|
-
});
|
|
4884
|
+
this.raise(error, buildPosition(pos, lineStart, curLine));
|
|
4843
4885
|
};
|
|
4844
4886
|
}
|
|
4845
4887
|
}
|
|
@@ -4874,8 +4916,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
4874
4916
|
current.undefinedPrivateNames.set(name, loc);
|
|
4875
4917
|
}
|
|
4876
4918
|
} else {
|
|
4877
|
-
this.parser.raise(Errors.InvalidPrivateFieldResolution, {
|
|
4878
|
-
at: loc,
|
|
4919
|
+
this.parser.raise(Errors.InvalidPrivateFieldResolution, loc, {
|
|
4879
4920
|
identifierName: name
|
|
4880
4921
|
});
|
|
4881
4922
|
}
|
|
@@ -4903,8 +4944,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
4903
4944
|
}
|
|
4904
4945
|
}
|
|
4905
4946
|
if (redefined) {
|
|
4906
|
-
this.parser.raise(Errors.PrivateNameRedeclaration, {
|
|
4907
|
-
at: loc,
|
|
4947
|
+
this.parser.raise(Errors.PrivateNameRedeclaration, loc, {
|
|
4908
4948
|
identifierName: name
|
|
4909
4949
|
});
|
|
4910
4950
|
}
|
|
@@ -4920,8 +4960,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
4920
4960
|
if (classScope) {
|
|
4921
4961
|
classScope.undefinedPrivateNames.set(name, loc);
|
|
4922
4962
|
} else {
|
|
4923
|
-
this.parser.raise(Errors.InvalidPrivateFieldResolution, {
|
|
4924
|
-
at: loc,
|
|
4963
|
+
this.parser.raise(Errors.InvalidPrivateFieldResolution, loc, {
|
|
4925
4964
|
identifierName: name
|
|
4926
4965
|
});
|
|
4927
4966
|
}
|
|
@@ -4945,9 +4984,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
4945
4984
|
super(type);
|
|
4946
4985
|
this.declarationErrors = new Map;
|
|
4947
4986
|
}
|
|
4948
|
-
recordDeclarationError(ParsingErrorClass, {
|
|
4949
|
-
at
|
|
4950
|
-
}) {
|
|
4987
|
+
recordDeclarationError(ParsingErrorClass, at) {
|
|
4951
4988
|
const index = at.index;
|
|
4952
4989
|
this.declarationErrors.set(index, [ParsingErrorClass, at]);
|
|
4953
4990
|
}
|
|
@@ -4971,12 +5008,8 @@ var require_lib = __commonJS((exports) => {
|
|
|
4971
5008
|
exit() {
|
|
4972
5009
|
this.stack.pop();
|
|
4973
5010
|
}
|
|
4974
|
-
recordParameterInitializerError(toParseError, {
|
|
4975
|
-
|
|
4976
|
-
}) {
|
|
4977
|
-
const origin = {
|
|
4978
|
-
at: node.loc.start
|
|
4979
|
-
};
|
|
5011
|
+
recordParameterInitializerError(toParseError, node) {
|
|
5012
|
+
const origin = node.loc.start;
|
|
4980
5013
|
const {
|
|
4981
5014
|
stack
|
|
4982
5015
|
} = this;
|
|
@@ -4992,16 +5025,12 @@ var require_lib = __commonJS((exports) => {
|
|
|
4992
5025
|
}
|
|
4993
5026
|
this.parser.raise(toParseError, origin);
|
|
4994
5027
|
}
|
|
4995
|
-
recordArrowParameterBindingError(error, {
|
|
4996
|
-
at: node
|
|
4997
|
-
}) {
|
|
5028
|
+
recordArrowParameterBindingError(error, node) {
|
|
4998
5029
|
const {
|
|
4999
5030
|
stack
|
|
5000
5031
|
} = this;
|
|
5001
5032
|
const scope = stack[stack.length - 1];
|
|
5002
|
-
const origin =
|
|
5003
|
-
at: node.loc.start
|
|
5004
|
-
};
|
|
5033
|
+
const origin = node.loc.start;
|
|
5005
5034
|
if (scope.isCertainlyParameterDeclaration()) {
|
|
5006
5035
|
this.parser.raise(error, origin);
|
|
5007
5036
|
} else if (scope.canBeArrowParameterDeclaration()) {
|
|
@@ -5010,9 +5039,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
5010
5039
|
return;
|
|
5011
5040
|
}
|
|
5012
5041
|
}
|
|
5013
|
-
recordAsyncArrowParametersError({
|
|
5014
|
-
at
|
|
5015
|
-
}) {
|
|
5042
|
+
recordAsyncArrowParametersError(at) {
|
|
5016
5043
|
const {
|
|
5017
5044
|
stack
|
|
5018
5045
|
} = this;
|
|
@@ -5020,9 +5047,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
5020
5047
|
let scope = stack[i];
|
|
5021
5048
|
while (scope.canBeArrowParameterDeclaration()) {
|
|
5022
5049
|
if (scope.type === 2) {
|
|
5023
|
-
scope.recordDeclarationError(Errors.AwaitBindingIdentifier,
|
|
5024
|
-
at
|
|
5025
|
-
});
|
|
5050
|
+
scope.recordDeclarationError(Errors.AwaitBindingIdentifier, at);
|
|
5026
5051
|
}
|
|
5027
5052
|
scope = stack[--i];
|
|
5028
5053
|
}
|
|
@@ -5035,9 +5060,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
5035
5060
|
if (!currentScope.canBeArrowParameterDeclaration())
|
|
5036
5061
|
return;
|
|
5037
5062
|
currentScope.iterateErrors(([toParseError, loc]) => {
|
|
5038
|
-
this.parser.raise(toParseError,
|
|
5039
|
-
at: loc
|
|
5040
|
-
});
|
|
5063
|
+
this.parser.raise(toParseError, loc);
|
|
5041
5064
|
let i = stack.length - 2;
|
|
5042
5065
|
let scope = stack[i];
|
|
5043
5066
|
while (scope.canBeArrowParameterDeclaration()) {
|
|
@@ -5114,9 +5137,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
5114
5137
|
expectContextual(token, toParseError) {
|
|
5115
5138
|
if (!this.eatContextual(token)) {
|
|
5116
5139
|
if (toParseError != null) {
|
|
5117
|
-
throw this.raise(toParseError,
|
|
5118
|
-
at: this.state.startLoc
|
|
5119
|
-
});
|
|
5140
|
+
throw this.raise(toParseError, this.state.startLoc);
|
|
5120
5141
|
}
|
|
5121
5142
|
this.unexpected(null, token);
|
|
5122
5143
|
}
|
|
@@ -5137,9 +5158,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
5137
5158
|
semicolon(allowAsi = true) {
|
|
5138
5159
|
if (allowAsi ? this.isLineTerminator() : this.eat(13))
|
|
5139
5160
|
return;
|
|
5140
|
-
this.raise(Errors.MissingSemicolon,
|
|
5141
|
-
at: this.state.lastTokEndLoc
|
|
5142
|
-
});
|
|
5161
|
+
this.raise(Errors.MissingSemicolon, this.state.lastTokEndLoc);
|
|
5143
5162
|
}
|
|
5144
5163
|
expect(type, loc) {
|
|
5145
5164
|
this.eat(type) || this.unexpected(loc, type);
|
|
@@ -5210,19 +5229,13 @@ var require_lib = __commonJS((exports) => {
|
|
|
5210
5229
|
return hasErrors;
|
|
5211
5230
|
}
|
|
5212
5231
|
if (shorthandAssignLoc != null) {
|
|
5213
|
-
this.raise(Errors.InvalidCoverInitializedName,
|
|
5214
|
-
at: shorthandAssignLoc
|
|
5215
|
-
});
|
|
5232
|
+
this.raise(Errors.InvalidCoverInitializedName, shorthandAssignLoc);
|
|
5216
5233
|
}
|
|
5217
5234
|
if (doubleProtoLoc != null) {
|
|
5218
|
-
this.raise(Errors.DuplicateProto,
|
|
5219
|
-
at: doubleProtoLoc
|
|
5220
|
-
});
|
|
5235
|
+
this.raise(Errors.DuplicateProto, doubleProtoLoc);
|
|
5221
5236
|
}
|
|
5222
5237
|
if (privateKeyLoc != null) {
|
|
5223
|
-
this.raise(Errors.UnexpectedPrivateField,
|
|
5224
|
-
at: privateKeyLoc
|
|
5225
|
-
});
|
|
5238
|
+
this.raise(Errors.UnexpectedPrivateField, privateKeyLoc);
|
|
5226
5239
|
}
|
|
5227
5240
|
if (optionalParametersLoc != null) {
|
|
5228
5241
|
this.unexpected(optionalParametersLoc);
|
|
@@ -5328,7 +5341,8 @@ var require_lib = __commonJS((exports) => {
|
|
|
5328
5341
|
|
|
5329
5342
|
class NodeUtils extends UtilParser {
|
|
5330
5343
|
startNode() {
|
|
5331
|
-
|
|
5344
|
+
const loc = this.state.startLoc;
|
|
5345
|
+
return new Node(this, loc.index, loc);
|
|
5332
5346
|
}
|
|
5333
5347
|
startNodeAt(loc) {
|
|
5334
5348
|
return new Node(this, loc.index, loc);
|
|
@@ -5516,10 +5530,8 @@ var require_lib = __commonJS((exports) => {
|
|
|
5516
5530
|
const moduloLoc = this.state.startLoc;
|
|
5517
5531
|
this.next();
|
|
5518
5532
|
this.expectContextual(110);
|
|
5519
|
-
if (this.state.
|
|
5520
|
-
this.raise(FlowErrors.UnexpectedSpaceBetweenModuloChecks,
|
|
5521
|
-
at: moduloLoc
|
|
5522
|
-
});
|
|
5533
|
+
if (this.state.lastTokStartLoc.index > moduloLoc.index + 1) {
|
|
5534
|
+
this.raise(FlowErrors.UnexpectedSpaceBetweenModuloChecks, moduloLoc);
|
|
5523
5535
|
}
|
|
5524
5536
|
if (this.eat(10)) {
|
|
5525
5537
|
node.value = super.parseExpression();
|
|
@@ -5588,9 +5600,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
5588
5600
|
return this.flowParseDeclareModuleExports(node);
|
|
5589
5601
|
} else {
|
|
5590
5602
|
if (insideModule) {
|
|
5591
|
-
this.raise(FlowErrors.NestedDeclareModule,
|
|
5592
|
-
at: this.state.lastTokStartLoc
|
|
5593
|
-
});
|
|
5603
|
+
this.raise(FlowErrors.NestedDeclareModule, this.state.lastTokStartLoc);
|
|
5594
5604
|
}
|
|
5595
5605
|
return this.flowParseDeclareModule(node);
|
|
5596
5606
|
}
|
|
@@ -5628,9 +5638,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
5628
5638
|
if (this.match(83)) {
|
|
5629
5639
|
this.next();
|
|
5630
5640
|
if (!this.isContextual(130) && !this.match(87)) {
|
|
5631
|
-
this.raise(FlowErrors.InvalidNonTypeImportInDeclareModule,
|
|
5632
|
-
at: this.state.lastTokStartLoc
|
|
5633
|
-
});
|
|
5641
|
+
this.raise(FlowErrors.InvalidNonTypeImportInDeclareModule, this.state.lastTokStartLoc);
|
|
5634
5642
|
}
|
|
5635
5643
|
super.parseImport(bodyNode2);
|
|
5636
5644
|
} else {
|
|
@@ -5647,21 +5655,15 @@ var require_lib = __commonJS((exports) => {
|
|
|
5647
5655
|
body.forEach((bodyElement) => {
|
|
5648
5656
|
if (isEsModuleType(bodyElement)) {
|
|
5649
5657
|
if (kind === "CommonJS") {
|
|
5650
|
-
this.raise(FlowErrors.AmbiguousDeclareModuleKind,
|
|
5651
|
-
at: bodyElement
|
|
5652
|
-
});
|
|
5658
|
+
this.raise(FlowErrors.AmbiguousDeclareModuleKind, bodyElement);
|
|
5653
5659
|
}
|
|
5654
5660
|
kind = "ES";
|
|
5655
5661
|
} else if (bodyElement.type === "DeclareModuleExports") {
|
|
5656
5662
|
if (hasModuleExport) {
|
|
5657
|
-
this.raise(FlowErrors.DuplicateDeclareModuleExports,
|
|
5658
|
-
at: bodyElement
|
|
5659
|
-
});
|
|
5663
|
+
this.raise(FlowErrors.DuplicateDeclareModuleExports, bodyElement);
|
|
5660
5664
|
}
|
|
5661
5665
|
if (kind === "ES") {
|
|
5662
|
-
this.raise(FlowErrors.AmbiguousDeclareModuleKind,
|
|
5663
|
-
at: bodyElement
|
|
5664
|
-
});
|
|
5666
|
+
this.raise(FlowErrors.AmbiguousDeclareModuleKind, bodyElement);
|
|
5665
5667
|
}
|
|
5666
5668
|
kind = "CommonJS";
|
|
5667
5669
|
hasModuleExport = true;
|
|
@@ -5684,8 +5686,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
5684
5686
|
} else {
|
|
5685
5687
|
if (this.match(75) || this.isLet() || (this.isContextual(130) || this.isContextual(129)) && !insideModule) {
|
|
5686
5688
|
const label = this.state.value;
|
|
5687
|
-
throw this.raise(FlowErrors.UnsupportedDeclareExportKind, {
|
|
5688
|
-
at: this.state.startLoc,
|
|
5689
|
+
throw this.raise(FlowErrors.UnsupportedDeclareExportKind, this.state.startLoc, {
|
|
5689
5690
|
unsupportedExportKind: label,
|
|
5690
5691
|
suggestion: exportSuggestions[label]
|
|
5691
5692
|
});
|
|
@@ -5783,16 +5784,13 @@ var require_lib = __commonJS((exports) => {
|
|
|
5783
5784
|
}
|
|
5784
5785
|
checkNotUnderscore(word) {
|
|
5785
5786
|
if (word === "_") {
|
|
5786
|
-
this.raise(FlowErrors.UnexpectedReservedUnderscore,
|
|
5787
|
-
at: this.state.startLoc
|
|
5788
|
-
});
|
|
5787
|
+
this.raise(FlowErrors.UnexpectedReservedUnderscore, this.state.startLoc);
|
|
5789
5788
|
}
|
|
5790
5789
|
}
|
|
5791
5790
|
checkReservedType(word, startLoc, declaration) {
|
|
5792
5791
|
if (!reservedTypes.has(word))
|
|
5793
5792
|
return;
|
|
5794
|
-
this.raise(declaration ? FlowErrors.AssignReservedType : FlowErrors.UnexpectedReservedType, {
|
|
5795
|
-
at: startLoc,
|
|
5793
|
+
this.raise(declaration ? FlowErrors.AssignReservedType : FlowErrors.UnexpectedReservedType, startLoc, {
|
|
5796
5794
|
reservedType: word
|
|
5797
5795
|
});
|
|
5798
5796
|
}
|
|
@@ -5845,9 +5843,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
5845
5843
|
node.default = this.flowParseType();
|
|
5846
5844
|
} else {
|
|
5847
5845
|
if (requireDefault) {
|
|
5848
|
-
this.raise(FlowErrors.MissingTypeParamDefault,
|
|
5849
|
-
at: nodeStartLoc
|
|
5850
|
-
});
|
|
5846
|
+
this.raise(FlowErrors.MissingTypeParamDefault, nodeStartLoc);
|
|
5851
5847
|
}
|
|
5852
5848
|
}
|
|
5853
5849
|
return this.finishNode(node, "TypeParameter");
|
|
@@ -6087,9 +6083,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
6087
6083
|
}
|
|
6088
6084
|
this.flowObjectTypeSemicolon();
|
|
6089
6085
|
if (inexactStartLoc && !this.match(8) && !this.match(9)) {
|
|
6090
|
-
this.raise(FlowErrors.UnexpectedExplicitInexactInObject,
|
|
6091
|
-
at: inexactStartLoc
|
|
6092
|
-
});
|
|
6086
|
+
this.raise(FlowErrors.UnexpectedExplicitInexactInObject, inexactStartLoc);
|
|
6093
6087
|
}
|
|
6094
6088
|
}
|
|
6095
6089
|
this.expect(endDelim);
|
|
@@ -6105,33 +6099,23 @@ var require_lib = __commonJS((exports) => {
|
|
|
6105
6099
|
const isInexactToken = this.match(12) || this.match(13) || this.match(8) || this.match(9);
|
|
6106
6100
|
if (isInexactToken) {
|
|
6107
6101
|
if (!allowSpread) {
|
|
6108
|
-
this.raise(FlowErrors.InexactInsideNonObject,
|
|
6109
|
-
at: this.state.lastTokStartLoc
|
|
6110
|
-
});
|
|
6102
|
+
this.raise(FlowErrors.InexactInsideNonObject, this.state.lastTokStartLoc);
|
|
6111
6103
|
} else if (!allowInexact) {
|
|
6112
|
-
this.raise(FlowErrors.InexactInsideExact,
|
|
6113
|
-
at: this.state.lastTokStartLoc
|
|
6114
|
-
});
|
|
6104
|
+
this.raise(FlowErrors.InexactInsideExact, this.state.lastTokStartLoc);
|
|
6115
6105
|
}
|
|
6116
6106
|
if (variance) {
|
|
6117
|
-
this.raise(FlowErrors.InexactVariance,
|
|
6118
|
-
at: variance
|
|
6119
|
-
});
|
|
6107
|
+
this.raise(FlowErrors.InexactVariance, variance);
|
|
6120
6108
|
}
|
|
6121
6109
|
return null;
|
|
6122
6110
|
}
|
|
6123
6111
|
if (!allowSpread) {
|
|
6124
|
-
this.raise(FlowErrors.UnexpectedSpreadType,
|
|
6125
|
-
at: this.state.lastTokStartLoc
|
|
6126
|
-
});
|
|
6112
|
+
this.raise(FlowErrors.UnexpectedSpreadType, this.state.lastTokStartLoc);
|
|
6127
6113
|
}
|
|
6128
6114
|
if (protoStartLoc != null) {
|
|
6129
6115
|
this.unexpected(protoStartLoc);
|
|
6130
6116
|
}
|
|
6131
6117
|
if (variance) {
|
|
6132
|
-
this.raise(FlowErrors.SpreadVariance,
|
|
6133
|
-
at: variance
|
|
6134
|
-
});
|
|
6118
|
+
this.raise(FlowErrors.SpreadVariance, variance);
|
|
6135
6119
|
}
|
|
6136
6120
|
node.argument = this.flowParseType();
|
|
6137
6121
|
return this.finishNode(node, "ObjectTypeSpreadProperty");
|
|
@@ -6154,9 +6138,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
6154
6138
|
this.flowCheckGetterSetterParams(node);
|
|
6155
6139
|
}
|
|
6156
6140
|
if (!allowSpread && node.key.name === "constructor" && node.value.this) {
|
|
6157
|
-
this.raise(FlowErrors.ThisParamBannedInConstructor,
|
|
6158
|
-
at: node.value.this
|
|
6159
|
-
});
|
|
6141
|
+
this.raise(FlowErrors.ThisParamBannedInConstructor, node.value.this);
|
|
6160
6142
|
}
|
|
6161
6143
|
} else {
|
|
6162
6144
|
if (kind !== "init")
|
|
@@ -6176,19 +6158,13 @@ var require_lib = __commonJS((exports) => {
|
|
|
6176
6158
|
const paramCount = property.kind === "get" ? 0 : 1;
|
|
6177
6159
|
const length = property.value.params.length + (property.value.rest ? 1 : 0);
|
|
6178
6160
|
if (property.value.this) {
|
|
6179
|
-
this.raise(property.kind === "get" ? FlowErrors.GetterMayNotHaveThisParam : FlowErrors.SetterMayNotHaveThisParam,
|
|
6180
|
-
at: property.value.this
|
|
6181
|
-
});
|
|
6161
|
+
this.raise(property.kind === "get" ? FlowErrors.GetterMayNotHaveThisParam : FlowErrors.SetterMayNotHaveThisParam, property.value.this);
|
|
6182
6162
|
}
|
|
6183
6163
|
if (length !== paramCount) {
|
|
6184
|
-
this.raise(property.kind === "get" ? Errors.BadGetterArity : Errors.BadSetterArity,
|
|
6185
|
-
at: property
|
|
6186
|
-
});
|
|
6164
|
+
this.raise(property.kind === "get" ? Errors.BadGetterArity : Errors.BadSetterArity, property);
|
|
6187
6165
|
}
|
|
6188
6166
|
if (property.kind === "set" && property.value.rest) {
|
|
6189
|
-
this.raise(Errors.BadSetterRestParameter,
|
|
6190
|
-
at: property
|
|
6191
|
-
});
|
|
6167
|
+
this.raise(Errors.BadSetterRestParameter, property);
|
|
6192
6168
|
}
|
|
6193
6169
|
}
|
|
6194
6170
|
flowObjectTypeSemicolon() {
|
|
@@ -6245,17 +6221,13 @@ var require_lib = __commonJS((exports) => {
|
|
|
6245
6221
|
const isThis = this.state.type === 78;
|
|
6246
6222
|
if (lh.type === 14 || lh.type === 17) {
|
|
6247
6223
|
if (isThis && !first) {
|
|
6248
|
-
this.raise(FlowErrors.ThisParamMustBeFirst,
|
|
6249
|
-
at: node
|
|
6250
|
-
});
|
|
6224
|
+
this.raise(FlowErrors.ThisParamMustBeFirst, node);
|
|
6251
6225
|
}
|
|
6252
6226
|
name = this.parseIdentifier(isThis);
|
|
6253
6227
|
if (this.eat(17)) {
|
|
6254
6228
|
optional = true;
|
|
6255
6229
|
if (isThis) {
|
|
6256
|
-
this.raise(FlowErrors.ThisParamMayNotBeOptional,
|
|
6257
|
-
at: node
|
|
6258
|
-
});
|
|
6230
|
+
this.raise(FlowErrors.ThisParamMayNotBeOptional, node);
|
|
6259
6231
|
}
|
|
6260
6232
|
}
|
|
6261
6233
|
typeAnnotation = this.flowParseTypeInitialiser();
|
|
@@ -6411,9 +6383,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
6411
6383
|
if (this.match(135)) {
|
|
6412
6384
|
return this.parseLiteralAtNode(-this.state.value, "BigIntLiteralTypeAnnotation", node);
|
|
6413
6385
|
}
|
|
6414
|
-
throw this.raise(FlowErrors.UnexpectedSubtractionOperand,
|
|
6415
|
-
at: this.state.startLoc
|
|
6416
|
-
});
|
|
6386
|
+
throw this.raise(FlowErrors.UnexpectedSubtractionOperand, this.state.startLoc);
|
|
6417
6387
|
}
|
|
6418
6388
|
this.unexpected();
|
|
6419
6389
|
return;
|
|
@@ -6678,9 +6648,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
6678
6648
|
[valid, invalid] = this.getArrowLikeExpressions(consequent);
|
|
6679
6649
|
}
|
|
6680
6650
|
if (failed && valid.length > 1) {
|
|
6681
|
-
this.raise(FlowErrors.AmbiguousConditionalArrow,
|
|
6682
|
-
at: state.startLoc
|
|
6683
|
-
});
|
|
6651
|
+
this.raise(FlowErrors.AmbiguousConditionalArrow, state.startLoc);
|
|
6684
6652
|
}
|
|
6685
6653
|
if (failed && valid.length === 1) {
|
|
6686
6654
|
this.state = state;
|
|
@@ -6842,13 +6810,9 @@ var require_lib = __commonJS((exports) => {
|
|
|
6842
6810
|
super.parseClassMember(classBody, member, state);
|
|
6843
6811
|
if (member.declare) {
|
|
6844
6812
|
if (member.type !== "ClassProperty" && member.type !== "ClassPrivateProperty" && member.type !== "PropertyDefinition") {
|
|
6845
|
-
this.raise(FlowErrors.DeclareClassElement,
|
|
6846
|
-
at: startLoc
|
|
6847
|
-
});
|
|
6813
|
+
this.raise(FlowErrors.DeclareClassElement, startLoc);
|
|
6848
6814
|
} else if (member.value) {
|
|
6849
|
-
this.raise(FlowErrors.DeclareClassFieldInitializer,
|
|
6850
|
-
at: member.value
|
|
6851
|
-
});
|
|
6815
|
+
this.raise(FlowErrors.DeclareClassFieldInitializer, member.value);
|
|
6852
6816
|
}
|
|
6853
6817
|
}
|
|
6854
6818
|
}
|
|
@@ -6859,8 +6823,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
6859
6823
|
const word = super.readWord1();
|
|
6860
6824
|
const fullWord = "@@" + word;
|
|
6861
6825
|
if (!this.isIterator(word) || !this.state.inType) {
|
|
6862
|
-
this.raise(Errors.InvalidIdentifier, {
|
|
6863
|
-
at: this.state.curPosition(),
|
|
6826
|
+
this.raise(Errors.InvalidIdentifier, this.state.curPosition(), {
|
|
6864
6827
|
identifierName: fullWord
|
|
6865
6828
|
});
|
|
6866
6829
|
}
|
|
@@ -6912,9 +6875,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
6912
6875
|
var _expr$extra;
|
|
6913
6876
|
const expr = exprList[i];
|
|
6914
6877
|
if (expr && expr.type === "TypeCastExpression" && !((_expr$extra = expr.extra) != null && _expr$extra.parenthesized) && (exprList.length > 1 || !isParenthesizedExpr)) {
|
|
6915
|
-
this.raise(FlowErrors.TypeCastInPattern,
|
|
6916
|
-
at: expr.typeAnnotation
|
|
6917
|
-
});
|
|
6878
|
+
this.raise(FlowErrors.TypeCastInPattern, expr.typeAnnotation);
|
|
6918
6879
|
}
|
|
6919
6880
|
}
|
|
6920
6881
|
return exprList;
|
|
@@ -6962,16 +6923,12 @@ var require_lib = __commonJS((exports) => {
|
|
|
6962
6923
|
if (method.params && isConstructor) {
|
|
6963
6924
|
const params = method.params;
|
|
6964
6925
|
if (params.length > 0 && this.isThisParam(params[0])) {
|
|
6965
|
-
this.raise(FlowErrors.ThisParamBannedInConstructor,
|
|
6966
|
-
at: method
|
|
6967
|
-
});
|
|
6926
|
+
this.raise(FlowErrors.ThisParamBannedInConstructor, method);
|
|
6968
6927
|
}
|
|
6969
6928
|
} else if (method.type === "MethodDefinition" && isConstructor && method.value.params) {
|
|
6970
6929
|
const params = method.value.params;
|
|
6971
6930
|
if (params.length > 0 && this.isThisParam(params[0])) {
|
|
6972
|
-
this.raise(FlowErrors.ThisParamBannedInConstructor,
|
|
6973
|
-
at: method
|
|
6974
|
-
});
|
|
6931
|
+
this.raise(FlowErrors.ThisParamBannedInConstructor, method);
|
|
6975
6932
|
}
|
|
6976
6933
|
}
|
|
6977
6934
|
}
|
|
@@ -7011,13 +6968,9 @@ var require_lib = __commonJS((exports) => {
|
|
|
7011
6968
|
if (params.length > 0) {
|
|
7012
6969
|
const param = params[0];
|
|
7013
6970
|
if (this.isThisParam(param) && method.kind === "get") {
|
|
7014
|
-
this.raise(FlowErrors.GetterMayNotHaveThisParam,
|
|
7015
|
-
at: param
|
|
7016
|
-
});
|
|
6971
|
+
this.raise(FlowErrors.GetterMayNotHaveThisParam, param);
|
|
7017
6972
|
} else if (this.isThisParam(param)) {
|
|
7018
|
-
this.raise(FlowErrors.SetterMayNotHaveThisParam,
|
|
7019
|
-
at: param
|
|
7020
|
-
});
|
|
6973
|
+
this.raise(FlowErrors.SetterMayNotHaveThisParam, param);
|
|
7021
6974
|
}
|
|
7022
6975
|
}
|
|
7023
6976
|
}
|
|
@@ -7044,28 +6997,20 @@ var require_lib = __commonJS((exports) => {
|
|
|
7044
6997
|
parseAssignableListItemTypes(param) {
|
|
7045
6998
|
if (this.eat(17)) {
|
|
7046
6999
|
if (param.type !== "Identifier") {
|
|
7047
|
-
this.raise(FlowErrors.PatternIsOptional,
|
|
7048
|
-
at: param
|
|
7049
|
-
});
|
|
7000
|
+
this.raise(FlowErrors.PatternIsOptional, param);
|
|
7050
7001
|
}
|
|
7051
7002
|
if (this.isThisParam(param)) {
|
|
7052
|
-
this.raise(FlowErrors.ThisParamMayNotBeOptional,
|
|
7053
|
-
at: param
|
|
7054
|
-
});
|
|
7003
|
+
this.raise(FlowErrors.ThisParamMayNotBeOptional, param);
|
|
7055
7004
|
}
|
|
7056
7005
|
param.optional = true;
|
|
7057
7006
|
}
|
|
7058
7007
|
if (this.match(14)) {
|
|
7059
7008
|
param.typeAnnotation = this.flowParseTypeAnnotation();
|
|
7060
7009
|
} else if (this.isThisParam(param)) {
|
|
7061
|
-
this.raise(FlowErrors.ThisParamAnnotationRequired,
|
|
7062
|
-
at: param
|
|
7063
|
-
});
|
|
7010
|
+
this.raise(FlowErrors.ThisParamAnnotationRequired, param);
|
|
7064
7011
|
}
|
|
7065
7012
|
if (this.match(29) && this.isThisParam(param)) {
|
|
7066
|
-
this.raise(FlowErrors.ThisParamNoDefault,
|
|
7067
|
-
at: param
|
|
7068
|
-
});
|
|
7013
|
+
this.raise(FlowErrors.ThisParamNoDefault, param);
|
|
7069
7014
|
}
|
|
7070
7015
|
this.resetEndLocation(param);
|
|
7071
7016
|
return param;
|
|
@@ -7073,18 +7018,14 @@ var require_lib = __commonJS((exports) => {
|
|
|
7073
7018
|
parseMaybeDefault(startLoc, left) {
|
|
7074
7019
|
const node = super.parseMaybeDefault(startLoc, left);
|
|
7075
7020
|
if (node.type === "AssignmentPattern" && node.typeAnnotation && node.right.start < node.typeAnnotation.start) {
|
|
7076
|
-
this.raise(FlowErrors.TypeBeforeInitializer,
|
|
7077
|
-
at: node.typeAnnotation
|
|
7078
|
-
});
|
|
7021
|
+
this.raise(FlowErrors.TypeBeforeInitializer, node.typeAnnotation);
|
|
7079
7022
|
}
|
|
7080
7023
|
return node;
|
|
7081
7024
|
}
|
|
7082
7025
|
checkImportReflection(node) {
|
|
7083
7026
|
super.checkImportReflection(node);
|
|
7084
7027
|
if (node.module && node.importKind !== "value") {
|
|
7085
|
-
this.raise(FlowErrors.ImportReflectionHasImportType,
|
|
7086
|
-
at: node.specifiers[0].loc.start
|
|
7087
|
-
});
|
|
7028
|
+
this.raise(FlowErrors.ImportReflectionHasImportType, node.specifiers[0].loc.start);
|
|
7088
7029
|
}
|
|
7089
7030
|
}
|
|
7090
7031
|
parseImportSpecifierLocal(node, specifier, type) {
|
|
@@ -7143,8 +7084,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
7143
7084
|
specifier.importKind = specifierTypeKind;
|
|
7144
7085
|
} else {
|
|
7145
7086
|
if (importedIsString) {
|
|
7146
|
-
throw this.raise(Errors.ImportBindingIsString, {
|
|
7147
|
-
at: specifier,
|
|
7087
|
+
throw this.raise(Errors.ImportBindingIsString, specifier, {
|
|
7148
7088
|
importName: firstIdent.value
|
|
7149
7089
|
});
|
|
7150
7090
|
}
|
|
@@ -7160,9 +7100,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
7160
7100
|
}
|
|
7161
7101
|
const specifierIsTypeImport = hasTypeImportKind(specifier);
|
|
7162
7102
|
if (isInTypeOnlyImport && specifierIsTypeImport) {
|
|
7163
|
-
this.raise(FlowErrors.ImportTypeShorthandOnlyInPureImport,
|
|
7164
|
-
at: specifier
|
|
7165
|
-
});
|
|
7103
|
+
this.raise(FlowErrors.ImportTypeShorthandOnlyInPureImport, specifier);
|
|
7166
7104
|
}
|
|
7167
7105
|
if (isInTypeOnlyImport || specifierIsTypeImport) {
|
|
7168
7106
|
this.checkReservedType(specifier.local.name, specifier.local.loc.start, true);
|
|
@@ -7248,9 +7186,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
7248
7186
|
if (arrow.node && this.maybeUnwrapTypeCastExpression(arrow.node).type === "ArrowFunctionExpression") {
|
|
7249
7187
|
if (!arrow.error && !arrow.aborted) {
|
|
7250
7188
|
if (arrow.node.async) {
|
|
7251
|
-
this.raise(FlowErrors.UnexpectedTypeParameterBeforeAsyncArrowFunction,
|
|
7252
|
-
at: typeParameters
|
|
7253
|
-
});
|
|
7189
|
+
this.raise(FlowErrors.UnexpectedTypeParameterBeforeAsyncArrowFunction, typeParameters);
|
|
7254
7190
|
}
|
|
7255
7191
|
return arrow.node;
|
|
7256
7192
|
}
|
|
@@ -7268,9 +7204,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
7268
7204
|
throw jsx2.error;
|
|
7269
7205
|
if (arrow.thrown)
|
|
7270
7206
|
throw arrow.error;
|
|
7271
|
-
throw this.raise(FlowErrors.UnexpectedTokenAfterTypeParameter,
|
|
7272
|
-
at: typeParameters
|
|
7273
|
-
});
|
|
7207
|
+
throw this.raise(FlowErrors.UnexpectedTokenAfterTypeParameter, typeParameters);
|
|
7274
7208
|
}
|
|
7275
7209
|
return super.parseMaybeAssign(refExpressionErrors, afterLeftParse);
|
|
7276
7210
|
}
|
|
@@ -7312,9 +7246,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
7312
7246
|
}
|
|
7313
7247
|
for (let i = 0;i < node.params.length; i++) {
|
|
7314
7248
|
if (this.isThisParam(node.params[i]) && i > 0) {
|
|
7315
|
-
this.raise(FlowErrors.ThisParamMustBeFirst,
|
|
7316
|
-
at: node.params[i]
|
|
7317
|
-
});
|
|
7249
|
+
this.raise(FlowErrors.ThisParamMustBeFirst, node.params[i]);
|
|
7318
7250
|
}
|
|
7319
7251
|
}
|
|
7320
7252
|
super.checkParams(node, allowDuplicates, isArrowFunction, strictModeChanged);
|
|
@@ -7420,18 +7352,14 @@ var require_lib = __commonJS((exports) => {
|
|
|
7420
7352
|
parseTopLevel(file, program) {
|
|
7421
7353
|
const fileNode = super.parseTopLevel(file, program);
|
|
7422
7354
|
if (this.state.hasFlowComment) {
|
|
7423
|
-
this.raise(FlowErrors.UnterminatedFlowComment,
|
|
7424
|
-
at: this.state.curPosition()
|
|
7425
|
-
});
|
|
7355
|
+
this.raise(FlowErrors.UnterminatedFlowComment, this.state.curPosition());
|
|
7426
7356
|
}
|
|
7427
7357
|
return fileNode;
|
|
7428
7358
|
}
|
|
7429
7359
|
skipBlockComment() {
|
|
7430
7360
|
if (this.hasPlugin("flowComments") && this.skipFlowComment()) {
|
|
7431
7361
|
if (this.state.hasFlowComment) {
|
|
7432
|
-
throw this.raise(FlowErrors.NestedFlowComment,
|
|
7433
|
-
at: this.state.startLoc
|
|
7434
|
-
});
|
|
7362
|
+
throw this.raise(FlowErrors.NestedFlowComment, this.state.startLoc);
|
|
7435
7363
|
}
|
|
7436
7364
|
this.hasFlowCommentCompletion();
|
|
7437
7365
|
const commentSkip = this.skipFlowComment();
|
|
@@ -7467,43 +7395,26 @@ var require_lib = __commonJS((exports) => {
|
|
|
7467
7395
|
hasFlowCommentCompletion() {
|
|
7468
7396
|
const end = this.input.indexOf("*/", this.state.pos);
|
|
7469
7397
|
if (end === -1) {
|
|
7470
|
-
throw this.raise(Errors.UnterminatedComment,
|
|
7471
|
-
at: this.state.curPosition()
|
|
7472
|
-
});
|
|
7398
|
+
throw this.raise(Errors.UnterminatedComment, this.state.curPosition());
|
|
7473
7399
|
}
|
|
7474
7400
|
}
|
|
7475
7401
|
flowEnumErrorBooleanMemberNotInitialized(loc, {
|
|
7476
7402
|
enumName,
|
|
7477
7403
|
memberName
|
|
7478
7404
|
}) {
|
|
7479
|
-
this.raise(FlowErrors.EnumBooleanMemberNotInitialized, {
|
|
7480
|
-
at: loc,
|
|
7405
|
+
this.raise(FlowErrors.EnumBooleanMemberNotInitialized, loc, {
|
|
7481
7406
|
memberName,
|
|
7482
7407
|
enumName
|
|
7483
7408
|
});
|
|
7484
7409
|
}
|
|
7485
7410
|
flowEnumErrorInvalidMemberInitializer(loc, enumContext) {
|
|
7486
|
-
return this.raise(!enumContext.explicitType ? FlowErrors.EnumInvalidMemberInitializerUnknownType : enumContext.explicitType === "symbol" ? FlowErrors.EnumInvalidMemberInitializerSymbolType : FlowErrors.EnumInvalidMemberInitializerPrimaryType,
|
|
7487
|
-
at: loc
|
|
7488
|
-
}, enumContext));
|
|
7411
|
+
return this.raise(!enumContext.explicitType ? FlowErrors.EnumInvalidMemberInitializerUnknownType : enumContext.explicitType === "symbol" ? FlowErrors.EnumInvalidMemberInitializerSymbolType : FlowErrors.EnumInvalidMemberInitializerPrimaryType, loc, enumContext);
|
|
7489
7412
|
}
|
|
7490
|
-
flowEnumErrorNumberMemberNotInitialized(loc, {
|
|
7491
|
-
|
|
7492
|
-
memberName
|
|
7493
|
-
}) {
|
|
7494
|
-
this.raise(FlowErrors.EnumNumberMemberNotInitialized, {
|
|
7495
|
-
at: loc,
|
|
7496
|
-
enumName,
|
|
7497
|
-
memberName
|
|
7498
|
-
});
|
|
7413
|
+
flowEnumErrorNumberMemberNotInitialized(loc, details) {
|
|
7414
|
+
this.raise(FlowErrors.EnumNumberMemberNotInitialized, loc, details);
|
|
7499
7415
|
}
|
|
7500
|
-
flowEnumErrorStringMemberInconsistentlyInitialized(node, {
|
|
7501
|
-
|
|
7502
|
-
}) {
|
|
7503
|
-
this.raise(FlowErrors.EnumStringMemberInconsistentlyInitialized, {
|
|
7504
|
-
at: node,
|
|
7505
|
-
enumName
|
|
7506
|
-
});
|
|
7416
|
+
flowEnumErrorStringMemberInconsistentlyInitialized(node, details) {
|
|
7417
|
+
this.raise(FlowErrors.EnumStringMemberInconsistentlyInitialized, node, details);
|
|
7507
7418
|
}
|
|
7508
7419
|
flowEnumMemberInit() {
|
|
7509
7420
|
const startLoc = this.state.startLoc;
|
|
@@ -7609,16 +7520,14 @@ var require_lib = __commonJS((exports) => {
|
|
|
7609
7520
|
continue;
|
|
7610
7521
|
}
|
|
7611
7522
|
if (/^[a-z]/.test(memberName)) {
|
|
7612
|
-
this.raise(FlowErrors.EnumInvalidMemberName, {
|
|
7613
|
-
at: id,
|
|
7523
|
+
this.raise(FlowErrors.EnumInvalidMemberName, id, {
|
|
7614
7524
|
memberName,
|
|
7615
7525
|
suggestion: memberName[0].toUpperCase() + memberName.slice(1),
|
|
7616
7526
|
enumName
|
|
7617
7527
|
});
|
|
7618
7528
|
}
|
|
7619
7529
|
if (seenNames.has(memberName)) {
|
|
7620
|
-
this.raise(FlowErrors.EnumDuplicateMemberName, {
|
|
7621
|
-
at: id,
|
|
7530
|
+
this.raise(FlowErrors.EnumDuplicateMemberName, id, {
|
|
7622
7531
|
memberName,
|
|
7623
7532
|
enumName
|
|
7624
7533
|
});
|
|
@@ -7703,8 +7612,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
7703
7612
|
if (!this.eatContextual(102))
|
|
7704
7613
|
return null;
|
|
7705
7614
|
if (!tokenIsIdentifier(this.state.type)) {
|
|
7706
|
-
throw this.raise(FlowErrors.EnumInvalidExplicitTypeUnknownSupplied, {
|
|
7707
|
-
at: this.state.startLoc,
|
|
7615
|
+
throw this.raise(FlowErrors.EnumInvalidExplicitTypeUnknownSupplied, this.state.startLoc, {
|
|
7708
7616
|
enumName
|
|
7709
7617
|
});
|
|
7710
7618
|
}
|
|
@@ -7713,8 +7621,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
7713
7621
|
} = this.state;
|
|
7714
7622
|
this.next();
|
|
7715
7623
|
if (value !== "boolean" && value !== "number" && value !== "string" && value !== "symbol") {
|
|
7716
|
-
this.raise(FlowErrors.EnumInvalidExplicitType, {
|
|
7717
|
-
at: this.state.startLoc,
|
|
7624
|
+
this.raise(FlowErrors.EnumInvalidExplicitType, this.state.startLoc, {
|
|
7718
7625
|
enumName,
|
|
7719
7626
|
invalidEnumType: value
|
|
7720
7627
|
});
|
|
@@ -7798,8 +7705,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
7798
7705
|
this.expect(8);
|
|
7799
7706
|
return this.finishNode(node, "EnumNumberBody");
|
|
7800
7707
|
} else {
|
|
7801
|
-
this.raise(FlowErrors.EnumInconsistentMemberValues, {
|
|
7802
|
-
at: nameLoc,
|
|
7708
|
+
this.raise(FlowErrors.EnumInconsistentMemberValues, nameLoc, {
|
|
7803
7709
|
enumName
|
|
7804
7710
|
});
|
|
7805
7711
|
return empty();
|
|
@@ -8102,9 +8008,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
8102
8008
|
let chunkStart = this.state.pos;
|
|
8103
8009
|
for (;; ) {
|
|
8104
8010
|
if (this.state.pos >= this.length) {
|
|
8105
|
-
throw this.raise(JsxErrors.UnterminatedJsxContent,
|
|
8106
|
-
at: this.state.startLoc
|
|
8107
|
-
});
|
|
8011
|
+
throw this.raise(JsxErrors.UnterminatedJsxContent, this.state.startLoc);
|
|
8108
8012
|
}
|
|
8109
8013
|
const ch = this.input.charCodeAt(this.state.pos);
|
|
8110
8014
|
switch (ch) {
|
|
@@ -8159,9 +8063,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
8159
8063
|
let chunkStart = ++this.state.pos;
|
|
8160
8064
|
for (;; ) {
|
|
8161
8065
|
if (this.state.pos >= this.length) {
|
|
8162
|
-
throw this.raise(Errors.UnterminatedString,
|
|
8163
|
-
at: this.state.startLoc
|
|
8164
|
-
});
|
|
8066
|
+
throw this.raise(Errors.UnterminatedString, this.state.startLoc);
|
|
8165
8067
|
}
|
|
8166
8068
|
const ch = this.input.charCodeAt(this.state.pos);
|
|
8167
8069
|
if (ch === quote)
|
|
@@ -8266,18 +8168,14 @@ var require_lib = __commonJS((exports) => {
|
|
|
8266
8168
|
this.next();
|
|
8267
8169
|
node = this.jsxParseExpressionContainer(node, types.j_oTag);
|
|
8268
8170
|
if (node.expression.type === "JSXEmptyExpression") {
|
|
8269
|
-
this.raise(JsxErrors.AttributeIsEmpty,
|
|
8270
|
-
at: node
|
|
8271
|
-
});
|
|
8171
|
+
this.raise(JsxErrors.AttributeIsEmpty, node);
|
|
8272
8172
|
}
|
|
8273
8173
|
return node;
|
|
8274
8174
|
case 142:
|
|
8275
8175
|
case 133:
|
|
8276
8176
|
return this.parseExprAtom();
|
|
8277
8177
|
default:
|
|
8278
|
-
throw this.raise(JsxErrors.UnsupportedJsxValue,
|
|
8279
|
-
at: this.state.startLoc
|
|
8280
|
-
});
|
|
8178
|
+
throw this.raise(JsxErrors.UnsupportedJsxValue, this.state.startLoc);
|
|
8281
8179
|
}
|
|
8282
8180
|
}
|
|
8283
8181
|
jsxParseEmptyExpression() {
|
|
@@ -8384,18 +8282,14 @@ var require_lib = __commonJS((exports) => {
|
|
|
8384
8282
|
}
|
|
8385
8283
|
}
|
|
8386
8284
|
if (isFragment(openingElement) && !isFragment(closingElement) && closingElement !== null) {
|
|
8387
|
-
this.raise(JsxErrors.MissingClosingTagFragment,
|
|
8388
|
-
at: closingElement
|
|
8389
|
-
});
|
|
8285
|
+
this.raise(JsxErrors.MissingClosingTagFragment, closingElement);
|
|
8390
8286
|
} else if (!isFragment(openingElement) && isFragment(closingElement)) {
|
|
8391
|
-
this.raise(JsxErrors.MissingClosingTagElement, {
|
|
8392
|
-
at: closingElement,
|
|
8287
|
+
this.raise(JsxErrors.MissingClosingTagElement, closingElement, {
|
|
8393
8288
|
openingTagName: getQualifiedJSXName(openingElement.name)
|
|
8394
8289
|
});
|
|
8395
8290
|
} else if (!isFragment(openingElement) && !isFragment(closingElement)) {
|
|
8396
8291
|
if (getQualifiedJSXName(closingElement.name) !== getQualifiedJSXName(openingElement.name)) {
|
|
8397
|
-
this.raise(JsxErrors.MissingClosingTagElement, {
|
|
8398
|
-
at: closingElement,
|
|
8292
|
+
this.raise(JsxErrors.MissingClosingTagElement, closingElement, {
|
|
8399
8293
|
openingTagName: getQualifiedJSXName(openingElement.name)
|
|
8400
8294
|
});
|
|
8401
8295
|
}
|
|
@@ -8410,9 +8304,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
8410
8304
|
}
|
|
8411
8305
|
node.children = children;
|
|
8412
8306
|
if (this.match(47)) {
|
|
8413
|
-
throw this.raise(JsxErrors.UnwrappedAdjacentJSXElements,
|
|
8414
|
-
at: this.state.startLoc
|
|
8415
|
-
});
|
|
8307
|
+
throw this.raise(JsxErrors.UnwrappedAdjacentJSXElements, this.state.startLoc);
|
|
8416
8308
|
}
|
|
8417
8309
|
return isFragment(openingElement) ? this.finishNode(node, "JSXFragment") : this.finishNode(node, "JSXElement");
|
|
8418
8310
|
}
|
|
@@ -8500,11 +8392,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
8500
8392
|
class TypeScriptScope extends Scope {
|
|
8501
8393
|
constructor(...args) {
|
|
8502
8394
|
super(...args);
|
|
8503
|
-
this.
|
|
8504
|
-
this.enums = new Set;
|
|
8505
|
-
this.constEnums = new Set;
|
|
8506
|
-
this.classes = new Set;
|
|
8507
|
-
this.exportOnlyBindings = new Set;
|
|
8395
|
+
this.tsNames = new Map;
|
|
8508
8396
|
}
|
|
8509
8397
|
}
|
|
8510
8398
|
|
|
@@ -8546,8 +8434,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
8546
8434
|
declareName(name, bindingType, loc) {
|
|
8547
8435
|
if (bindingType & 4096) {
|
|
8548
8436
|
if (this.hasImport(name, true)) {
|
|
8549
|
-
this.parser.raise(Errors.VarRedeclaration, {
|
|
8550
|
-
at: loc,
|
|
8437
|
+
this.parser.raise(Errors.VarRedeclaration, loc, {
|
|
8551
8438
|
identifierName: name
|
|
8552
8439
|
});
|
|
8553
8440
|
}
|
|
@@ -8555,9 +8442,10 @@ var require_lib = __commonJS((exports) => {
|
|
|
8555
8442
|
return;
|
|
8556
8443
|
}
|
|
8557
8444
|
const scope = this.currentScope();
|
|
8445
|
+
let type = scope.tsNames.get(name) || 0;
|
|
8558
8446
|
if (bindingType & 1024) {
|
|
8559
8447
|
this.maybeExportDefined(scope, name);
|
|
8560
|
-
scope.
|
|
8448
|
+
scope.tsNames.set(name, type | 16);
|
|
8561
8449
|
return;
|
|
8562
8450
|
}
|
|
8563
8451
|
super.declareName(name, bindingType, loc);
|
|
@@ -8566,33 +8454,38 @@ var require_lib = __commonJS((exports) => {
|
|
|
8566
8454
|
this.checkRedeclarationInScope(scope, name, bindingType, loc);
|
|
8567
8455
|
this.maybeExportDefined(scope, name);
|
|
8568
8456
|
}
|
|
8569
|
-
|
|
8457
|
+
type = type | 1;
|
|
8458
|
+
}
|
|
8459
|
+
if (bindingType & 256) {
|
|
8460
|
+
type = type | 2;
|
|
8570
8461
|
}
|
|
8571
|
-
if (bindingType & 256)
|
|
8572
|
-
scope.enums.add(name);
|
|
8573
8462
|
if (bindingType & 512) {
|
|
8574
|
-
|
|
8463
|
+
type = type | 4;
|
|
8575
8464
|
}
|
|
8576
|
-
if (bindingType & 128)
|
|
8577
|
-
|
|
8465
|
+
if (bindingType & 128) {
|
|
8466
|
+
type = type | 8;
|
|
8467
|
+
}
|
|
8468
|
+
if (type)
|
|
8469
|
+
scope.tsNames.set(name, type);
|
|
8578
8470
|
}
|
|
8579
8471
|
isRedeclaredInScope(scope, name, bindingType) {
|
|
8580
|
-
|
|
8472
|
+
const type = scope.tsNames.get(name);
|
|
8473
|
+
if ((type & 2) > 0) {
|
|
8581
8474
|
if (bindingType & 256) {
|
|
8582
8475
|
const isConst = !!(bindingType & 512);
|
|
8583
|
-
const wasConst =
|
|
8476
|
+
const wasConst = (type & 4) > 0;
|
|
8584
8477
|
return isConst !== wasConst;
|
|
8585
8478
|
}
|
|
8586
8479
|
return true;
|
|
8587
8480
|
}
|
|
8588
|
-
if (bindingType & 128 &&
|
|
8589
|
-
if (scope.
|
|
8481
|
+
if (bindingType & 128 && (type & 8) > 0) {
|
|
8482
|
+
if (scope.names.get(name) & 2) {
|
|
8590
8483
|
return !!(bindingType & 1);
|
|
8591
8484
|
} else {
|
|
8592
8485
|
return false;
|
|
8593
8486
|
}
|
|
8594
8487
|
}
|
|
8595
|
-
if (bindingType & 2 &&
|
|
8488
|
+
if (bindingType & 2 && (type & 1) > 0) {
|
|
8596
8489
|
return true;
|
|
8597
8490
|
}
|
|
8598
8491
|
return super.isRedeclaredInScope(scope, name, bindingType);
|
|
@@ -8606,8 +8499,10 @@ var require_lib = __commonJS((exports) => {
|
|
|
8606
8499
|
const len = this.scopeStack.length;
|
|
8607
8500
|
for (let i = len - 1;i >= 0; i--) {
|
|
8608
8501
|
const scope = this.scopeStack[i];
|
|
8609
|
-
|
|
8502
|
+
const type = scope.tsNames.get(name);
|
|
8503
|
+
if ((type & 1) > 0 || (type & 16) > 0) {
|
|
8610
8504
|
return;
|
|
8505
|
+
}
|
|
8611
8506
|
}
|
|
8612
8507
|
super.checkLocalExport(id);
|
|
8613
8508
|
}
|
|
@@ -8625,18 +8520,12 @@ var require_lib = __commonJS((exports) => {
|
|
|
8625
8520
|
parenthesized = unwrapParenthesizedExpression(node);
|
|
8626
8521
|
if (isLHS) {
|
|
8627
8522
|
if (parenthesized.type === "Identifier") {
|
|
8628
|
-
this.expressionScope.recordArrowParameterBindingError(Errors.InvalidParenthesizedAssignment,
|
|
8629
|
-
at: node
|
|
8630
|
-
});
|
|
8523
|
+
this.expressionScope.recordArrowParameterBindingError(Errors.InvalidParenthesizedAssignment, node);
|
|
8631
8524
|
} else if (parenthesized.type !== "MemberExpression" && !this.isOptionalMemberExpression(parenthesized)) {
|
|
8632
|
-
this.raise(Errors.InvalidParenthesizedAssignment,
|
|
8633
|
-
at: node
|
|
8634
|
-
});
|
|
8525
|
+
this.raise(Errors.InvalidParenthesizedAssignment, node);
|
|
8635
8526
|
}
|
|
8636
8527
|
} else {
|
|
8637
|
-
this.raise(Errors.InvalidParenthesizedAssignment,
|
|
8638
|
-
at: node
|
|
8639
|
-
});
|
|
8528
|
+
this.raise(Errors.InvalidParenthesizedAssignment, node);
|
|
8640
8529
|
}
|
|
8641
8530
|
}
|
|
8642
8531
|
switch (node.type) {
|
|
@@ -8654,9 +8543,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
8654
8543
|
const isLast = i === last;
|
|
8655
8544
|
this.toAssignableObjectExpressionProp(prop, isLast, isLHS);
|
|
8656
8545
|
if (isLast && prop.type === "RestElement" && (_node$extra2 = node.extra) != null && _node$extra2.trailingCommaLoc) {
|
|
8657
|
-
this.raise(Errors.RestTrailingComma,
|
|
8658
|
-
at: node.extra.trailingCommaLoc
|
|
8659
|
-
});
|
|
8546
|
+
this.raise(Errors.RestTrailingComma, node.extra.trailingCommaLoc);
|
|
8660
8547
|
}
|
|
8661
8548
|
}
|
|
8662
8549
|
break;
|
|
@@ -8680,9 +8567,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
8680
8567
|
break;
|
|
8681
8568
|
case "AssignmentExpression":
|
|
8682
8569
|
if (node.operator !== "=") {
|
|
8683
|
-
this.raise(Errors.MissingEqInAssignment,
|
|
8684
|
-
at: node.left.loc.end
|
|
8685
|
-
});
|
|
8570
|
+
this.raise(Errors.MissingEqInAssignment, node.left.loc.end);
|
|
8686
8571
|
}
|
|
8687
8572
|
node.type = "AssignmentPattern";
|
|
8688
8573
|
delete node.operator;
|
|
@@ -8695,18 +8580,14 @@ var require_lib = __commonJS((exports) => {
|
|
|
8695
8580
|
}
|
|
8696
8581
|
toAssignableObjectExpressionProp(prop, isLast, isLHS) {
|
|
8697
8582
|
if (prop.type === "ObjectMethod") {
|
|
8698
|
-
this.raise(prop.kind === "get" || prop.kind === "set" ? Errors.PatternHasAccessor : Errors.PatternHasMethod,
|
|
8699
|
-
at: prop.key
|
|
8700
|
-
});
|
|
8583
|
+
this.raise(prop.kind === "get" || prop.kind === "set" ? Errors.PatternHasAccessor : Errors.PatternHasMethod, prop.key);
|
|
8701
8584
|
} else if (prop.type === "SpreadElement") {
|
|
8702
8585
|
prop.type = "RestElement";
|
|
8703
8586
|
const arg = prop.argument;
|
|
8704
8587
|
this.checkToRestConversion(arg, false);
|
|
8705
8588
|
this.toAssignable(arg, isLHS);
|
|
8706
8589
|
if (!isLast) {
|
|
8707
|
-
this.raise(Errors.RestTrailingComma,
|
|
8708
|
-
at: prop
|
|
8709
|
-
});
|
|
8590
|
+
this.raise(Errors.RestTrailingComma, prop);
|
|
8710
8591
|
}
|
|
8711
8592
|
} else {
|
|
8712
8593
|
this.toAssignable(prop, isLHS);
|
|
@@ -8728,13 +8609,9 @@ var require_lib = __commonJS((exports) => {
|
|
|
8728
8609
|
}
|
|
8729
8610
|
if (elt.type === "RestElement") {
|
|
8730
8611
|
if (i < end) {
|
|
8731
|
-
this.raise(Errors.RestTrailingComma,
|
|
8732
|
-
at: elt
|
|
8733
|
-
});
|
|
8612
|
+
this.raise(Errors.RestTrailingComma, elt);
|
|
8734
8613
|
} else if (trailingCommaLoc) {
|
|
8735
|
-
this.raise(Errors.RestTrailingComma,
|
|
8736
|
-
at: trailingCommaLoc
|
|
8737
|
-
});
|
|
8614
|
+
this.raise(Errors.RestTrailingComma, trailingCommaLoc);
|
|
8738
8615
|
}
|
|
8739
8616
|
}
|
|
8740
8617
|
}
|
|
@@ -8829,9 +8706,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
8829
8706
|
} else {
|
|
8830
8707
|
const decorators = [];
|
|
8831
8708
|
if (this.match(26) && this.hasPlugin("decorators")) {
|
|
8832
|
-
this.raise(Errors.UnsupportedParameterDecorator,
|
|
8833
|
-
at: this.state.startLoc
|
|
8834
|
-
});
|
|
8709
|
+
this.raise(Errors.UnsupportedParameterDecorator, this.state.startLoc);
|
|
8835
8710
|
}
|
|
8836
8711
|
while (this.match(26)) {
|
|
8837
8712
|
decorators.push(this.parseDecorator());
|
|
@@ -8917,16 +8792,13 @@ var require_lib = __commonJS((exports) => {
|
|
|
8917
8792
|
if (isOptionalMemberExpression) {
|
|
8918
8793
|
this.expectPlugin("optionalChainingAssign", expression.loc.start);
|
|
8919
8794
|
if (ancestor.type !== "AssignmentExpression") {
|
|
8920
|
-
this.raise(Errors.InvalidLhsOptionalChaining, {
|
|
8921
|
-
at: expression,
|
|
8795
|
+
this.raise(Errors.InvalidLhsOptionalChaining, expression, {
|
|
8922
8796
|
ancestor
|
|
8923
8797
|
});
|
|
8924
8798
|
}
|
|
8925
8799
|
}
|
|
8926
8800
|
if (binding !== 64) {
|
|
8927
|
-
this.raise(Errors.InvalidPropertyBindingPattern,
|
|
8928
|
-
at: expression
|
|
8929
|
-
});
|
|
8801
|
+
this.raise(Errors.InvalidPropertyBindingPattern, expression);
|
|
8930
8802
|
}
|
|
8931
8803
|
return;
|
|
8932
8804
|
}
|
|
@@ -8937,9 +8809,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
8937
8809
|
} = expression;
|
|
8938
8810
|
if (checkClashes) {
|
|
8939
8811
|
if (checkClashes.has(name)) {
|
|
8940
|
-
this.raise(Errors.ParamDupe,
|
|
8941
|
-
at: expression
|
|
8942
|
-
});
|
|
8812
|
+
this.raise(Errors.ParamDupe, expression);
|
|
8943
8813
|
} else {
|
|
8944
8814
|
checkClashes.add(name);
|
|
8945
8815
|
}
|
|
@@ -8951,8 +8821,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
8951
8821
|
return;
|
|
8952
8822
|
if (validity === false) {
|
|
8953
8823
|
const ParseErrorClass = binding === 64 ? Errors.InvalidLhs : Errors.InvalidLhsBinding;
|
|
8954
|
-
this.raise(ParseErrorClass, {
|
|
8955
|
-
at: expression,
|
|
8824
|
+
this.raise(ParseErrorClass, expression, {
|
|
8956
8825
|
ancestor
|
|
8957
8826
|
});
|
|
8958
8827
|
return;
|
|
@@ -8976,21 +8845,17 @@ var require_lib = __commonJS((exports) => {
|
|
|
8976
8845
|
checkIdentifier(at, bindingType, strictModeChanged = false) {
|
|
8977
8846
|
if (this.state.strict && (strictModeChanged ? isStrictBindReservedWord(at.name, this.inModule) : isStrictBindOnlyReservedWord(at.name))) {
|
|
8978
8847
|
if (bindingType === 64) {
|
|
8979
|
-
this.raise(Errors.StrictEvalArguments, {
|
|
8980
|
-
at,
|
|
8848
|
+
this.raise(Errors.StrictEvalArguments, at, {
|
|
8981
8849
|
referenceName: at.name
|
|
8982
8850
|
});
|
|
8983
8851
|
} else {
|
|
8984
|
-
this.raise(Errors.StrictEvalArgumentsBinding, {
|
|
8985
|
-
at,
|
|
8852
|
+
this.raise(Errors.StrictEvalArgumentsBinding, at, {
|
|
8986
8853
|
bindingName: at.name
|
|
8987
8854
|
});
|
|
8988
8855
|
}
|
|
8989
8856
|
}
|
|
8990
8857
|
if (bindingType & 8192 && at.name === "let") {
|
|
8991
|
-
this.raise(Errors.LetInLexicalBinding,
|
|
8992
|
-
at
|
|
8993
|
-
});
|
|
8858
|
+
this.raise(Errors.LetInLexicalBinding, at);
|
|
8994
8859
|
}
|
|
8995
8860
|
if (!(bindingType & 64)) {
|
|
8996
8861
|
this.declareNameFromIdentifier(at, bindingType);
|
|
@@ -9012,18 +8877,14 @@ var require_lib = __commonJS((exports) => {
|
|
|
9012
8877
|
if (allowPattern)
|
|
9013
8878
|
break;
|
|
9014
8879
|
default:
|
|
9015
|
-
this.raise(Errors.InvalidRestAssignmentPattern,
|
|
9016
|
-
at: node
|
|
9017
|
-
});
|
|
8880
|
+
this.raise(Errors.InvalidRestAssignmentPattern, node);
|
|
9018
8881
|
}
|
|
9019
8882
|
}
|
|
9020
8883
|
checkCommaAfterRest(close) {
|
|
9021
8884
|
if (!this.match(12)) {
|
|
9022
8885
|
return false;
|
|
9023
8886
|
}
|
|
9024
|
-
this.raise(this.lookaheadCharCode() === close ? Errors.RestTrailingComma : Errors.ElementAfterRest,
|
|
9025
|
-
at: this.state.startLoc
|
|
9026
|
-
});
|
|
8887
|
+
this.raise(this.lookaheadCharCode() === close ? Errors.RestTrailingComma : Errors.ElementAfterRest, this.state.startLoc);
|
|
9027
8888
|
return true;
|
|
9028
8889
|
}
|
|
9029
8890
|
}
|
|
@@ -9176,16 +9037,14 @@ var require_lib = __commonJS((exports) => {
|
|
|
9176
9037
|
}, modified) {
|
|
9177
9038
|
const enforceOrder = (loc, modifier, before, after) => {
|
|
9178
9039
|
if (modifier === before && modified[after]) {
|
|
9179
|
-
this.raise(TSErrors.InvalidModifiersOrder, {
|
|
9180
|
-
at: loc,
|
|
9040
|
+
this.raise(TSErrors.InvalidModifiersOrder, loc, {
|
|
9181
9041
|
orderedModifiers: [before, after]
|
|
9182
9042
|
});
|
|
9183
9043
|
}
|
|
9184
9044
|
};
|
|
9185
9045
|
const incompatible = (loc, modifier, mod1, mod2) => {
|
|
9186
9046
|
if (modified[mod1] && modifier === mod2 || modified[mod2] && modifier === mod1) {
|
|
9187
|
-
this.raise(TSErrors.IncompatibleModifiers, {
|
|
9188
|
-
at: loc,
|
|
9047
|
+
this.raise(TSErrors.IncompatibleModifiers, loc, {
|
|
9189
9048
|
modifiers: [mod1, mod2]
|
|
9190
9049
|
});
|
|
9191
9050
|
}
|
|
@@ -9199,8 +9058,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
9199
9058
|
break;
|
|
9200
9059
|
if (tsIsAccessModifier(modifier)) {
|
|
9201
9060
|
if (modified.accessibility) {
|
|
9202
|
-
this.raise(TSErrors.DuplicateAccessibilityModifier, {
|
|
9203
|
-
at: startLoc,
|
|
9061
|
+
this.raise(TSErrors.DuplicateAccessibilityModifier, startLoc, {
|
|
9204
9062
|
modifier
|
|
9205
9063
|
});
|
|
9206
9064
|
} else {
|
|
@@ -9211,8 +9069,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
9211
9069
|
}
|
|
9212
9070
|
} else if (tsIsVarianceAnnotations(modifier)) {
|
|
9213
9071
|
if (modified[modifier]) {
|
|
9214
|
-
this.raise(TSErrors.DuplicateModifier, {
|
|
9215
|
-
at: startLoc,
|
|
9072
|
+
this.raise(TSErrors.DuplicateModifier, startLoc, {
|
|
9216
9073
|
modifier
|
|
9217
9074
|
});
|
|
9218
9075
|
}
|
|
@@ -9220,8 +9077,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
9220
9077
|
enforceOrder(startLoc, modifier, "in", "out");
|
|
9221
9078
|
} else {
|
|
9222
9079
|
if (Object.hasOwnProperty.call(modified, modifier)) {
|
|
9223
|
-
this.raise(TSErrors.DuplicateModifier, {
|
|
9224
|
-
at: startLoc,
|
|
9080
|
+
this.raise(TSErrors.DuplicateModifier, startLoc, {
|
|
9225
9081
|
modifier
|
|
9226
9082
|
});
|
|
9227
9083
|
} else {
|
|
@@ -9235,8 +9091,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
9235
9091
|
modified[modifier] = true;
|
|
9236
9092
|
}
|
|
9237
9093
|
if (disallowedModifiers != null && disallowedModifiers.includes(modifier)) {
|
|
9238
|
-
this.raise(errorTemplate, {
|
|
9239
|
-
at: startLoc,
|
|
9094
|
+
this.raise(errorTemplate, startLoc, {
|
|
9240
9095
|
modifier
|
|
9241
9096
|
});
|
|
9242
9097
|
}
|
|
@@ -9279,7 +9134,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
9279
9134
|
}
|
|
9280
9135
|
result.push(element);
|
|
9281
9136
|
if (this.eat(12)) {
|
|
9282
|
-
trailingCommaPos = this.state.
|
|
9137
|
+
trailingCommaPos = this.state.lastTokStartLoc.index;
|
|
9283
9138
|
continue;
|
|
9284
9139
|
}
|
|
9285
9140
|
if (this.tsIsListTerminator(kind)) {
|
|
@@ -9316,9 +9171,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
9316
9171
|
this.expect(83);
|
|
9317
9172
|
this.expect(10);
|
|
9318
9173
|
if (!this.match(133)) {
|
|
9319
|
-
this.raise(TSErrors.UnsupportedImportTypeArgument,
|
|
9320
|
-
at: this.state.startLoc
|
|
9321
|
-
});
|
|
9174
|
+
this.raise(TSErrors.UnsupportedImportTypeArgument, this.state.startLoc);
|
|
9322
9175
|
}
|
|
9323
9176
|
node.argument = super.parseExprAtom();
|
|
9324
9177
|
this.expect(11);
|
|
@@ -9399,9 +9252,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
9399
9252
|
};
|
|
9400
9253
|
node.params = this.tsParseBracketedList("TypeParametersOrArguments", this.tsParseTypeParameter.bind(this, parseModifiers), false, true, refTrailingCommaPos);
|
|
9401
9254
|
if (node.params.length === 0) {
|
|
9402
|
-
this.raise(TSErrors.EmptyTypeParameters,
|
|
9403
|
-
at: node
|
|
9404
|
-
});
|
|
9255
|
+
this.raise(TSErrors.EmptyTypeParameters, node);
|
|
9405
9256
|
}
|
|
9406
9257
|
if (refTrailingCommaPos.value !== -1) {
|
|
9407
9258
|
this.addExtra(node, "trailingComma", refTrailingCommaPos.value);
|
|
@@ -9428,8 +9279,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
9428
9279
|
type
|
|
9429
9280
|
} = pattern;
|
|
9430
9281
|
if (type === "AssignmentPattern" || type === "TSParameterProperty") {
|
|
9431
|
-
this.raise(TSErrors.UnsupportedSignatureParameterKind, {
|
|
9432
|
-
at: pattern,
|
|
9282
|
+
this.raise(TSErrors.UnsupportedSignatureParameterKind, pattern, {
|
|
9433
9283
|
type
|
|
9434
9284
|
});
|
|
9435
9285
|
}
|
|
@@ -9476,15 +9326,11 @@ var require_lib = __commonJS((exports) => {
|
|
|
9476
9326
|
const nodeAny = node;
|
|
9477
9327
|
if (this.match(10) || this.match(47)) {
|
|
9478
9328
|
if (readonly) {
|
|
9479
|
-
this.raise(TSErrors.ReadonlyForMethodSignature,
|
|
9480
|
-
at: node
|
|
9481
|
-
});
|
|
9329
|
+
this.raise(TSErrors.ReadonlyForMethodSignature, node);
|
|
9482
9330
|
}
|
|
9483
9331
|
const method = nodeAny;
|
|
9484
9332
|
if (method.kind && this.match(47)) {
|
|
9485
|
-
this.raise(TSErrors.AccesorCannotHaveTypeParameters,
|
|
9486
|
-
at: this.state.curPosition()
|
|
9487
|
-
});
|
|
9333
|
+
this.raise(TSErrors.AccesorCannotHaveTypeParameters, this.state.curPosition());
|
|
9488
9334
|
}
|
|
9489
9335
|
this.tsFillSignature(14, method);
|
|
9490
9336
|
this.tsParseTypeMemberSemicolon();
|
|
@@ -9492,42 +9338,28 @@ var require_lib = __commonJS((exports) => {
|
|
|
9492
9338
|
const returnTypeKey = "typeAnnotation";
|
|
9493
9339
|
if (method.kind === "get") {
|
|
9494
9340
|
if (method[paramsKey].length > 0) {
|
|
9495
|
-
this.raise(Errors.BadGetterArity,
|
|
9496
|
-
at: this.state.curPosition()
|
|
9497
|
-
});
|
|
9341
|
+
this.raise(Errors.BadGetterArity, this.state.curPosition());
|
|
9498
9342
|
if (this.isThisParam(method[paramsKey][0])) {
|
|
9499
|
-
this.raise(TSErrors.AccesorCannotDeclareThisParameter,
|
|
9500
|
-
at: this.state.curPosition()
|
|
9501
|
-
});
|
|
9343
|
+
this.raise(TSErrors.AccesorCannotDeclareThisParameter, this.state.curPosition());
|
|
9502
9344
|
}
|
|
9503
9345
|
}
|
|
9504
9346
|
} else if (method.kind === "set") {
|
|
9505
9347
|
if (method[paramsKey].length !== 1) {
|
|
9506
|
-
this.raise(Errors.BadSetterArity,
|
|
9507
|
-
at: this.state.curPosition()
|
|
9508
|
-
});
|
|
9348
|
+
this.raise(Errors.BadSetterArity, this.state.curPosition());
|
|
9509
9349
|
} else {
|
|
9510
9350
|
const firstParameter = method[paramsKey][0];
|
|
9511
9351
|
if (this.isThisParam(firstParameter)) {
|
|
9512
|
-
this.raise(TSErrors.AccesorCannotDeclareThisParameter,
|
|
9513
|
-
at: this.state.curPosition()
|
|
9514
|
-
});
|
|
9352
|
+
this.raise(TSErrors.AccesorCannotDeclareThisParameter, this.state.curPosition());
|
|
9515
9353
|
}
|
|
9516
9354
|
if (firstParameter.type === "Identifier" && firstParameter.optional) {
|
|
9517
|
-
this.raise(TSErrors.SetAccesorCannotHaveOptionalParameter,
|
|
9518
|
-
at: this.state.curPosition()
|
|
9519
|
-
});
|
|
9355
|
+
this.raise(TSErrors.SetAccesorCannotHaveOptionalParameter, this.state.curPosition());
|
|
9520
9356
|
}
|
|
9521
9357
|
if (firstParameter.type === "RestElement") {
|
|
9522
|
-
this.raise(TSErrors.SetAccesorCannotHaveRestParameter,
|
|
9523
|
-
at: this.state.curPosition()
|
|
9524
|
-
});
|
|
9358
|
+
this.raise(TSErrors.SetAccesorCannotHaveRestParameter, this.state.curPosition());
|
|
9525
9359
|
}
|
|
9526
9360
|
}
|
|
9527
9361
|
if (method[returnTypeKey]) {
|
|
9528
|
-
this.raise(TSErrors.SetAccesorCannotHaveReturnType,
|
|
9529
|
-
at: method[returnTypeKey]
|
|
9530
|
-
});
|
|
9362
|
+
this.raise(TSErrors.SetAccesorCannotHaveReturnType, method[returnTypeKey]);
|
|
9531
9363
|
}
|
|
9532
9364
|
} else {
|
|
9533
9365
|
method.kind = "method";
|
|
@@ -9644,9 +9476,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
9644
9476
|
type
|
|
9645
9477
|
} = elementNode;
|
|
9646
9478
|
if (seenOptionalElement && type !== "TSRestType" && type !== "TSOptionalType" && !(type === "TSNamedTupleMember" && elementNode.optional)) {
|
|
9647
|
-
this.raise(TSErrors.OptionalTypeBeforeRequired,
|
|
9648
|
-
at: elementNode
|
|
9649
|
-
});
|
|
9479
|
+
this.raise(TSErrors.OptionalTypeBeforeRequired, elementNode);
|
|
9650
9480
|
}
|
|
9651
9481
|
seenOptionalElement || (seenOptionalElement = type === "TSNamedTupleMember" && elementNode.optional || type === "TSOptionalType");
|
|
9652
9482
|
});
|
|
@@ -9699,16 +9529,12 @@ var require_lib = __commonJS((exports) => {
|
|
|
9699
9529
|
labeledNode.elementType = type;
|
|
9700
9530
|
if (this.eat(17)) {
|
|
9701
9531
|
labeledNode.optional = true;
|
|
9702
|
-
this.raise(TSErrors.TupleOptionalAfterType,
|
|
9703
|
-
at: this.state.lastTokStartLoc
|
|
9704
|
-
});
|
|
9532
|
+
this.raise(TSErrors.TupleOptionalAfterType, this.state.lastTokStartLoc);
|
|
9705
9533
|
}
|
|
9706
9534
|
} else {
|
|
9707
9535
|
labeledNode = this.startNodeAtNode(type);
|
|
9708
9536
|
labeledNode.optional = optional;
|
|
9709
|
-
this.raise(TSErrors.InvalidTupleMemberLabel,
|
|
9710
|
-
at: type
|
|
9711
|
-
});
|
|
9537
|
+
this.raise(TSErrors.InvalidTupleMemberLabel, type);
|
|
9712
9538
|
labeledNode.label = type;
|
|
9713
9539
|
labeledNode.elementType = this.tsParseType();
|
|
9714
9540
|
}
|
|
@@ -9862,9 +9688,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
9862
9688
|
case "TSArrayType":
|
|
9863
9689
|
return;
|
|
9864
9690
|
default:
|
|
9865
|
-
this.raise(TSErrors.UnexpectedReadonly,
|
|
9866
|
-
at: node
|
|
9867
|
-
});
|
|
9691
|
+
this.raise(TSErrors.UnexpectedReadonly, node);
|
|
9868
9692
|
}
|
|
9869
9693
|
}
|
|
9870
9694
|
tsParseInferType() {
|
|
@@ -10032,8 +9856,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
10032
9856
|
return false;
|
|
10033
9857
|
}
|
|
10034
9858
|
if (containsEsc) {
|
|
10035
|
-
this.raise(Errors.InvalidEscapedReservedWord, {
|
|
10036
|
-
at: this.state.lastTokStartLoc,
|
|
9859
|
+
this.raise(Errors.InvalidEscapedReservedWord, this.state.lastTokStartLoc, {
|
|
10037
9860
|
reservedWord: "asserts"
|
|
10038
9861
|
});
|
|
10039
9862
|
}
|
|
@@ -10078,9 +9901,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
10078
9901
|
}
|
|
10079
9902
|
tsParseTypeAssertion() {
|
|
10080
9903
|
if (this.getPluginOption("typescript", "disallowAmbiguousJSXLike")) {
|
|
10081
|
-
this.raise(TSErrors.ReservedTypeAssertion,
|
|
10082
|
-
at: this.state.startLoc
|
|
10083
|
-
});
|
|
9904
|
+
this.raise(TSErrors.ReservedTypeAssertion, this.state.startLoc);
|
|
10084
9905
|
}
|
|
10085
9906
|
const node = this.startNode();
|
|
10086
9907
|
node.typeAnnotation = this.tsInType(() => {
|
|
@@ -10102,8 +9923,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
10102
9923
|
return this.finishNode(node, "TSExpressionWithTypeArguments");
|
|
10103
9924
|
});
|
|
10104
9925
|
if (!delimitedList.length) {
|
|
10105
|
-
this.raise(TSErrors.EmptyHeritageClauseType, {
|
|
10106
|
-
at: originalStartLoc,
|
|
9926
|
+
this.raise(TSErrors.EmptyHeritageClauseType, originalStartLoc, {
|
|
10107
9927
|
token
|
|
10108
9928
|
});
|
|
10109
9929
|
}
|
|
@@ -10120,9 +9940,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
10120
9940
|
this.checkIdentifier(node.id, 130);
|
|
10121
9941
|
} else {
|
|
10122
9942
|
node.id = null;
|
|
10123
|
-
this.raise(TSErrors.MissingInterfaceName,
|
|
10124
|
-
at: this.state.startLoc
|
|
10125
|
-
});
|
|
9943
|
+
this.raise(TSErrors.MissingInterfaceName, this.state.startLoc);
|
|
10126
9944
|
}
|
|
10127
9945
|
node.typeParameters = this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers);
|
|
10128
9946
|
if (this.eat(81)) {
|
|
@@ -10276,9 +10094,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
10276
10094
|
this.expect(29);
|
|
10277
10095
|
const moduleReference = this.tsParseModuleReference();
|
|
10278
10096
|
if (node.importKind === "type" && moduleReference.type !== "TSExternalModuleReference") {
|
|
10279
|
-
this.raise(TSErrors.ImportAliasHasImportType,
|
|
10280
|
-
at: moduleReference
|
|
10281
|
-
});
|
|
10097
|
+
this.raise(TSErrors.ImportAliasHasImportType, moduleReference);
|
|
10282
10098
|
}
|
|
10283
10099
|
node.moduleReference = moduleReference;
|
|
10284
10100
|
this.semicolon();
|
|
@@ -10469,9 +10285,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
10469
10285
|
return this.tsParseDelimitedList("TypeParametersOrArguments", this.tsParseType.bind(this));
|
|
10470
10286
|
}));
|
|
10471
10287
|
if (node.params.length === 0) {
|
|
10472
|
-
this.raise(TSErrors.EmptyTypeArguments,
|
|
10473
|
-
at: node
|
|
10474
|
-
});
|
|
10288
|
+
this.raise(TSErrors.EmptyTypeArguments, node);
|
|
10475
10289
|
} else if (!this.state.inType && this.curContext() === types.brace) {
|
|
10476
10290
|
this.reScan_lt_gt();
|
|
10477
10291
|
}
|
|
@@ -10496,9 +10310,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
10496
10310
|
const override = modified.override;
|
|
10497
10311
|
const readonly = modified.readonly;
|
|
10498
10312
|
if (!(flags & 4) && (accessibility || readonly || override)) {
|
|
10499
|
-
this.raise(TSErrors.UnexpectedParameterModifier,
|
|
10500
|
-
at: startLoc
|
|
10501
|
-
});
|
|
10313
|
+
this.raise(TSErrors.UnexpectedParameterModifier, startLoc);
|
|
10502
10314
|
}
|
|
10503
10315
|
const left = this.parseMaybeDefault();
|
|
10504
10316
|
this.parseAssignableListItemTypes(left, flags);
|
|
@@ -10515,9 +10327,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
10515
10327
|
if (override)
|
|
10516
10328
|
pp.override = override;
|
|
10517
10329
|
if (elt.type !== "Identifier" && elt.type !== "AssignmentPattern") {
|
|
10518
|
-
this.raise(TSErrors.UnsupportedParameterPropertyKind,
|
|
10519
|
-
at: pp
|
|
10520
|
-
});
|
|
10330
|
+
this.raise(TSErrors.UnsupportedParameterPropertyKind, pp);
|
|
10521
10331
|
}
|
|
10522
10332
|
pp.parameter = elt;
|
|
10523
10333
|
return this.finishNode(pp, "TSParameterProperty");
|
|
@@ -10533,9 +10343,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
10533
10343
|
tsDisallowOptionalPattern(node) {
|
|
10534
10344
|
for (const param of node.params) {
|
|
10535
10345
|
if (param.type !== "Identifier" && param.optional && !this.state.isAmbientContext) {
|
|
10536
|
-
this.raise(TSErrors.PatternIsOptional,
|
|
10537
|
-
at: param
|
|
10538
|
-
});
|
|
10346
|
+
this.raise(TSErrors.PatternIsOptional, param);
|
|
10539
10347
|
}
|
|
10540
10348
|
}
|
|
10541
10349
|
}
|
|
@@ -10552,9 +10360,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
10552
10360
|
return this.finishNode(node, bodilessType);
|
|
10553
10361
|
}
|
|
10554
10362
|
if (bodilessType === "TSDeclareFunction" && this.state.isAmbientContext) {
|
|
10555
|
-
this.raise(TSErrors.DeclareFunctionHasImplementation,
|
|
10556
|
-
at: node
|
|
10557
|
-
});
|
|
10363
|
+
this.raise(TSErrors.DeclareFunctionHasImplementation, node);
|
|
10558
10364
|
if (node.declare) {
|
|
10559
10365
|
return super.parseFunctionBodyAndFinish(node, bodilessType, isMethod);
|
|
10560
10366
|
}
|
|
@@ -10572,9 +10378,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
10572
10378
|
tsCheckForInvalidTypeCasts(items) {
|
|
10573
10379
|
items.forEach((node) => {
|
|
10574
10380
|
if ((node == null ? undefined : node.type) === "TSTypeCastExpression") {
|
|
10575
|
-
this.raise(TSErrors.UnexpectedTypeAnnotation,
|
|
10576
|
-
at: node.typeAnnotation
|
|
10577
|
-
});
|
|
10381
|
+
this.raise(TSErrors.UnexpectedTypeAnnotation, node.typeAnnotation);
|
|
10578
10382
|
}
|
|
10579
10383
|
});
|
|
10580
10384
|
}
|
|
@@ -10652,9 +10456,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
10652
10456
|
}
|
|
10653
10457
|
if (result) {
|
|
10654
10458
|
if (result.type === "TSInstantiationExpression" && (this.match(16) || this.match(18) && this.lookaheadCharCode() !== 40)) {
|
|
10655
|
-
this.raise(TSErrors.InvalidPropertyAccessAfterInstantiationExpression,
|
|
10656
|
-
at: this.state.startLoc
|
|
10657
|
-
});
|
|
10459
|
+
this.raise(TSErrors.InvalidPropertyAccessAfterInstantiationExpression, this.state.startLoc);
|
|
10658
10460
|
}
|
|
10659
10461
|
return result;
|
|
10660
10462
|
}
|
|
@@ -10681,8 +10483,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
10681
10483
|
this.next();
|
|
10682
10484
|
if (this.match(75)) {
|
|
10683
10485
|
if (isSatisfies) {
|
|
10684
|
-
this.raise(Errors.UnexpectedKeyword, {
|
|
10685
|
-
at: this.state.startLoc,
|
|
10486
|
+
this.raise(Errors.UnexpectedKeyword, this.state.startLoc, {
|
|
10686
10487
|
keyword: "const"
|
|
10687
10488
|
});
|
|
10688
10489
|
}
|
|
@@ -10704,9 +10505,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
10704
10505
|
checkImportReflection(node) {
|
|
10705
10506
|
super.checkImportReflection(node);
|
|
10706
10507
|
if (node.module && node.importKind !== "value") {
|
|
10707
|
-
this.raise(TSErrors.ImportReflectionHasImportType,
|
|
10708
|
-
at: node.specifiers[0].loc.start
|
|
10709
|
-
});
|
|
10508
|
+
this.raise(TSErrors.ImportReflectionHasImportType, node.specifiers[0].loc.start);
|
|
10710
10509
|
}
|
|
10711
10510
|
}
|
|
10712
10511
|
checkDuplicateExports() {
|
|
@@ -10748,9 +10547,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
10748
10547
|
importNode = super.parseImport(node);
|
|
10749
10548
|
}
|
|
10750
10549
|
if (importNode.importKind === "type" && importNode.specifiers.length > 1 && importNode.specifiers[0].type === "ImportDefaultSpecifier") {
|
|
10751
|
-
this.raise(TSErrors.TypeImportCannotSpecifyDefaultAndNamed,
|
|
10752
|
-
at: importNode
|
|
10753
|
-
});
|
|
10550
|
+
this.raise(TSErrors.TypeImportCannotSpecifyDefaultAndNamed, importNode);
|
|
10754
10551
|
}
|
|
10755
10552
|
return importNode;
|
|
10756
10553
|
}
|
|
@@ -10811,13 +10608,9 @@ var require_lib = __commonJS((exports) => {
|
|
|
10811
10608
|
if (!init)
|
|
10812
10609
|
continue;
|
|
10813
10610
|
if (kind !== "const" || !!id.typeAnnotation) {
|
|
10814
|
-
this.raise(TSErrors.InitializerNotAllowedInAmbientContext,
|
|
10815
|
-
at: init
|
|
10816
|
-
});
|
|
10611
|
+
this.raise(TSErrors.InitializerNotAllowedInAmbientContext, init);
|
|
10817
10612
|
} else if (!isValidAmbientConstInitializer(init, this.hasPlugin("estree"))) {
|
|
10818
|
-
this.raise(TSErrors.ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference,
|
|
10819
|
-
at: init
|
|
10820
|
-
});
|
|
10613
|
+
this.raise(TSErrors.ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference, init);
|
|
10821
10614
|
}
|
|
10822
10615
|
}
|
|
10823
10616
|
return declaration;
|
|
@@ -10867,9 +10660,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
10867
10660
|
this.next();
|
|
10868
10661
|
this.next();
|
|
10869
10662
|
if (this.tsHasSomeModifiers(member, modifiers)) {
|
|
10870
|
-
this.raise(TSErrors.StaticBlockCannotHaveModifier,
|
|
10871
|
-
at: this.state.curPosition()
|
|
10872
|
-
});
|
|
10663
|
+
this.raise(TSErrors.StaticBlockCannotHaveModifier, this.state.curPosition());
|
|
10873
10664
|
}
|
|
10874
10665
|
super.parseClassStaticBlock(classBody, member);
|
|
10875
10666
|
} else {
|
|
@@ -10887,38 +10678,27 @@ var require_lib = __commonJS((exports) => {
|
|
|
10887
10678
|
if (idx) {
|
|
10888
10679
|
classBody.body.push(idx);
|
|
10889
10680
|
if (member.abstract) {
|
|
10890
|
-
this.raise(TSErrors.IndexSignatureHasAbstract,
|
|
10891
|
-
at: member
|
|
10892
|
-
});
|
|
10681
|
+
this.raise(TSErrors.IndexSignatureHasAbstract, member);
|
|
10893
10682
|
}
|
|
10894
10683
|
if (member.accessibility) {
|
|
10895
|
-
this.raise(TSErrors.IndexSignatureHasAccessibility, {
|
|
10896
|
-
at: member,
|
|
10684
|
+
this.raise(TSErrors.IndexSignatureHasAccessibility, member, {
|
|
10897
10685
|
modifier: member.accessibility
|
|
10898
10686
|
});
|
|
10899
10687
|
}
|
|
10900
10688
|
if (member.declare) {
|
|
10901
|
-
this.raise(TSErrors.IndexSignatureHasDeclare,
|
|
10902
|
-
at: member
|
|
10903
|
-
});
|
|
10689
|
+
this.raise(TSErrors.IndexSignatureHasDeclare, member);
|
|
10904
10690
|
}
|
|
10905
10691
|
if (member.override) {
|
|
10906
|
-
this.raise(TSErrors.IndexSignatureHasOverride,
|
|
10907
|
-
at: member
|
|
10908
|
-
});
|
|
10692
|
+
this.raise(TSErrors.IndexSignatureHasOverride, member);
|
|
10909
10693
|
}
|
|
10910
10694
|
return;
|
|
10911
10695
|
}
|
|
10912
10696
|
if (!this.state.inAbstractClass && member.abstract) {
|
|
10913
|
-
this.raise(TSErrors.NonAbstractClassHasAbstractMethod,
|
|
10914
|
-
at: member
|
|
10915
|
-
});
|
|
10697
|
+
this.raise(TSErrors.NonAbstractClassHasAbstractMethod, member);
|
|
10916
10698
|
}
|
|
10917
10699
|
if (member.override) {
|
|
10918
10700
|
if (!state.hadSuperClass) {
|
|
10919
|
-
this.raise(TSErrors.OverrideNotInSubClass,
|
|
10920
|
-
at: member
|
|
10921
|
-
});
|
|
10701
|
+
this.raise(TSErrors.OverrideNotInSubClass, member);
|
|
10922
10702
|
}
|
|
10923
10703
|
}
|
|
10924
10704
|
super.parseClassMemberWithIsStatic(classBody, member, state, isStatic);
|
|
@@ -10928,14 +10708,10 @@ var require_lib = __commonJS((exports) => {
|
|
|
10928
10708
|
if (optional)
|
|
10929
10709
|
methodOrProp.optional = true;
|
|
10930
10710
|
if (methodOrProp.readonly && this.match(10)) {
|
|
10931
|
-
this.raise(TSErrors.ClassMethodHasReadonly,
|
|
10932
|
-
at: methodOrProp
|
|
10933
|
-
});
|
|
10711
|
+
this.raise(TSErrors.ClassMethodHasReadonly, methodOrProp);
|
|
10934
10712
|
}
|
|
10935
10713
|
if (methodOrProp.declare && this.match(10)) {
|
|
10936
|
-
this.raise(TSErrors.ClassMethodHasDeclare,
|
|
10937
|
-
at: methodOrProp
|
|
10938
|
-
});
|
|
10714
|
+
this.raise(TSErrors.ClassMethodHasDeclare, methodOrProp);
|
|
10939
10715
|
}
|
|
10940
10716
|
}
|
|
10941
10717
|
parseExpressionStatement(node, expr, decorators) {
|
|
@@ -10983,9 +10759,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
10983
10759
|
const startLoc = this.state.startLoc;
|
|
10984
10760
|
const isDeclare = this.eatContextual(125);
|
|
10985
10761
|
if (isDeclare && (this.isContextual(125) || !this.shouldParseExportDeclaration())) {
|
|
10986
|
-
throw this.raise(TSErrors.ExpectedAmbientAfterExportDeclare,
|
|
10987
|
-
at: this.state.startLoc
|
|
10988
|
-
});
|
|
10762
|
+
throw this.raise(TSErrors.ExpectedAmbientAfterExportDeclare, this.state.startLoc);
|
|
10989
10763
|
}
|
|
10990
10764
|
const isIdentifier = tokenIsIdentifier(this.state.type);
|
|
10991
10765
|
const declaration = isIdentifier && this.tsTryParseExportDeclaration() || super.parseExportDeclaration(node);
|
|
@@ -11024,16 +10798,13 @@ var require_lib = __commonJS((exports) => {
|
|
|
11024
10798
|
parseClassProperty(node) {
|
|
11025
10799
|
this.parseClassPropertyAnnotation(node);
|
|
11026
10800
|
if (this.state.isAmbientContext && !(node.readonly && !node.typeAnnotation) && this.match(29)) {
|
|
11027
|
-
this.raise(TSErrors.DeclareClassFieldHasInitializer,
|
|
11028
|
-
at: this.state.startLoc
|
|
11029
|
-
});
|
|
10801
|
+
this.raise(TSErrors.DeclareClassFieldHasInitializer, this.state.startLoc);
|
|
11030
10802
|
}
|
|
11031
10803
|
if (node.abstract && this.match(29)) {
|
|
11032
10804
|
const {
|
|
11033
10805
|
key
|
|
11034
10806
|
} = node;
|
|
11035
|
-
this.raise(TSErrors.AbstractPropertyHasInitializer, {
|
|
11036
|
-
at: this.state.startLoc,
|
|
10807
|
+
this.raise(TSErrors.AbstractPropertyHasInitializer, this.state.startLoc, {
|
|
11037
10808
|
propertyName: key.type === "Identifier" && !node.computed ? key.name : `[${this.input.slice(key.start, key.end)}]`
|
|
11038
10809
|
});
|
|
11039
10810
|
}
|
|
@@ -11041,13 +10812,10 @@ var require_lib = __commonJS((exports) => {
|
|
|
11041
10812
|
}
|
|
11042
10813
|
parseClassPrivateProperty(node) {
|
|
11043
10814
|
if (node.abstract) {
|
|
11044
|
-
this.raise(TSErrors.PrivateElementHasAbstract,
|
|
11045
|
-
at: node
|
|
11046
|
-
});
|
|
10815
|
+
this.raise(TSErrors.PrivateElementHasAbstract, node);
|
|
11047
10816
|
}
|
|
11048
10817
|
if (node.accessibility) {
|
|
11049
|
-
this.raise(TSErrors.PrivateElementHasAccessibility, {
|
|
11050
|
-
at: node,
|
|
10818
|
+
this.raise(TSErrors.PrivateElementHasAccessibility, node, {
|
|
11051
10819
|
modifier: node.accessibility
|
|
11052
10820
|
});
|
|
11053
10821
|
}
|
|
@@ -11057,26 +10825,21 @@ var require_lib = __commonJS((exports) => {
|
|
|
11057
10825
|
parseClassAccessorProperty(node) {
|
|
11058
10826
|
this.parseClassPropertyAnnotation(node);
|
|
11059
10827
|
if (node.optional) {
|
|
11060
|
-
this.raise(TSErrors.AccessorCannotBeOptional,
|
|
11061
|
-
at: node
|
|
11062
|
-
});
|
|
10828
|
+
this.raise(TSErrors.AccessorCannotBeOptional, node);
|
|
11063
10829
|
}
|
|
11064
10830
|
return super.parseClassAccessorProperty(node);
|
|
11065
10831
|
}
|
|
11066
10832
|
pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) {
|
|
11067
10833
|
const typeParameters = this.tsTryParseTypeParameters(this.tsParseConstModifier);
|
|
11068
10834
|
if (typeParameters && isConstructor) {
|
|
11069
|
-
this.raise(TSErrors.ConstructorHasTypeParameters,
|
|
11070
|
-
at: typeParameters
|
|
11071
|
-
});
|
|
10835
|
+
this.raise(TSErrors.ConstructorHasTypeParameters, typeParameters);
|
|
11072
10836
|
}
|
|
11073
10837
|
const {
|
|
11074
10838
|
declare = false,
|
|
11075
10839
|
kind
|
|
11076
10840
|
} = method;
|
|
11077
10841
|
if (declare && (kind === "get" || kind === "set")) {
|
|
11078
|
-
this.raise(TSErrors.DeclareAccessor, {
|
|
11079
|
-
at: method,
|
|
10842
|
+
this.raise(TSErrors.DeclareAccessor, method, {
|
|
11080
10843
|
kind
|
|
11081
10844
|
});
|
|
11082
10845
|
}
|
|
@@ -11202,9 +10965,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
11202
10965
|
reportReservedArrowTypeParam(node) {
|
|
11203
10966
|
var _node$extra;
|
|
11204
10967
|
if (node.params.length === 1 && !node.params[0].constraint && !((_node$extra = node.extra) != null && _node$extra.trailingComma) && this.getPluginOption("typescript", "disallowAmbiguousJSXLike")) {
|
|
11205
|
-
this.raise(TSErrors.ReservedArrowTypeParam,
|
|
11206
|
-
at: node
|
|
11207
|
-
});
|
|
10968
|
+
this.raise(TSErrors.ReservedArrowTypeParam, node);
|
|
11208
10969
|
}
|
|
11209
10970
|
}
|
|
11210
10971
|
parseMaybeUnary(refExpressionErrors, sawUnary) {
|
|
@@ -11263,13 +11024,9 @@ var require_lib = __commonJS((exports) => {
|
|
|
11263
11024
|
case "TSNonNullExpression":
|
|
11264
11025
|
case "TSTypeAssertion":
|
|
11265
11026
|
if (isLHS) {
|
|
11266
|
-
this.expressionScope.recordArrowParameterBindingError(TSErrors.UnexpectedTypeCastInParameter,
|
|
11267
|
-
at: node
|
|
11268
|
-
});
|
|
11027
|
+
this.expressionScope.recordArrowParameterBindingError(TSErrors.UnexpectedTypeCastInParameter, node);
|
|
11269
11028
|
} else {
|
|
11270
|
-
this.raise(TSErrors.UnexpectedTypeCastInParameter,
|
|
11271
|
-
at: node
|
|
11272
|
-
});
|
|
11029
|
+
this.raise(TSErrors.UnexpectedTypeCastInParameter, node);
|
|
11273
11030
|
}
|
|
11274
11031
|
this.toAssignable(node.expression, isLHS);
|
|
11275
11032
|
break;
|
|
@@ -11350,9 +11107,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
11350
11107
|
parseMaybeDefault(startLoc, left) {
|
|
11351
11108
|
const node = super.parseMaybeDefault(startLoc, left);
|
|
11352
11109
|
if (node.type === "AssignmentPattern" && node.typeAnnotation && node.right.start < node.typeAnnotation.start) {
|
|
11353
|
-
this.raise(TSErrors.TypeAnnotationAfterAssign,
|
|
11354
|
-
at: node.typeAnnotation
|
|
11355
|
-
});
|
|
11110
|
+
this.raise(TSErrors.TypeAnnotationAfterAssign, node.typeAnnotation);
|
|
11356
11111
|
}
|
|
11357
11112
|
return node;
|
|
11358
11113
|
}
|
|
@@ -11467,9 +11222,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
11467
11222
|
} else if (this.isContextual(129)) {
|
|
11468
11223
|
if (!this.hasFollowingLineBreak()) {
|
|
11469
11224
|
node.abstract = true;
|
|
11470
|
-
this.raise(TSErrors.NonClassMethodPropertyHasAbstractModifer,
|
|
11471
|
-
at: node
|
|
11472
|
-
});
|
|
11225
|
+
this.raise(TSErrors.NonClassMethodPropertyHasAbstractModifer, node);
|
|
11473
11226
|
return this.tsParseInterfaceDeclaration(node);
|
|
11474
11227
|
}
|
|
11475
11228
|
} else {
|
|
@@ -11484,8 +11237,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
11484
11237
|
const {
|
|
11485
11238
|
key
|
|
11486
11239
|
} = method;
|
|
11487
|
-
this.raise(TSErrors.AbstractMethodHasImplementation, {
|
|
11488
|
-
at: method,
|
|
11240
|
+
this.raise(TSErrors.AbstractMethodHasImplementation, method, {
|
|
11489
11241
|
methodName: key.type === "Identifier" && !method.computed ? key.name : `[${this.input.slice(key.start, key.end)}]`
|
|
11490
11242
|
});
|
|
11491
11243
|
}
|
|
@@ -11567,9 +11319,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
11567
11319
|
}
|
|
11568
11320
|
}
|
|
11569
11321
|
if (hasTypeSpecifier && isInTypeOnlyImportExport) {
|
|
11570
|
-
this.raise(isImport ? TSErrors.TypeModifierIsUsedInTypeImports : TSErrors.TypeModifierIsUsedInTypeExports,
|
|
11571
|
-
at: loc
|
|
11572
|
-
});
|
|
11322
|
+
this.raise(isImport ? TSErrors.TypeModifierIsUsedInTypeImports : TSErrors.TypeModifierIsUsedInTypeExports, loc);
|
|
11573
11323
|
}
|
|
11574
11324
|
node[leftOfAsKey] = leftOfAs;
|
|
11575
11325
|
node[rightOfAsKey] = rightOfAs;
|
|
@@ -11688,9 +11438,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
11688
11438
|
node.body = this.finishPlaceholder(placeholder, "ClassBody");
|
|
11689
11439
|
return this.finishNode(node, type);
|
|
11690
11440
|
} else {
|
|
11691
|
-
throw this.raise(PlaceholderErrors.ClassNameIsRequired,
|
|
11692
|
-
at: this.state.startLoc
|
|
11693
|
-
});
|
|
11441
|
+
throw this.raise(PlaceholderErrors.ClassNameIsRequired, this.state.startLoc);
|
|
11694
11442
|
}
|
|
11695
11443
|
} else {
|
|
11696
11444
|
this.parseClassId(node, isStatement, optionalId);
|
|
@@ -11771,9 +11519,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
11771
11519
|
}
|
|
11772
11520
|
assertNoSpace() {
|
|
11773
11521
|
if (this.state.start > this.state.lastTokEndLoc.index) {
|
|
11774
|
-
this.raise(PlaceholderErrors.UnexpectedSpace,
|
|
11775
|
-
at: this.state.lastTokEndLoc
|
|
11776
|
-
});
|
|
11522
|
+
this.raise(PlaceholderErrors.UnexpectedSpace, this.state.lastTokEndLoc);
|
|
11777
11523
|
}
|
|
11778
11524
|
}
|
|
11779
11525
|
};
|
|
@@ -11841,9 +11587,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
11841
11587
|
const name = key.type === "Identifier" ? key.name : key.value;
|
|
11842
11588
|
if (name === "__proto__") {
|
|
11843
11589
|
if (isRecord) {
|
|
11844
|
-
this.raise(Errors.RecordNoProto,
|
|
11845
|
-
at: key
|
|
11846
|
-
});
|
|
11590
|
+
this.raise(Errors.RecordNoProto, key);
|
|
11847
11591
|
return;
|
|
11848
11592
|
}
|
|
11849
11593
|
if (protoRef.used) {
|
|
@@ -11852,9 +11596,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
11852
11596
|
refExpressionErrors.doubleProtoLoc = key.loc.start;
|
|
11853
11597
|
}
|
|
11854
11598
|
} else {
|
|
11855
|
-
this.raise(Errors.DuplicateProto,
|
|
11856
|
-
at: key
|
|
11857
|
-
});
|
|
11599
|
+
this.raise(Errors.DuplicateProto, key);
|
|
11858
11600
|
}
|
|
11859
11601
|
}
|
|
11860
11602
|
protoRef.used = true;
|
|
@@ -11871,7 +11613,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
11871
11613
|
this.unexpected();
|
|
11872
11614
|
}
|
|
11873
11615
|
this.finalizeRemainingComments();
|
|
11874
|
-
expr.comments = this.
|
|
11616
|
+
expr.comments = this.comments;
|
|
11875
11617
|
expr.errors = this.state.errors;
|
|
11876
11618
|
if (this.options.tokens) {
|
|
11877
11619
|
expr.tokens = this.tokens;
|
|
@@ -12004,8 +11746,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
12004
11746
|
if (this.isPrivateName(left)) {
|
|
12005
11747
|
const value = this.getPrivateNameSV(left);
|
|
12006
11748
|
if (minPrec >= tokenOperatorPrecedence(58) || !this.prodParam.hasIn || !this.match(58)) {
|
|
12007
|
-
this.raise(Errors.PrivateInExpectedIn, {
|
|
12008
|
-
at: left,
|
|
11749
|
+
this.raise(Errors.PrivateInExpectedIn, left, {
|
|
12009
11750
|
identifierName: value
|
|
12010
11751
|
});
|
|
12011
11752
|
}
|
|
@@ -12035,18 +11776,14 @@ var require_lib = __commonJS((exports) => {
|
|
|
12035
11776
|
proposal: "minimal"
|
|
12036
11777
|
}])) {
|
|
12037
11778
|
if (this.state.type === 96 && this.prodParam.hasAwait) {
|
|
12038
|
-
throw this.raise(Errors.UnexpectedAwaitAfterPipelineBody,
|
|
12039
|
-
at: this.state.startLoc
|
|
12040
|
-
});
|
|
11779
|
+
throw this.raise(Errors.UnexpectedAwaitAfterPipelineBody, this.state.startLoc);
|
|
12041
11780
|
}
|
|
12042
11781
|
}
|
|
12043
11782
|
node.right = this.parseExprOpRightExpr(op, prec);
|
|
12044
11783
|
const finishedNode = this.finishNode(node, logical || coalesce ? "LogicalExpression" : "BinaryExpression");
|
|
12045
11784
|
const nextOp = this.state.type;
|
|
12046
11785
|
if (coalesce && (nextOp === 41 || nextOp === 42) || logical && nextOp === 40) {
|
|
12047
|
-
throw this.raise(Errors.MixingCoalesceWithLogical,
|
|
12048
|
-
at: this.state.startLoc
|
|
12049
|
-
});
|
|
11786
|
+
throw this.raise(Errors.MixingCoalesceWithLogical, this.state.startLoc);
|
|
12050
11787
|
}
|
|
12051
11788
|
return this.parseExprOp(finishedNode, leftStartLoc, minPrec);
|
|
12052
11789
|
}
|
|
@@ -12065,9 +11802,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
12065
11802
|
case "smart":
|
|
12066
11803
|
return this.withTopicBindingContext(() => {
|
|
12067
11804
|
if (this.prodParam.hasYield && this.isContextual(108)) {
|
|
12068
|
-
throw this.raise(Errors.PipeBodyIsTighter,
|
|
12069
|
-
at: this.state.startLoc
|
|
12070
|
-
});
|
|
11805
|
+
throw this.raise(Errors.PipeBodyIsTighter, this.state.startLoc);
|
|
12071
11806
|
}
|
|
12072
11807
|
return this.parseSmartPipelineBodyInStyle(this.parseExprOpBaseRightExpr(op, prec), startLoc);
|
|
12073
11808
|
});
|
|
@@ -12092,23 +11827,18 @@ var require_lib = __commonJS((exports) => {
|
|
|
12092
11827
|
const body = this.parseMaybeAssign();
|
|
12093
11828
|
const requiredParentheses = UnparenthesizedPipeBodyDescriptions.has(body.type);
|
|
12094
11829
|
if (requiredParentheses && !((_body$extra = body.extra) != null && _body$extra.parenthesized)) {
|
|
12095
|
-
this.raise(Errors.PipeUnparenthesizedBody, {
|
|
12096
|
-
at: startLoc,
|
|
11830
|
+
this.raise(Errors.PipeUnparenthesizedBody, startLoc, {
|
|
12097
11831
|
type: body.type
|
|
12098
11832
|
});
|
|
12099
11833
|
}
|
|
12100
11834
|
if (!this.topicReferenceWasUsedInCurrentContext()) {
|
|
12101
|
-
this.raise(Errors.PipeTopicUnused,
|
|
12102
|
-
at: startLoc
|
|
12103
|
-
});
|
|
11835
|
+
this.raise(Errors.PipeTopicUnused, startLoc);
|
|
12104
11836
|
}
|
|
12105
11837
|
return body;
|
|
12106
11838
|
}
|
|
12107
11839
|
checkExponentialAfterUnary(node) {
|
|
12108
11840
|
if (this.match(57)) {
|
|
12109
|
-
this.raise(Errors.UnexpectedTokenUnaryExponentiation,
|
|
12110
|
-
at: node.argument
|
|
12111
|
-
});
|
|
11841
|
+
this.raise(Errors.UnexpectedTokenUnaryExponentiation, node.argument);
|
|
12112
11842
|
}
|
|
12113
11843
|
}
|
|
12114
11844
|
parseMaybeUnary(refExpressionErrors, sawUnary) {
|
|
@@ -12136,13 +11866,9 @@ var require_lib = __commonJS((exports) => {
|
|
|
12136
11866
|
if (this.state.strict && isDelete) {
|
|
12137
11867
|
const arg = node.argument;
|
|
12138
11868
|
if (arg.type === "Identifier") {
|
|
12139
|
-
this.raise(Errors.StrictDelete,
|
|
12140
|
-
at: node
|
|
12141
|
-
});
|
|
11869
|
+
this.raise(Errors.StrictDelete, node);
|
|
12142
11870
|
} else if (this.hasPropertyAsPrivateName(arg)) {
|
|
12143
|
-
this.raise(Errors.DeletePrivateField,
|
|
12144
|
-
at: node
|
|
12145
|
-
});
|
|
11871
|
+
this.raise(Errors.DeletePrivateField, node);
|
|
12146
11872
|
}
|
|
12147
11873
|
}
|
|
12148
11874
|
if (!update) {
|
|
@@ -12159,9 +11885,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
12159
11885
|
} = this.state;
|
|
12160
11886
|
const startsExpr2 = this.hasPlugin("v8intrinsic") ? tokenCanStartExpression(type) : tokenCanStartExpression(type) && !this.match(54);
|
|
12161
11887
|
if (startsExpr2 && !this.isAmbiguousAwait()) {
|
|
12162
|
-
this.raiseOverwrite(Errors.AwaitNotInAsyncContext,
|
|
12163
|
-
at: startLoc
|
|
12164
|
-
});
|
|
11888
|
+
this.raiseOverwrite(Errors.AwaitNotInAsyncContext, startLoc);
|
|
12165
11889
|
return this.parseAwait(startLoc);
|
|
12166
11890
|
}
|
|
12167
11891
|
}
|
|
@@ -12224,9 +11948,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
12224
11948
|
let optional = false;
|
|
12225
11949
|
if (type === 18) {
|
|
12226
11950
|
if (noCalls) {
|
|
12227
|
-
this.raise(Errors.OptionalChainingNoNew,
|
|
12228
|
-
at: this.state.startLoc
|
|
12229
|
-
});
|
|
11951
|
+
this.raise(Errors.OptionalChainingNoNew, this.state.startLoc);
|
|
12230
11952
|
if (this.lookaheadCharCode() === 40) {
|
|
12231
11953
|
state.stop = true;
|
|
12232
11954
|
return base;
|
|
@@ -12256,9 +11978,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
12256
11978
|
this.expect(3);
|
|
12257
11979
|
} else if (this.match(138)) {
|
|
12258
11980
|
if (base.type === "Super") {
|
|
12259
|
-
this.raise(Errors.SuperPrivateField,
|
|
12260
|
-
at: startLoc
|
|
12261
|
-
});
|
|
11981
|
+
this.raise(Errors.SuperPrivateField, startLoc);
|
|
12262
11982
|
}
|
|
12263
11983
|
this.classScope.usePrivateName(this.state.value, this.state.startLoc);
|
|
12264
11984
|
node.property = this.parsePrivateName();
|
|
@@ -12328,9 +12048,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
12328
12048
|
node.tag = base;
|
|
12329
12049
|
node.quasi = this.parseTemplate(true);
|
|
12330
12050
|
if (state.optionalChainMember) {
|
|
12331
|
-
this.raise(Errors.OptionalChainingNoTemplate,
|
|
12332
|
-
at: startLoc
|
|
12333
|
-
});
|
|
12051
|
+
this.raise(Errors.OptionalChainingNoTemplate, startLoc);
|
|
12334
12052
|
}
|
|
12335
12053
|
return this.finishNode(node, "TaggedTemplateExpression");
|
|
12336
12054
|
}
|
|
@@ -12352,16 +12070,13 @@ var require_lib = __commonJS((exports) => {
|
|
|
12352
12070
|
}
|
|
12353
12071
|
}
|
|
12354
12072
|
if (node.arguments.length === 0 || node.arguments.length > 2) {
|
|
12355
|
-
this.raise(Errors.ImportCallArity, {
|
|
12356
|
-
at: node,
|
|
12073
|
+
this.raise(Errors.ImportCallArity, node, {
|
|
12357
12074
|
maxArgumentCount: this.hasPlugin("importAttributes") || this.hasPlugin("importAssertions") || this.hasPlugin("moduleAttributes") ? 2 : 1
|
|
12358
12075
|
});
|
|
12359
12076
|
} else {
|
|
12360
12077
|
for (const arg of node.arguments) {
|
|
12361
12078
|
if (arg.type === "SpreadElement") {
|
|
12362
|
-
this.raise(Errors.ImportCallSpreadArgument,
|
|
12363
|
-
at: arg
|
|
12364
|
-
});
|
|
12079
|
+
this.raise(Errors.ImportCallSpreadArgument, arg);
|
|
12365
12080
|
}
|
|
12366
12081
|
}
|
|
12367
12082
|
}
|
|
@@ -12380,9 +12095,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
12380
12095
|
this.expect(12);
|
|
12381
12096
|
if (this.match(close)) {
|
|
12382
12097
|
if (dynamicImport && !this.hasPlugin("importAttributes") && !this.hasPlugin("importAssertions") && !this.hasPlugin("moduleAttributes")) {
|
|
12383
|
-
this.raise(Errors.ImportCallArgumentTrailingComma,
|
|
12384
|
-
at: this.state.lastTokStartLoc
|
|
12385
|
-
});
|
|
12098
|
+
this.raise(Errors.ImportCallArgumentTrailingComma, this.state.lastTokStartLoc);
|
|
12386
12099
|
}
|
|
12387
12100
|
if (nodeForExtra) {
|
|
12388
12101
|
this.addTrailingCommaExtraToNode(nodeForExtra);
|
|
@@ -12438,9 +12151,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
12438
12151
|
return this.finishNode(node, "Import");
|
|
12439
12152
|
}
|
|
12440
12153
|
} else {
|
|
12441
|
-
this.raise(Errors.UnsupportedImport,
|
|
12442
|
-
at: this.state.lastTokStartLoc
|
|
12443
|
-
});
|
|
12154
|
+
this.raise(Errors.UnsupportedImport, this.state.lastTokStartLoc);
|
|
12444
12155
|
return this.finishNode(node, "Import");
|
|
12445
12156
|
}
|
|
12446
12157
|
case 78:
|
|
@@ -12506,14 +12217,11 @@ var require_lib = __commonJS((exports) => {
|
|
|
12506
12217
|
if (callee.type === "MemberExpression") {
|
|
12507
12218
|
return this.finishNode(node, "BindExpression");
|
|
12508
12219
|
} else {
|
|
12509
|
-
throw this.raise(Errors.UnsupportedBind,
|
|
12510
|
-
at: callee
|
|
12511
|
-
});
|
|
12220
|
+
throw this.raise(Errors.UnsupportedBind, callee);
|
|
12512
12221
|
}
|
|
12513
12222
|
}
|
|
12514
12223
|
case 138: {
|
|
12515
|
-
this.raise(Errors.PrivateInExpectedIn, {
|
|
12516
|
-
at: this.state.startLoc,
|
|
12224
|
+
this.raise(Errors.PrivateInExpectedIn, this.state.startLoc, {
|
|
12517
12225
|
identifierName: this.state.value
|
|
12518
12226
|
});
|
|
12519
12227
|
return this.parsePrivateName();
|
|
@@ -12608,15 +12316,12 @@ var require_lib = __commonJS((exports) => {
|
|
|
12608
12316
|
if (this.testTopicReferenceConfiguration(pipeProposal, startLoc, tokenType)) {
|
|
12609
12317
|
const nodeType = pipeProposal === "smart" ? "PipelinePrimaryTopicReference" : "TopicReference";
|
|
12610
12318
|
if (!this.topicReferenceIsAllowedInCurrentContext()) {
|
|
12611
|
-
this.raise(pipeProposal === "smart" ? Errors.PrimaryTopicNotAllowed : Errors.PipeTopicUnbound,
|
|
12612
|
-
at: startLoc
|
|
12613
|
-
});
|
|
12319
|
+
this.raise(pipeProposal === "smart" ? Errors.PrimaryTopicNotAllowed : Errors.PipeTopicUnbound, startLoc);
|
|
12614
12320
|
}
|
|
12615
12321
|
this.registerTopicReference();
|
|
12616
12322
|
return this.finishNode(node, nodeType);
|
|
12617
12323
|
} else {
|
|
12618
|
-
throw this.raise(Errors.PipeTopicUnconfiguredToken, {
|
|
12619
|
-
at: startLoc,
|
|
12324
|
+
throw this.raise(Errors.PipeTopicUnconfiguredToken, startLoc, {
|
|
12620
12325
|
token: tokenLabelName(tokenType)
|
|
12621
12326
|
});
|
|
12622
12327
|
}
|
|
@@ -12631,9 +12336,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
12631
12336
|
case "smart":
|
|
12632
12337
|
return tokenType === 27;
|
|
12633
12338
|
default:
|
|
12634
|
-
throw this.raise(Errors.PipeTopicRequiresHackPipes,
|
|
12635
|
-
at: startLoc
|
|
12636
|
-
});
|
|
12339
|
+
throw this.raise(Errors.PipeTopicRequiresHackPipes, startLoc);
|
|
12637
12340
|
}
|
|
12638
12341
|
}
|
|
12639
12342
|
parseAsyncArrowUnaryFunction(node) {
|
|
@@ -12641,9 +12344,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
12641
12344
|
const params = [this.parseIdentifier()];
|
|
12642
12345
|
this.prodParam.exit();
|
|
12643
12346
|
if (this.hasPrecedingLineBreak()) {
|
|
12644
|
-
this.raise(Errors.LineTerminatorBeforeArrow,
|
|
12645
|
-
at: this.state.curPosition()
|
|
12646
|
-
});
|
|
12347
|
+
this.raise(Errors.LineTerminatorBeforeArrow, this.state.curPosition());
|
|
12647
12348
|
}
|
|
12648
12349
|
this.expect(19);
|
|
12649
12350
|
return this.parseArrowExpression(node, params, true);
|
|
@@ -12671,18 +12372,12 @@ var require_lib = __commonJS((exports) => {
|
|
|
12671
12372
|
const node = this.startNode();
|
|
12672
12373
|
this.next();
|
|
12673
12374
|
if (this.match(10) && !this.scope.allowDirectSuper && !this.options.allowSuperOutsideMethod) {
|
|
12674
|
-
this.raise(Errors.SuperNotAllowed,
|
|
12675
|
-
at: node
|
|
12676
|
-
});
|
|
12375
|
+
this.raise(Errors.SuperNotAllowed, node);
|
|
12677
12376
|
} else if (!this.scope.allowSuper && !this.options.allowSuperOutsideMethod) {
|
|
12678
|
-
this.raise(Errors.UnexpectedSuper,
|
|
12679
|
-
at: node
|
|
12680
|
-
});
|
|
12377
|
+
this.raise(Errors.UnexpectedSuper, node);
|
|
12681
12378
|
}
|
|
12682
12379
|
if (!this.match(10) && !this.match(0) && !this.match(16)) {
|
|
12683
|
-
this.raise(Errors.UnsupportedSuper,
|
|
12684
|
-
at: node
|
|
12685
|
-
});
|
|
12380
|
+
this.raise(Errors.UnsupportedSuper, node);
|
|
12686
12381
|
}
|
|
12687
12382
|
return this.finishNode(node, "Super");
|
|
12688
12383
|
}
|
|
@@ -12714,8 +12409,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
12714
12409
|
const containsEsc = this.state.containsEsc;
|
|
12715
12410
|
node.property = this.parseIdentifier(true);
|
|
12716
12411
|
if (node.property.name !== propertyName || containsEsc) {
|
|
12717
|
-
this.raise(Errors.UnsupportedMetaProperty, {
|
|
12718
|
-
at: node.property,
|
|
12412
|
+
this.raise(Errors.UnsupportedMetaProperty, node.property, {
|
|
12719
12413
|
target: meta2.name,
|
|
12720
12414
|
onlyValidPropertyName: propertyName
|
|
12721
12415
|
});
|
|
@@ -12727,9 +12421,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
12727
12421
|
this.next();
|
|
12728
12422
|
if (this.isContextual(101)) {
|
|
12729
12423
|
if (!this.inModule) {
|
|
12730
|
-
this.raise(Errors.ImportMetaOutsideModule,
|
|
12731
|
-
at: id
|
|
12732
|
-
});
|
|
12424
|
+
this.raise(Errors.ImportMetaOutsideModule, id);
|
|
12733
12425
|
}
|
|
12734
12426
|
this.sawUnambiguousESM = true;
|
|
12735
12427
|
} else if (this.isContextual(105) || this.isContextual(97)) {
|
|
@@ -12738,8 +12430,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
12738
12430
|
this.unexpected();
|
|
12739
12431
|
this.expectPlugin(isSource ? "sourcePhaseImports" : "deferredImportEvaluation");
|
|
12740
12432
|
if (!this.options.createImportExpressions) {
|
|
12741
|
-
throw this.raise(Errors.DynamicImportPhaseRequiresImportExpressions, {
|
|
12742
|
-
at: this.state.startLoc,
|
|
12433
|
+
throw this.raise(Errors.DynamicImportPhaseRequiresImportExpressions, this.state.startLoc, {
|
|
12743
12434
|
phase: this.state.value
|
|
12744
12435
|
});
|
|
12745
12436
|
}
|
|
@@ -12887,9 +12578,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
12887
12578
|
this.next();
|
|
12888
12579
|
const metaProp = this.parseMetaProperty(node, meta2, "target");
|
|
12889
12580
|
if (!this.scope.inNonArrowFunction && !this.scope.inClass && !this.options.allowNewTargetOutsideFunction) {
|
|
12890
|
-
this.raise(Errors.UnexpectedNewTarget,
|
|
12891
|
-
at: metaProp
|
|
12892
|
-
});
|
|
12581
|
+
this.raise(Errors.UnexpectedNewTarget, metaProp);
|
|
12893
12582
|
}
|
|
12894
12583
|
return metaProp;
|
|
12895
12584
|
}
|
|
@@ -12911,9 +12600,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
12911
12600
|
const callee = this.parseNoCallExpr();
|
|
12912
12601
|
node.callee = callee;
|
|
12913
12602
|
if (isImport && (callee.type === "Import" || callee.type === "ImportExpression")) {
|
|
12914
|
-
this.raise(Errors.ImportCallNotNewExpression,
|
|
12915
|
-
at: callee
|
|
12916
|
-
});
|
|
12603
|
+
this.raise(Errors.ImportCallNotNewExpression, callee);
|
|
12917
12604
|
}
|
|
12918
12605
|
}
|
|
12919
12606
|
parseTemplateElement(isTagged) {
|
|
@@ -12927,9 +12614,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
12927
12614
|
const elem = this.startNodeAt(createPositionWithColumnOffset(startLoc, 1));
|
|
12928
12615
|
if (value === null) {
|
|
12929
12616
|
if (!isTagged) {
|
|
12930
|
-
this.raise(Errors.InvalidEscapeSequenceTemplate,
|
|
12931
|
-
at: createPositionWithColumnOffset(this.state.firstInvalidTemplateEscapePos, 1)
|
|
12932
|
-
});
|
|
12617
|
+
this.raise(Errors.InvalidEscapeSequenceTemplate, createPositionWithColumnOffset(this.state.firstInvalidTemplateEscapePos, 1));
|
|
12933
12618
|
}
|
|
12934
12619
|
}
|
|
12935
12620
|
const isTail = this.match(24);
|
|
@@ -12989,9 +12674,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
12989
12674
|
this.checkProto(prop, isRecord, propHash, refExpressionErrors);
|
|
12990
12675
|
}
|
|
12991
12676
|
if (isRecord && !this.isObjectProperty(prop) && prop.type !== "SpreadElement") {
|
|
12992
|
-
this.raise(Errors.InvalidRecordProperty,
|
|
12993
|
-
at: prop
|
|
12994
|
-
});
|
|
12677
|
+
this.raise(Errors.InvalidRecordProperty, prop);
|
|
12995
12678
|
}
|
|
12996
12679
|
if (prop.shorthand) {
|
|
12997
12680
|
this.addExtra(prop, "shorthand", true);
|
|
@@ -13009,7 +12692,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
13009
12692
|
return this.finishNode(node, type);
|
|
13010
12693
|
}
|
|
13011
12694
|
addTrailingCommaExtraToNode(node) {
|
|
13012
|
-
this.addExtra(node, "trailingComma", this.state.
|
|
12695
|
+
this.addExtra(node, "trailingComma", this.state.lastTokStartLoc.index);
|
|
13013
12696
|
this.addExtra(node, "trailingCommaLoc", this.state.lastTokStartLoc, false);
|
|
13014
12697
|
}
|
|
13015
12698
|
maybeAsyncOrAccessorProp(prop) {
|
|
@@ -13019,9 +12702,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
13019
12702
|
let decorators = [];
|
|
13020
12703
|
if (this.match(26)) {
|
|
13021
12704
|
if (this.hasPlugin("decorators")) {
|
|
13022
|
-
this.raise(Errors.UnsupportedPropertyDecorator,
|
|
13023
|
-
at: this.state.startLoc
|
|
13024
|
-
});
|
|
12705
|
+
this.raise(Errors.UnsupportedPropertyDecorator, this.state.startLoc);
|
|
13025
12706
|
}
|
|
13026
12707
|
while (this.match(26)) {
|
|
13027
12708
|
decorators.push(this.parseDecorator());
|
|
@@ -13062,8 +12743,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
13062
12743
|
prop.kind = keyName;
|
|
13063
12744
|
if (this.match(55)) {
|
|
13064
12745
|
isGenerator = true;
|
|
13065
|
-
this.raise(Errors.AccessorIsGenerator, {
|
|
13066
|
-
at: this.state.curPosition(),
|
|
12746
|
+
this.raise(Errors.AccessorIsGenerator, this.state.curPosition(), {
|
|
13067
12747
|
kind: keyName
|
|
13068
12748
|
});
|
|
13069
12749
|
this.next();
|
|
@@ -13084,14 +12764,10 @@ var require_lib = __commonJS((exports) => {
|
|
|
13084
12764
|
const paramCount = this.getGetterSetterExpectedParamCount(method);
|
|
13085
12765
|
const params = this.getObjectOrClassMethodParams(method);
|
|
13086
12766
|
if (params.length !== paramCount) {
|
|
13087
|
-
this.raise(method.kind === "get" ? Errors.BadGetterArity : Errors.BadSetterArity,
|
|
13088
|
-
at: method
|
|
13089
|
-
});
|
|
12767
|
+
this.raise(method.kind === "get" ? Errors.BadGetterArity : Errors.BadSetterArity, method);
|
|
13090
12768
|
}
|
|
13091
12769
|
if (method.kind === "set" && ((_params = params[params.length - 1]) == null ? undefined : _params.type) === "RestElement") {
|
|
13092
|
-
this.raise(Errors.BadSetterRestParameter,
|
|
13093
|
-
at: method
|
|
13094
|
-
});
|
|
12770
|
+
this.raise(Errors.BadSetterRestParameter, method);
|
|
13095
12771
|
}
|
|
13096
12772
|
}
|
|
13097
12773
|
parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor) {
|
|
@@ -13125,9 +12801,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
13125
12801
|
refExpressionErrors.shorthandAssignLoc = shorthandAssignLoc;
|
|
13126
12802
|
}
|
|
13127
12803
|
} else {
|
|
13128
|
-
this.raise(Errors.InvalidCoverInitializedName,
|
|
13129
|
-
at: shorthandAssignLoc
|
|
13130
|
-
});
|
|
12804
|
+
this.raise(Errors.InvalidCoverInitializedName, shorthandAssignLoc);
|
|
13131
12805
|
}
|
|
13132
12806
|
prop.value = this.parseMaybeDefault(startLoc, cloneIdentifier(prop.key));
|
|
13133
12807
|
} else {
|
|
@@ -13177,9 +12851,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
13177
12851
|
refExpressionErrors.privateKeyLoc = privateKeyLoc;
|
|
13178
12852
|
}
|
|
13179
12853
|
} else {
|
|
13180
|
-
this.raise(Errors.UnexpectedPrivateField,
|
|
13181
|
-
at: privateKeyLoc
|
|
13182
|
-
});
|
|
12854
|
+
this.raise(Errors.UnexpectedPrivateField, privateKeyLoc);
|
|
13183
12855
|
}
|
|
13184
12856
|
key = this.parsePrivateName();
|
|
13185
12857
|
break;
|
|
@@ -13265,9 +12937,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
13265
12937
|
node.body = this.parseBlock(true, false, (hasStrictModeDirective) => {
|
|
13266
12938
|
const nonSimple = !this.isSimpleParamList(node.params);
|
|
13267
12939
|
if (hasStrictModeDirective && nonSimple) {
|
|
13268
|
-
this.raise(Errors.IllegalLanguageModeDirective,
|
|
13269
|
-
at: (node.kind === "method" || node.kind === "constructor") && !!node.key ? node.key.loc.end : node
|
|
13270
|
-
});
|
|
12940
|
+
this.raise(Errors.IllegalLanguageModeDirective, (node.kind === "method" || node.kind === "constructor") && !!node.key ? node.key.loc.end : node);
|
|
13271
12941
|
}
|
|
13272
12942
|
const strictModeChanged = !oldStrict && this.state.strict;
|
|
13273
12943
|
this.checkParams(node, !this.state.strict && !allowExpression && !isMethod && !nonSimple, allowExpression, strictModeChanged);
|
|
@@ -13328,8 +12998,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
13328
12998
|
let elt;
|
|
13329
12999
|
if (this.match(12)) {
|
|
13330
13000
|
if (!allowEmpty) {
|
|
13331
|
-
this.raise(Errors.UnexpectedToken, {
|
|
13332
|
-
at: this.state.curPosition(),
|
|
13001
|
+
this.raise(Errors.UnexpectedToken, this.state.curPosition(), {
|
|
13333
13002
|
unexpected: ","
|
|
13334
13003
|
});
|
|
13335
13004
|
}
|
|
@@ -13340,9 +13009,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
13340
13009
|
} else if (this.match(17)) {
|
|
13341
13010
|
this.expectPlugin("partialApplication");
|
|
13342
13011
|
if (!allowPlaceholder) {
|
|
13343
|
-
this.raise(Errors.UnexpectedArgumentPlaceholder,
|
|
13344
|
-
at: this.state.startLoc
|
|
13345
|
-
});
|
|
13012
|
+
this.raise(Errors.UnexpectedArgumentPlaceholder, this.state.startLoc);
|
|
13346
13013
|
}
|
|
13347
13014
|
const node = this.startNode();
|
|
13348
13015
|
this.next();
|
|
@@ -13392,47 +13059,35 @@ var require_lib = __commonJS((exports) => {
|
|
|
13392
13059
|
return;
|
|
13393
13060
|
}
|
|
13394
13061
|
if (checkKeywords && isKeyword(word)) {
|
|
13395
|
-
this.raise(Errors.UnexpectedKeyword, {
|
|
13396
|
-
at: startLoc,
|
|
13062
|
+
this.raise(Errors.UnexpectedKeyword, startLoc, {
|
|
13397
13063
|
keyword: word
|
|
13398
13064
|
});
|
|
13399
13065
|
return;
|
|
13400
13066
|
}
|
|
13401
13067
|
const reservedTest = !this.state.strict ? isReservedWord : isBinding ? isStrictBindReservedWord : isStrictReservedWord;
|
|
13402
13068
|
if (reservedTest(word, this.inModule)) {
|
|
13403
|
-
this.raise(Errors.UnexpectedReservedWord, {
|
|
13404
|
-
at: startLoc,
|
|
13069
|
+
this.raise(Errors.UnexpectedReservedWord, startLoc, {
|
|
13405
13070
|
reservedWord: word
|
|
13406
13071
|
});
|
|
13407
13072
|
return;
|
|
13408
13073
|
} else if (word === "yield") {
|
|
13409
13074
|
if (this.prodParam.hasYield) {
|
|
13410
|
-
this.raise(Errors.YieldBindingIdentifier,
|
|
13411
|
-
at: startLoc
|
|
13412
|
-
});
|
|
13075
|
+
this.raise(Errors.YieldBindingIdentifier, startLoc);
|
|
13413
13076
|
return;
|
|
13414
13077
|
}
|
|
13415
13078
|
} else if (word === "await") {
|
|
13416
13079
|
if (this.prodParam.hasAwait) {
|
|
13417
|
-
this.raise(Errors.AwaitBindingIdentifier,
|
|
13418
|
-
at: startLoc
|
|
13419
|
-
});
|
|
13080
|
+
this.raise(Errors.AwaitBindingIdentifier, startLoc);
|
|
13420
13081
|
return;
|
|
13421
13082
|
}
|
|
13422
13083
|
if (this.scope.inStaticBlock) {
|
|
13423
|
-
this.raise(Errors.AwaitBindingIdentifierInStaticBlock,
|
|
13424
|
-
at: startLoc
|
|
13425
|
-
});
|
|
13084
|
+
this.raise(Errors.AwaitBindingIdentifierInStaticBlock, startLoc);
|
|
13426
13085
|
return;
|
|
13427
13086
|
}
|
|
13428
|
-
this.expressionScope.recordAsyncArrowParametersError(
|
|
13429
|
-
at: startLoc
|
|
13430
|
-
});
|
|
13087
|
+
this.expressionScope.recordAsyncArrowParametersError(startLoc);
|
|
13431
13088
|
} else if (word === "arguments") {
|
|
13432
13089
|
if (this.scope.inClassAndNotInNonArrowFunction) {
|
|
13433
|
-
this.raise(Errors.ArgumentsInClass,
|
|
13434
|
-
at: startLoc
|
|
13435
|
-
});
|
|
13090
|
+
this.raise(Errors.ArgumentsInClass, startLoc);
|
|
13436
13091
|
return;
|
|
13437
13092
|
}
|
|
13438
13093
|
}
|
|
@@ -13447,13 +13102,9 @@ var require_lib = __commonJS((exports) => {
|
|
|
13447
13102
|
}
|
|
13448
13103
|
parseAwait(startLoc) {
|
|
13449
13104
|
const node = this.startNodeAt(startLoc);
|
|
13450
|
-
this.expressionScope.recordParameterInitializerError(Errors.AwaitExpressionFormalParameter,
|
|
13451
|
-
at: node
|
|
13452
|
-
});
|
|
13105
|
+
this.expressionScope.recordParameterInitializerError(Errors.AwaitExpressionFormalParameter, node);
|
|
13453
13106
|
if (this.eat(55)) {
|
|
13454
|
-
this.raise(Errors.ObsoleteAwaitStar,
|
|
13455
|
-
at: node
|
|
13456
|
-
});
|
|
13107
|
+
this.raise(Errors.ObsoleteAwaitStar, node);
|
|
13457
13108
|
}
|
|
13458
13109
|
if (!this.scope.inFunction && !this.options.allowAwaitOutsideFunction) {
|
|
13459
13110
|
if (this.isAmbiguousAwait()) {
|
|
@@ -13477,9 +13128,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
13477
13128
|
}
|
|
13478
13129
|
parseYield() {
|
|
13479
13130
|
const node = this.startNode();
|
|
13480
|
-
this.expressionScope.recordParameterInitializerError(Errors.YieldInParameter,
|
|
13481
|
-
at: node
|
|
13482
|
-
});
|
|
13131
|
+
this.expressionScope.recordParameterInitializerError(Errors.YieldInParameter, node);
|
|
13483
13132
|
this.next();
|
|
13484
13133
|
let delegating = false;
|
|
13485
13134
|
let argument = null;
|
|
@@ -13525,9 +13174,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
13525
13174
|
proposal: "smart"
|
|
13526
13175
|
}])) {
|
|
13527
13176
|
if (left.type === "SequenceExpression") {
|
|
13528
|
-
this.raise(Errors.PipelineHeadSequenceExpression,
|
|
13529
|
-
at: leftStartLoc
|
|
13530
|
-
});
|
|
13177
|
+
this.raise(Errors.PipelineHeadSequenceExpression, leftStartLoc);
|
|
13531
13178
|
}
|
|
13532
13179
|
}
|
|
13533
13180
|
}
|
|
@@ -13555,14 +13202,10 @@ var require_lib = __commonJS((exports) => {
|
|
|
13555
13202
|
}
|
|
13556
13203
|
checkSmartPipeTopicBodyEarlyErrors(startLoc) {
|
|
13557
13204
|
if (this.match(19)) {
|
|
13558
|
-
throw this.raise(Errors.PipelineBodyNoArrow,
|
|
13559
|
-
at: this.state.startLoc
|
|
13560
|
-
});
|
|
13205
|
+
throw this.raise(Errors.PipelineBodyNoArrow, this.state.startLoc);
|
|
13561
13206
|
}
|
|
13562
13207
|
if (!this.topicReferenceWasUsedInCurrentContext()) {
|
|
13563
|
-
this.raise(Errors.PipelineTopicUnused,
|
|
13564
|
-
at: startLoc
|
|
13565
|
-
});
|
|
13208
|
+
this.raise(Errors.PipelineTopicUnused, startLoc);
|
|
13566
13209
|
}
|
|
13567
13210
|
}
|
|
13568
13211
|
withTopicBindingContext(callback) {
|
|
@@ -13670,10 +13313,10 @@ var require_lib = __commonJS((exports) => {
|
|
|
13670
13313
|
}
|
|
13671
13314
|
}
|
|
13672
13315
|
var loopLabel = {
|
|
13673
|
-
kind:
|
|
13316
|
+
kind: 1
|
|
13674
13317
|
};
|
|
13675
13318
|
var switchLabel = {
|
|
13676
|
-
kind:
|
|
13319
|
+
kind: 2
|
|
13677
13320
|
};
|
|
13678
13321
|
var loneSurrogate = /[\uD800-\uDFFF]/u;
|
|
13679
13322
|
var keywordRelationalOperator = /in(?:stanceof)?/y;
|
|
@@ -13681,7 +13324,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
13681
13324
|
class StatementParser extends ExpressionParser {
|
|
13682
13325
|
parseTopLevel(file, program) {
|
|
13683
13326
|
file.program = this.parseProgram(program);
|
|
13684
|
-
file.comments = this.
|
|
13327
|
+
file.comments = this.comments;
|
|
13685
13328
|
if (this.options.tokens) {
|
|
13686
13329
|
file.tokens = babel7CompatTokens(this.tokens, this.input);
|
|
13687
13330
|
}
|
|
@@ -13693,8 +13336,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
13693
13336
|
this.parseBlockBody(program, true, true, end);
|
|
13694
13337
|
if (this.inModule && !this.options.allowUndeclaredExports && this.scope.undefinedExports.size > 0) {
|
|
13695
13338
|
for (const [localName, at] of Array.from(this.scope.undefinedExports)) {
|
|
13696
|
-
this.raise(Errors.ModuleExportUndefined, {
|
|
13697
|
-
at,
|
|
13339
|
+
this.raise(Errors.ModuleExportUndefined, at, {
|
|
13698
13340
|
localName
|
|
13699
13341
|
});
|
|
13700
13342
|
}
|
|
@@ -13837,9 +13479,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
13837
13479
|
if (this.lookaheadCharCode() === 46)
|
|
13838
13480
|
break;
|
|
13839
13481
|
if (!allowFunctionDeclaration) {
|
|
13840
|
-
this.raise(this.state.strict ? Errors.StrictFunction : this.options.annexB ? Errors.SloppyFunctionAnnexB : Errors.SloppyFunction,
|
|
13841
|
-
at: this.state.startLoc
|
|
13842
|
-
});
|
|
13482
|
+
this.raise(this.state.strict ? Errors.StrictFunction : this.options.annexB ? Errors.SloppyFunctionAnnexB : Errors.SloppyFunction, this.state.startLoc);
|
|
13843
13483
|
}
|
|
13844
13484
|
return this.parseFunctionStatement(node, false, !allowDeclaration && allowFunctionDeclaration);
|
|
13845
13485
|
case 80:
|
|
@@ -13859,13 +13499,9 @@ var require_lib = __commonJS((exports) => {
|
|
|
13859
13499
|
case 96:
|
|
13860
13500
|
if (!this.state.containsEsc && this.startsAwaitUsing()) {
|
|
13861
13501
|
if (!this.isAwaitAllowed()) {
|
|
13862
|
-
this.raise(Errors.AwaitUsingNotInAsyncContext,
|
|
13863
|
-
at: node
|
|
13864
|
-
});
|
|
13502
|
+
this.raise(Errors.AwaitUsingNotInAsyncContext, node);
|
|
13865
13503
|
} else if (!allowDeclaration) {
|
|
13866
|
-
this.raise(Errors.UnexpectedLexicalDeclaration,
|
|
13867
|
-
at: node
|
|
13868
|
-
});
|
|
13504
|
+
this.raise(Errors.UnexpectedLexicalDeclaration, node);
|
|
13869
13505
|
}
|
|
13870
13506
|
this.next();
|
|
13871
13507
|
return this.parseVarStatement(node, "await using");
|
|
@@ -13877,13 +13513,9 @@ var require_lib = __commonJS((exports) => {
|
|
|
13877
13513
|
}
|
|
13878
13514
|
this.expectPlugin("explicitResourceManagement");
|
|
13879
13515
|
if (!this.scope.inModule && this.scope.inTopLevel) {
|
|
13880
|
-
this.raise(Errors.UnexpectedUsingDeclaration,
|
|
13881
|
-
at: this.state.startLoc
|
|
13882
|
-
});
|
|
13516
|
+
this.raise(Errors.UnexpectedUsingDeclaration, this.state.startLoc);
|
|
13883
13517
|
} else if (!allowDeclaration) {
|
|
13884
|
-
this.raise(Errors.UnexpectedLexicalDeclaration,
|
|
13885
|
-
at: this.state.startLoc
|
|
13886
|
-
});
|
|
13518
|
+
this.raise(Errors.UnexpectedLexicalDeclaration, this.state.startLoc);
|
|
13887
13519
|
}
|
|
13888
13520
|
return this.parseVarStatement(node, "using");
|
|
13889
13521
|
case 100: {
|
|
@@ -13902,9 +13534,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
13902
13534
|
}
|
|
13903
13535
|
case 75: {
|
|
13904
13536
|
if (!allowDeclaration) {
|
|
13905
|
-
this.raise(Errors.UnexpectedLexicalDeclaration,
|
|
13906
|
-
at: this.state.startLoc
|
|
13907
|
-
});
|
|
13537
|
+
this.raise(Errors.UnexpectedLexicalDeclaration, this.state.startLoc);
|
|
13908
13538
|
}
|
|
13909
13539
|
}
|
|
13910
13540
|
case 74: {
|
|
@@ -13927,9 +13557,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
13927
13557
|
}
|
|
13928
13558
|
case 82: {
|
|
13929
13559
|
if (!this.options.allowImportExportEverywhere && !topLevel) {
|
|
13930
|
-
this.raise(Errors.UnexpectedImportExport,
|
|
13931
|
-
at: this.state.startLoc
|
|
13932
|
-
});
|
|
13560
|
+
this.raise(Errors.UnexpectedImportExport, this.state.startLoc);
|
|
13933
13561
|
}
|
|
13934
13562
|
this.next();
|
|
13935
13563
|
let result;
|
|
@@ -13950,9 +13578,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
13950
13578
|
default: {
|
|
13951
13579
|
if (this.isAsyncFunction()) {
|
|
13952
13580
|
if (!allowDeclaration) {
|
|
13953
|
-
this.raise(Errors.AsyncFunctionInSingleStatementContext,
|
|
13954
|
-
at: this.state.startLoc
|
|
13955
|
-
});
|
|
13581
|
+
this.raise(Errors.AsyncFunctionInSingleStatementContext, this.state.startLoc);
|
|
13956
13582
|
}
|
|
13957
13583
|
this.next();
|
|
13958
13584
|
return this.parseFunctionStatement(node, true, !allowDeclaration && allowFunctionDeclaration);
|
|
@@ -13969,9 +13595,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
13969
13595
|
}
|
|
13970
13596
|
assertModuleNodeAllowed(node) {
|
|
13971
13597
|
if (!this.options.allowImportExportEverywhere && !this.inModule) {
|
|
13972
|
-
this.raise(Errors.ImportOutsideModule,
|
|
13973
|
-
at: node
|
|
13974
|
-
});
|
|
13598
|
+
this.raise(Errors.ImportOutsideModule, node);
|
|
13975
13599
|
}
|
|
13976
13600
|
}
|
|
13977
13601
|
decoratorsEnabledBeforeExport() {
|
|
@@ -13983,9 +13607,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
13983
13607
|
if (maybeDecorators) {
|
|
13984
13608
|
if (classNode.decorators && classNode.decorators.length > 0) {
|
|
13985
13609
|
if (typeof this.getPluginOption("decorators", "decoratorsBeforeExport") !== "boolean") {
|
|
13986
|
-
this.raise(Errors.DecoratorsBeforeAfterExport,
|
|
13987
|
-
at: classNode.decorators[0]
|
|
13988
|
-
});
|
|
13610
|
+
this.raise(Errors.DecoratorsBeforeAfterExport, classNode.decorators[0]);
|
|
13989
13611
|
}
|
|
13990
13612
|
classNode.decorators.unshift(...maybeDecorators);
|
|
13991
13613
|
} else {
|
|
@@ -14010,14 +13632,10 @@ var require_lib = __commonJS((exports) => {
|
|
|
14010
13632
|
this.unexpected();
|
|
14011
13633
|
}
|
|
14012
13634
|
if (!this.decoratorsEnabledBeforeExport()) {
|
|
14013
|
-
this.raise(Errors.DecoratorExportClass,
|
|
14014
|
-
at: this.state.startLoc
|
|
14015
|
-
});
|
|
13635
|
+
this.raise(Errors.DecoratorExportClass, this.state.startLoc);
|
|
14016
13636
|
}
|
|
14017
13637
|
} else if (!this.canHaveLeadingDecorator()) {
|
|
14018
|
-
throw this.raise(Errors.UnexpectedLeadingDecorator,
|
|
14019
|
-
at: this.state.startLoc
|
|
14020
|
-
});
|
|
13638
|
+
throw this.raise(Errors.UnexpectedLeadingDecorator, this.state.startLoc);
|
|
14021
13639
|
}
|
|
14022
13640
|
return decorators;
|
|
14023
13641
|
}
|
|
@@ -14037,9 +13655,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
14037
13655
|
const paramsStartLoc = this.state.startLoc;
|
|
14038
13656
|
node.expression = this.parseMaybeDecoratorArguments(expr);
|
|
14039
13657
|
if (this.getPluginOption("decorators", "allowCallParenthesized") === false && node.expression !== expr) {
|
|
14040
|
-
this.raise(Errors.DecoratorArgumentsOutsideParentheses,
|
|
14041
|
-
at: paramsStartLoc
|
|
14042
|
-
});
|
|
13658
|
+
this.raise(Errors.DecoratorArgumentsOutsideParentheses, paramsStartLoc);
|
|
14043
13659
|
}
|
|
14044
13660
|
} else {
|
|
14045
13661
|
expr = this.parseIdentifier(false);
|
|
@@ -14088,16 +13704,16 @@ var require_lib = __commonJS((exports) => {
|
|
|
14088
13704
|
for (i = 0;i < this.state.labels.length; ++i) {
|
|
14089
13705
|
const lab = this.state.labels[i];
|
|
14090
13706
|
if (node.label == null || lab.name === node.label.name) {
|
|
14091
|
-
if (lab.kind != null && (isBreak || lab.kind ===
|
|
13707
|
+
if (lab.kind != null && (isBreak || lab.kind === 1)) {
|
|
14092
13708
|
break;
|
|
13709
|
+
}
|
|
14093
13710
|
if (node.label && isBreak)
|
|
14094
13711
|
break;
|
|
14095
13712
|
}
|
|
14096
13713
|
}
|
|
14097
13714
|
if (i === this.state.labels.length) {
|
|
14098
13715
|
const type = isBreak ? "BreakStatement" : "ContinueStatement";
|
|
14099
|
-
this.raise(Errors.IllegalBreakContinue, {
|
|
14100
|
-
at: node,
|
|
13716
|
+
this.raise(Errors.IllegalBreakContinue, node, {
|
|
14101
13717
|
type
|
|
14102
13718
|
});
|
|
14103
13719
|
}
|
|
@@ -14149,9 +13765,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
14149
13765
|
if (startsWithAwaitUsing) {
|
|
14150
13766
|
kind = "await using";
|
|
14151
13767
|
if (!this.isAwaitAllowed()) {
|
|
14152
|
-
this.raise(Errors.AwaitUsingNotInAsyncContext,
|
|
14153
|
-
at: this.state.startLoc
|
|
14154
|
-
});
|
|
13768
|
+
this.raise(Errors.AwaitUsingNotInAsyncContext, this.state.startLoc);
|
|
14155
13769
|
}
|
|
14156
13770
|
this.next();
|
|
14157
13771
|
} else {
|
|
@@ -14162,9 +13776,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
14162
13776
|
const init2 = this.finishNode(initNode, "VariableDeclaration");
|
|
14163
13777
|
const isForIn = this.match(58);
|
|
14164
13778
|
if (isForIn && starsWithUsingDeclaration) {
|
|
14165
|
-
this.raise(Errors.ForInUsing,
|
|
14166
|
-
at: init2
|
|
14167
|
-
});
|
|
13779
|
+
this.raise(Errors.ForInUsing, init2);
|
|
14168
13780
|
}
|
|
14169
13781
|
if ((isForIn || this.isContextual(102)) && init2.declarations.length === 1) {
|
|
14170
13782
|
return this.parseForIn(node, init2, awaitAt);
|
|
@@ -14181,14 +13793,10 @@ var require_lib = __commonJS((exports) => {
|
|
|
14181
13793
|
const isForOf = this.isContextual(102);
|
|
14182
13794
|
if (isForOf) {
|
|
14183
13795
|
if (startsWithLet) {
|
|
14184
|
-
this.raise(Errors.ForOfLet,
|
|
14185
|
-
at: init
|
|
14186
|
-
});
|
|
13796
|
+
this.raise(Errors.ForOfLet, init);
|
|
14187
13797
|
}
|
|
14188
13798
|
if (awaitAt === null && startsWithAsync && init.type === "Identifier") {
|
|
14189
|
-
this.raise(Errors.ForOfAsync,
|
|
14190
|
-
at: init
|
|
14191
|
-
});
|
|
13799
|
+
this.raise(Errors.ForOfAsync, init);
|
|
14192
13800
|
}
|
|
14193
13801
|
}
|
|
14194
13802
|
if (isForOf || this.match(58)) {
|
|
@@ -14222,9 +13830,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
14222
13830
|
}
|
|
14223
13831
|
parseReturnStatement(node) {
|
|
14224
13832
|
if (!this.prodParam.hasReturn && !this.options.allowReturnOutsideFunction) {
|
|
14225
|
-
this.raise(Errors.IllegalReturn,
|
|
14226
|
-
at: this.state.startLoc
|
|
14227
|
-
});
|
|
13833
|
+
this.raise(Errors.IllegalReturn, this.state.startLoc);
|
|
14228
13834
|
}
|
|
14229
13835
|
this.next();
|
|
14230
13836
|
if (this.isLineTerminator()) {
|
|
@@ -14255,9 +13861,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
14255
13861
|
cur.test = this.parseExpression();
|
|
14256
13862
|
} else {
|
|
14257
13863
|
if (sawDefault) {
|
|
14258
|
-
this.raise(Errors.MultipleDefaultsInSwitch,
|
|
14259
|
-
at: this.state.lastTokStartLoc
|
|
14260
|
-
});
|
|
13864
|
+
this.raise(Errors.MultipleDefaultsInSwitch, this.state.lastTokStartLoc);
|
|
14261
13865
|
}
|
|
14262
13866
|
sawDefault = true;
|
|
14263
13867
|
cur.test = null;
|
|
@@ -14281,9 +13885,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
14281
13885
|
parseThrowStatement(node) {
|
|
14282
13886
|
this.next();
|
|
14283
13887
|
if (this.hasPrecedingLineBreak()) {
|
|
14284
|
-
this.raise(Errors.NewlineAfterThrow,
|
|
14285
|
-
at: this.state.lastTokEndLoc
|
|
14286
|
-
});
|
|
13888
|
+
this.raise(Errors.NewlineAfterThrow, this.state.lastTokEndLoc);
|
|
14287
13889
|
}
|
|
14288
13890
|
node.argument = this.parseExpression();
|
|
14289
13891
|
this.semicolon();
|
|
@@ -14321,9 +13923,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
14321
13923
|
}
|
|
14322
13924
|
node.finalizer = this.eat(67) ? this.parseBlock() : null;
|
|
14323
13925
|
if (!node.handler && !node.finalizer) {
|
|
14324
|
-
this.raise(Errors.NoCatchOrFinally,
|
|
14325
|
-
at: node
|
|
14326
|
-
});
|
|
13926
|
+
this.raise(Errors.NoCatchOrFinally, node);
|
|
14327
13927
|
}
|
|
14328
13928
|
return this.finishNode(node, "TryStatement");
|
|
14329
13929
|
}
|
|
@@ -14343,9 +13943,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
14343
13943
|
}
|
|
14344
13944
|
parseWithStatement(node) {
|
|
14345
13945
|
if (this.state.strict) {
|
|
14346
|
-
this.raise(Errors.StrictWith,
|
|
14347
|
-
at: this.state.startLoc
|
|
14348
|
-
});
|
|
13946
|
+
this.raise(Errors.StrictWith, this.state.startLoc);
|
|
14349
13947
|
}
|
|
14350
13948
|
this.next();
|
|
14351
13949
|
node.object = this.parseHeaderExpression();
|
|
@@ -14359,13 +13957,12 @@ var require_lib = __commonJS((exports) => {
|
|
|
14359
13957
|
parseLabeledStatement(node, maybeName, expr, flags) {
|
|
14360
13958
|
for (const label of this.state.labels) {
|
|
14361
13959
|
if (label.name === maybeName) {
|
|
14362
|
-
this.raise(Errors.LabelRedeclaration, {
|
|
14363
|
-
at: expr,
|
|
13960
|
+
this.raise(Errors.LabelRedeclaration, expr, {
|
|
14364
13961
|
labelName: maybeName
|
|
14365
13962
|
});
|
|
14366
13963
|
}
|
|
14367
13964
|
}
|
|
14368
|
-
const kind = tokenIsLoop(this.state.type) ?
|
|
13965
|
+
const kind = tokenIsLoop(this.state.type) ? 1 : this.match(71) ? 2 : null;
|
|
14369
13966
|
for (let i = this.state.labels.length - 1;i >= 0; i--) {
|
|
14370
13967
|
const label = this.state.labels[i];
|
|
14371
13968
|
if (label.statementStart === node.start) {
|
|
@@ -14462,14 +14059,12 @@ var require_lib = __commonJS((exports) => {
|
|
|
14462
14059
|
node.await = awaitAt !== null;
|
|
14463
14060
|
}
|
|
14464
14061
|
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")) {
|
|
14465
|
-
this.raise(Errors.ForInOfLoopInitializer, {
|
|
14466
|
-
at: init,
|
|
14062
|
+
this.raise(Errors.ForInOfLoopInitializer, init, {
|
|
14467
14063
|
type: isForIn ? "ForInStatement" : "ForOfStatement"
|
|
14468
14064
|
});
|
|
14469
14065
|
}
|
|
14470
14066
|
if (init.type === "AssignmentPattern") {
|
|
14471
|
-
this.raise(Errors.InvalidLhs, {
|
|
14472
|
-
at: init,
|
|
14067
|
+
this.raise(Errors.InvalidLhs, init, {
|
|
14473
14068
|
ancestor: {
|
|
14474
14069
|
type: "ForStatement"
|
|
14475
14070
|
}
|
|
@@ -14492,13 +14087,11 @@ var require_lib = __commonJS((exports) => {
|
|
|
14492
14087
|
decl.init = !this.eat(29) ? null : isFor ? this.parseMaybeAssignDisallowIn() : this.parseMaybeAssignAllowIn();
|
|
14493
14088
|
if (decl.init === null && !allowMissingInitializer) {
|
|
14494
14089
|
if (decl.id.type !== "Identifier" && !(isFor && (this.match(58) || this.isContextual(102)))) {
|
|
14495
|
-
this.raise(Errors.DeclarationMissingInitializer, {
|
|
14496
|
-
at: this.state.lastTokEndLoc,
|
|
14090
|
+
this.raise(Errors.DeclarationMissingInitializer, this.state.lastTokEndLoc, {
|
|
14497
14091
|
kind: "destructuring"
|
|
14498
14092
|
});
|
|
14499
14093
|
} else if (kind === "const" && !(this.match(58) || this.isContextual(102))) {
|
|
14500
|
-
this.raise(Errors.DeclarationMissingInitializer, {
|
|
14501
|
-
at: this.state.lastTokEndLoc,
|
|
14094
|
+
this.raise(Errors.DeclarationMissingInitializer, this.state.lastTokEndLoc, {
|
|
14502
14095
|
kind: "const"
|
|
14503
14096
|
});
|
|
14504
14097
|
}
|
|
@@ -14530,9 +14123,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
14530
14123
|
this.initFunction(node, isAsync);
|
|
14531
14124
|
if (this.match(55)) {
|
|
14532
14125
|
if (hangingDeclaration) {
|
|
14533
|
-
this.raise(Errors.GeneratorInSingleStatementContext,
|
|
14534
|
-
at: this.state.startLoc
|
|
14535
|
-
});
|
|
14126
|
+
this.raise(Errors.GeneratorInSingleStatementContext, this.state.startLoc);
|
|
14536
14127
|
}
|
|
14537
14128
|
this.next();
|
|
14538
14129
|
node.generator = true;
|
|
@@ -14605,9 +14196,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
14605
14196
|
while (!this.match(8)) {
|
|
14606
14197
|
if (this.eat(13)) {
|
|
14607
14198
|
if (decorators.length > 0) {
|
|
14608
|
-
throw this.raise(Errors.DecoratorSemicolon,
|
|
14609
|
-
at: this.state.lastTokEndLoc
|
|
14610
|
-
});
|
|
14199
|
+
throw this.raise(Errors.DecoratorSemicolon, this.state.lastTokEndLoc);
|
|
14611
14200
|
}
|
|
14612
14201
|
continue;
|
|
14613
14202
|
}
|
|
@@ -14623,18 +14212,14 @@ var require_lib = __commonJS((exports) => {
|
|
|
14623
14212
|
}
|
|
14624
14213
|
this.parseClassMember(classBody, member, state);
|
|
14625
14214
|
if (member.kind === "constructor" && member.decorators && member.decorators.length > 0) {
|
|
14626
|
-
this.raise(Errors.DecoratorConstructor,
|
|
14627
|
-
at: member
|
|
14628
|
-
});
|
|
14215
|
+
this.raise(Errors.DecoratorConstructor, member);
|
|
14629
14216
|
}
|
|
14630
14217
|
}
|
|
14631
14218
|
});
|
|
14632
14219
|
this.state.strict = oldStrict;
|
|
14633
14220
|
this.next();
|
|
14634
14221
|
if (decorators.length) {
|
|
14635
|
-
throw this.raise(Errors.TrailingDecorator,
|
|
14636
|
-
at: this.state.startLoc
|
|
14637
|
-
});
|
|
14222
|
+
throw this.raise(Errors.TrailingDecorator, this.state.startLoc);
|
|
14638
14223
|
}
|
|
14639
14224
|
this.classScope.exit();
|
|
14640
14225
|
return this.finishNode(classBody, "ClassBody");
|
|
@@ -14692,9 +14277,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
14692
14277
|
return;
|
|
14693
14278
|
}
|
|
14694
14279
|
if (this.isNonstaticConstructor(publicMethod)) {
|
|
14695
|
-
this.raise(Errors.ConstructorIsGenerator,
|
|
14696
|
-
at: publicMethod.key
|
|
14697
|
-
});
|
|
14280
|
+
this.raise(Errors.ConstructorIsGenerator, publicMethod.key);
|
|
14698
14281
|
}
|
|
14699
14282
|
this.pushClassMethod(classBody, publicMethod, true, false, false, false);
|
|
14700
14283
|
return;
|
|
@@ -14715,14 +14298,10 @@ var require_lib = __commonJS((exports) => {
|
|
|
14715
14298
|
if (isConstructor) {
|
|
14716
14299
|
publicMethod.kind = "constructor";
|
|
14717
14300
|
if (state.hadConstructor && !this.hasPlugin("typescript")) {
|
|
14718
|
-
this.raise(Errors.DuplicateConstructor,
|
|
14719
|
-
at: key
|
|
14720
|
-
});
|
|
14301
|
+
this.raise(Errors.DuplicateConstructor, key);
|
|
14721
14302
|
}
|
|
14722
14303
|
if (isConstructor && this.hasPlugin("typescript") && member.override) {
|
|
14723
|
-
this.raise(Errors.OverrideOnConstructor,
|
|
14724
|
-
at: key
|
|
14725
|
-
});
|
|
14304
|
+
this.raise(Errors.OverrideOnConstructor, key);
|
|
14726
14305
|
}
|
|
14727
14306
|
state.hadConstructor = true;
|
|
14728
14307
|
allowsDirectSuper = state.hadSuperClass;
|
|
@@ -14748,9 +14327,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
14748
14327
|
this.pushClassPrivateMethod(classBody, privateMethod, isGenerator, true);
|
|
14749
14328
|
} else {
|
|
14750
14329
|
if (this.isNonstaticConstructor(publicMethod)) {
|
|
14751
|
-
this.raise(Errors.ConstructorIsAsync,
|
|
14752
|
-
at: publicMethod.key
|
|
14753
|
-
});
|
|
14330
|
+
this.raise(Errors.ConstructorIsAsync, publicMethod.key);
|
|
14754
14331
|
}
|
|
14755
14332
|
this.pushClassMethod(classBody, publicMethod, isGenerator, true, false, false);
|
|
14756
14333
|
}
|
|
@@ -14763,9 +14340,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
14763
14340
|
this.pushClassPrivateMethod(classBody, privateMethod, false, false);
|
|
14764
14341
|
} else {
|
|
14765
14342
|
if (this.isNonstaticConstructor(publicMethod)) {
|
|
14766
|
-
this.raise(Errors.ConstructorIsAccessor,
|
|
14767
|
-
at: publicMethod.key
|
|
14768
|
-
});
|
|
14343
|
+
this.raise(Errors.ConstructorIsAccessor, publicMethod.key);
|
|
14769
14344
|
}
|
|
14770
14345
|
this.pushClassMethod(classBody, publicMethod, false, false, false, false);
|
|
14771
14346
|
}
|
|
@@ -14792,15 +14367,11 @@ var require_lib = __commonJS((exports) => {
|
|
|
14792
14367
|
value
|
|
14793
14368
|
} = this.state;
|
|
14794
14369
|
if ((type === 132 || type === 133) && member.static && value === "prototype") {
|
|
14795
|
-
this.raise(Errors.StaticPrototype,
|
|
14796
|
-
at: this.state.startLoc
|
|
14797
|
-
});
|
|
14370
|
+
this.raise(Errors.StaticPrototype, this.state.startLoc);
|
|
14798
14371
|
}
|
|
14799
14372
|
if (type === 138) {
|
|
14800
14373
|
if (value === "constructor") {
|
|
14801
|
-
this.raise(Errors.ConstructorClassPrivateField,
|
|
14802
|
-
at: this.state.startLoc
|
|
14803
|
-
});
|
|
14374
|
+
this.raise(Errors.ConstructorClassPrivateField, this.state.startLoc);
|
|
14804
14375
|
}
|
|
14805
14376
|
const key = this.parsePrivateName();
|
|
14806
14377
|
member.key = key;
|
|
@@ -14821,16 +14392,12 @@ var require_lib = __commonJS((exports) => {
|
|
|
14821
14392
|
this.state.labels = oldLabels;
|
|
14822
14393
|
classBody.body.push(this.finishNode(member, "StaticBlock"));
|
|
14823
14394
|
if ((_member$decorators = member.decorators) != null && _member$decorators.length) {
|
|
14824
|
-
this.raise(Errors.DecoratorStaticBlock,
|
|
14825
|
-
at: member
|
|
14826
|
-
});
|
|
14395
|
+
this.raise(Errors.DecoratorStaticBlock, member);
|
|
14827
14396
|
}
|
|
14828
14397
|
}
|
|
14829
14398
|
pushClassProperty(classBody, prop) {
|
|
14830
14399
|
if (!prop.computed && (prop.key.name === "constructor" || prop.key.value === "constructor")) {
|
|
14831
|
-
this.raise(Errors.ConstructorClassField,
|
|
14832
|
-
at: prop.key
|
|
14833
|
-
});
|
|
14400
|
+
this.raise(Errors.ConstructorClassField, prop.key);
|
|
14834
14401
|
}
|
|
14835
14402
|
classBody.body.push(this.parseClassProperty(prop));
|
|
14836
14403
|
}
|
|
@@ -14843,9 +14410,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
14843
14410
|
if (!isPrivate && !prop.computed) {
|
|
14844
14411
|
const key = prop.key;
|
|
14845
14412
|
if (key.name === "constructor" || key.value === "constructor") {
|
|
14846
|
-
this.raise(Errors.ConstructorClassField,
|
|
14847
|
-
at: key
|
|
14848
|
-
});
|
|
14413
|
+
this.raise(Errors.ConstructorClassField, key);
|
|
14849
14414
|
}
|
|
14850
14415
|
}
|
|
14851
14416
|
const node = this.parseClassAccessorProperty(prop);
|
|
@@ -14902,9 +14467,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
14902
14467
|
if (optionalId || !isStatement) {
|
|
14903
14468
|
node.id = null;
|
|
14904
14469
|
} else {
|
|
14905
|
-
throw this.raise(Errors.MissingClassName,
|
|
14906
|
-
at: this.state.startLoc
|
|
14907
|
-
});
|
|
14470
|
+
throw this.raise(Errors.MissingClassName, this.state.startLoc);
|
|
14908
14471
|
}
|
|
14909
14472
|
}
|
|
14910
14473
|
}
|
|
@@ -14923,9 +14486,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
14923
14486
|
if (hasDefault)
|
|
14924
14487
|
this.unexpected();
|
|
14925
14488
|
if (decorators) {
|
|
14926
|
-
throw this.raise(Errors.UnsupportedDecoratorExport,
|
|
14927
|
-
at: node
|
|
14928
|
-
});
|
|
14489
|
+
throw this.raise(Errors.UnsupportedDecoratorExport, node);
|
|
14929
14490
|
}
|
|
14930
14491
|
this.parseExportFrom(node, true);
|
|
14931
14492
|
return this.finishNode(node, "ExportAllDeclaration");
|
|
@@ -14941,9 +14502,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
14941
14502
|
if (isFromRequired || hasSpecifiers) {
|
|
14942
14503
|
hasDeclaration = false;
|
|
14943
14504
|
if (decorators) {
|
|
14944
|
-
throw this.raise(Errors.UnsupportedDecoratorExport,
|
|
14945
|
-
at: node
|
|
14946
|
-
});
|
|
14505
|
+
throw this.raise(Errors.UnsupportedDecoratorExport, node);
|
|
14947
14506
|
}
|
|
14948
14507
|
this.parseExportFrom(node, isFromRequired);
|
|
14949
14508
|
} else {
|
|
@@ -14956,9 +14515,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
14956
14515
|
if (((_node2$declaration = node2.declaration) == null ? undefined : _node2$declaration.type) === "ClassDeclaration") {
|
|
14957
14516
|
this.maybeTakeDecorators(decorators, node2.declaration, node2);
|
|
14958
14517
|
} else if (decorators) {
|
|
14959
|
-
throw this.raise(Errors.UnsupportedDecoratorExport,
|
|
14960
|
-
at: node
|
|
14961
|
-
});
|
|
14518
|
+
throw this.raise(Errors.UnsupportedDecoratorExport, node);
|
|
14962
14519
|
}
|
|
14963
14520
|
return this.finishNode(node2, "ExportNamedDeclaration");
|
|
14964
14521
|
}
|
|
@@ -14969,9 +14526,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
14969
14526
|
if (decl.type === "ClassDeclaration") {
|
|
14970
14527
|
this.maybeTakeDecorators(decorators, decl, node2);
|
|
14971
14528
|
} else if (decorators) {
|
|
14972
|
-
throw this.raise(Errors.UnsupportedDecoratorExport,
|
|
14973
|
-
at: node
|
|
14974
|
-
});
|
|
14529
|
+
throw this.raise(Errors.UnsupportedDecoratorExport, node);
|
|
14975
14530
|
}
|
|
14976
14531
|
this.checkExport(node2, true, true);
|
|
14977
14532
|
return this.finishNode(node2, "ExportDefaultDeclaration");
|
|
@@ -15052,16 +14607,12 @@ var require_lib = __commonJS((exports) => {
|
|
|
15052
14607
|
}
|
|
15053
14608
|
if (this.match(26)) {
|
|
15054
14609
|
if (this.hasPlugin("decorators") && this.getPluginOption("decorators", "decoratorsBeforeExport") === true) {
|
|
15055
|
-
this.raise(Errors.DecoratorBeforeExport,
|
|
15056
|
-
at: this.state.startLoc
|
|
15057
|
-
});
|
|
14610
|
+
this.raise(Errors.DecoratorBeforeExport, this.state.startLoc);
|
|
15058
14611
|
}
|
|
15059
14612
|
return this.parseClass(this.maybeTakeDecorators(this.parseDecorators(false), this.startNode()), true, true);
|
|
15060
14613
|
}
|
|
15061
14614
|
if (this.match(75) || this.match(74) || this.isLet()) {
|
|
15062
|
-
throw this.raise(Errors.UnsupportedDefaultExport,
|
|
15063
|
-
at: this.state.startLoc
|
|
15064
|
-
});
|
|
14615
|
+
throw this.raise(Errors.UnsupportedDefaultExport, this.state.startLoc);
|
|
15065
14616
|
}
|
|
15066
14617
|
const res = this.parseMaybeAssignAllowIn();
|
|
15067
14618
|
this.semicolon();
|
|
@@ -15124,9 +14675,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
15124
14675
|
this.expectOnePlugin(["decorators", "decorators-legacy"]);
|
|
15125
14676
|
if (this.hasPlugin("decorators")) {
|
|
15126
14677
|
if (this.getPluginOption("decorators", "decoratorsBeforeExport") === true) {
|
|
15127
|
-
this.raise(Errors.DecoratorBeforeExport,
|
|
15128
|
-
at: this.state.startLoc
|
|
15129
|
-
});
|
|
14678
|
+
this.raise(Errors.DecoratorBeforeExport, this.state.startLoc);
|
|
15130
14679
|
}
|
|
15131
14680
|
return true;
|
|
15132
14681
|
}
|
|
@@ -15142,9 +14691,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
15142
14691
|
var _declaration$extra;
|
|
15143
14692
|
const declaration = node.declaration;
|
|
15144
14693
|
if (declaration.type === "Identifier" && declaration.name === "from" && declaration.end - declaration.start === 4 && !((_declaration$extra = declaration.extra) != null && _declaration$extra.parenthesized)) {
|
|
15145
|
-
this.raise(Errors.ExportDefaultFromAsIdentifier,
|
|
15146
|
-
at: declaration
|
|
15147
|
-
});
|
|
14694
|
+
this.raise(Errors.ExportDefaultFromAsIdentifier, declaration);
|
|
15148
14695
|
}
|
|
15149
14696
|
}
|
|
15150
14697
|
} else if ((_node$specifiers = node.specifiers) != null && _node$specifiers.length) {
|
|
@@ -15159,8 +14706,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
15159
14706
|
local
|
|
15160
14707
|
} = specifier;
|
|
15161
14708
|
if (local.type !== "Identifier") {
|
|
15162
|
-
this.raise(Errors.ExportBindingIsString, {
|
|
15163
|
-
at: specifier,
|
|
14709
|
+
this.raise(Errors.ExportBindingIsString, specifier, {
|
|
15164
14710
|
localName: local.value,
|
|
15165
14711
|
exportName
|
|
15166
14712
|
});
|
|
@@ -15208,12 +14754,9 @@ var require_lib = __commonJS((exports) => {
|
|
|
15208
14754
|
checkDuplicateExports(node, exportName) {
|
|
15209
14755
|
if (this.exportedIdentifiers.has(exportName)) {
|
|
15210
14756
|
if (exportName === "default") {
|
|
15211
|
-
this.raise(Errors.DuplicateDefaultExport,
|
|
15212
|
-
at: node
|
|
15213
|
-
});
|
|
14757
|
+
this.raise(Errors.DuplicateDefaultExport, node);
|
|
15214
14758
|
} else {
|
|
15215
|
-
this.raise(Errors.DuplicateExport, {
|
|
15216
|
-
at: node,
|
|
14759
|
+
this.raise(Errors.DuplicateExport, node, {
|
|
15217
14760
|
exportName
|
|
15218
14761
|
});
|
|
15219
14762
|
}
|
|
@@ -15255,8 +14798,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
15255
14798
|
const result = this.parseStringLiteral(this.state.value);
|
|
15256
14799
|
const surrogate = result.value.match(loneSurrogate);
|
|
15257
14800
|
if (surrogate) {
|
|
15258
|
-
this.raise(Errors.ModuleExportNameHasLoneSurrogate, {
|
|
15259
|
-
at: result,
|
|
14801
|
+
this.raise(Errors.ModuleExportNameHasLoneSurrogate, result, {
|
|
15260
14802
|
surrogateCharCode: surrogate[0].charCodeAt(0)
|
|
15261
14803
|
});
|
|
15262
14804
|
}
|
|
@@ -15282,27 +14824,19 @@ var require_lib = __commonJS((exports) => {
|
|
|
15282
14824
|
const singleBindingType = specifiers.length === 1 ? specifiers[0].type : null;
|
|
15283
14825
|
if (node.phase === "source") {
|
|
15284
14826
|
if (singleBindingType !== "ImportDefaultSpecifier") {
|
|
15285
|
-
this.raise(Errors.SourcePhaseImportRequiresDefault,
|
|
15286
|
-
at: specifiers[0].loc.start
|
|
15287
|
-
});
|
|
14827
|
+
this.raise(Errors.SourcePhaseImportRequiresDefault, specifiers[0].loc.start);
|
|
15288
14828
|
}
|
|
15289
14829
|
} else if (node.phase === "defer") {
|
|
15290
14830
|
if (singleBindingType !== "ImportNamespaceSpecifier") {
|
|
15291
|
-
this.raise(Errors.DeferImportRequiresNamespace,
|
|
15292
|
-
at: specifiers[0].loc.start
|
|
15293
|
-
});
|
|
14831
|
+
this.raise(Errors.DeferImportRequiresNamespace, specifiers[0].loc.start);
|
|
15294
14832
|
}
|
|
15295
14833
|
} else if (node.module) {
|
|
15296
14834
|
var _node$assertions;
|
|
15297
14835
|
if (singleBindingType !== "ImportDefaultSpecifier") {
|
|
15298
|
-
this.raise(Errors.ImportReflectionNotBinding,
|
|
15299
|
-
at: specifiers[0].loc.start
|
|
15300
|
-
});
|
|
14836
|
+
this.raise(Errors.ImportReflectionNotBinding, specifiers[0].loc.start);
|
|
15301
14837
|
}
|
|
15302
14838
|
if (((_node$assertions = node.assertions) == null ? undefined : _node$assertions.length) > 0) {
|
|
15303
|
-
this.raise(Errors.ImportReflectionHasAssertion,
|
|
15304
|
-
at: node.specifiers[0].loc.start
|
|
15305
|
-
});
|
|
14839
|
+
this.raise(Errors.ImportReflectionHasAssertion, specifiers[0].loc.start);
|
|
15306
14840
|
}
|
|
15307
14841
|
}
|
|
15308
14842
|
}
|
|
@@ -15324,9 +14858,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
15324
14858
|
}
|
|
15325
14859
|
});
|
|
15326
14860
|
if (nonDefaultNamedSpecifier !== undefined) {
|
|
15327
|
-
this.raise(Errors.ImportJSONBindingNotDefault,
|
|
15328
|
-
at: nonDefaultNamedSpecifier.loc.start
|
|
15329
|
-
});
|
|
14861
|
+
this.raise(Errors.ImportJSONBindingNotDefault, nonDefaultNamedSpecifier.loc.start);
|
|
15330
14862
|
}
|
|
15331
14863
|
}
|
|
15332
14864
|
}
|
|
@@ -15436,8 +14968,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
15436
14968
|
const node = this.startNode();
|
|
15437
14969
|
const keyName = this.state.value;
|
|
15438
14970
|
if (attrNames.has(keyName)) {
|
|
15439
|
-
this.raise(Errors.ModuleAttributesWithDuplicateKeys, {
|
|
15440
|
-
at: this.state.startLoc,
|
|
14971
|
+
this.raise(Errors.ModuleAttributesWithDuplicateKeys, this.state.startLoc, {
|
|
15441
14972
|
key: keyName
|
|
15442
14973
|
});
|
|
15443
14974
|
}
|
|
@@ -15449,9 +14980,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
15449
14980
|
}
|
|
15450
14981
|
this.expect(14);
|
|
15451
14982
|
if (!this.match(133)) {
|
|
15452
|
-
throw this.raise(Errors.ModuleAttributeInvalidValue,
|
|
15453
|
-
at: this.state.startLoc
|
|
15454
|
-
});
|
|
14983
|
+
throw this.raise(Errors.ModuleAttributeInvalidValue, this.state.startLoc);
|
|
15455
14984
|
}
|
|
15456
14985
|
node.value = this.parseStringLiteral(this.state.value);
|
|
15457
14986
|
attrs.push(this.finishNode(node, "ImportAttribute"));
|
|
@@ -15466,22 +14995,17 @@ var require_lib = __commonJS((exports) => {
|
|
|
15466
14995
|
const node = this.startNode();
|
|
15467
14996
|
node.key = this.parseIdentifier(true);
|
|
15468
14997
|
if (node.key.name !== "type") {
|
|
15469
|
-
this.raise(Errors.ModuleAttributeDifferentFromType,
|
|
15470
|
-
at: node.key
|
|
15471
|
-
});
|
|
14998
|
+
this.raise(Errors.ModuleAttributeDifferentFromType, node.key);
|
|
15472
14999
|
}
|
|
15473
15000
|
if (attributes.has(node.key.name)) {
|
|
15474
|
-
this.raise(Errors.ModuleAttributesWithDuplicateKeys, {
|
|
15475
|
-
at: node.key,
|
|
15001
|
+
this.raise(Errors.ModuleAttributesWithDuplicateKeys, node.key, {
|
|
15476
15002
|
key: node.key.name
|
|
15477
15003
|
});
|
|
15478
15004
|
}
|
|
15479
15005
|
attributes.add(node.key.name);
|
|
15480
15006
|
this.expect(14);
|
|
15481
15007
|
if (!this.match(133)) {
|
|
15482
|
-
throw this.raise(Errors.ModuleAttributeInvalidValue,
|
|
15483
|
-
at: this.state.startLoc
|
|
15484
|
-
});
|
|
15008
|
+
throw this.raise(Errors.ModuleAttributeInvalidValue, this.state.startLoc);
|
|
15485
15009
|
}
|
|
15486
15010
|
node.value = this.parseStringLiteral(this.state.value);
|
|
15487
15011
|
attrs.push(this.finishNode(node, "ImportAttribute"));
|
|
@@ -15508,9 +15032,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
15508
15032
|
} else if (this.isContextual(94) && !this.hasPrecedingLineBreak()) {
|
|
15509
15033
|
if (this.hasPlugin("importAttributes")) {
|
|
15510
15034
|
if (this.getPluginOption("importAttributes", "deprecatedAssertSyntax") !== true) {
|
|
15511
|
-
this.raise(Errors.ImportAttributesUseAssert,
|
|
15512
|
-
at: this.state.startLoc
|
|
15513
|
-
});
|
|
15035
|
+
this.raise(Errors.ImportAttributesUseAssert, this.state.startLoc);
|
|
15514
15036
|
}
|
|
15515
15037
|
this.addExtra(node, "deprecatedAssertSyntax", true);
|
|
15516
15038
|
} else {
|
|
@@ -15562,9 +15084,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
15562
15084
|
first = false;
|
|
15563
15085
|
} else {
|
|
15564
15086
|
if (this.eat(14)) {
|
|
15565
|
-
throw this.raise(Errors.DestructureNamedImport,
|
|
15566
|
-
at: this.state.startLoc
|
|
15567
|
-
});
|
|
15087
|
+
throw this.raise(Errors.DestructureNamedImport, this.state.startLoc);
|
|
15568
15088
|
}
|
|
15569
15089
|
this.expect(12);
|
|
15570
15090
|
if (this.eat(8))
|
|
@@ -15586,8 +15106,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
15586
15106
|
imported
|
|
15587
15107
|
} = specifier;
|
|
15588
15108
|
if (importedIsString) {
|
|
15589
|
-
throw this.raise(Errors.ImportBindingIsString, {
|
|
15590
|
-
at: specifier,
|
|
15109
|
+
throw this.raise(Errors.ImportBindingIsString, specifier, {
|
|
15591
15110
|
importName: imported.value
|
|
15592
15111
|
});
|
|
15593
15112
|
}
|
|
@@ -15623,6 +15142,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
15623
15142
|
file.errors = null;
|
|
15624
15143
|
this.parseTopLevel(file, program);
|
|
15625
15144
|
file.errors = this.state.errors;
|
|
15145
|
+
file.comments.length = this.state.commentsLen;
|
|
15626
15146
|
return file;
|
|
15627
15147
|
}
|
|
15628
15148
|
}
|
|
@@ -216787,6 +216307,7 @@ async function detectOverflow(state, options) {
|
|
|
216787
216307
|
y: 1
|
|
216788
216308
|
};
|
|
216789
216309
|
const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
216310
|
+
elements,
|
|
216790
216311
|
rect,
|
|
216791
216312
|
offsetParent,
|
|
216792
216313
|
strategy
|
|
@@ -216918,7 +216439,6 @@ var computePosition = async (reference, floating, config2) => {
|
|
|
216918
216439
|
} = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
|
|
216919
216440
|
}
|
|
216920
216441
|
i = -1;
|
|
216921
|
-
continue;
|
|
216922
216442
|
}
|
|
216923
216443
|
}
|
|
216924
216444
|
return {
|
|
@@ -216976,7 +216496,7 @@ var arrow = (options) => ({
|
|
|
216976
216496
|
const max2 = clientSize - arrowDimensions[length] - maxPadding;
|
|
216977
216497
|
const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
|
|
216978
216498
|
const offset = clamp(min$1, center, max2);
|
|
216979
|
-
const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center
|
|
216499
|
+
const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
|
|
216980
216500
|
const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max2 : 0;
|
|
216981
216501
|
return {
|
|
216982
216502
|
[axis]: coords[axis] + alignmentOffset,
|
|
@@ -219377,7 +218897,7 @@ var TwoslashFloatingVue = {
|
|
|
219377
218897
|
}
|
|
219378
218898
|
};
|
|
219379
218899
|
|
|
219380
|
-
// /home/runner/work/stacks/stacks/node_modules/shikiji-
|
|
218900
|
+
// /home/runner/work/stacks/stacks/node_modules/shikiji-core/dist/textmate.mjs
|
|
219381
218901
|
var toOptionalTokenType = function(standardType) {
|
|
219382
218902
|
return standardType;
|
|
219383
218903
|
};
|
|
@@ -222094,7 +221614,7 @@ var Registry$1 = class Registry {
|
|
|
222094
221614
|
};
|
|
222095
221615
|
var INITIAL = StateStackImpl.NULL;
|
|
222096
221616
|
|
|
222097
|
-
// /home/runner/work/stacks/stacks/node_modules/shikiji-
|
|
221617
|
+
// /home/runner/work/stacks/stacks/node_modules/shikiji-core/dist/index.mjs
|
|
222098
221618
|
var addClassToHast = function(node, className) {
|
|
222099
221619
|
if (!className)
|
|
222100
221620
|
return;
|
|
@@ -226510,22 +226030,19 @@ function markdownLineEndingOrSpace(code) {
|
|
|
226510
226030
|
function markdownSpace(code) {
|
|
226511
226031
|
return code === -2 || code === -1 || code === 32;
|
|
226512
226032
|
}
|
|
226513
|
-
function unicodePunctuation(code) {
|
|
226514
|
-
return asciiPunctuation(code) || unicodePunctuationInternal(code);
|
|
226515
|
-
}
|
|
226516
226033
|
var regexCheck = function(regex) {
|
|
226517
226034
|
return check;
|
|
226518
226035
|
function check(code) {
|
|
226519
226036
|
return code !== null && code > -1 && regex.test(String.fromCharCode(code));
|
|
226520
226037
|
}
|
|
226521
226038
|
};
|
|
226522
|
-
var unicodePunctuationInternal = regexCheck(/\p{P}/u);
|
|
226523
226039
|
var asciiAlpha = regexCheck(/[A-Za-z]/);
|
|
226524
226040
|
var asciiAlphanumeric = regexCheck(/[\dA-Za-z]/);
|
|
226525
226041
|
var asciiAtext = regexCheck(/[#-'*+\--9=?A-Z^-~]/);
|
|
226526
226042
|
var asciiDigit = regexCheck(/\d/);
|
|
226527
226043
|
var asciiHexDigit = regexCheck(/[\dA-Fa-f]/);
|
|
226528
226044
|
var asciiPunctuation = regexCheck(/[!-/:-@[-`{-~]/);
|
|
226045
|
+
var unicodePunctuation = regexCheck(/\p{P}|\p{S}/u);
|
|
226529
226046
|
var unicodeWhitespace = regexCheck(/\s/);
|
|
226530
226047
|
|
|
226531
226048
|
// /home/runner/work/stacks/stacks/node_modules/mdast-util-find-and-replace/node_modules/escape-string-regexp/index.js
|