vitest-pool-assemblyscript 0.9.1 → 0.10.1
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/assembly/compare.ts +11 -12
- package/assembly/describe.ts +4 -4
- package/assembly/expect.ts +44 -26
- package/assembly/test.ts +9 -9
- package/assembly/utils.ts +218 -62
- package/dist/{addon-interface-CYFXMbK7.mjs → addon-interface-BaUmn7uC.mjs} +12 -12
- package/dist/addon-interface-BaUmn7uC.mjs.map +1 -0
- package/dist/{ast-visitor-CWEOd3UH.mjs → ast-visitor-w1HMbuJR.mjs} +2 -2
- package/dist/{ast-visitor-CWEOd3UH.mjs.map → ast-visitor-w1HMbuJR.mjs.map} +1 -1
- package/dist/compile-runner-BGHM_85g.mjs +82 -0
- package/dist/compile-runner-BGHM_85g.mjs.map +1 -0
- package/dist/compiler/transforms/deep-equals.d.mts.map +1 -1
- package/dist/compiler/transforms/deep-equals.mjs +61 -22
- package/dist/compiler/transforms/deep-equals.mjs.map +1 -1
- package/dist/compiler/transforms/strip-inline.mjs +2 -2
- package/dist/{compiler-Dqs-qd3I.mjs → compiler-CXR5UJId.mjs} +55 -27
- package/dist/compiler-CXR5UJId.mjs.map +1 -0
- package/dist/config/index-v3.d.mts +1 -1
- package/dist/config/index-v3.d.mts.map +1 -1
- package/dist/config/index-v3.mjs.map +1 -1
- package/dist/config/index.d.mts +2 -2
- package/dist/config/index.mjs +5 -7
- package/dist/{constants-DbxJ3hzg.mjs → constants-Bq5KNxXJ.mjs} +4 -2
- package/dist/constants-Bq5KNxXJ.mjs.map +1 -0
- package/dist/{coverage-merge-CBXkpM1O.mjs → coverage-merge-0WqdC-dq.mjs} +1 -1
- package/dist/{coverage-merge-CBXkpM1O.mjs.map → coverage-merge-0WqdC-dq.mjs.map} +1 -1
- package/dist/coverage-provider/index.mjs +36 -36
- package/dist/coverage-provider/index.mjs.map +1 -1
- package/dist/{feature-check-Bje3ntpV.mjs → feature-check-BJpc4LoO.mjs} +4 -4
- package/dist/{feature-check-Bje3ntpV.mjs.map → feature-check-BJpc4LoO.mjs.map} +1 -1
- package/dist/index-internal.d.mts +3 -3
- package/dist/index-internal.d.mts.map +1 -1
- package/dist/index-internal.mjs +5 -4
- package/dist/index-v3.d.mts.map +1 -1
- package/dist/index-v3.mjs +19 -33
- package/dist/index-v3.mjs.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +5 -7
- package/dist/{load-user-imports-Bx5ZlhSm.mjs → load-user-imports-Bcx9NOt9.mjs} +119 -232
- package/dist/load-user-imports-Bcx9NOt9.mjs.map +1 -0
- package/dist/pool-errors-Bn6YaguR.mjs +630 -0
- package/dist/pool-errors-Bn6YaguR.mjs.map +1 -0
- package/dist/{pool-runner-init-CNpRdA5u.d.mts → pool-runner-init-CCvnKt5o.d.mts} +2 -2
- package/dist/pool-runner-init-CCvnKt5o.d.mts.map +1 -0
- package/dist/{pool-runner-init-BqkwQ2tk.mjs → pool-runner-init-DjRCbiX-.mjs} +15 -30
- package/dist/pool-runner-init-DjRCbiX-.mjs.map +1 -0
- package/dist/pool-thread/compile-worker-thread.d.mts +1 -1
- package/dist/pool-thread/compile-worker-thread.d.mts.map +1 -1
- package/dist/pool-thread/compile-worker-thread.mjs +29 -19
- package/dist/pool-thread/compile-worker-thread.mjs.map +1 -1
- package/dist/pool-thread/test-worker-thread.d.mts +1 -1
- package/dist/pool-thread/test-worker-thread.d.mts.map +1 -1
- package/dist/pool-thread/test-worker-thread.mjs +25 -18
- package/dist/pool-thread/test-worker-thread.mjs.map +1 -1
- package/dist/pool-thread/v3-tinypool-thread.d.mts +1 -1
- package/dist/pool-thread/v3-tinypool-thread.d.mts.map +1 -1
- package/dist/pool-thread/v3-tinypool-thread.mjs +43 -33
- package/dist/pool-thread/v3-tinypool-thread.mjs.map +1 -1
- package/dist/test-runner-BeP8ClnE.mjs +147 -0
- package/dist/test-runner-BeP8ClnE.mjs.map +1 -0
- package/dist/{types-DHVk5iAx.d.mts → types-CoroKYxB.d.mts} +39 -16
- package/dist/types-CoroKYxB.d.mts.map +1 -0
- package/dist/vitest-file-tasks-vvZzigcF.mjs +473 -0
- package/dist/vitest-file-tasks-vvZzigcF.mjs.map +1 -0
- package/dist/wasm-memory-C8Nkl2Sz.mjs +134 -0
- package/dist/wasm-memory-C8Nkl2Sz.mjs.map +1 -0
- package/dist/{worker-rpc-channel-CZZIxtv5.mjs → worker-rpc-channel-CvCrc8aa.mjs} +1 -1
- package/dist/{worker-rpc-channel-CZZIxtv5.mjs.map → worker-rpc-channel-CvCrc8aa.mjs.map} +1 -1
- package/package.json +1 -1
- package/prebuilds/darwin-arm64/vitest-pool-assemblyscript.glibc.node +0 -0
- package/prebuilds/darwin-x64/vitest-pool-assemblyscript.glibc.node +0 -0
- package/prebuilds/linux-arm64/vitest-pool-assemblyscript.glibc.node +0 -0
- package/prebuilds/linux-x64/vitest-pool-assemblyscript.glibc.node +0 -0
- package/prebuilds/linux-x64/vitest-pool-assemblyscript.musl.node +0 -0
- package/prebuilds/win32-arm64/vitest-pool-assemblyscript.glibc.node +0 -0
- package/prebuilds/win32-x64/vitest-pool-assemblyscript.glibc.node +0 -0
- package/src/instrumentation/native/addon.cpp +71 -32
- package/dist/addon-interface-CYFXMbK7.mjs.map +0 -1
- package/dist/compile-runner-BNFHRGZO.mjs +0 -85
- package/dist/compile-runner-BNFHRGZO.mjs.map +0 -1
- package/dist/compiler-Dqs-qd3I.mjs.map +0 -1
- package/dist/constants-DbxJ3hzg.mjs.map +0 -1
- package/dist/debug-DtRAL4rM.mjs +0 -232
- package/dist/debug-DtRAL4rM.mjs.map +0 -1
- package/dist/load-user-imports-Bx5ZlhSm.mjs.map +0 -1
- package/dist/path-utils-t9OzjXYF.mjs +0 -24
- package/dist/path-utils-t9OzjXYF.mjs.map +0 -1
- package/dist/pool-runner-init-BqkwQ2tk.mjs.map +0 -1
- package/dist/pool-runner-init-CNpRdA5u.d.mts.map +0 -1
- package/dist/resolve-config-s9gSJSMc.mjs +0 -85
- package/dist/resolve-config-s9gSJSMc.mjs.map +0 -1
- package/dist/test-runner-BGqc9uCK.mjs +0 -138
- package/dist/test-runner-BGqc9uCK.mjs.map +0 -1
- package/dist/types-DHVk5iAx.d.mts.map +0 -1
- package/dist/vitest-file-tasks-D8sOClGX.mjs +0 -149
- package/dist/vitest-file-tasks-D8sOClGX.mjs.map +0 -1
- package/dist/vitest-tasks-BZ24sghI.mjs +0 -321
- package/dist/vitest-tasks-BZ24sghI.mjs.map +0 -1
- package/dist/wasm-names-BFtzQCH4.mjs +0 -124
- package/dist/wasm-names-BFtzQCH4.mjs.map +0 -1
|
@@ -1,321 +0,0 @@
|
|
|
1
|
-
import { POOL_ERROR_NAMES, TEST_ERROR_NAMES } from "./constants-DbxJ3hzg.mjs";
|
|
2
|
-
import { retryCompat } from "./resolve-config-s9gSJSMc.mjs";
|
|
3
|
-
import { createPoolErrorFromAnyError, createTestExpectedToFailError, createTestTimeoutError, debug } from "./debug-DtRAL4rM.mjs";
|
|
4
|
-
|
|
5
|
-
//#region src/wasm-executor/source-maps.ts
|
|
6
|
-
function parseSourceMap(sourceMap) {
|
|
7
|
-
try {
|
|
8
|
-
const sourceMapObj = JSON.parse(sourceMap);
|
|
9
|
-
delete sourceMapObj.sourceRoot;
|
|
10
|
-
return sourceMapObj;
|
|
11
|
-
} catch (err) {
|
|
12
|
-
throw createPoolErrorFromAnyError(`parseSourceMap error`, POOL_ERROR_NAMES.PoolError, err);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Extract structured call stack from V8 using Error.prepareStackTrace
|
|
17
|
-
*
|
|
18
|
-
* V8 provides a special API to access structured stack traces with line:column info.
|
|
19
|
-
* This gives us WAT text positions which can be mapped to AS source via source maps.
|
|
20
|
-
*
|
|
21
|
-
* @param capturedError - Error object to extract stack from
|
|
22
|
-
* @returns Array of V8 CallSite objects
|
|
23
|
-
*/
|
|
24
|
-
function extractCallStack(capturedError) {
|
|
25
|
-
let stackTrace = [];
|
|
26
|
-
const originalPrepareStackTrace = Error.prepareStackTrace;
|
|
27
|
-
Error.prepareStackTrace = (_err, structuredStackTrace) => {
|
|
28
|
-
stackTrace = structuredStackTrace;
|
|
29
|
-
return "";
|
|
30
|
-
};
|
|
31
|
-
capturedError.stack;
|
|
32
|
-
Error.prepareStackTrace = originalPrepareStackTrace;
|
|
33
|
-
return stackTrace;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Create WebAssembly call site with source mapping
|
|
37
|
-
*
|
|
38
|
-
* Takes a V8 CallSite and maps it to AS source location if possible.
|
|
39
|
-
*
|
|
40
|
-
* @param callSite - V8 CallSite object from Error.prepareStackTrace
|
|
41
|
-
* @param sourceMapJson - Source map consumer initialized with WASM source map
|
|
42
|
-
* @returns Mapped call site or null if not a WASM call site
|
|
43
|
-
*/
|
|
44
|
-
function createWebAssemblyCallSite(callSite, sourceMapConsumer, loggingPrefix) {
|
|
45
|
-
const fileName = callSite.getFileName();
|
|
46
|
-
if (!fileName || !fileName.startsWith("wasm://")) return null;
|
|
47
|
-
const watLine = callSite.getLineNumber();
|
|
48
|
-
const watColumn = callSite.getColumnNumber();
|
|
49
|
-
const functionName = callSite.getFunctionName() || "wasm-function[unknown]";
|
|
50
|
-
const debugString = `function: "${functionName}" | wasm: ${fileName}:${watLine}:${watColumn}`;
|
|
51
|
-
if (watLine && watColumn) {
|
|
52
|
-
const original = sourceMapConsumer.originalPositionFor({
|
|
53
|
-
line: watLine,
|
|
54
|
-
column: watColumn
|
|
55
|
-
});
|
|
56
|
-
if (!original.source || original.line === null || original.column === null) {
|
|
57
|
-
debug(`${loggingPrefix} - Failed to source-map stack location: ${debugString}`);
|
|
58
|
-
return null;
|
|
59
|
-
}
|
|
60
|
-
debug(`${loggingPrefix} - Source-mapped stack location: ${debugString} → ${original.source}:${original.line}:${original.column}`);
|
|
61
|
-
return {
|
|
62
|
-
functionName,
|
|
63
|
-
location: {
|
|
64
|
-
filePath: original.source,
|
|
65
|
-
line: original.line,
|
|
66
|
-
column: original.column
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
debug(`${loggingPrefix} - Failed to source-map stack-location: ${debugString}`);
|
|
71
|
-
return {
|
|
72
|
-
functionName,
|
|
73
|
-
location: {
|
|
74
|
-
filePath: fileName,
|
|
75
|
-
line: watLine || -1,
|
|
76
|
-
column: watColumn || -1
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
//#endregion
|
|
82
|
-
//#region src/util/vitest-tasks.ts
|
|
83
|
-
function positiveSum(items, getSummableValue) {
|
|
84
|
-
return items.reduce((total, next) => {
|
|
85
|
-
return total + Math.max(getSummableValue(next) || 0, 0);
|
|
86
|
-
}, 0);
|
|
87
|
-
}
|
|
88
|
-
function hasNonFileParentSuite(suite) {
|
|
89
|
-
return !!suite.suite?.id && suite.suite.id !== suite.file.id;
|
|
90
|
-
}
|
|
91
|
-
function getSuiteHierarchyName(suite) {
|
|
92
|
-
let name = suite.name;
|
|
93
|
-
let currentSuite = suite;
|
|
94
|
-
while (hasNonFileParentSuite(currentSuite)) {
|
|
95
|
-
name = `${currentSuite.suite.name} > ${name}`;
|
|
96
|
-
currentSuite = currentSuite.suite;
|
|
97
|
-
}
|
|
98
|
-
return name;
|
|
99
|
-
}
|
|
100
|
-
function isSuiteOwnFile(suite) {
|
|
101
|
-
return suite.file.id === suite.id;
|
|
102
|
-
}
|
|
103
|
-
function getTaskLogLabel(base, task) {
|
|
104
|
-
if (task.type === "suite") return isSuiteOwnFile(task) ? `${base}` : `${base} - "${getSuiteHierarchyName(task)}"`;
|
|
105
|
-
else return `${base} - "${getSuiteHierarchyName(task.suite)} > ${task.name}"`;
|
|
106
|
-
}
|
|
107
|
-
function getTaskLogPrefix(logModule, base, task) {
|
|
108
|
-
return `[${logModule}] ${getTaskLogLabel(base, task)}`;
|
|
109
|
-
}
|
|
110
|
-
function createAfterSuiteRunMeta(coverage, testFiles, projectName = "", vitestVersion = "v4") {
|
|
111
|
-
const base = {
|
|
112
|
-
coverage,
|
|
113
|
-
testFiles,
|
|
114
|
-
projectName
|
|
115
|
-
};
|
|
116
|
-
if (vitestVersion) return {
|
|
117
|
-
...base,
|
|
118
|
-
transformMode: "ssr"
|
|
119
|
-
};
|
|
120
|
-
else return {
|
|
121
|
-
...base,
|
|
122
|
-
environment: "node"
|
|
123
|
-
};
|
|
124
|
-
}
|
|
125
|
-
function getInitialTaskMode(options) {
|
|
126
|
-
if (options.skip) return "skip";
|
|
127
|
-
else if (options.only) return "only";
|
|
128
|
-
else return "run";
|
|
129
|
-
}
|
|
130
|
-
function getInitialTestTaskMeta(fnIndex, parentAfterAddingTask) {
|
|
131
|
-
return {
|
|
132
|
-
fnIndex,
|
|
133
|
-
idxInParentTasks: parentAfterAddingTask.tasks.length - 1,
|
|
134
|
-
assertionsPassedCount: 0,
|
|
135
|
-
assertionsFailed: [],
|
|
136
|
-
resultFinal: false
|
|
137
|
-
};
|
|
138
|
-
}
|
|
139
|
-
function getInitialSuiteTaskMeta(parentAfterAddingTask, mergedOptions) {
|
|
140
|
-
return {
|
|
141
|
-
idxInParentTasks: parentAfterAddingTask.tasks.length - 1,
|
|
142
|
-
defaultTestOptions: mergedOptions,
|
|
143
|
-
suitePreparedSent: false,
|
|
144
|
-
resultFinal: false
|
|
145
|
-
};
|
|
146
|
-
}
|
|
147
|
-
function createTaskName(names, separator = " > ") {
|
|
148
|
-
return names.filter((name) => name !== void 0).join(separator);
|
|
149
|
-
}
|
|
150
|
-
function createTestTask(name, fnIndex, file, parent, mergedOptions, vitestVersion = "v4") {
|
|
151
|
-
const test = {
|
|
152
|
-
type: "test",
|
|
153
|
-
name,
|
|
154
|
-
fullName: createTaskName([parent?.fullName ?? file?.fullName, name]),
|
|
155
|
-
fullTestName: createTaskName([parent?.fullTestName, name]),
|
|
156
|
-
id: "",
|
|
157
|
-
file,
|
|
158
|
-
suite: parent,
|
|
159
|
-
context: {},
|
|
160
|
-
annotations: [],
|
|
161
|
-
artifacts: [],
|
|
162
|
-
meta: {},
|
|
163
|
-
mode: getInitialTaskMode(mergedOptions),
|
|
164
|
-
timeout: mergedOptions.timeout,
|
|
165
|
-
retry: mergedOptions.retry,
|
|
166
|
-
fails: mergedOptions.fails
|
|
167
|
-
};
|
|
168
|
-
if (vitestVersion === "v3") {
|
|
169
|
-
delete test.fullName;
|
|
170
|
-
delete test.fullTestName;
|
|
171
|
-
delete test.artifacts;
|
|
172
|
-
}
|
|
173
|
-
parent.tasks.push(test);
|
|
174
|
-
test.meta = getInitialTestTaskMeta(fnIndex, parent);
|
|
175
|
-
return test;
|
|
176
|
-
}
|
|
177
|
-
function createSuiteTask(name, file, parent, mergedOptions, vitestVersion = "v4") {
|
|
178
|
-
const suite = {
|
|
179
|
-
type: "suite",
|
|
180
|
-
name,
|
|
181
|
-
fullName: createTaskName([parent?.fullName ?? file?.fullName, name]),
|
|
182
|
-
fullTestName: createTaskName([parent?.fullTestName, name]),
|
|
183
|
-
id: "",
|
|
184
|
-
file,
|
|
185
|
-
suite: parent,
|
|
186
|
-
meta: {},
|
|
187
|
-
tasks: [],
|
|
188
|
-
mode: getInitialTaskMode(mergedOptions)
|
|
189
|
-
};
|
|
190
|
-
if (vitestVersion === "v3") {
|
|
191
|
-
delete suite.fullName;
|
|
192
|
-
delete suite.fullTestName;
|
|
193
|
-
}
|
|
194
|
-
parent.tasks.push(suite);
|
|
195
|
-
suite.meta = getInitialSuiteTaskMeta(parent, mergedOptions);
|
|
196
|
-
return suite;
|
|
197
|
-
}
|
|
198
|
-
function getRunnableTasks(suite) {
|
|
199
|
-
return suite.tasks.filter((t) => t.mode === "queued" || t.mode === "run");
|
|
200
|
-
}
|
|
201
|
-
function shouldRetryTask(task) {
|
|
202
|
-
const retry = retryCompat(task.retry);
|
|
203
|
-
return task.result?.state === "fail" && task.retry !== void 0 && retry > 0 && (task.result.retryCount === void 0 || task.result.retryCount === 0 || task.result.retryCount < retry);
|
|
204
|
-
}
|
|
205
|
-
/**
|
|
206
|
-
* Invert result if test configured as 'fails'.
|
|
207
|
-
*/
|
|
208
|
-
function checkFailsAndInvertResult(test, logPrefix) {
|
|
209
|
-
if (test.fails) {
|
|
210
|
-
if (test.result?.state === "pass") {
|
|
211
|
-
test.result.state = "fail";
|
|
212
|
-
debug(`${logPrefix} - Has 'fails' option set - inverted "pass" to "fail"`);
|
|
213
|
-
const err = createTestExpectedToFailError(test);
|
|
214
|
-
if (test.result.errors) test.result.errors.push(err);
|
|
215
|
-
else test.result.errors = [err];
|
|
216
|
-
} else if (test.result?.state === "fail") {
|
|
217
|
-
test.result.state = "pass";
|
|
218
|
-
test.result.errors = [];
|
|
219
|
-
debug(`${logPrefix} - Has 'fails' option set - inverted "fail" to "pass"`);
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
function setTestResultForTestPrepare(test, startTime) {
|
|
224
|
-
test.result = {
|
|
225
|
-
state: "run",
|
|
226
|
-
startTime,
|
|
227
|
-
retryCount: 0
|
|
228
|
-
};
|
|
229
|
-
}
|
|
230
|
-
function updateTestResultAfterRun(test, testTimings) {
|
|
231
|
-
if (test.result?.state === "run") test.result.state = "pass";
|
|
232
|
-
if (test.result && testTimings) test.result.duration = (test.result.duration ?? 0) + (testTimings.execEnd - testTimings.execStart);
|
|
233
|
-
}
|
|
234
|
-
function flagTestTerminated(test) {
|
|
235
|
-
test.meta.lastTimeoutTerminationTime = Date.now();
|
|
236
|
-
}
|
|
237
|
-
function flagTestFinalized(test) {
|
|
238
|
-
test.meta.resultFinal = true;
|
|
239
|
-
}
|
|
240
|
-
function failTest(test, errorMessage, capturedError, logPrefix) {
|
|
241
|
-
if (test.result) test.result.state = "fail";
|
|
242
|
-
else test.result = { state: "fail" };
|
|
243
|
-
const testError = {
|
|
244
|
-
name: TEST_ERROR_NAMES.WASMRuntimeError,
|
|
245
|
-
message: errorMessage
|
|
246
|
-
};
|
|
247
|
-
const meta = test.meta;
|
|
248
|
-
if (meta.assertionsFailed?.length > 0) {
|
|
249
|
-
testError.name = TEST_ERROR_NAMES.AssertionError;
|
|
250
|
-
const assertion = meta.assertionsFailed[meta.assertionsFailed.length - 1];
|
|
251
|
-
if (assertion.valuesProvided) {
|
|
252
|
-
meta.lastErrorValuesProvided = true;
|
|
253
|
-
testError.expected = assertion.expected !== void 0 ? String(assertion.expected) : void 0;
|
|
254
|
-
testError.actual = assertion.actual !== void 0 ? String(assertion.actual) : void 0;
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
meta.lastError = testError;
|
|
258
|
-
meta.lastErrorRawCallStack = extractCallStack(capturedError);
|
|
259
|
-
debug(`${logPrefix} - Captured raw V8 call stack with ${meta.lastErrorRawCallStack.length} frames`);
|
|
260
|
-
}
|
|
261
|
-
function failTestWithTimeoutError(test, startTime, duration) {
|
|
262
|
-
const timeoutErr = createTestTimeoutError(test);
|
|
263
|
-
if (test.result) {
|
|
264
|
-
test.result.state = "fail";
|
|
265
|
-
test.result.startTime = startTime;
|
|
266
|
-
test.result.duration = (test.result.duration ?? 0) + duration;
|
|
267
|
-
if (test.result.errors) test.result.errors.push(timeoutErr);
|
|
268
|
-
else test.result.errors = [timeoutErr];
|
|
269
|
-
} else test.result = {
|
|
270
|
-
state: "fail",
|
|
271
|
-
startTime,
|
|
272
|
-
duration,
|
|
273
|
-
errors: [timeoutErr],
|
|
274
|
-
retryCount: 0
|
|
275
|
-
};
|
|
276
|
-
}
|
|
277
|
-
function setSuitePrepareResult(suite) {
|
|
278
|
-
if (suite.mode === "skip") suite.result = {
|
|
279
|
-
state: "skip",
|
|
280
|
-
duration: 0
|
|
281
|
-
};
|
|
282
|
-
else suite.result = {
|
|
283
|
-
state: "run",
|
|
284
|
-
startTime: Date.now()
|
|
285
|
-
};
|
|
286
|
-
}
|
|
287
|
-
function updateSuiteFinishedResult(suite, logPrefix) {
|
|
288
|
-
if (suite.mode === "skip") suite.result = {
|
|
289
|
-
state: "skip",
|
|
290
|
-
duration: 0
|
|
291
|
-
};
|
|
292
|
-
else {
|
|
293
|
-
const hasFailures = suite.tasks.some(({ result }) => result?.state === "fail");
|
|
294
|
-
if (suite.result) {
|
|
295
|
-
suite.result.duration = positiveSum(suite.tasks, (t) => t.result?.duration);
|
|
296
|
-
suite.result.state = hasFailures ? "fail" : "pass";
|
|
297
|
-
debug(`${logPrefix} - Set suite result: "${suite.result.state}" (hasFailures: ${hasFailures})`);
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
function finalizeSuiteResult(suite) {
|
|
302
|
-
suite.meta.resultFinal = true;
|
|
303
|
-
}
|
|
304
|
-
function resetTestForRetry(test, startTime) {
|
|
305
|
-
if (test.result) {
|
|
306
|
-
test.result.state = "run";
|
|
307
|
-
test.result.startTime = startTime;
|
|
308
|
-
}
|
|
309
|
-
const meta = test.meta;
|
|
310
|
-
meta.assertionsPassedCount = 0;
|
|
311
|
-
meta.assertionsFailed = [];
|
|
312
|
-
delete meta.lastError;
|
|
313
|
-
delete meta.lastErrorValuesProvided;
|
|
314
|
-
delete meta.lastErrorRawCallStack;
|
|
315
|
-
delete meta.lastTimeoutTerminationTime;
|
|
316
|
-
delete meta.coverageData;
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
//#endregion
|
|
320
|
-
export { checkFailsAndInvertResult, createAfterSuiteRunMeta, createSuiteTask, createTestTask, createWebAssemblyCallSite, extractCallStack, failTest, failTestWithTimeoutError, finalizeSuiteResult, flagTestFinalized, flagTestTerminated, getRunnableTasks, getTaskLogLabel, getTaskLogPrefix, isSuiteOwnFile, parseSourceMap, resetTestForRetry, setSuitePrepareResult, setTestResultForTestPrepare, shouldRetryTask, updateSuiteFinishedResult, updateTestResultAfterRun };
|
|
321
|
-
//# sourceMappingURL=vitest-tasks-BZ24sghI.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"vitest-tasks-BZ24sghI.mjs","names":[],"sources":["../src/wasm-executor/source-maps.ts","../src/util/vitest-tasks.ts"],"sourcesContent":["/**\n * Source Map Utilities\n *\n * Maps WASM errors to AssemblyScript source locations using V8 stack traces + source maps.\n *\n * Approach: V8's Error.prepareStackTrace provides WAT (WebAssembly Text) line:column positions,\n * which can be mapped to AS source using the source maps generated by AS compiler.\n */\n\nimport { type RawSourceMap, SourceMapConsumer } from 'source-map';\n\nimport { debug } from '../util/debug.js';\nimport type { WebAssemblyCallSite } from '../types/types.js';\nimport { createPoolErrorFromAnyError } from '../util/pool-errors.js';\nimport { POOL_ERROR_NAMES } from '../types/constants.js';\n\nexport function parseSourceMap(sourceMap: string): RawSourceMap {\n // Remove sourceRoot if present to prevent source-map library from prepending it to paths\n // AS compiler sets sourceRoot: \"./output\" which would make paths like \"output/tests/...\"\n // instead of \"tests/...\" - these paths don't exist and won't be found by Vitest\n try {\n const sourceMapObj: RawSourceMap = JSON.parse(sourceMap);\n delete sourceMapObj.sourceRoot;\n return sourceMapObj;\n }\n catch (err) {\n throw createPoolErrorFromAnyError(\n `parseSourceMap error`,\n POOL_ERROR_NAMES.PoolError,\n err\n )\n }\n}\n\n/**\n * Extract structured call stack from V8 using Error.prepareStackTrace\n *\n * V8 provides a special API to access structured stack traces with line:column info.\n * This gives us WAT text positions which can be mapped to AS source via source maps.\n *\n * @param capturedError - Error object to extract stack from\n * @returns Array of V8 CallSite objects\n */\nexport function extractCallStack(capturedError: Error): NodeJS.CallSite[] {\n let stackTrace: NodeJS.CallSite[] = [];\n\n const originalPrepareStackTrace = Error.prepareStackTrace;\n Error.prepareStackTrace = (_err: Error, structuredStackTrace: NodeJS.CallSite[]) => {\n stackTrace = structuredStackTrace;\n return ''; // Return empty string to avoid modifying error.stack\n };\n\n // Access error.stack to trigger prepareStackTrace (result unused, just triggers callback)\n capturedError.stack;\n\n // Restore original\n Error.prepareStackTrace = originalPrepareStackTrace;\n\n return stackTrace;\n}\n\n/**\n * Create WebAssembly call site with source mapping\n *\n * Takes a V8 CallSite and maps it to AS source location if possible.\n *\n * @param callSite - V8 CallSite object from Error.prepareStackTrace\n * @param sourceMapJson - Source map consumer initialized with WASM source map\n * @returns Mapped call site or null if not a WASM call site\n */\nexport function createWebAssemblyCallSite(\n callSite: NodeJS.CallSite,\n sourceMapConsumer: SourceMapConsumer,\n loggingPrefix: string,\n): WebAssemblyCallSite | null {\n const fileName = callSite.getFileName();\n\n // Only process WASM call sites\n if (!fileName || !fileName.startsWith('wasm://')) {\n return null;\n }\n\n const watLine = callSite.getLineNumber();\n const watColumn = callSite.getColumnNumber();\n const functionName = callSite.getFunctionName() || 'wasm-function[unknown]';\n const debugString = `function: \"${functionName}\" | wasm: ${fileName}:${watLine}:${watColumn}`;\n\n // Try to map to source\n if (watLine && watColumn) {\n const original = sourceMapConsumer.originalPositionFor({\n line: watLine,\n column: watColumn\n });\n \n if (!original.source || original.line === null || original.column === null) {\n debug(`${loggingPrefix} - Failed to source-map stack location: ${debugString}`);\n return null;\n }\n\n debug(`${loggingPrefix} - Source-mapped stack location: ${debugString} → ${original.source}:${original.line}:${original.column}`);\n \n const callSite: WebAssemblyCallSite = {\n functionName,\n location: {\n filePath: original.source,\n line: original.line,\n column: original.column\n }\n };\n\n return callSite;\n }\n\n debug(`${loggingPrefix} - Failed to source-map stack-location: ${debugString}`);\n\n // Fallback to WAT position\n return {\n functionName,\n location: {\n filePath: fileName,\n line: watLine || -1,\n column: watColumn || -1\n }\n };\n}\n","import type { File, RunMode, Suite, Task, Test } from '@vitest/runner/types';\n\nimport type {\n AssemblyScriptCoveragePayload,\n AssemblyScriptSuiteTaskMeta,\n AssemblyScriptTestError,\n AssemblyScriptTestOptions,\n AssemblyScriptTestTaskMeta,\n FailedAssertion,\n VitestVersion,\n WASMExecutorPerfTimings\n} from '../types/types.js';\nimport { TEST_ERROR_NAMES } from '../types/constants.js';\nimport { debug } from './debug.js';\nimport { createTestExpectedToFailError, createTestTimeoutError } from './pool-errors.js';\nimport { extractCallStack } from '../wasm-executor/source-maps.js';\nimport { retryCompat } from './resolve-config.js';\n\n// ============================================================================\n// Util\n// ============================================================================\n\nfunction positiveSum<T>(items: T[], getSummableValue: (_next: T) => number | undefined): number {\n return items.reduce((total, next) => {\n return total + Math.max(getSummableValue(next) || 0, 0)\n }, 0);\n}\n\nfunction hasNonFileParentSuite(suite: Suite): boolean {\n return !!suite.suite?.id && suite.suite.id !== suite.file.id;\n}\n\nfunction getSuiteHierarchyName(suite: Suite): string {\n let name = suite.name;\n let currentSuite = suite;\n \n while (hasNonFileParentSuite(currentSuite)) {\n name = `${currentSuite.suite!.name} > ${name}`;\n currentSuite = currentSuite.suite!;\n }\n \n return name;\n}\n\nexport function isSuiteOwnFile(suite: Suite): boolean {\n return suite.file.id === suite.id;\n}\n\nexport function getTaskLogLabel(base: string, task: Task): string {\n if (task.type === 'suite') {\n return isSuiteOwnFile(task) ?\n `${base}`\n : `${base} - \"${getSuiteHierarchyName(task)}\"`;\n } else {\n return `${base} - \"${getSuiteHierarchyName(task.suite!)} > ${task.name}\"`;\n }\n}\n\nexport function getTaskLogPrefix(logModule: string, base: string, task: Task): string {\n return `[${logModule}] ${getTaskLogLabel(base, task)}`;\n}\n\nexport function createAfterSuiteRunMeta(\n coverage: AssemblyScriptCoveragePayload,\n testFiles: string[],\n projectName: string = '',\n vitestVersion: VitestVersion = 'v4',\n): any {\n const base = { coverage, testFiles, projectName };\n\n if (vitestVersion) {\n return { ...base, transformMode: 'ssr' as const };\n } else {\n return { ...base, environment: 'node' as const };\n }\n}\n\n// ============================================================================\n// Task Creation\n// ============================================================================\n\nexport function getInitialTaskMode(options: AssemblyScriptTestOptions): RunMode {\n if (options.skip) {\n return 'skip';\n } else if (options.only) {\n return 'only';\n } else {\n return 'run';\n }\n}\n\nexport function getInitialTestTaskMeta(\n fnIndex: number,\n parentAfterAddingTask: Suite,\n): AssemblyScriptTestTaskMeta {\n return {\n fnIndex,\n idxInParentTasks: parentAfterAddingTask.tasks.length - 1,\n assertionsPassedCount: 0,\n assertionsFailed: [],\n resultFinal: false,\n };\n}\n\nexport function getInitialSuiteTaskMeta(\n parentAfterAddingTask: Suite,\n mergedOptions: AssemblyScriptTestOptions,\n): AssemblyScriptSuiteTaskMeta {\n return {\n idxInParentTasks: parentAfterAddingTask.tasks.length - 1,\n defaultTestOptions: mergedOptions,\n suitePreparedSent: false,\n resultFinal: false,\n };\n}\n\n\nfunction createTaskName(names: readonly (string | undefined)[], separator: string = ' > '): string {\n return names.filter(name => name !== undefined).join(separator);\n}\n\nexport function createTestTask(\n name: string,\n fnIndex: number,\n file: File,\n parent: Suite,\n mergedOptions: AssemblyScriptTestOptions,\n vitestVersion: VitestVersion = 'v4',\n): Test {\n const test: Test = {\n type: 'test',\n name,\n fullName: createTaskName([\n parent?.fullName ?? file?.fullName,\n name,\n ]),\n fullTestName: createTaskName([parent?.fullTestName, name]),\n id: '',\n file,\n suite: parent,\n context: {} as any,\n annotations: [],\n artifacts: [],\n meta: {},\n mode: getInitialTaskMode(mergedOptions),\n timeout: mergedOptions.timeout,\n retry: mergedOptions.retry,\n fails: mergedOptions.fails,\n };\n\n if (vitestVersion === 'v3') {\n // @ts-ignore\n delete test.fullName;\n // @ts-ignore\n delete test.fullTestName;\n // @ts-ignore\n delete test.artifacts;\n }\n\n parent.tasks.push(test);\n\n // use custom TaskMeta to capture fnIndex, parent task index, etc\n test.meta = getInitialTestTaskMeta(fnIndex, parent);\n\n return test;\n}\n\nexport function createSuiteTask(\n name: string,\n file: File,\n parent: Suite,\n mergedOptions: AssemblyScriptTestOptions,\n vitestVersion: VitestVersion = 'v4',\n): Suite {\n // const suiteIsFile = parent.file.id === parent.id;\n // const prefix = suiteIsFile ? parent.name : `${file.filepath}_${parent.name}`;\n const suite: Suite = {\n type: 'suite',\n name,\n fullName: createTaskName([\n parent?.fullName ?? file?.fullName,\n name,\n ]),\n fullTestName: createTaskName([parent?.fullTestName, name]),\n id: '',\n file,\n suite: parent,\n meta: {},\n tasks: [],\n mode: getInitialTaskMode(mergedOptions),\n };\n\n if (vitestVersion === 'v3') {\n // @ts-ignore\n delete suite.fullName;\n // @ts-ignore\n delete suite.fullTestName;\n }\n\n parent.tasks.push(suite);\n\n // use custom TaskMeta to capture parent task index and default options\n suite.meta = getInitialSuiteTaskMeta(parent, mergedOptions);\n\n return suite;\n}\n\n\n// ============================================================================\n// Dispatch Helpers\n// ============================================================================\n\nexport function getRunnableTasks(suite: Suite): Task[] {\n return suite.tasks.filter(t => t.mode === 'queued' || t.mode === 'run');\n}\n\n\n// ============================================================================\n// Result Handling Helpers\n// ============================================================================\n\nexport function shouldRetryTask(task: Task): boolean {\n const retry = retryCompat(task.retry);\n return task.result?.state === 'fail'\n && task.retry !== undefined\n && retry > 0\n && (\n task.result.retryCount === undefined\n || task.result.retryCount === 0\n || (task.result.retryCount < retry)\n );\n}\n\n/**\n * Invert result if test configured as 'fails'.\n */\nexport function checkFailsAndInvertResult(test: Test, logPrefix: string): void {\n if (test.fails) {\n if (test.result?.state === 'pass') {\n test.result.state = 'fail';\n\n debug(`${logPrefix} - Has 'fails' option set - inverted \"pass\" to \"fail\"`);\n\n const err = createTestExpectedToFailError(test);\n if (test.result.errors) {\n test.result.errors.push(err);\n } else {\n test.result.errors = [err];\n }\n } else if (test.result?.state === 'fail') {\n test.result.state = 'pass';\n test.result.errors = [];\n\n debug(`${logPrefix} - Has 'fails' option set - inverted \"fail\" to \"pass\"`);\n }\n }\n}\n\nexport function setTestResultForTestPrepare(test: Test, startTime: number): void {\n test.result = {\n state: 'run',\n startTime,\n retryCount: 0\n };\n};\n\nexport function updateTestResultAfterRun(test: Test, testTimings?: WASMExecutorPerfTimings): void {\n // while failed tests are actively set to failed, a passed test\n // will still be in the prepared result state (run), so set it to pass\n if (test.result?.state === 'run') {\n test.result.state = 'pass';\n }\n \n if (test.result && testTimings) {\n // accumulate duration for any retries that may be done\n test.result.duration = (test.result.duration ?? 0) + (testTimings.execEnd - testTimings.execStart);\n }\n}\n\nexport function flagTestTerminated(test: Test): void {\n (test.meta as AssemblyScriptTestTaskMeta).lastTimeoutTerminationTime = Date.now();\n}\n\nexport function flagTestFinalized(test: Test): void {\n (test.meta as AssemblyScriptTestTaskMeta).resultFinal = true;\n}\n\nexport function failTest(\n test: Test,\n errorMessage: string,\n capturedError: Error,\n logPrefix: string,\n): void {\n if (test.result) {\n test.result.state = 'fail';\n } else {\n test.result = { state: 'fail' };\n }\n\n const testError: AssemblyScriptTestError = {\n name: TEST_ERROR_NAMES.WASMRuntimeError,\n message: errorMessage\n };\n\n const meta = test.meta as AssemblyScriptTestTaskMeta;\n \n // determine if this was an assertion failure\n if (meta.assertionsFailed?.length > 0) {\n testError.name = TEST_ERROR_NAMES.AssertionError;\n\n const assertion: FailedAssertion = meta.assertionsFailed[meta.assertionsFailed.length - 1]!;\n\n // set actual and expected values as strings, if provided\n if (assertion.valuesProvided) {\n meta.lastErrorValuesProvided = true;\n testError.expected = assertion.expected !== undefined ? String(assertion.expected) : undefined;\n testError.actual = assertion.actual !== undefined ? String(assertion.actual) : undefined;\n }\n }\n \n // Set error to report to vitest on the test meta.\n // Stack gets updated when executor enhances/source-maps the error, post-abort\n meta.lastError = testError;\n\n // Create error to capture V8 stack trace and extract V8 call stack before throwing.\n // This gives us WAT line:column positions that can be mapped to AS source\n meta.lastErrorRawCallStack = extractCallStack(capturedError);\n\n debug(`${logPrefix} - Captured raw V8 call stack with ${meta.lastErrorRawCallStack.length} frames`);\n}\n\nexport function failTestWithTimeoutError (test: Test, startTime: number, duration: number): void {\n const timeoutErr = createTestTimeoutError(test);\n\n if (test.result) {\n test.result.state = 'fail';\n test.result.startTime = startTime;\n \n // accumulate duration for any retries that may be done\n test.result.duration = (test.result.duration ?? 0) + duration;\n\n if (test.result.errors) {\n test.result.errors.push(timeoutErr)\n } else {\n test.result.errors = [timeoutErr];\n }\n } else {\n test.result = {\n state: 'fail',\n startTime,\n duration,\n errors: [timeoutErr],\n retryCount: 0,\n };\n }\n}\n\nexport function setSuitePrepareResult(suite: Suite): void {\n if (suite.mode === 'skip') {\n suite.result = {\n state: 'skip',\n duration: 0,\n };\n } else {\n suite.result = {\n state: 'run',\n startTime: Date.now(),\n };\n }\n}\n\nexport function updateSuiteFinishedResult(suite: Suite, logPrefix: string): void {\n if (suite.mode === 'skip') {\n suite.result = {\n state: 'skip',\n duration: 0,\n };\n } else {\n // update suite final result based on sub-task results\n const hasFailures = suite.tasks.some(({ result }) => result?.state === 'fail' );\n \n if (suite.result) {\n suite.result.duration = positiveSum(suite.tasks, t => t.result?.duration);\n suite.result.state = hasFailures ? 'fail' : 'pass';\n \n debug(`${logPrefix} - Set suite result: \"${suite.result.state}\" (hasFailures: ${hasFailures})`);\n }\n }\n}\n\nexport function finalizeSuiteResult(suite: Suite): void {\n (suite.meta as AssemblyScriptSuiteTaskMeta).resultFinal = true;\n}\n\nexport function resetTestForRetry(test: Test, startTime: number): void {\n if (test.result) {\n test.result!.state = 'run';\n test.result!.startTime = startTime;\n }\n\n const meta = test.meta as AssemblyScriptTestTaskMeta;\n\n // clear any custom metadata associated with the immediate last run\n meta.assertionsPassedCount = 0;\n meta.assertionsFailed = [];\n delete meta.lastError;\n delete meta.lastErrorValuesProvided;\n delete meta.lastErrorRawCallStack;\n delete meta.lastTimeoutTerminationTime;\n delete meta.coverageData;\n}\n\n\n"],"mappings":";;;;;AAgBA,SAAgB,eAAe,WAAiC;AAI9D,KAAI;EACF,MAAM,eAA6B,KAAK,MAAM,UAAU;AACxD,SAAO,aAAa;AACpB,SAAO;UAEF,KAAK;AACV,QAAM,4BACJ,wBACA,iBAAiB,WACjB,IACD;;;;;;;;;;;;AAaL,SAAgB,iBAAiB,eAAyC;CACxE,IAAI,aAAgC,EAAE;CAEtC,MAAM,4BAA4B,MAAM;AACxC,OAAM,qBAAqB,MAAa,yBAA4C;AAClF,eAAa;AACb,SAAO;;AAIT,eAAc;AAGd,OAAM,oBAAoB;AAE1B,QAAO;;;;;;;;;;;AAYT,SAAgB,0BACd,UACA,mBACA,eAC4B;CAC5B,MAA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C1B,QAAO,KAAK;AACZ,QAAO,KAAK;AACZ,QAAO,KAAK;AACZ,QAAO,KAAK;AACZ,QAAO,KAAK"}
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
//#region src/wasm-executor/wasm-names.ts
|
|
2
|
-
/**
|
|
3
|
-
* Extracts the short name from a WASM function table name identifier.
|
|
4
|
-
*/
|
|
5
|
-
function getShortFunctionName(fullName) {
|
|
6
|
-
if (!fullName) return "";
|
|
7
|
-
let decoded;
|
|
8
|
-
try {
|
|
9
|
-
decoded = decodeURIComponent(fullName);
|
|
10
|
-
decoded = decoded.replace("\\2c", ",");
|
|
11
|
-
} catch {
|
|
12
|
-
decoded = fullName;
|
|
13
|
-
}
|
|
14
|
-
let angleBracketDepth = 0;
|
|
15
|
-
let parenDepth = 0;
|
|
16
|
-
let lastSlashOutsideBrackets = -1;
|
|
17
|
-
for (let i = 0; i < decoded.length; i++) {
|
|
18
|
-
const char = decoded[i];
|
|
19
|
-
if (char === "<") angleBracketDepth++;
|
|
20
|
-
else if (char === ">" && decoded[i - 1] !== "=") angleBracketDepth--;
|
|
21
|
-
else if (char === "(") parenDepth++;
|
|
22
|
-
else if (char === ")") parenDepth--;
|
|
23
|
-
else if (char === "/" && angleBracketDepth === 0 && parenDepth === 0) lastSlashOutsideBrackets = i;
|
|
24
|
-
}
|
|
25
|
-
const functionPart = lastSlashOutsideBrackets >= 0 ? decoded.substring(lastSlashOutsideBrackets + 1) : decoded;
|
|
26
|
-
const anonymousMatch = functionPart.match(/^.+~(anonymous\|\d+)$/);
|
|
27
|
-
if (anonymousMatch) return anonymousMatch[1];
|
|
28
|
-
return shortenTypePart(functionPart);
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Finds the index of the closing '>' that matches the opening '<' at openIndex.
|
|
32
|
-
*/
|
|
33
|
-
function findMatchingCloseBracket(str, openIndex) {
|
|
34
|
-
let angleBracketDepth = 1;
|
|
35
|
-
for (let i = openIndex + 1; i < str.length; i++) {
|
|
36
|
-
const char = str[i];
|
|
37
|
-
if (char === "<") angleBracketDepth++;
|
|
38
|
-
else if (char === ">" && str[i - 1] !== "=") {
|
|
39
|
-
angleBracketDepth--;
|
|
40
|
-
if (angleBracketDepth === 0) return i;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
return str.length - 1;
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Finds the index of the closing ')' that matches the opening '(' at openIndex.
|
|
47
|
-
*/
|
|
48
|
-
function findMatchingCloseParen(str, openIndex) {
|
|
49
|
-
let parenDepth = 1;
|
|
50
|
-
let angleBracketDepth = 0;
|
|
51
|
-
for (let i = openIndex + 1; i < str.length; i++) {
|
|
52
|
-
const char = str[i];
|
|
53
|
-
if (char === "(") parenDepth++;
|
|
54
|
-
else if (char === ")") {
|
|
55
|
-
parenDepth--;
|
|
56
|
-
if (parenDepth === 0) return i;
|
|
57
|
-
} else if (char === "<") angleBracketDepth++;
|
|
58
|
-
else if (char === ">" && str[i - 1] !== "=") angleBracketDepth--;
|
|
59
|
-
}
|
|
60
|
-
return str.length - 1;
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Splits a string by commas at the top level (not inside <> or ()).
|
|
64
|
-
*/
|
|
65
|
-
function splitByTopLevelComma(str) {
|
|
66
|
-
const parts = [];
|
|
67
|
-
let current = "";
|
|
68
|
-
let angleBracketDepth = 0;
|
|
69
|
-
let parenDepth = 0;
|
|
70
|
-
for (let i = 0; i < str.length; i++) {
|
|
71
|
-
const char = str[i];
|
|
72
|
-
if (char === "<") angleBracketDepth++;
|
|
73
|
-
else if (char === ">" && str[i - 1] !== "=") angleBracketDepth--;
|
|
74
|
-
else if (char === "(") parenDepth++;
|
|
75
|
-
else if (char === ")") parenDepth--;
|
|
76
|
-
else if (char === "," && angleBracketDepth === 0 && parenDepth === 0) {
|
|
77
|
-
parts.push(current);
|
|
78
|
-
current = "";
|
|
79
|
-
continue;
|
|
80
|
-
}
|
|
81
|
-
current += char;
|
|
82
|
-
}
|
|
83
|
-
parts.push(current);
|
|
84
|
-
return parts;
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Processes the content inside generic brackets or function args.
|
|
88
|
-
*/
|
|
89
|
-
function shortenGenericContent(content) {
|
|
90
|
-
return splitByTopLevelComma(content).map((part) => shortenTypePart(part.trim())).join(",");
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* Shortens a function type like (args)=>returnType.
|
|
94
|
-
*/
|
|
95
|
-
function shortenFunctionType(part) {
|
|
96
|
-
const closeParenIndex = findMatchingCloseParen(part, 0);
|
|
97
|
-
const argsContent = part.substring(1, closeParenIndex);
|
|
98
|
-
const afterParen = part.substring(closeParenIndex + 1);
|
|
99
|
-
const shortenedArgs = argsContent ? shortenGenericContent(argsContent) : "";
|
|
100
|
-
let returnPart = afterParen;
|
|
101
|
-
if (afterParen.startsWith("=>") && afterParen.length > 2) returnPart = "=>" + shortenTypePart(afterParen.substring(2));
|
|
102
|
-
return "(" + shortenedArgs + ")" + returnPart;
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* Shortens a type/function part, processing paths and generics recursively.
|
|
106
|
-
*/
|
|
107
|
-
function shortenTypePart(part) {
|
|
108
|
-
if (part.startsWith("(")) return shortenFunctionType(part);
|
|
109
|
-
const openBracket = part.indexOf("<");
|
|
110
|
-
if (openBracket === -1) {
|
|
111
|
-
if (!part.includes("/")) return part;
|
|
112
|
-
return part.substring(part.lastIndexOf("/") + 1);
|
|
113
|
-
}
|
|
114
|
-
const namePart = part.substring(0, openBracket);
|
|
115
|
-
const closeBracket = findMatchingCloseBracket(part, openBracket);
|
|
116
|
-
const genericContent = part.substring(openBracket + 1, closeBracket);
|
|
117
|
-
const name = namePart.includes("/") ? namePart.substring(namePart.lastIndexOf("/") + 1) : namePart;
|
|
118
|
-
const shortenedContent = shortenGenericContent(genericContent);
|
|
119
|
-
return name + "<" + shortenedContent + ">";
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
//#endregion
|
|
123
|
-
export { getShortFunctionName };
|
|
124
|
-
//# sourceMappingURL=wasm-names-BFtzQCH4.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"wasm-names-BFtzQCH4.mjs","names":[],"sources":["../src/wasm-executor/wasm-names.ts"],"sourcesContent":["/**\n * Extracts the short name from a WASM function table name identifier.\n */\nexport function getShortFunctionName(fullName: string): string {\n if (!fullName) {\n return '';\n }\n\n // URL decode first (handle potential decoding errors)\n let decoded: string;\n try {\n decoded = decodeURIComponent(fullName);\n \n // handle AS encoding quirk in generics\n // e.g. \"closeTo<bool\\2cbool>\" -> \"closeTo<bool,bool>\"\n decoded = decoded.replace('\\\\2c', ',');\n } catch {\n decoded = fullName;\n }\n\n // Find the last '/' that's not inside angle brackets or parens\n let angleBracketDepth = 0;\n let parenDepth = 0;\n let lastSlashOutsideBrackets = -1;\n\n for (let i = 0; i < decoded.length; i++) {\n const char = decoded[i];\n if (char === '<') {\n angleBracketDepth++;\n } else if (char === '>' && decoded[i - 1] !== '=') {\n angleBracketDepth--;\n } else if (char === '(') {\n parenDepth++;\n } else if (char === ')') {\n parenDepth--;\n } else if (char === '/' && angleBracketDepth === 0 && parenDepth === 0) {\n lastSlashOutsideBrackets = i;\n }\n }\n\n const functionPart = lastSlashOutsideBrackets >= 0\n ? decoded.substring(lastSlashOutsideBrackets + 1)\n : decoded;\n\n // Handle anonymous function case: \"file.as.test~anonymous|1\" → \"anonymous|1\"\n const anonymousMatch = functionPart.match(/^.+~(anonymous\\|\\d+)$/);\n if (anonymousMatch) {\n return anonymousMatch[1]!;\n }\n\n // Process any generics/paths in the function signature\n return shortenTypePart(functionPart);\n}\n\n/**\n * Finds the index of the closing '>' that matches the opening '<' at openIndex.\n */\nfunction findMatchingCloseBracket(str: string, openIndex: number): number {\n let angleBracketDepth = 1;\n\n for (let i = openIndex + 1; i < str.length; i++) {\n const char = str[i];\n if (char === '<') {\n angleBracketDepth++;\n } else if (char === '>' && str[i - 1] !== '=') {\n angleBracketDepth--;\n if (angleBracketDepth === 0) return i;\n }\n }\n return str.length - 1;\n}\n\n/**\n * Finds the index of the closing ')' that matches the opening '(' at openIndex.\n */\nfunction findMatchingCloseParen(str: string, openIndex: number): number {\n let parenDepth = 1;\n let angleBracketDepth = 0;\n\n for (let i = openIndex + 1; i < str.length; i++) {\n const char = str[i];\n if (char === '(') {\n parenDepth++;\n } else if (char === ')') {\n parenDepth--;\n if (parenDepth === 0) return i;\n } else if (char === '<') {\n angleBracketDepth++;\n } else if (char === '>' && str[i - 1] !== '=') {\n angleBracketDepth--;\n }\n }\n return str.length - 1;\n}\n\n/**\n * Splits a string by commas at the top level (not inside <> or ()).\n */\nfunction splitByTopLevelComma(str: string): string[] {\n const parts: string[] = [];\n let current = '';\n let angleBracketDepth = 0;\n let parenDepth = 0;\n\n for (let i = 0; i < str.length; i++) {\n const char = str[i];\n if (char === '<') {\n angleBracketDepth++;\n } else if (char === '>' && str[i - 1] !== '=') {\n angleBracketDepth--;\n } else if (char === '(') {\n parenDepth++;\n } else if (char === ')') {\n parenDepth--;\n } else if (char === ',' && angleBracketDepth === 0 && parenDepth === 0) {\n parts.push(current);\n current = '';\n continue;\n }\n current += char;\n }\n parts.push(current);\n return parts;\n}\n\n/**\n * Processes the content inside generic brackets or function args.\n */\nfunction shortenGenericContent(content: string): string {\n const parts = splitByTopLevelComma(content);\n return parts.map(part => shortenTypePart(part.trim())).join(',');\n}\n\n/**\n * Shortens a function type like (args)=>returnType.\n */\nfunction shortenFunctionType(part: string): string {\n const closeParenIndex = findMatchingCloseParen(part, 0);\n const argsContent = part.substring(1, closeParenIndex);\n const afterParen = part.substring(closeParenIndex + 1);\n\n const shortenedArgs = argsContent ? shortenGenericContent(argsContent) : '';\n\n let returnPart = afterParen;\n if (afterParen.startsWith('=>') && afterParen.length > 2) {\n const returnType = afterParen.substring(2);\n returnPart = '=>' + shortenTypePart(returnType);\n }\n\n return '(' + shortenedArgs + ')' + returnPart;\n}\n\n/**\n * Shortens a type/function part, processing paths and generics recursively.\n */\nfunction shortenTypePart(part: string): string {\n // Function types\n if (part.startsWith('(')) {\n return shortenFunctionType(part);\n }\n\n const openBracket = part.indexOf('<');\n\n if (openBracket === -1) {\n // No generics - extract last path segment if present\n if (!part.includes('/')) {\n return part;\n }\n return part.substring(part.lastIndexOf('/') + 1);\n }\n\n // Has generics - extract name and process content\n const namePart = part.substring(0, openBracket);\n const closeBracket = findMatchingCloseBracket(part, openBracket);\n const genericContent = part.substring(openBracket + 1, closeBracket);\n\n const name = namePart.includes('/')\n ? namePart.substring(namePart.lastIndexOf('/') + 1)\n : namePart;\n\n const shortenedContent = shortenGenericContent(genericContent);\n\n return name + '<' + shortenedContent + '>';\n}\n"],"mappings":";;;;AAGA,SAAgB,qBAAqB,UAA0B;AAC7D,KAAI,CAAC,SACH,QAAO;CAIT,IAAI;AACJ,KAAI;AACF,YAAU,mBAAmB,SAAS;AAItC,YAAU,QAAQ,QAAQ,QAAQ,IAAI;SAChC;AACN,YAAU;;CAIZ,IAAI,oBAAoB;CACxB,IAAI,aAAa;CACjB,IAAI,2BAA2B;AAE/B,MAAK,IAAI,IAAI,GAAG,IAAI,QAAQ,QAAQ,KAAK;EACvC,MAAM,OAAO,QAAQ;AACrB,MAAI,SAAS,IACX;WACS,SAAS,OAAO,QAAQ,IAAI,OAAO,IAC5C;WACS,SAAS,IAClB;WACS,SAAS,IAClB;WACS,SAAS,OAAO,sBAAsB,KAAK,eAAe,EACnE,4BAA2B;;CAI/B,MAAM,eAAe,4BAA4B,IAC7C,QAAQ,UAAU,2BAA2B,EAAE,GAC/C;CAGJ,MAAM,iBAAiB,aAAa,MAAM,wBAAwB;AAClE,KAAI,eACF,QAAO,eAAe;AAIxB,QAAO,gBAAgB,aAAa;;;;;AAMtC,SAAS,yBAAyB,KAAa,WAA2B;CACxE,IAAI,oBAAoB;AAExB,MAAK,IAAI,IAAI,YAAY,GAAG,IAAI,IAAI,QAAQ,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