wasm-idle 1.1.2 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +134 -82
- package/dist/container/bash-profile.d.ts +80 -0
- package/dist/container/bash-profile.js +328 -0
- package/dist/{playground/container → container}/binding.d.ts +21 -8
- package/dist/{playground/container → container}/binding.js +109 -25
- package/dist/{playground/container → container}/clang-runtime.d.ts +11 -7
- package/dist/container/clang-runtime.js +561 -0
- package/dist/container/client.d.ts +14 -0
- package/dist/{playground/container → container}/client.js +2 -6
- package/dist/{playground/container → container}/explorer.d.ts +1 -1
- package/dist/container/index.d.ts +11 -0
- package/dist/container/index.js +11 -0
- package/dist/container/owner-worker.d.ts +19 -0
- package/dist/container/owner-worker.js +464 -0
- package/dist/{playground/container → container}/protocol.d.ts +12 -1
- package/dist/{playground/container → container}/runtime-adapter.d.ts +13 -11
- package/dist/{playground/container → container}/runtime-adapter.js +104 -41
- package/dist/{playground/container → container}/shell-control.d.ts +2 -2
- package/dist/{playground/container → container}/shell-control.js +93 -36
- package/dist/{playground/container → container}/workspace.d.ts +5 -1
- package/dist/index.d.ts +1 -1
- package/dist/playground/assetBridge.js +5 -2
- package/dist/playground/assets.d.ts +8 -0
- package/dist/playground/clang.d.ts +5 -1
- package/dist/playground/clang.js +61 -5
- package/dist/playground/compiledLldb.d.ts +41 -0
- package/dist/playground/compiledLldb.js +167 -0
- package/dist/playground/d.d.ts +4 -1
- package/dist/playground/d.js +78 -9
- package/dist/playground/debugDeadline.d.ts +12 -0
- package/dist/playground/debugDeadline.js +34 -0
- package/dist/playground/debugMailbox.d.ts +12 -0
- package/dist/playground/debugMailbox.js +77 -0
- package/dist/playground/go.js +9 -4
- package/dist/playground/goDebugInstrumentation.js +24 -44
- package/dist/playground/java-debug-FMHDKUN6.js +124 -0
- package/dist/playground/java-debug-notices.txt +492 -0
- package/dist/playground/java.d.ts +17 -1
- package/dist/playground/java.js +159 -3
- package/dist/playground/javaDebug.d.ts +62 -0
- package/dist/playground/javaDebug.js +305 -0
- package/dist/playground/javaDebugBridge.d.ts +6 -0
- package/dist/playground/javaDebugBridge.js +250 -0
- package/dist/playground/javaDebugSource.d.ts +9 -0
- package/dist/playground/javaDebugSource.js +4 -0
- package/dist/playground/javaRuntimeErrors.js +34 -1
- package/dist/playground/lean4Assets.d.ts +1 -25
- package/dist/playground/lean4Assets.js +2 -123
- package/dist/playground/lfortranAssets.d.ts +2 -2
- package/dist/playground/lldbSession.d.ts +23 -2
- package/dist/playground/lldbSession.js +278 -58
- package/dist/playground/lldbSourcePath.d.ts +2 -0
- package/dist/playground/lldbSourcePath.js +9 -0
- package/dist/playground/lua.d.ts +20 -1
- package/dist/playground/lua.js +190 -8
- package/dist/playground/luaDebug.d.ts +1 -0
- package/dist/playground/luaDebug.js +1 -0
- package/dist/playground/nim.d.ts +1 -0
- package/dist/playground/nim.js +8 -0
- package/dist/playground/objectivec.d.ts +7 -6
- package/dist/playground/objectivec.js +75 -9
- package/dist/playground/options.d.ts +10 -4
- package/dist/playground/python.d.ts +8 -1
- package/dist/playground/python.js +81 -6
- package/dist/playground/ruby.d.ts +10 -1
- package/dist/playground/ruby.js +66 -1
- package/dist/playground/rubyDebug.d.ts +21 -0
- package/dist/playground/rubyDebug.js +128 -0
- package/dist/playground/rust.d.ts +5 -1
- package/dist/playground/rust.js +128 -46
- package/dist/playground/sandbox.d.ts +8 -1
- package/dist/playground/staticWorkerRuntime.js +8 -2
- package/dist/playground/stdinBuffer.d.ts +1 -1
- package/dist/playground/stdinBuffer.js +19 -2
- package/dist/playground/tinygo.js +7 -0
- package/dist/playground/typescript.js +8 -0
- package/dist/playground/v.d.ts +3 -2
- package/dist/playground/v.js +66 -12
- package/dist/playground/wasmC3Version.d.ts +2 -2
- package/dist/playground/wasmC3Version.js +2 -2
- package/dist/playground/wasmLean4Version.d.ts +1 -110
- package/dist/playground/wasmLean4Version.js +2 -111
- package/dist/playground/wasmLfortranVersion.d.ts +2 -2
- package/dist/playground/wasmLfortranVersion.js +2 -2
- package/dist/playground/wasmLuaVersion.d.ts +1 -1
- package/dist/playground/wasmLuaVersion.js +1 -1
- package/dist/playground/wasmRustVersion.d.ts +26 -38
- package/dist/playground/wasmRustVersion.js +25 -40
- package/dist/playground/worker/clang.js +1 -1
- package/dist/playground/worker/cobol.js +1 -1
- package/dist/playground/worker/d.js +51 -2
- package/dist/playground/worker/fortran.js +1 -1
- package/dist/playground/worker/java.js +188 -35
- package/dist/playground/worker/javaDebugEvaluator.d.ts +16 -0
- package/dist/playground/worker/javaDebugEvaluator.js +44 -0
- package/dist/playground/worker/javaDebugRuntime.d.ts +24 -0
- package/dist/playground/worker/javaDebugRuntime.js +315 -0
- package/dist/playground/worker/javaOutput.d.ts +11 -0
- package/dist/playground/worker/javaOutput.js +54 -0
- package/dist/playground/worker/lua.js +13 -0
- package/dist/playground/worker/python.js +57 -22
- package/dist/playground/worker/ruby.js +13 -0
- package/dist/playground/worker/rubyDebugPreview.d.ts +2 -0
- package/dist/playground/worker/rubyDebugPreview.js +80 -0
- package/dist/playground/worker/rubyTracepoint.d.ts +16 -0
- package/dist/playground/worker/rubyTracepoint.js +162 -0
- package/dist/playground/worker/rust.js +4 -1
- package/dist/playground/worker/v.js +30 -5
- package/dist/playground/zig.js +4 -0
- package/package.json +55 -11
- package/dist/playground/container/ContainerExplorer.svelte +0 -307
- package/dist/playground/container/ContainerExplorer.svelte.d.ts +0 -14
- package/dist/playground/container/clang-runtime.js +0 -343
- package/dist/playground/container/client.d.ts +0 -15
- package/dist/playground/container/owner.worker.d.ts +0 -1
- package/dist/playground/container/owner.worker.js +0 -390
- package/dist/playground/container/release.d.ts +0 -31
- package/dist/playground/container/release.js +0 -612
- /package/dist/{playground/container → container}/explorer.js +0 -0
- /package/dist/{playground/container → container}/protocol.js +0 -0
- /package/dist/{playground/container → container}/workspace.js +0 -0
|
@@ -113,7 +113,7 @@ function followsLiteralType(tokens, braceIndex, closedFrame) {
|
|
|
113
113
|
}
|
|
114
114
|
return open === index - 1 || tokens[open - 1] === 'map';
|
|
115
115
|
}
|
|
116
|
-
function lineTokens(line, state) {
|
|
116
|
+
function lineTokens(line, state, onWord) {
|
|
117
117
|
const tokens = [];
|
|
118
118
|
const wordPattern = /[\p{L}_][\p{L}\p{N}_]*|\.?\d[\p{L}\p{N}_.]*/uy;
|
|
119
119
|
let index = 0;
|
|
@@ -160,6 +160,7 @@ function lineTokens(line, state) {
|
|
|
160
160
|
if (word) {
|
|
161
161
|
tokens.push(/^[\p{L}_]/u.test(word) ? word : '0');
|
|
162
162
|
index += word.length;
|
|
163
|
+
onWord?.(word, index);
|
|
163
164
|
continue;
|
|
164
165
|
}
|
|
165
166
|
const operator = ['++', '--', ':=', '...'].find((candidate) => line.startsWith(candidate, index)) ||
|
|
@@ -194,50 +195,27 @@ function shouldInstrumentLine(line) {
|
|
|
194
195
|
}
|
|
195
196
|
function insertDebugImports(source) {
|
|
196
197
|
const lines = source.split('\n');
|
|
197
|
-
const
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
198
|
+
const state = { rawString: false, blockComment: false };
|
|
199
|
+
let packageKeyword = false;
|
|
200
|
+
for (let index = 0; index < lines.length; index += 1) {
|
|
201
|
+
const line = lines[index];
|
|
202
|
+
let packageNameEnd;
|
|
203
|
+
lineTokens(line, state, (word, end) => {
|
|
204
|
+
if (packageNameEnd !== undefined)
|
|
205
|
+
return;
|
|
206
|
+
if (packageKeyword)
|
|
207
|
+
packageNameEnd = end;
|
|
208
|
+
else if (word === 'package')
|
|
209
|
+
packageKeyword = true;
|
|
210
|
+
});
|
|
211
|
+
if (packageNameEnd === undefined)
|
|
212
|
+
continue;
|
|
213
|
+
// Insert before trailing comments, which may span lines or end beside an import.
|
|
214
|
+
// Keep the suffix on ')' so an explicit package semicolon still terminates a declaration.
|
|
215
|
+
lines.splice(index, 1, line.slice(0, packageNameEnd), '', 'import (', ...debugImports.map((entry) => `\t${entry}`), ')' + line.slice(packageNameEnd));
|
|
213
216
|
return lines.join('\n');
|
|
214
217
|
}
|
|
215
|
-
|
|
216
|
-
lines.splice(importStart, 1, 'import (', `\t${singleImport}`, ...debugImports.map((entry) => `\t${entry}`), ')');
|
|
217
|
-
return lines.join('\n');
|
|
218
|
-
}
|
|
219
|
-
function insertDebugSupport(source) {
|
|
220
|
-
const lines = source.split('\n');
|
|
221
|
-
let insertIndex = lines.findIndex((line) => /^\s*import\b/.test(line));
|
|
222
|
-
if (insertIndex === -1) {
|
|
223
|
-
insertIndex = lines.findIndex((line) => /^\s*package\s+\w+/.test(line));
|
|
224
|
-
if (insertIndex === -1)
|
|
225
|
-
return source;
|
|
226
|
-
insertIndex += 1;
|
|
227
|
-
}
|
|
228
|
-
else if (/^\s*import\s*\(/.test(lines[insertIndex] || '')) {
|
|
229
|
-
for (; insertIndex < lines.length; insertIndex += 1) {
|
|
230
|
-
if (/^\s*\)/.test(lines[insertIndex] || '')) {
|
|
231
|
-
insertIndex += 1;
|
|
232
|
-
break;
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
else {
|
|
237
|
-
insertIndex += 1;
|
|
238
|
-
}
|
|
239
|
-
lines.splice(insertIndex, 0, debugSupportSource.trim());
|
|
240
|
-
return lines.join('\n');
|
|
218
|
+
return source;
|
|
241
219
|
}
|
|
242
220
|
function instrumentFunctionLines(source) {
|
|
243
221
|
const lines = source.split('\n');
|
|
@@ -355,5 +333,7 @@ function instrumentFunctionLines(source) {
|
|
|
355
333
|
export function instrumentGoDebugSource(source) {
|
|
356
334
|
if (source.includes('__wasmIdleDebugLine'))
|
|
357
335
|
return source;
|
|
358
|
-
|
|
336
|
+
// Declarations may follow user code; placing them here keeps every user import
|
|
337
|
+
// ahead of declarations, including a second import block.
|
|
338
|
+
return `${insertDebugImports(instrumentFunctionLines(source))}\n\n${debugSupportSource.trim()}\n`;
|
|
359
339
|
}
|