@poe-platform/safe-js 0.1.583 → 0.1.584
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/safe-js/chunks/{chunk-YUMLRCTH.js → chunk-4DPRV34R.js} +2 -2
- package/dist/safe-js/chunks/{chunk-4WKBTY6W.js → chunk-63JRSQOL.js} +3 -3
- package/dist/safe-js/chunks/{chunk-QNAVME3B.js → chunk-7PX7MOB4.js} +6 -6
- package/dist/safe-js/chunks/{chunk-7IEVHJ7R.js → chunk-AMO5WXVQ.js} +4 -4
- package/dist/safe-js/chunks/{chunk-ZEN6IY6M.js → chunk-AMY5ETO5.js} +4 -4
- package/dist/safe-js/chunks/{chunk-P3M3BXHT.js → chunk-EAHOLZQ2.js} +3 -3
- package/dist/safe-js/chunks/{chunk-27YAKAEE.js → chunk-EUQCKN74.js} +3 -3
- package/dist/safe-js/chunks/{chunk-CGIQDK6Z.js → chunk-F6K7WXYP.js} +2 -2
- package/dist/safe-js/chunks/{chunk-XM6DQK7C.js → chunk-J23VJ4EG.js} +2 -2
- package/dist/safe-js/chunks/{chunk-HUD3ISAJ.js → chunk-OMSG6GZF.js} +57 -12
- package/dist/safe-js/chunks/chunk-OMSG6GZF.js.map +7 -0
- package/dist/safe-js/chunks/{chunk-3YD5RZJH.js → chunk-PTB5KJXJ.js} +2 -2
- package/dist/safe-js/chunks/{chunk-FRTUNUVH.js → chunk-Q2PTRBJS.js} +2 -2
- package/dist/safe-js/chunks/{chunk-HENSQ4YT.js → chunk-XXUVGE2L.js} +2 -2
- package/dist/safe-js/chunks/{cli-runtime-R4XQ76EV.js → cli-runtime-PRCR2J63.js} +13 -13
- package/dist/safe-js/chunks/{dump-7N6NYNQE.js → dump-SGDGD32M.js} +4 -4
- package/dist/safe-js/chunks/{fs-DJXSKCFB.js → fs-LOAD43QB.js} +4 -4
- package/dist/safe-js/chunks/harness-PYDC7ICR.js +10 -0
- package/dist/safe-js/chunks/mcp-SL5B3WKQ.js +11 -0
- package/dist/safe-js/chunks/migration-file-RIMCERFB.js +12 -0
- package/dist/safe-js/chunks/restore-CJSMB4QO.js +13 -0
- package/dist/safe-js/chunks/run-ZTGDITEC.js +17 -0
- package/dist/safe-js/chunks/runtime-modules-M5XUCL6O.js +10 -0
- package/dist/safe-js/cli.js +2 -2
- package/dist/safe-js/core.js +7 -7
- package/dist/safe-js/index.js +13 -13
- package/dist/safe-js/workerd.js +56 -11
- package/dist/safe-js/workerd.js.map +2 -2
- package/package.json +2 -2
- package/dist/safe-js/chunks/chunk-HUD3ISAJ.js.map +0 -7
- package/dist/safe-js/chunks/harness-I47WMMSB.js +0 -10
- package/dist/safe-js/chunks/mcp-43SITYLO.js +0 -11
- package/dist/safe-js/chunks/migration-file-TKW2VXE5.js +0 -12
- package/dist/safe-js/chunks/restore-ITFWVMAU.js +0 -13
- package/dist/safe-js/chunks/run-P3JBDBSD.js +0 -17
- package/dist/safe-js/chunks/runtime-modules-AAL3MW44.js +0 -10
- /package/dist/safe-js/chunks/{chunk-YUMLRCTH.js.map → chunk-4DPRV34R.js.map} +0 -0
- /package/dist/safe-js/chunks/{chunk-4WKBTY6W.js.map → chunk-63JRSQOL.js.map} +0 -0
- /package/dist/safe-js/chunks/{chunk-QNAVME3B.js.map → chunk-7PX7MOB4.js.map} +0 -0
- /package/dist/safe-js/chunks/{chunk-7IEVHJ7R.js.map → chunk-AMO5WXVQ.js.map} +0 -0
- /package/dist/safe-js/chunks/{chunk-ZEN6IY6M.js.map → chunk-AMY5ETO5.js.map} +0 -0
- /package/dist/safe-js/chunks/{chunk-P3M3BXHT.js.map → chunk-EAHOLZQ2.js.map} +0 -0
- /package/dist/safe-js/chunks/{chunk-27YAKAEE.js.map → chunk-EUQCKN74.js.map} +0 -0
- /package/dist/safe-js/chunks/{chunk-CGIQDK6Z.js.map → chunk-F6K7WXYP.js.map} +0 -0
- /package/dist/safe-js/chunks/{chunk-XM6DQK7C.js.map → chunk-J23VJ4EG.js.map} +0 -0
- /package/dist/safe-js/chunks/{chunk-3YD5RZJH.js.map → chunk-PTB5KJXJ.js.map} +0 -0
- /package/dist/safe-js/chunks/{chunk-FRTUNUVH.js.map → chunk-Q2PTRBJS.js.map} +0 -0
- /package/dist/safe-js/chunks/{chunk-HENSQ4YT.js.map → chunk-XXUVGE2L.js.map} +0 -0
- /package/dist/safe-js/chunks/{cli-runtime-R4XQ76EV.js.map → cli-runtime-PRCR2J63.js.map} +0 -0
- /package/dist/safe-js/chunks/{dump-7N6NYNQE.js.map → dump-SGDGD32M.js.map} +0 -0
- /package/dist/safe-js/chunks/{fs-DJXSKCFB.js.map → fs-LOAD43QB.js.map} +0 -0
- /package/dist/safe-js/chunks/{harness-I47WMMSB.js.map → harness-PYDC7ICR.js.map} +0 -0
- /package/dist/safe-js/chunks/{mcp-43SITYLO.js.map → mcp-SL5B3WKQ.js.map} +0 -0
- /package/dist/safe-js/chunks/{migration-file-TKW2VXE5.js.map → migration-file-RIMCERFB.js.map} +0 -0
- /package/dist/safe-js/chunks/{restore-ITFWVMAU.js.map → restore-CJSMB4QO.js.map} +0 -0
- /package/dist/safe-js/chunks/{run-P3JBDBSD.js.map → run-ZTGDITEC.js.map} +0 -0
- /package/dist/safe-js/chunks/{runtime-modules-AAL3MW44.js.map → runtime-modules-M5XUCL6O.js.map} +0 -0
|
@@ -39,7 +39,7 @@ import {
|
|
|
39
39
|
sandboxErrorTypes,
|
|
40
40
|
syntaxDiagnostics,
|
|
41
41
|
templateRealms
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-OMSG6GZF.js";
|
|
43
43
|
|
|
44
44
|
// packages/safe-js/src/interp/native-promise-properties.ts
|
|
45
45
|
import { types } from "node:util";
|
|
@@ -47092,4 +47092,4 @@ authorization of the copyright holder.
|
|
|
47092
47092
|
SPDX-License-Identifier: Unicode-3.0
|
|
47093
47093
|
|
|
47094
47094
|
*/
|
|
47095
|
-
//# sourceMappingURL=chunk-
|
|
47095
|
+
//# sourceMappingURL=chunk-4DPRV34R.js.map
|
|
@@ -2,14 +2,14 @@ import {
|
|
|
2
2
|
HostCallJournal,
|
|
3
3
|
decodeReplayData,
|
|
4
4
|
validateSnapshotData
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-4DPRV34R.js";
|
|
6
6
|
import {
|
|
7
7
|
CompileScope,
|
|
8
8
|
SandboxError,
|
|
9
9
|
functionSources,
|
|
10
10
|
parse,
|
|
11
11
|
parseModule
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-OMSG6GZF.js";
|
|
13
13
|
|
|
14
14
|
// packages/safe-js/src/parse/hash.ts
|
|
15
15
|
var FNV_OFFSET_BASIS = 2166136261;
|
|
@@ -219,4 +219,4 @@ export {
|
|
|
219
219
|
validateMigrationReconciliation,
|
|
220
220
|
validateSnapshotMigration
|
|
221
221
|
};
|
|
222
|
-
//# sourceMappingURL=chunk-
|
|
222
|
+
//# sourceMappingURL=chunk-63JRSQOL.js.map
|
|
@@ -3,11 +3,11 @@ import {
|
|
|
3
3
|
} from "./chunk-BRFJ7BKN.js";
|
|
4
4
|
import {
|
|
5
5
|
restore
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-AMY5ETO5.js";
|
|
7
7
|
import {
|
|
8
8
|
attachDumpController,
|
|
9
9
|
createDumpController
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-EAHOLZQ2.js";
|
|
11
11
|
import {
|
|
12
12
|
getOwnErrorCode,
|
|
13
13
|
hasOwnErrorCode
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
import {
|
|
16
16
|
hashParsedAst,
|
|
17
17
|
hashSource
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-63JRSQOL.js";
|
|
19
19
|
import {
|
|
20
20
|
DUMP_FORMAT_VERSION,
|
|
21
21
|
EXECUTION_SEMANTICS,
|
|
@@ -89,7 +89,7 @@ import {
|
|
|
89
89
|
withSandboxPromiseRejectionTracker,
|
|
90
90
|
wrapCallerInjectedBindings,
|
|
91
91
|
wrapCancelableBindings
|
|
92
|
-
} from "./chunk-
|
|
92
|
+
} from "./chunk-4DPRV34R.js";
|
|
93
93
|
import {
|
|
94
94
|
Budget,
|
|
95
95
|
CompileScope,
|
|
@@ -103,7 +103,7 @@ import {
|
|
|
103
103
|
parseExecutableModule,
|
|
104
104
|
replaceErrorStack,
|
|
105
105
|
safeAddEvent
|
|
106
|
-
} from "./chunk-
|
|
106
|
+
} from "./chunk-OMSG6GZF.js";
|
|
107
107
|
|
|
108
108
|
// packages/safe-js/src/realm.ts
|
|
109
109
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
@@ -2037,4 +2037,4 @@ export {
|
|
|
2037
2037
|
UnhandledRejectionError,
|
|
2038
2038
|
run
|
|
2039
2039
|
};
|
|
2040
|
-
//# sourceMappingURL=chunk-
|
|
2040
|
+
//# sourceMappingURL=chunk-7PX7MOB4.js.map
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
validateMigrationReconciliation,
|
|
8
8
|
validateMigrationSemantics,
|
|
9
9
|
validateSnapshotMigration
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-63JRSQOL.js";
|
|
11
11
|
import {
|
|
12
12
|
DUMP_FORMAT_VERSION,
|
|
13
13
|
EXECUTION_SEMANTICS,
|
|
@@ -17,10 +17,10 @@ import {
|
|
|
17
17
|
serializeSafeJSSnapshot,
|
|
18
18
|
validateDumpEnvelope,
|
|
19
19
|
validateSnapshotData
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-4DPRV34R.js";
|
|
21
21
|
import {
|
|
22
22
|
parseModule
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-OMSG6GZF.js";
|
|
24
24
|
|
|
25
25
|
// packages/safe-js/src/migration-file.ts
|
|
26
26
|
import { randomUUID } from "node:crypto";
|
|
@@ -179,4 +179,4 @@ export {
|
|
|
179
179
|
migrateSnapshot,
|
|
180
180
|
migrateSnapshotFile
|
|
181
181
|
};
|
|
182
|
-
//# sourceMappingURL=chunk-
|
|
182
|
+
//# sourceMappingURL=chunk-AMO5WXVQ.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
hashSource,
|
|
3
3
|
validateSnapshotMigration
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-63JRSQOL.js";
|
|
5
5
|
import {
|
|
6
6
|
SnapshotValidationError,
|
|
7
7
|
assertSnapshotInactive,
|
|
@@ -13,12 +13,12 @@ import {
|
|
|
13
13
|
validateDumpEnvelope,
|
|
14
14
|
validateGuestFunctionAst,
|
|
15
15
|
validateTemplateObjects
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-4DPRV34R.js";
|
|
17
17
|
import {
|
|
18
18
|
ParseError,
|
|
19
19
|
parseModule,
|
|
20
20
|
replaceErrorStack
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-OMSG6GZF.js";
|
|
22
22
|
|
|
23
23
|
// packages/safe-js/src/restore.ts
|
|
24
24
|
var SnapshotMismatchError = class extends Error {
|
|
@@ -110,4 +110,4 @@ export {
|
|
|
110
110
|
SnapshotMismatchError,
|
|
111
111
|
restore
|
|
112
112
|
};
|
|
113
|
-
//# sourceMappingURL=chunk-
|
|
113
|
+
//# sourceMappingURL=chunk-AMY5ETO5.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SnapshotNotReadyError,
|
|
3
3
|
serializeSafeJSSnapshot
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-4DPRV34R.js";
|
|
5
5
|
import {
|
|
6
6
|
SandboxError
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-OMSG6GZF.js";
|
|
8
8
|
|
|
9
9
|
// packages/safe-js/src/snapshot/dump.ts
|
|
10
10
|
var RUN_DUMP_CONTROLLER = /* @__PURE__ */ Symbol("SafeJS.run-dump-controller");
|
|
@@ -195,4 +195,4 @@ export {
|
|
|
195
195
|
dumpCurrent,
|
|
196
196
|
serializeRunSnapshot
|
|
197
197
|
};
|
|
198
|
-
//# sourceMappingURL=chunk-
|
|
198
|
+
//# sourceMappingURL=chunk-EAHOLZQ2.js.map
|
|
@@ -6,10 +6,10 @@ import {
|
|
|
6
6
|
import {
|
|
7
7
|
declareHostOperation,
|
|
8
8
|
runResources
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-4DPRV34R.js";
|
|
10
10
|
import {
|
|
11
11
|
hostErrorData
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-OMSG6GZF.js";
|
|
13
13
|
|
|
14
14
|
// packages/safe-js/src/modules/mcp.ts
|
|
15
15
|
var DEFAULT_TOOL_BATCH_CONCURRENCY = 4;
|
|
@@ -402,4 +402,4 @@ function isPlainObjectRecord(value) {
|
|
|
402
402
|
export {
|
|
403
403
|
makeMcpModule
|
|
404
404
|
};
|
|
405
|
-
//# sourceMappingURL=chunk-
|
|
405
|
+
//# sourceMappingURL=chunk-EUQCKN74.js.map
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "./chunk-SJZWSPWD.js";
|
|
7
7
|
import {
|
|
8
8
|
declareHostOperation
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-4DPRV34R.js";
|
|
10
10
|
|
|
11
11
|
// packages/safe-js/src/modules/fs.ts
|
|
12
12
|
import { constants as nodeFsConstants } from "node:fs";
|
|
@@ -673,4 +673,4 @@ export {
|
|
|
673
673
|
FS_OPTION_SURFACE,
|
|
674
674
|
makeFsModule
|
|
675
675
|
};
|
|
676
|
-
//# sourceMappingURL=chunk-
|
|
676
|
+
//# sourceMappingURL=chunk-F6K7WXYP.js.map
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
numericTypedArrayConstructors,
|
|
9
9
|
parseModule,
|
|
10
10
|
tokenize
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-OMSG6GZF.js";
|
|
12
12
|
|
|
13
13
|
// packages/safe-js/src/lint/rules/AS001.ts
|
|
14
14
|
function AS001(source, options = {}) {
|
|
@@ -11176,4 +11176,4 @@ function hasOnlyRegexLiteralDiagnostics(diagnostics) {
|
|
|
11176
11176
|
export {
|
|
11177
11177
|
lint
|
|
11178
11178
|
};
|
|
11179
|
-
//# sourceMappingURL=chunk-
|
|
11179
|
+
//# sourceMappingURL=chunk-J23VJ4EG.js.map
|
|
@@ -1234,7 +1234,7 @@ var Lexer = class {
|
|
|
1234
1234
|
line = 1;
|
|
1235
1235
|
column = 1;
|
|
1236
1236
|
tokens = [];
|
|
1237
|
-
|
|
1237
|
+
groupingState = { stack: [], classHeads: [], tokenCount: 0 };
|
|
1238
1238
|
lastClosedStatementBoundary = false;
|
|
1239
1239
|
legacyStringEscape = false;
|
|
1240
1240
|
lineHasToken = false;
|
|
@@ -1407,7 +1407,7 @@ var Lexer = class {
|
|
|
1407
1407
|
skipTemplateExpression(start) {
|
|
1408
1408
|
let depth = 1;
|
|
1409
1409
|
const tokens = [];
|
|
1410
|
-
const
|
|
1410
|
+
const groupingState = { stack: [], classHeads: [], tokenCount: 0 };
|
|
1411
1411
|
let lastClosedStatementBoundary = false;
|
|
1412
1412
|
while (!this.isAtEnd() && depth > 0) {
|
|
1413
1413
|
this.skipTrivia();
|
|
@@ -1477,8 +1477,9 @@ var Lexer = class {
|
|
|
1477
1477
|
if (char === "{") {
|
|
1478
1478
|
depth += 1;
|
|
1479
1479
|
this.advance();
|
|
1480
|
-
|
|
1480
|
+
const previousToken = tokens[tokens.length - 1];
|
|
1481
1481
|
tokens.push({ type: "punctuator", value: "{" });
|
|
1482
|
+
updateGroupingState(groupingState, previousToken, "{", lastClosedStatementBoundary, false, tokens);
|
|
1482
1483
|
lastClosedStatementBoundary = false;
|
|
1483
1484
|
continue;
|
|
1484
1485
|
}
|
|
@@ -1488,8 +1489,9 @@ var Lexer = class {
|
|
|
1488
1489
|
if (depth === 0) {
|
|
1489
1490
|
return;
|
|
1490
1491
|
}
|
|
1491
|
-
|
|
1492
|
+
const previousToken = tokens[tokens.length - 1];
|
|
1492
1493
|
tokens.push({ type: "punctuator", value: "}" });
|
|
1494
|
+
lastClosedStatementBoundary = updateGroupingState(groupingState, previousToken, "}", lastClosedStatementBoundary, false, tokens);
|
|
1493
1495
|
continue;
|
|
1494
1496
|
}
|
|
1495
1497
|
if (char === "/" && shouldRejectRegexLiteral(tokens[tokens.length - 1], lastClosedStatementBoundary, tokens)) {
|
|
@@ -1508,12 +1510,12 @@ var Lexer = class {
|
|
|
1508
1510
|
this.advanceBy(punctuator.length);
|
|
1509
1511
|
tokens.push({ type: "punctuator", value: punctuator });
|
|
1510
1512
|
lastClosedStatementBoundary = updateGroupingState(
|
|
1511
|
-
|
|
1513
|
+
groupingState,
|
|
1512
1514
|
previousToken,
|
|
1513
1515
|
punctuator,
|
|
1514
1516
|
lastClosedStatementBoundary,
|
|
1515
1517
|
false,
|
|
1516
|
-
tokens
|
|
1518
|
+
tokens
|
|
1517
1519
|
);
|
|
1518
1520
|
continue;
|
|
1519
1521
|
}
|
|
@@ -1872,12 +1874,12 @@ var Lexer = class {
|
|
|
1872
1874
|
this.tokens.push(token);
|
|
1873
1875
|
if (type === "punctuator") {
|
|
1874
1876
|
this.lastClosedStatementBoundary = updateGroupingState(
|
|
1875
|
-
this.
|
|
1877
|
+
this.groupingState,
|
|
1876
1878
|
previousToken,
|
|
1877
1879
|
value,
|
|
1878
1880
|
this.lastClosedStatementBoundary,
|
|
1879
1881
|
this.options.statementList === true,
|
|
1880
|
-
this.tokens
|
|
1882
|
+
this.tokens
|
|
1881
1883
|
);
|
|
1882
1884
|
return;
|
|
1883
1885
|
}
|
|
@@ -2128,11 +2130,39 @@ function endsWithForOfSeparator(tokens) {
|
|
|
2128
2130
|
}
|
|
2129
2131
|
return false;
|
|
2130
2132
|
}
|
|
2131
|
-
function updateGroupingState(
|
|
2133
|
+
function updateGroupingState(state, previousToken, punctuator, previousStatementBoundary, initialStatementList, tokens) {
|
|
2134
|
+
const groupingStack = state.stack;
|
|
2135
|
+
const functionBody = state.functionBody;
|
|
2136
|
+
state.functionBody = false;
|
|
2137
|
+
for (let index = state.tokenCount; index < tokens.length; index++) {
|
|
2138
|
+
const token = tokens[index];
|
|
2139
|
+
if (token.type !== "keyword" || token.value !== "class") continue;
|
|
2140
|
+
const before = tokens[index - 1];
|
|
2141
|
+
if (before?.value === "." || before?.value === "?.") continue;
|
|
2142
|
+
const next = tokens[index + 1]?.value;
|
|
2143
|
+
const afterName = tokens[index + 2]?.value;
|
|
2144
|
+
if (next !== "{" && next !== "extends" && afterName !== "{" && afterName !== "extends") continue;
|
|
2145
|
+
const parent = groupingStack[groupingStack.length - 1];
|
|
2146
|
+
if (parent?.classBody && (before === void 0 || ["{", "}", ";", "static"].includes(before.value) || ["identifier", "numeric", "string", "template", "regex"].includes(before.type))) continue;
|
|
2147
|
+
state.classHeads.push({
|
|
2148
|
+
depth: groupingStack.length,
|
|
2149
|
+
declaration: isDeclarationPosition(tokens, index, groupingStack, initialStatementList)
|
|
2150
|
+
});
|
|
2151
|
+
}
|
|
2152
|
+
state.tokenCount = tokens.length;
|
|
2153
|
+
const beforePreviousToken = tokens[tokens.length - 3];
|
|
2132
2154
|
if (punctuator === "(") {
|
|
2155
|
+
let functionIndex = tokens.length - 2;
|
|
2156
|
+
if (tokens[functionIndex]?.value !== "function") {
|
|
2157
|
+
if (tokens[functionIndex]?.value !== "*") functionIndex--;
|
|
2158
|
+
if (tokens[functionIndex]?.value === "*") functionIndex--;
|
|
2159
|
+
}
|
|
2160
|
+
const functionParameters = tokens[functionIndex]?.type === "keyword" && tokens[functionIndex].value === "function";
|
|
2161
|
+
const functionDeclaration = functionParameters && isDeclarationPosition(tokens, functionIndex, groupingStack, initialStatementList);
|
|
2133
2162
|
groupingStack.push({
|
|
2134
2163
|
value: "(",
|
|
2135
|
-
|
|
2164
|
+
functionParameters,
|
|
2165
|
+
isControlCondition: functionDeclaration || (previousToken?.type === "keyword" || previousToken?.type === "identifier") && (CONTROL_FLOW_PAREN_KEYWORDS.has(previousToken.value) || previousToken.value === "await" && beforePreviousToken?.type === "keyword" && beforePreviousToken.value === "for") && beforePreviousToken?.value !== "." && beforePreviousToken?.value !== "?."
|
|
2136
2166
|
});
|
|
2137
2167
|
return false;
|
|
2138
2168
|
}
|
|
@@ -2141,6 +2171,12 @@ function updateGroupingState(groupingStack, previousToken, punctuator, previousS
|
|
|
2141
2171
|
return false;
|
|
2142
2172
|
}
|
|
2143
2173
|
if (punctuator === "{") {
|
|
2174
|
+
const classHead = state.classHeads[state.classHeads.length - 1];
|
|
2175
|
+
if (!functionBody && previousToken?.value !== "=>" && classHead?.depth === groupingStack.length) {
|
|
2176
|
+
state.classHeads.pop();
|
|
2177
|
+
groupingStack.push({ value: "{", classBody: true, closesStatement: classHead.declaration });
|
|
2178
|
+
return false;
|
|
2179
|
+
}
|
|
2144
2180
|
const parent = groupingStack[groupingStack.length - 1];
|
|
2145
2181
|
const closesStatement = previousToken === void 0 ? initialStatementList : previousStatementBoundary || ["{", ";"].includes(previousToken.value) && (parent === void 0 || parent.statementList === true) || previousToken.type === "keyword" && ["else", "do", "try", "finally"].includes(previousToken.value);
|
|
2146
2182
|
groupingStack.push({
|
|
@@ -2151,7 +2187,9 @@ function updateGroupingState(groupingStack, previousToken, punctuator, previousS
|
|
|
2151
2187
|
return false;
|
|
2152
2188
|
}
|
|
2153
2189
|
if (punctuator === ")") {
|
|
2154
|
-
|
|
2190
|
+
const group = popGroupingContext(groupingStack, "(");
|
|
2191
|
+
state.functionBody = group?.functionParameters === true;
|
|
2192
|
+
return group?.isControlCondition === true;
|
|
2155
2193
|
}
|
|
2156
2194
|
if (punctuator === "]") {
|
|
2157
2195
|
popGroupingContext(groupingStack, "[");
|
|
@@ -2162,6 +2200,13 @@ function updateGroupingState(groupingStack, previousToken, punctuator, previousS
|
|
|
2162
2200
|
}
|
|
2163
2201
|
return false;
|
|
2164
2202
|
}
|
|
2203
|
+
function isDeclarationPosition(tokens, index, groupingStack, initialStatementList) {
|
|
2204
|
+
const parent = groupingStack[groupingStack.length - 1];
|
|
2205
|
+
if (parent === void 0 ? !initialStatementList : parent.statementList !== true) return false;
|
|
2206
|
+
if (tokens[index - 1]?.value === "async") index--;
|
|
2207
|
+
const previous = tokens[index - 1];
|
|
2208
|
+
return previous === void 0 || ["{", "}", ";", ")", "]", "export", "default"].includes(previous.value) || ["identifier", "numeric", "string", "template", "regex"].includes(previous.type) || previous.type === "keyword" && EXPRESSION_ENDING_KEYWORDS.has(previous.value);
|
|
2209
|
+
}
|
|
2165
2210
|
function popGroupingContext(groupingStack, expected) {
|
|
2166
2211
|
const top = groupingStack[groupingStack.length - 1];
|
|
2167
2212
|
if (top?.value !== expected) {
|
|
@@ -7321,4 +7366,4 @@ export {
|
|
|
7321
7366
|
Float16Array2 as Float16Array,
|
|
7322
7367
|
numericTypedArrayConstructors
|
|
7323
7368
|
};
|
|
7324
|
-
//# sourceMappingURL=chunk-
|
|
7369
|
+
//# sourceMappingURL=chunk-OMSG6GZF.js.map
|