poe-code 11.0.9 → 11.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +14 -13
- package/dist/index.js.map +2 -2
- package/dist/metafile.json +1 -1
- package/package.json +1 -1
- package/packages/safejs/dist/chunks/{chunk-2GHBBE5J.js → chunk-BESE73VB.js} +14 -13
- package/packages/safejs/dist/chunks/chunk-BESE73VB.js.map +7 -0
- package/packages/safejs/dist/chunks/{chunk-APPD5CFI.js → chunk-DF7PY5YX.js} +2 -2
- package/packages/safejs/dist/cli.js +2 -2
- package/packages/safejs/dist/core.js +1 -1
- package/packages/safejs/dist/index.js +2 -2
- package/packages/safejs/dist/parse/parser.js +23 -19
- package/packages/safejs/dist/chunks/chunk-2GHBBE5J.js.map +0 -7
- /package/packages/safejs/dist/chunks/{chunk-APPD5CFI.js.map → chunk-DF7PY5YX.js.map} +0 -0
package/package.json
CHANGED
|
@@ -3767,26 +3767,31 @@ var Parser = class {
|
|
|
3767
3767
|
`Generator shorthand methods are not supported at line ${generatorToken.start.line}, column ${generatorToken.start.column}.`
|
|
3768
3768
|
);
|
|
3769
3769
|
}
|
|
3770
|
-
if (this.currentToken().type === "identifier" && (this.currentToken().value === "get" || this.currentToken().value === "set") && this.
|
|
3770
|
+
if (this.currentToken().type === "identifier" && (this.currentToken().value === "get" || this.currentToken().value === "set") && this.isObjectMethodStart()) {
|
|
3771
3771
|
const token2 = this.currentToken();
|
|
3772
3772
|
const syntax = token2.value === "get" ? "Getter" : "Setter";
|
|
3773
3773
|
throw new Error(
|
|
3774
3774
|
`${syntax} shorthand methods are not supported at line ${token2.start.line}, column ${token2.start.column}.`
|
|
3775
3775
|
);
|
|
3776
3776
|
}
|
|
3777
|
+
const modifierToken = this.currentToken();
|
|
3778
|
+
const asyncToken = modifierToken.type === "keyword" && modifierToken.value === "async" && modifierToken.end.offset - modifierToken.start.offset === modifierToken.value.length && this.isObjectMethodStart() && !hasLineBreakBetween(modifierToken, this.peekToken(1)) ? modifierToken : void 0;
|
|
3779
|
+
if (asyncToken !== void 0) {
|
|
3780
|
+
this.index += 1;
|
|
3781
|
+
}
|
|
3777
3782
|
if (this.consumePunctuator("[") !== void 0) {
|
|
3778
3783
|
const propertyStart = this.previousToken();
|
|
3779
3784
|
const key = this.parseExpression();
|
|
3780
3785
|
this.expectPunctuator("]");
|
|
3781
3786
|
if (this.currentToken().type === "punctuator" && this.currentToken().value === "(") {
|
|
3782
|
-
const value2 = this.parseObjectMethod(
|
|
3787
|
+
const value2 = this.parseObjectMethod(asyncToken, propertyStart.start);
|
|
3783
3788
|
return {
|
|
3784
3789
|
type: "Property",
|
|
3785
3790
|
computed: true,
|
|
3786
3791
|
shorthand: false,
|
|
3787
3792
|
key: key.node,
|
|
3788
3793
|
value: value2,
|
|
3789
|
-
span: createSpan2(propertyStart.start, value2.span.end)
|
|
3794
|
+
span: createSpan2(asyncToken?.start ?? propertyStart.start, value2.span.end)
|
|
3790
3795
|
};
|
|
3791
3796
|
}
|
|
3792
3797
|
this.expectPunctuator(":");
|
|
@@ -3800,12 +3805,8 @@ var Parser = class {
|
|
|
3800
3805
|
span: createSpan2(propertyStart.start, value.node.span.end)
|
|
3801
3806
|
};
|
|
3802
3807
|
}
|
|
3803
|
-
const asyncToken = this.currentToken().type === "keyword" && this.currentToken().value === "async" && isIdentifierLikeToken(this.peekToken(1)) && this.peekToken(2).type === "punctuator" && this.peekToken(2).value === "(" && !hasLineBreakBetween(this.currentToken(), this.peekToken(1)) ? this.currentToken() : void 0;
|
|
3804
|
-
if (asyncToken !== void 0) {
|
|
3805
|
-
this.index += 1;
|
|
3806
|
-
}
|
|
3807
3808
|
const token = this.currentToken();
|
|
3808
|
-
if (isIdentifierLikeToken(token)) {
|
|
3809
|
+
if (isIdentifierLikeToken(token) || token.type === "keyword" && this.peekToken(1).type === "punctuator" && this.peekToken(1).value === "(") {
|
|
3809
3810
|
this.index += 1;
|
|
3810
3811
|
const key = createIdentifier2(token);
|
|
3811
3812
|
if (this.currentToken().type === "punctuator" && this.currentToken().value === "(") {
|
|
@@ -3844,14 +3845,14 @@ var Parser = class {
|
|
|
3844
3845
|
this.index += 1;
|
|
3845
3846
|
const key = createLiteralFromToken(token);
|
|
3846
3847
|
if (this.currentToken().type === "punctuator" && this.currentToken().value === "(") {
|
|
3847
|
-
const value2 = this.parseObjectMethod(
|
|
3848
|
+
const value2 = this.parseObjectMethod(asyncToken, key.span.start);
|
|
3848
3849
|
return {
|
|
3849
3850
|
type: "Property",
|
|
3850
3851
|
computed: false,
|
|
3851
3852
|
shorthand: false,
|
|
3852
3853
|
key,
|
|
3853
3854
|
value: value2,
|
|
3854
|
-
span: createSpan2(key.span.start, value2.span.end)
|
|
3855
|
+
span: createSpan2(asyncToken?.start ?? key.span.start, value2.span.end)
|
|
3855
3856
|
};
|
|
3856
3857
|
}
|
|
3857
3858
|
this.expectPunctuator(":");
|
|
@@ -3867,7 +3868,7 @@ var Parser = class {
|
|
|
3867
3868
|
}
|
|
3868
3869
|
throw unexpectedTokenError(token);
|
|
3869
3870
|
}
|
|
3870
|
-
|
|
3871
|
+
isObjectMethodStart() {
|
|
3871
3872
|
const propertyToken = this.peekToken(1);
|
|
3872
3873
|
if (propertyToken.type === "punctuator" && propertyToken.value === "[") {
|
|
3873
3874
|
let depth = 0;
|
|
@@ -3889,7 +3890,7 @@ var Parser = class {
|
|
|
3889
3890
|
offset += 1;
|
|
3890
3891
|
}
|
|
3891
3892
|
}
|
|
3892
|
-
return (
|
|
3893
|
+
return (propertyToken.type === "identifier" || propertyToken.type === "keyword" || propertyToken.type === "numeric" || propertyToken.type === "string") && this.peekToken(2).type === "punctuator" && this.peekToken(2).value === "(";
|
|
3893
3894
|
}
|
|
3894
3895
|
parseObjectMethod(asyncToken, methodStart) {
|
|
3895
3896
|
const params = this.withScope(() => {
|
|
@@ -28984,4 +28985,4 @@ export {
|
|
|
28984
28985
|
FileSnapshotBackend,
|
|
28985
28986
|
run
|
|
28986
28987
|
};
|
|
28987
|
-
//# sourceMappingURL=chunk-
|
|
28988
|
+
//# sourceMappingURL=chunk-BESE73VB.js.map
|