@vercel/python-analysis 0.8.2 → 0.9.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/dist/index.cjs +9 -10
- package/dist/index.d.ts +1 -1
- package/dist/index.js +8 -9
- package/dist/semantic/entrypoints.d.ts +10 -9
- package/dist/wasm/interfaces/wasi-cli-stdin.d.ts +3 -0
- package/dist/wasm/interfaces/wasi-cli-stdout.d.ts +3 -0
- package/dist/wasm/interfaces/wasi-cli-terminal-input.d.ts +8 -0
- package/dist/wasm/interfaces/wasi-cli-terminal-output.d.ts +8 -0
- package/dist/wasm/interfaces/wasi-cli-terminal-stderr.d.ts +3 -0
- package/dist/wasm/interfaces/wasi-cli-terminal-stdin.d.ts +3 -0
- package/dist/wasm/interfaces/wasi-cli-terminal-stdout.d.ts +3 -0
- package/dist/wasm/interfaces/wasi-io-error.d.ts +0 -1
- package/dist/wasm/interfaces/wasi-io-poll.d.ts +9 -0
- package/dist/wasm/interfaces/wasi-io-streams.d.ts +12 -1
- package/dist/wasm/vercel_python_analysis.core.wasm +0 -0
- package/dist/wasm/vercel_python_analysis.core2.wasm +0 -0
- package/dist/wasm/vercel_python_analysis.core3.wasm +0 -0
- package/dist/wasm/vercel_python_analysis.d.ts +17 -1
- package/dist/wasm/vercel_python_analysis.js +542 -157
- package/package.json +1 -1
- package/dist/wasm/vercel_python_analysis.core4.wasm +0 -0
package/dist/index.cjs
CHANGED
|
@@ -64,13 +64,13 @@ __export(src_exports, {
|
|
|
64
64
|
UvIndexEntrySchema: () => UvIndexEntrySchema,
|
|
65
65
|
classifyPackages: () => classifyPackages,
|
|
66
66
|
containsAppOrHandler: () => containsAppOrHandler,
|
|
67
|
+
containsTopLevelCallable: () => containsTopLevelCallable,
|
|
67
68
|
createMinimalManifest: () => createMinimalManifest,
|
|
68
69
|
discoverPythonPackage: () => discoverPythonPackage,
|
|
69
70
|
extendDistRecord: () => extendDistRecord,
|
|
70
71
|
getStringConstant: () => getStringConstant,
|
|
71
72
|
isPrivatePackageSource: () => isPrivatePackageSource,
|
|
72
73
|
normalizePackageName: () => normalizePackageName2,
|
|
73
|
-
parseDjangoSettingsModule: () => parseDjangoSettingsModule,
|
|
74
74
|
parseUvLock: () => parseUvLock,
|
|
75
75
|
scanDistributions: () => scanDistributions,
|
|
76
76
|
selectPython: () => selectPython,
|
|
@@ -127,17 +127,16 @@ async function containsAppOrHandler(source) {
|
|
|
127
127
|
const mod = await importWasmModule();
|
|
128
128
|
return mod.containsAppOrHandler(source);
|
|
129
129
|
}
|
|
130
|
-
async function
|
|
130
|
+
async function containsTopLevelCallable(source, name) {
|
|
131
|
+
if (!source.includes(name)) {
|
|
132
|
+
return false;
|
|
133
|
+
}
|
|
131
134
|
const mod = await importWasmModule();
|
|
132
|
-
return mod.
|
|
135
|
+
return mod.containsTopLevelCallable(source, name);
|
|
133
136
|
}
|
|
134
|
-
|
|
135
|
-
async function parseDjangoSettingsModule(content) {
|
|
136
|
-
if (!DJANGO_SETTINGS_MODULE_PATTERN_RE.test(content)) {
|
|
137
|
-
return null;
|
|
138
|
-
}
|
|
137
|
+
async function getStringConstant(source, name) {
|
|
139
138
|
const mod = await importWasmModule();
|
|
140
|
-
return mod.
|
|
139
|
+
return mod.getStringConstant(source, name) ?? null;
|
|
141
140
|
}
|
|
142
141
|
|
|
143
142
|
// src/manifest/dist-metadata.ts
|
|
@@ -2691,13 +2690,13 @@ var HashDigestSchema = hashDigestSchema;
|
|
|
2691
2690
|
UvIndexEntrySchema,
|
|
2692
2691
|
classifyPackages,
|
|
2693
2692
|
containsAppOrHandler,
|
|
2693
|
+
containsTopLevelCallable,
|
|
2694
2694
|
createMinimalManifest,
|
|
2695
2695
|
discoverPythonPackage,
|
|
2696
2696
|
extendDistRecord,
|
|
2697
2697
|
getStringConstant,
|
|
2698
2698
|
isPrivatePackageSource,
|
|
2699
2699
|
normalizePackageName,
|
|
2700
|
-
parseDjangoSettingsModule,
|
|
2701
2700
|
parseUvLock,
|
|
2702
2701
|
scanDistributions,
|
|
2703
2702
|
selectPython,
|
package/dist/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @module @vercel/python-analysis
|
|
8
8
|
*/
|
|
9
|
-
export { containsAppOrHandler,
|
|
9
|
+
export { containsAppOrHandler, containsTopLevelCallable, getStringConstant, } from './semantic/entrypoints';
|
|
10
10
|
export type { Distribution, DistributionIndex, PackagePath, DirectUrlInfo, } from './manifest/dist-metadata';
|
|
11
11
|
export { extendDistRecord, scanDistributions } from './manifest/dist-metadata';
|
|
12
12
|
export type { PythonConfig, PythonConfigs, PythonLockFile, PythonManifest, PythonManifestOrigin, PythonPackage, PythonVersionConfig, } from './manifest/package';
|
package/dist/index.js
CHANGED
|
@@ -46,17 +46,16 @@ async function containsAppOrHandler(source) {
|
|
|
46
46
|
const mod = await importWasmModule();
|
|
47
47
|
return mod.containsAppOrHandler(source);
|
|
48
48
|
}
|
|
49
|
-
async function
|
|
49
|
+
async function containsTopLevelCallable(source, name) {
|
|
50
|
+
if (!source.includes(name)) {
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
50
53
|
const mod = await importWasmModule();
|
|
51
|
-
return mod.
|
|
54
|
+
return mod.containsTopLevelCallable(source, name);
|
|
52
55
|
}
|
|
53
|
-
|
|
54
|
-
async function parseDjangoSettingsModule(content) {
|
|
55
|
-
if (!DJANGO_SETTINGS_MODULE_PATTERN_RE.test(content)) {
|
|
56
|
-
return null;
|
|
57
|
-
}
|
|
56
|
+
async function getStringConstant(source, name) {
|
|
58
57
|
const mod = await importWasmModule();
|
|
59
|
-
return mod.
|
|
58
|
+
return mod.getStringConstant(source, name) ?? null;
|
|
60
59
|
}
|
|
61
60
|
|
|
62
61
|
// src/manifest/dist-metadata.ts
|
|
@@ -2612,13 +2611,13 @@ export {
|
|
|
2612
2611
|
UvIndexEntrySchema,
|
|
2613
2612
|
classifyPackages,
|
|
2614
2613
|
containsAppOrHandler,
|
|
2614
|
+
containsTopLevelCallable,
|
|
2615
2615
|
createMinimalManifest,
|
|
2616
2616
|
discoverPythonPackage,
|
|
2617
2617
|
extendDistRecord,
|
|
2618
2618
|
getStringConstant,
|
|
2619
2619
|
isPrivatePackageSource,
|
|
2620
2620
|
normalizePackageName2 as normalizePackageName,
|
|
2621
|
-
parseDjangoSettingsModule,
|
|
2622
2621
|
parseUvLock,
|
|
2623
2622
|
scanDistributions,
|
|
2624
2623
|
selectPython,
|
|
@@ -27,6 +27,16 @@
|
|
|
27
27
|
* ```
|
|
28
28
|
*/
|
|
29
29
|
export declare function containsAppOrHandler(source: string): Promise<boolean>;
|
|
30
|
+
/**
|
|
31
|
+
* Check if a top-level callable with the given name exists in Python source.
|
|
32
|
+
*
|
|
33
|
+
* Returns true if found, false otherwise.
|
|
34
|
+
* Returns false for invalid Python syntax.
|
|
35
|
+
*
|
|
36
|
+
* @param source - The Python source code to analyze
|
|
37
|
+
* @param name - The callable name to look for (e.g. "cleanup")
|
|
38
|
+
*/
|
|
39
|
+
export declare function containsTopLevelCallable(source: string, name: string): Promise<boolean>;
|
|
30
40
|
/**
|
|
31
41
|
* Extract the string value of a top-level constant with the given name.
|
|
32
42
|
* Only considers simple assignments (NAME = "string") and annotated assignments
|
|
@@ -38,12 +48,3 @@ export declare function containsAppOrHandler(source: string): Promise<boolean>;
|
|
|
38
48
|
* @returns The string value or null
|
|
39
49
|
*/
|
|
40
50
|
export declare function getStringConstant(source: string, name: string): Promise<string | null>;
|
|
41
|
-
/**
|
|
42
|
-
* Parse manage.py content for DJANGO_SETTINGS_MODULE (e.g. from
|
|
43
|
-
* os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'app.settings')).
|
|
44
|
-
* Uses the WASM Python parser to extract the value from the AST.
|
|
45
|
-
*
|
|
46
|
-
* @param content - Raw content of manage.py
|
|
47
|
-
* @returns The settings module string (e.g. 'app.settings') or null if not found
|
|
48
|
-
*/
|
|
49
|
-
export declare function parseDjangoSettingsModule(content: string): Promise<string | null>;
|
|
@@ -8,11 +8,22 @@ export interface StreamErrorLastOperationFailed {
|
|
|
8
8
|
export interface StreamErrorClosed {
|
|
9
9
|
tag: 'closed',
|
|
10
10
|
}
|
|
11
|
+
export type Pollable = import('./wasi-io-poll.js').Pollable;
|
|
12
|
+
|
|
13
|
+
export class InputStream {
|
|
14
|
+
/**
|
|
15
|
+
* This type does not have a public constructor.
|
|
16
|
+
*/
|
|
17
|
+
private constructor();
|
|
18
|
+
}
|
|
11
19
|
|
|
12
20
|
export class OutputStream {
|
|
13
21
|
/**
|
|
14
22
|
* This type does not have a public constructor.
|
|
15
23
|
*/
|
|
16
24
|
private constructor();
|
|
17
|
-
|
|
25
|
+
checkWrite(): bigint;
|
|
26
|
+
write(contents: Uint8Array): void;
|
|
27
|
+
blockingFlush(): void;
|
|
28
|
+
subscribe(): Pollable;
|
|
18
29
|
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -56,21 +56,37 @@ export interface DirectUrlInfoVcs {
|
|
|
56
56
|
import type * as WasiCliEnvironment from './interfaces/wasi-cli-environment.js'; // wasi:cli/environment@0.2.6
|
|
57
57
|
import type * as WasiCliExit from './interfaces/wasi-cli-exit.js'; // wasi:cli/exit@0.2.6
|
|
58
58
|
import type * as WasiCliStderr from './interfaces/wasi-cli-stderr.js'; // wasi:cli/stderr@0.2.6
|
|
59
|
+
import type * as WasiCliStdin from './interfaces/wasi-cli-stdin.js'; // wasi:cli/stdin@0.2.6
|
|
60
|
+
import type * as WasiCliStdout from './interfaces/wasi-cli-stdout.js'; // wasi:cli/stdout@0.2.6
|
|
61
|
+
import type * as WasiCliTerminalInput from './interfaces/wasi-cli-terminal-input.js'; // wasi:cli/terminal-input@0.2.6
|
|
62
|
+
import type * as WasiCliTerminalOutput from './interfaces/wasi-cli-terminal-output.js'; // wasi:cli/terminal-output@0.2.6
|
|
63
|
+
import type * as WasiCliTerminalStderr from './interfaces/wasi-cli-terminal-stderr.js'; // wasi:cli/terminal-stderr@0.2.6
|
|
64
|
+
import type * as WasiCliTerminalStdin from './interfaces/wasi-cli-terminal-stdin.js'; // wasi:cli/terminal-stdin@0.2.6
|
|
65
|
+
import type * as WasiCliTerminalStdout from './interfaces/wasi-cli-terminal-stdout.js'; // wasi:cli/terminal-stdout@0.2.6
|
|
59
66
|
import type * as WasiIoError from './interfaces/wasi-io-error.js'; // wasi:io/error@0.2.6
|
|
67
|
+
import type * as WasiIoPoll from './interfaces/wasi-io-poll.js'; // wasi:io/poll@0.2.6
|
|
60
68
|
import type * as WasiIoStreams from './interfaces/wasi-io-streams.js'; // wasi:io/streams@0.2.6
|
|
61
69
|
import type * as WasiRandomInsecureSeed from './interfaces/wasi-random-insecure-seed.js'; // wasi:random/insecure-seed@0.2.6
|
|
62
70
|
export interface ImportObject {
|
|
63
71
|
'wasi:cli/environment@0.2.6': typeof WasiCliEnvironment,
|
|
64
72
|
'wasi:cli/exit@0.2.6': typeof WasiCliExit,
|
|
65
73
|
'wasi:cli/stderr@0.2.6': typeof WasiCliStderr,
|
|
74
|
+
'wasi:cli/stdin@0.2.6': typeof WasiCliStdin,
|
|
75
|
+
'wasi:cli/stdout@0.2.6': typeof WasiCliStdout,
|
|
76
|
+
'wasi:cli/terminal-input@0.2.6': typeof WasiCliTerminalInput,
|
|
77
|
+
'wasi:cli/terminal-output@0.2.6': typeof WasiCliTerminalOutput,
|
|
78
|
+
'wasi:cli/terminal-stderr@0.2.6': typeof WasiCliTerminalStderr,
|
|
79
|
+
'wasi:cli/terminal-stdin@0.2.6': typeof WasiCliTerminalStdin,
|
|
80
|
+
'wasi:cli/terminal-stdout@0.2.6': typeof WasiCliTerminalStdout,
|
|
66
81
|
'wasi:io/error@0.2.6': typeof WasiIoError,
|
|
82
|
+
'wasi:io/poll@0.2.6': typeof WasiIoPoll,
|
|
67
83
|
'wasi:io/streams@0.2.6': typeof WasiIoStreams,
|
|
68
84
|
'wasi:random/insecure-seed@0.2.6': typeof WasiRandomInsecureSeed,
|
|
69
85
|
}
|
|
70
86
|
export interface Root {
|
|
71
87
|
containsAppOrHandler(source: string): boolean,
|
|
72
88
|
getStringConstant(source: string, name: string): string | undefined,
|
|
73
|
-
|
|
89
|
+
containsTopLevelCallable(source: string, name: string): boolean,
|
|
74
90
|
parseDistMetadata(content: Uint8Array): DistMetadata,
|
|
75
91
|
parseRecord(content: string): Array<RecordEntry>,
|
|
76
92
|
parseDirectUrl(content: string): DirectUrlInfo,
|
|
@@ -789,48 +789,25 @@ if (!getCoreModule) getCoreModule = (name) => fetchCompile(new URL(`./${name}`,
|
|
|
789
789
|
const module0 = getCoreModule('vercel_python_analysis.core.wasm');
|
|
790
790
|
const module1 = getCoreModule('vercel_python_analysis.core2.wasm');
|
|
791
791
|
const module2 = getCoreModule('vercel_python_analysis.core3.wasm');
|
|
792
|
-
const module3 = getCoreModule('vercel_python_analysis.core4.wasm');
|
|
793
792
|
|
|
794
793
|
const { getEnvironment } = imports['wasi:cli/environment'];
|
|
795
794
|
const { exit } = imports['wasi:cli/exit'];
|
|
796
795
|
const { getStderr } = imports['wasi:cli/stderr'];
|
|
796
|
+
const { getStdin } = imports['wasi:cli/stdin'];
|
|
797
|
+
const { getStdout } = imports['wasi:cli/stdout'];
|
|
798
|
+
const { TerminalInput } = imports['wasi:cli/terminal-input'];
|
|
799
|
+
const { TerminalOutput } = imports['wasi:cli/terminal-output'];
|
|
800
|
+
const { getTerminalStderr } = imports['wasi:cli/terminal-stderr'];
|
|
801
|
+
const { getTerminalStdin } = imports['wasi:cli/terminal-stdin'];
|
|
802
|
+
const { getTerminalStdout } = imports['wasi:cli/terminal-stdout'];
|
|
797
803
|
const { Error: Error$1 } = imports['wasi:io/error'];
|
|
798
|
-
const {
|
|
804
|
+
const { Pollable } = imports['wasi:io/poll'];
|
|
805
|
+
const { InputStream, OutputStream } = imports['wasi:io/streams'];
|
|
799
806
|
const { insecureSeed } = imports['wasi:random/insecure-seed'];
|
|
800
807
|
let gen = (function* _initGenerator () {
|
|
801
808
|
let exports0;
|
|
802
|
-
const handleTable1 = [T_FLAG, 0];
|
|
803
|
-
const captureTable1= new Map();
|
|
804
|
-
let captureCnt1 = 0;
|
|
805
|
-
handleTables[1] = handleTable1;
|
|
806
809
|
|
|
807
|
-
function
|
|
808
|
-
_debugLog('[iface="wasi:cli/stderr@0.2.6", function="get-stderr"] [Instruction::CallInterface] (async? sync, @ enter)');
|
|
809
|
-
const _interface_call_currentTaskID = startCurrentTask(0, false, 'get-stderr');
|
|
810
|
-
const ret = getStderr();
|
|
811
|
-
_debugLog('[iface="wasi:cli/stderr@0.2.6", function="get-stderr"] [Instruction::CallInterface] (sync, @ post-call)');
|
|
812
|
-
endCurrentTask(0);
|
|
813
|
-
if (!(ret instanceof OutputStream)) {
|
|
814
|
-
throw new TypeError('Resource error: Not a valid "OutputStream" resource.');
|
|
815
|
-
}
|
|
816
|
-
var handle0 = ret[symbolRscHandle];
|
|
817
|
-
if (!handle0) {
|
|
818
|
-
const rep = ret[symbolRscRep] || ++captureCnt1;
|
|
819
|
-
captureTable1.set(rep, ret);
|
|
820
|
-
handle0 = rscTableCreateOwn(handleTable1, rep);
|
|
821
|
-
}
|
|
822
|
-
_debugLog('[iface="wasi:cli/stderr@0.2.6", function="get-stderr"][Instruction::Return]', {
|
|
823
|
-
funcName: 'get-stderr',
|
|
824
|
-
paramCount: 1,
|
|
825
|
-
async: false,
|
|
826
|
-
postReturn: false
|
|
827
|
-
});
|
|
828
|
-
return handle0;
|
|
829
|
-
}
|
|
830
|
-
|
|
831
|
-
let exports1;
|
|
832
|
-
|
|
833
|
-
function trampoline3(arg0) {
|
|
810
|
+
function trampoline6(arg0) {
|
|
834
811
|
let variant0;
|
|
835
812
|
switch (arg0) {
|
|
836
813
|
case 0: {
|
|
@@ -864,12 +841,164 @@ let gen = (function* _initGenerator () {
|
|
|
864
841
|
});
|
|
865
842
|
}
|
|
866
843
|
|
|
867
|
-
|
|
844
|
+
const handleTable0 = [T_FLAG, 0];
|
|
845
|
+
const captureTable0= new Map();
|
|
846
|
+
let captureCnt0 = 0;
|
|
847
|
+
handleTables[0] = handleTable0;
|
|
848
|
+
|
|
849
|
+
function trampoline7(arg0) {
|
|
850
|
+
var handle1 = arg0;
|
|
851
|
+
var rep2 = handleTable0[(handle1 << 1) + 1] & ~T_FLAG;
|
|
852
|
+
var rsc0 = captureTable0.get(rep2);
|
|
853
|
+
if (!rsc0) {
|
|
854
|
+
rsc0 = Object.create(Pollable.prototype);
|
|
855
|
+
Object.defineProperty(rsc0, symbolRscHandle, { writable: true, value: handle1});
|
|
856
|
+
Object.defineProperty(rsc0, symbolRscRep, { writable: true, value: rep2});
|
|
857
|
+
}
|
|
858
|
+
curResourceBorrows.push(rsc0);
|
|
859
|
+
_debugLog('[iface="wasi:io/poll@0.2.6", function="[method]pollable.block"] [Instruction::CallInterface] (async? sync, @ enter)');
|
|
860
|
+
const _interface_call_currentTaskID = startCurrentTask(0, false, '[method]pollable.block');
|
|
861
|
+
rsc0.block();
|
|
862
|
+
_debugLog('[iface="wasi:io/poll@0.2.6", function="[method]pollable.block"] [Instruction::CallInterface] (sync, @ post-call)');
|
|
863
|
+
for (const rsc of curResourceBorrows) {
|
|
864
|
+
rsc[symbolRscHandle] = undefined;
|
|
865
|
+
}
|
|
866
|
+
curResourceBorrows = [];
|
|
867
|
+
endCurrentTask(0);
|
|
868
|
+
_debugLog('[iface="wasi:io/poll@0.2.6", function="[method]pollable.block"][Instruction::Return]', {
|
|
869
|
+
funcName: '[method]pollable.block',
|
|
870
|
+
paramCount: 0,
|
|
871
|
+
async: false,
|
|
872
|
+
postReturn: false
|
|
873
|
+
});
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
const handleTable3 = [T_FLAG, 0];
|
|
877
|
+
const captureTable3= new Map();
|
|
878
|
+
let captureCnt3 = 0;
|
|
879
|
+
handleTables[3] = handleTable3;
|
|
880
|
+
|
|
881
|
+
function trampoline8(arg0) {
|
|
882
|
+
var handle1 = arg0;
|
|
883
|
+
var rep2 = handleTable3[(handle1 << 1) + 1] & ~T_FLAG;
|
|
884
|
+
var rsc0 = captureTable3.get(rep2);
|
|
885
|
+
if (!rsc0) {
|
|
886
|
+
rsc0 = Object.create(OutputStream.prototype);
|
|
887
|
+
Object.defineProperty(rsc0, symbolRscHandle, { writable: true, value: handle1});
|
|
888
|
+
Object.defineProperty(rsc0, symbolRscRep, { writable: true, value: rep2});
|
|
889
|
+
}
|
|
890
|
+
curResourceBorrows.push(rsc0);
|
|
891
|
+
_debugLog('[iface="wasi:io/streams@0.2.6", function="[method]output-stream.subscribe"] [Instruction::CallInterface] (async? sync, @ enter)');
|
|
892
|
+
const _interface_call_currentTaskID = startCurrentTask(0, false, '[method]output-stream.subscribe');
|
|
893
|
+
const ret = rsc0.subscribe();
|
|
894
|
+
_debugLog('[iface="wasi:io/streams@0.2.6", function="[method]output-stream.subscribe"] [Instruction::CallInterface] (sync, @ post-call)');
|
|
895
|
+
for (const rsc of curResourceBorrows) {
|
|
896
|
+
rsc[symbolRscHandle] = undefined;
|
|
897
|
+
}
|
|
898
|
+
curResourceBorrows = [];
|
|
899
|
+
endCurrentTask(0);
|
|
900
|
+
if (!(ret instanceof Pollable)) {
|
|
901
|
+
throw new TypeError('Resource error: Not a valid "Pollable" resource.');
|
|
902
|
+
}
|
|
903
|
+
var handle3 = ret[symbolRscHandle];
|
|
904
|
+
if (!handle3) {
|
|
905
|
+
const rep = ret[symbolRscRep] || ++captureCnt0;
|
|
906
|
+
captureTable0.set(rep, ret);
|
|
907
|
+
handle3 = rscTableCreateOwn(handleTable0, rep);
|
|
908
|
+
}
|
|
909
|
+
_debugLog('[iface="wasi:io/streams@0.2.6", function="[method]output-stream.subscribe"][Instruction::Return]', {
|
|
910
|
+
funcName: '[method]output-stream.subscribe',
|
|
911
|
+
paramCount: 1,
|
|
912
|
+
async: false,
|
|
913
|
+
postReturn: false
|
|
914
|
+
});
|
|
915
|
+
return handle3;
|
|
916
|
+
}
|
|
917
|
+
|
|
918
|
+
const handleTable2 = [T_FLAG, 0];
|
|
919
|
+
const captureTable2= new Map();
|
|
920
|
+
let captureCnt2 = 0;
|
|
921
|
+
handleTables[2] = handleTable2;
|
|
922
|
+
|
|
923
|
+
function trampoline9() {
|
|
924
|
+
_debugLog('[iface="wasi:cli/stdin@0.2.6", function="get-stdin"] [Instruction::CallInterface] (async? sync, @ enter)');
|
|
925
|
+
const _interface_call_currentTaskID = startCurrentTask(0, false, 'get-stdin');
|
|
926
|
+
const ret = getStdin();
|
|
927
|
+
_debugLog('[iface="wasi:cli/stdin@0.2.6", function="get-stdin"] [Instruction::CallInterface] (sync, @ post-call)');
|
|
928
|
+
endCurrentTask(0);
|
|
929
|
+
if (!(ret instanceof InputStream)) {
|
|
930
|
+
throw new TypeError('Resource error: Not a valid "InputStream" resource.');
|
|
931
|
+
}
|
|
932
|
+
var handle0 = ret[symbolRscHandle];
|
|
933
|
+
if (!handle0) {
|
|
934
|
+
const rep = ret[symbolRscRep] || ++captureCnt2;
|
|
935
|
+
captureTable2.set(rep, ret);
|
|
936
|
+
handle0 = rscTableCreateOwn(handleTable2, rep);
|
|
937
|
+
}
|
|
938
|
+
_debugLog('[iface="wasi:cli/stdin@0.2.6", function="get-stdin"][Instruction::Return]', {
|
|
939
|
+
funcName: 'get-stdin',
|
|
940
|
+
paramCount: 1,
|
|
941
|
+
async: false,
|
|
942
|
+
postReturn: false
|
|
943
|
+
});
|
|
944
|
+
return handle0;
|
|
945
|
+
}
|
|
946
|
+
|
|
947
|
+
|
|
948
|
+
function trampoline10() {
|
|
949
|
+
_debugLog('[iface="wasi:cli/stdout@0.2.6", function="get-stdout"] [Instruction::CallInterface] (async? sync, @ enter)');
|
|
950
|
+
const _interface_call_currentTaskID = startCurrentTask(0, false, 'get-stdout');
|
|
951
|
+
const ret = getStdout();
|
|
952
|
+
_debugLog('[iface="wasi:cli/stdout@0.2.6", function="get-stdout"] [Instruction::CallInterface] (sync, @ post-call)');
|
|
953
|
+
endCurrentTask(0);
|
|
954
|
+
if (!(ret instanceof OutputStream)) {
|
|
955
|
+
throw new TypeError('Resource error: Not a valid "OutputStream" resource.');
|
|
956
|
+
}
|
|
957
|
+
var handle0 = ret[symbolRscHandle];
|
|
958
|
+
if (!handle0) {
|
|
959
|
+
const rep = ret[symbolRscRep] || ++captureCnt3;
|
|
960
|
+
captureTable3.set(rep, ret);
|
|
961
|
+
handle0 = rscTableCreateOwn(handleTable3, rep);
|
|
962
|
+
}
|
|
963
|
+
_debugLog('[iface="wasi:cli/stdout@0.2.6", function="get-stdout"][Instruction::Return]', {
|
|
964
|
+
funcName: 'get-stdout',
|
|
965
|
+
paramCount: 1,
|
|
966
|
+
async: false,
|
|
967
|
+
postReturn: false
|
|
968
|
+
});
|
|
969
|
+
return handle0;
|
|
970
|
+
}
|
|
971
|
+
|
|
972
|
+
|
|
973
|
+
function trampoline11() {
|
|
974
|
+
_debugLog('[iface="wasi:cli/stderr@0.2.6", function="get-stderr"] [Instruction::CallInterface] (async? sync, @ enter)');
|
|
975
|
+
const _interface_call_currentTaskID = startCurrentTask(0, false, 'get-stderr');
|
|
976
|
+
const ret = getStderr();
|
|
977
|
+
_debugLog('[iface="wasi:cli/stderr@0.2.6", function="get-stderr"] [Instruction::CallInterface] (sync, @ post-call)');
|
|
978
|
+
endCurrentTask(0);
|
|
979
|
+
if (!(ret instanceof OutputStream)) {
|
|
980
|
+
throw new TypeError('Resource error: Not a valid "OutputStream" resource.');
|
|
981
|
+
}
|
|
982
|
+
var handle0 = ret[symbolRscHandle];
|
|
983
|
+
if (!handle0) {
|
|
984
|
+
const rep = ret[symbolRscRep] || ++captureCnt3;
|
|
985
|
+
captureTable3.set(rep, ret);
|
|
986
|
+
handle0 = rscTableCreateOwn(handleTable3, rep);
|
|
987
|
+
}
|
|
988
|
+
_debugLog('[iface="wasi:cli/stderr@0.2.6", function="get-stderr"][Instruction::Return]', {
|
|
989
|
+
funcName: 'get-stderr',
|
|
990
|
+
paramCount: 1,
|
|
991
|
+
async: false,
|
|
992
|
+
postReturn: false
|
|
993
|
+
});
|
|
994
|
+
return handle0;
|
|
995
|
+
}
|
|
996
|
+
|
|
997
|
+
let exports1;
|
|
868
998
|
let memory0;
|
|
869
999
|
let realloc0;
|
|
870
|
-
let realloc1;
|
|
871
1000
|
|
|
872
|
-
function
|
|
1001
|
+
function trampoline12(arg0) {
|
|
873
1002
|
_debugLog('[iface="wasi:random/insecure-seed@0.2.6", function="insecure-seed"] [Instruction::CallInterface] (async? sync, @ enter)');
|
|
874
1003
|
const _interface_call_currentTaskID = startCurrentTask(0, false, 'insecure-seed');
|
|
875
1004
|
const ret = insecureSeed();
|
|
@@ -886,15 +1015,90 @@ let gen = (function* _initGenerator () {
|
|
|
886
1015
|
});
|
|
887
1016
|
}
|
|
888
1017
|
|
|
889
|
-
const
|
|
890
|
-
const
|
|
891
|
-
let
|
|
892
|
-
handleTables[
|
|
1018
|
+
const handleTable1 = [T_FLAG, 0];
|
|
1019
|
+
const captureTable1= new Map();
|
|
1020
|
+
let captureCnt1 = 0;
|
|
1021
|
+
handleTables[1] = handleTable1;
|
|
893
1022
|
|
|
894
|
-
function
|
|
1023
|
+
function trampoline13(arg0, arg1) {
|
|
895
1024
|
var handle1 = arg0;
|
|
896
|
-
var rep2 =
|
|
897
|
-
var rsc0 =
|
|
1025
|
+
var rep2 = handleTable3[(handle1 << 1) + 1] & ~T_FLAG;
|
|
1026
|
+
var rsc0 = captureTable3.get(rep2);
|
|
1027
|
+
if (!rsc0) {
|
|
1028
|
+
rsc0 = Object.create(OutputStream.prototype);
|
|
1029
|
+
Object.defineProperty(rsc0, symbolRscHandle, { writable: true, value: handle1});
|
|
1030
|
+
Object.defineProperty(rsc0, symbolRscRep, { writable: true, value: rep2});
|
|
1031
|
+
}
|
|
1032
|
+
curResourceBorrows.push(rsc0);
|
|
1033
|
+
_debugLog('[iface="wasi:io/streams@0.2.6", function="[method]output-stream.check-write"] [Instruction::CallInterface] (async? sync, @ enter)');
|
|
1034
|
+
const _interface_call_currentTaskID = startCurrentTask(0, false, '[method]output-stream.check-write');
|
|
1035
|
+
let ret;
|
|
1036
|
+
try {
|
|
1037
|
+
ret = { tag: 'ok', val: rsc0.checkWrite()};
|
|
1038
|
+
} catch (e) {
|
|
1039
|
+
ret = { tag: 'err', val: getErrorPayload(e) };
|
|
1040
|
+
}
|
|
1041
|
+
_debugLog('[iface="wasi:io/streams@0.2.6", function="[method]output-stream.check-write"] [Instruction::CallInterface] (sync, @ post-call)');
|
|
1042
|
+
for (const rsc of curResourceBorrows) {
|
|
1043
|
+
rsc[symbolRscHandle] = undefined;
|
|
1044
|
+
}
|
|
1045
|
+
curResourceBorrows = [];
|
|
1046
|
+
endCurrentTask(0);
|
|
1047
|
+
var variant5 = ret;
|
|
1048
|
+
switch (variant5.tag) {
|
|
1049
|
+
case 'ok': {
|
|
1050
|
+
const e = variant5.val;
|
|
1051
|
+
dataView(memory0).setInt8(arg1 + 0, 0, true);
|
|
1052
|
+
dataView(memory0).setBigInt64(arg1 + 8, toUint64(e), true);
|
|
1053
|
+
break;
|
|
1054
|
+
}
|
|
1055
|
+
case 'err': {
|
|
1056
|
+
const e = variant5.val;
|
|
1057
|
+
dataView(memory0).setInt8(arg1 + 0, 1, true);
|
|
1058
|
+
var variant4 = e;
|
|
1059
|
+
switch (variant4.tag) {
|
|
1060
|
+
case 'last-operation-failed': {
|
|
1061
|
+
const e = variant4.val;
|
|
1062
|
+
dataView(memory0).setInt8(arg1 + 8, 0, true);
|
|
1063
|
+
if (!(e instanceof Error$1)) {
|
|
1064
|
+
throw new TypeError('Resource error: Not a valid "Error" resource.');
|
|
1065
|
+
}
|
|
1066
|
+
var handle3 = e[symbolRscHandle];
|
|
1067
|
+
if (!handle3) {
|
|
1068
|
+
const rep = e[symbolRscRep] || ++captureCnt1;
|
|
1069
|
+
captureTable1.set(rep, e);
|
|
1070
|
+
handle3 = rscTableCreateOwn(handleTable1, rep);
|
|
1071
|
+
}
|
|
1072
|
+
dataView(memory0).setInt32(arg1 + 12, handle3, true);
|
|
1073
|
+
break;
|
|
1074
|
+
}
|
|
1075
|
+
case 'closed': {
|
|
1076
|
+
dataView(memory0).setInt8(arg1 + 8, 1, true);
|
|
1077
|
+
break;
|
|
1078
|
+
}
|
|
1079
|
+
default: {
|
|
1080
|
+
throw new TypeError(`invalid variant tag value \`${JSON.stringify(variant4.tag)}\` (received \`${variant4}\`) specified for \`StreamError\``);
|
|
1081
|
+
}
|
|
1082
|
+
}
|
|
1083
|
+
break;
|
|
1084
|
+
}
|
|
1085
|
+
default: {
|
|
1086
|
+
throw new TypeError('invalid variant specified for result');
|
|
1087
|
+
}
|
|
1088
|
+
}
|
|
1089
|
+
_debugLog('[iface="wasi:io/streams@0.2.6", function="[method]output-stream.check-write"][Instruction::Return]', {
|
|
1090
|
+
funcName: '[method]output-stream.check-write',
|
|
1091
|
+
paramCount: 0,
|
|
1092
|
+
async: false,
|
|
1093
|
+
postReturn: false
|
|
1094
|
+
});
|
|
1095
|
+
}
|
|
1096
|
+
|
|
1097
|
+
|
|
1098
|
+
function trampoline14(arg0, arg1, arg2, arg3) {
|
|
1099
|
+
var handle1 = arg0;
|
|
1100
|
+
var rep2 = handleTable3[(handle1 << 1) + 1] & ~T_FLAG;
|
|
1101
|
+
var rsc0 = captureTable3.get(rep2);
|
|
898
1102
|
if (!rsc0) {
|
|
899
1103
|
rsc0 = Object.create(OutputStream.prototype);
|
|
900
1104
|
Object.defineProperty(rsc0, symbolRscHandle, { writable: true, value: handle1});
|
|
@@ -904,15 +1108,15 @@ let gen = (function* _initGenerator () {
|
|
|
904
1108
|
var ptr3 = arg1;
|
|
905
1109
|
var len3 = arg2;
|
|
906
1110
|
var result3 = new Uint8Array(memory0.buffer.slice(ptr3, ptr3 + len3 * 1));
|
|
907
|
-
_debugLog('[iface="wasi:io/streams@0.2.6", function="[method]output-stream.
|
|
908
|
-
const _interface_call_currentTaskID = startCurrentTask(0, false, '[method]output-stream.
|
|
1111
|
+
_debugLog('[iface="wasi:io/streams@0.2.6", function="[method]output-stream.write"] [Instruction::CallInterface] (async? sync, @ enter)');
|
|
1112
|
+
const _interface_call_currentTaskID = startCurrentTask(0, false, '[method]output-stream.write');
|
|
909
1113
|
let ret;
|
|
910
1114
|
try {
|
|
911
|
-
ret = { tag: 'ok', val: rsc0.
|
|
1115
|
+
ret = { tag: 'ok', val: rsc0.write(result3)};
|
|
912
1116
|
} catch (e) {
|
|
913
1117
|
ret = { tag: 'err', val: getErrorPayload(e) };
|
|
914
1118
|
}
|
|
915
|
-
_debugLog('[iface="wasi:io/streams@0.2.6", function="[method]output-stream.
|
|
1119
|
+
_debugLog('[iface="wasi:io/streams@0.2.6", function="[method]output-stream.write"] [Instruction::CallInterface] (sync, @ post-call)');
|
|
916
1120
|
for (const rsc of curResourceBorrows) {
|
|
917
1121
|
rsc[symbolRscHandle] = undefined;
|
|
918
1122
|
}
|
|
@@ -938,9 +1142,9 @@ let gen = (function* _initGenerator () {
|
|
|
938
1142
|
}
|
|
939
1143
|
var handle4 = e[symbolRscHandle];
|
|
940
1144
|
if (!handle4) {
|
|
941
|
-
const rep = e[symbolRscRep] || ++
|
|
942
|
-
|
|
943
|
-
handle4 = rscTableCreateOwn(
|
|
1145
|
+
const rep = e[symbolRscRep] || ++captureCnt1;
|
|
1146
|
+
captureTable1.set(rep, e);
|
|
1147
|
+
handle4 = rscTableCreateOwn(handleTable1, rep);
|
|
944
1148
|
}
|
|
945
1149
|
dataView(memory0).setInt32(arg3 + 8, handle4, true);
|
|
946
1150
|
break;
|
|
@@ -959,8 +1163,8 @@ let gen = (function* _initGenerator () {
|
|
|
959
1163
|
throw new TypeError('invalid variant specified for result');
|
|
960
1164
|
}
|
|
961
1165
|
}
|
|
962
|
-
_debugLog('[iface="wasi:io/streams@0.2.6", function="[method]output-stream.
|
|
963
|
-
funcName: '[method]output-stream.
|
|
1166
|
+
_debugLog('[iface="wasi:io/streams@0.2.6", function="[method]output-stream.write"][Instruction::Return]', {
|
|
1167
|
+
funcName: '[method]output-stream.write',
|
|
964
1168
|
paramCount: 0,
|
|
965
1169
|
async: false,
|
|
966
1170
|
postReturn: false
|
|
@@ -968,31 +1172,73 @@ let gen = (function* _initGenerator () {
|
|
|
968
1172
|
}
|
|
969
1173
|
|
|
970
1174
|
|
|
971
|
-
function
|
|
1175
|
+
function trampoline15(arg0, arg1) {
|
|
972
1176
|
var handle1 = arg0;
|
|
973
|
-
var rep2 =
|
|
974
|
-
var rsc0 =
|
|
1177
|
+
var rep2 = handleTable3[(handle1 << 1) + 1] & ~T_FLAG;
|
|
1178
|
+
var rsc0 = captureTable3.get(rep2);
|
|
975
1179
|
if (!rsc0) {
|
|
976
|
-
rsc0 = Object.create(
|
|
1180
|
+
rsc0 = Object.create(OutputStream.prototype);
|
|
977
1181
|
Object.defineProperty(rsc0, symbolRscHandle, { writable: true, value: handle1});
|
|
978
1182
|
Object.defineProperty(rsc0, symbolRscRep, { writable: true, value: rep2});
|
|
979
1183
|
}
|
|
980
1184
|
curResourceBorrows.push(rsc0);
|
|
981
|
-
_debugLog('[iface="wasi:io/
|
|
982
|
-
const _interface_call_currentTaskID = startCurrentTask(0, false, '[method]
|
|
983
|
-
|
|
984
|
-
|
|
1185
|
+
_debugLog('[iface="wasi:io/streams@0.2.6", function="[method]output-stream.blocking-flush"] [Instruction::CallInterface] (async? sync, @ enter)');
|
|
1186
|
+
const _interface_call_currentTaskID = startCurrentTask(0, false, '[method]output-stream.blocking-flush');
|
|
1187
|
+
let ret;
|
|
1188
|
+
try {
|
|
1189
|
+
ret = { tag: 'ok', val: rsc0.blockingFlush()};
|
|
1190
|
+
} catch (e) {
|
|
1191
|
+
ret = { tag: 'err', val: getErrorPayload(e) };
|
|
1192
|
+
}
|
|
1193
|
+
_debugLog('[iface="wasi:io/streams@0.2.6", function="[method]output-stream.blocking-flush"] [Instruction::CallInterface] (sync, @ post-call)');
|
|
985
1194
|
for (const rsc of curResourceBorrows) {
|
|
986
1195
|
rsc[symbolRscHandle] = undefined;
|
|
987
1196
|
}
|
|
988
1197
|
curResourceBorrows = [];
|
|
989
1198
|
endCurrentTask(0);
|
|
990
|
-
var
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
1199
|
+
var variant5 = ret;
|
|
1200
|
+
switch (variant5.tag) {
|
|
1201
|
+
case 'ok': {
|
|
1202
|
+
const e = variant5.val;
|
|
1203
|
+
dataView(memory0).setInt8(arg1 + 0, 0, true);
|
|
1204
|
+
break;
|
|
1205
|
+
}
|
|
1206
|
+
case 'err': {
|
|
1207
|
+
const e = variant5.val;
|
|
1208
|
+
dataView(memory0).setInt8(arg1 + 0, 1, true);
|
|
1209
|
+
var variant4 = e;
|
|
1210
|
+
switch (variant4.tag) {
|
|
1211
|
+
case 'last-operation-failed': {
|
|
1212
|
+
const e = variant4.val;
|
|
1213
|
+
dataView(memory0).setInt8(arg1 + 4, 0, true);
|
|
1214
|
+
if (!(e instanceof Error$1)) {
|
|
1215
|
+
throw new TypeError('Resource error: Not a valid "Error" resource.');
|
|
1216
|
+
}
|
|
1217
|
+
var handle3 = e[symbolRscHandle];
|
|
1218
|
+
if (!handle3) {
|
|
1219
|
+
const rep = e[symbolRscRep] || ++captureCnt1;
|
|
1220
|
+
captureTable1.set(rep, e);
|
|
1221
|
+
handle3 = rscTableCreateOwn(handleTable1, rep);
|
|
1222
|
+
}
|
|
1223
|
+
dataView(memory0).setInt32(arg1 + 8, handle3, true);
|
|
1224
|
+
break;
|
|
1225
|
+
}
|
|
1226
|
+
case 'closed': {
|
|
1227
|
+
dataView(memory0).setInt8(arg1 + 4, 1, true);
|
|
1228
|
+
break;
|
|
1229
|
+
}
|
|
1230
|
+
default: {
|
|
1231
|
+
throw new TypeError(`invalid variant tag value \`${JSON.stringify(variant4.tag)}\` (received \`${variant4}\`) specified for \`StreamError\``);
|
|
1232
|
+
}
|
|
1233
|
+
}
|
|
1234
|
+
break;
|
|
1235
|
+
}
|
|
1236
|
+
default: {
|
|
1237
|
+
throw new TypeError('invalid variant specified for result');
|
|
1238
|
+
}
|
|
1239
|
+
}
|
|
1240
|
+
_debugLog('[iface="wasi:io/streams@0.2.6", function="[method]output-stream.blocking-flush"][Instruction::Return]', {
|
|
1241
|
+
funcName: '[method]output-stream.blocking-flush',
|
|
996
1242
|
paramCount: 0,
|
|
997
1243
|
async: false,
|
|
998
1244
|
postReturn: false
|
|
@@ -1000,7 +1246,7 @@ let gen = (function* _initGenerator () {
|
|
|
1000
1246
|
}
|
|
1001
1247
|
|
|
1002
1248
|
|
|
1003
|
-
function
|
|
1249
|
+
function trampoline16(arg0) {
|
|
1004
1250
|
_debugLog('[iface="wasi:cli/environment@0.2.6", function="get-environment"] [Instruction::CallInterface] (async? sync, @ enter)');
|
|
1005
1251
|
const _interface_call_currentTaskID = startCurrentTask(0, false, 'get-environment');
|
|
1006
1252
|
const ret = getEnvironment();
|
|
@@ -1008,15 +1254,15 @@ let gen = (function* _initGenerator () {
|
|
|
1008
1254
|
endCurrentTask(0);
|
|
1009
1255
|
var vec3 = ret;
|
|
1010
1256
|
var len3 = vec3.length;
|
|
1011
|
-
var result3 =
|
|
1257
|
+
var result3 = realloc0(0, 0, 4, len3 * 16);
|
|
1012
1258
|
for (let i = 0; i < vec3.length; i++) {
|
|
1013
1259
|
const e = vec3[i];
|
|
1014
1260
|
const base = result3 + i * 16;var [tuple0_0, tuple0_1] = e;
|
|
1015
|
-
var ptr1 = utf8Encode(tuple0_0,
|
|
1261
|
+
var ptr1 = utf8Encode(tuple0_0, realloc0, memory0);
|
|
1016
1262
|
var len1 = utf8EncodedLen;
|
|
1017
1263
|
dataView(memory0).setUint32(base + 4, len1, true);
|
|
1018
1264
|
dataView(memory0).setUint32(base + 0, ptr1, true);
|
|
1019
|
-
var ptr2 = utf8Encode(tuple0_1,
|
|
1265
|
+
var ptr2 = utf8Encode(tuple0_1, realloc0, memory0);
|
|
1020
1266
|
var len2 = utf8EncodedLen;
|
|
1021
1267
|
dataView(memory0).setUint32(base + 12, len2, true);
|
|
1022
1268
|
dataView(memory0).setUint32(base + 8, ptr2, true);
|
|
@@ -1031,7 +1277,111 @@ let gen = (function* _initGenerator () {
|
|
|
1031
1277
|
});
|
|
1032
1278
|
}
|
|
1033
1279
|
|
|
1034
|
-
|
|
1280
|
+
const handleTable4 = [T_FLAG, 0];
|
|
1281
|
+
const captureTable4= new Map();
|
|
1282
|
+
let captureCnt4 = 0;
|
|
1283
|
+
handleTables[4] = handleTable4;
|
|
1284
|
+
|
|
1285
|
+
function trampoline17(arg0) {
|
|
1286
|
+
_debugLog('[iface="wasi:cli/terminal-stdin@0.2.6", function="get-terminal-stdin"] [Instruction::CallInterface] (async? sync, @ enter)');
|
|
1287
|
+
const _interface_call_currentTaskID = startCurrentTask(0, false, 'get-terminal-stdin');
|
|
1288
|
+
const ret = getTerminalStdin();
|
|
1289
|
+
_debugLog('[iface="wasi:cli/terminal-stdin@0.2.6", function="get-terminal-stdin"] [Instruction::CallInterface] (sync, @ post-call)');
|
|
1290
|
+
endCurrentTask(0);
|
|
1291
|
+
var variant1 = ret;
|
|
1292
|
+
if (variant1 === null || variant1=== undefined) {
|
|
1293
|
+
dataView(memory0).setInt8(arg0 + 0, 0, true);
|
|
1294
|
+
} else {
|
|
1295
|
+
const e = variant1;
|
|
1296
|
+
dataView(memory0).setInt8(arg0 + 0, 1, true);
|
|
1297
|
+
if (!(e instanceof TerminalInput)) {
|
|
1298
|
+
throw new TypeError('Resource error: Not a valid "TerminalInput" resource.');
|
|
1299
|
+
}
|
|
1300
|
+
var handle0 = e[symbolRscHandle];
|
|
1301
|
+
if (!handle0) {
|
|
1302
|
+
const rep = e[symbolRscRep] || ++captureCnt4;
|
|
1303
|
+
captureTable4.set(rep, e);
|
|
1304
|
+
handle0 = rscTableCreateOwn(handleTable4, rep);
|
|
1305
|
+
}
|
|
1306
|
+
dataView(memory0).setInt32(arg0 + 4, handle0, true);
|
|
1307
|
+
}
|
|
1308
|
+
_debugLog('[iface="wasi:cli/terminal-stdin@0.2.6", function="get-terminal-stdin"][Instruction::Return]', {
|
|
1309
|
+
funcName: 'get-terminal-stdin',
|
|
1310
|
+
paramCount: 0,
|
|
1311
|
+
async: false,
|
|
1312
|
+
postReturn: false
|
|
1313
|
+
});
|
|
1314
|
+
}
|
|
1315
|
+
|
|
1316
|
+
const handleTable5 = [T_FLAG, 0];
|
|
1317
|
+
const captureTable5= new Map();
|
|
1318
|
+
let captureCnt5 = 0;
|
|
1319
|
+
handleTables[5] = handleTable5;
|
|
1320
|
+
|
|
1321
|
+
function trampoline18(arg0) {
|
|
1322
|
+
_debugLog('[iface="wasi:cli/terminal-stdout@0.2.6", function="get-terminal-stdout"] [Instruction::CallInterface] (async? sync, @ enter)');
|
|
1323
|
+
const _interface_call_currentTaskID = startCurrentTask(0, false, 'get-terminal-stdout');
|
|
1324
|
+
const ret = getTerminalStdout();
|
|
1325
|
+
_debugLog('[iface="wasi:cli/terminal-stdout@0.2.6", function="get-terminal-stdout"] [Instruction::CallInterface] (sync, @ post-call)');
|
|
1326
|
+
endCurrentTask(0);
|
|
1327
|
+
var variant1 = ret;
|
|
1328
|
+
if (variant1 === null || variant1=== undefined) {
|
|
1329
|
+
dataView(memory0).setInt8(arg0 + 0, 0, true);
|
|
1330
|
+
} else {
|
|
1331
|
+
const e = variant1;
|
|
1332
|
+
dataView(memory0).setInt8(arg0 + 0, 1, true);
|
|
1333
|
+
if (!(e instanceof TerminalOutput)) {
|
|
1334
|
+
throw new TypeError('Resource error: Not a valid "TerminalOutput" resource.');
|
|
1335
|
+
}
|
|
1336
|
+
var handle0 = e[symbolRscHandle];
|
|
1337
|
+
if (!handle0) {
|
|
1338
|
+
const rep = e[symbolRscRep] || ++captureCnt5;
|
|
1339
|
+
captureTable5.set(rep, e);
|
|
1340
|
+
handle0 = rscTableCreateOwn(handleTable5, rep);
|
|
1341
|
+
}
|
|
1342
|
+
dataView(memory0).setInt32(arg0 + 4, handle0, true);
|
|
1343
|
+
}
|
|
1344
|
+
_debugLog('[iface="wasi:cli/terminal-stdout@0.2.6", function="get-terminal-stdout"][Instruction::Return]', {
|
|
1345
|
+
funcName: 'get-terminal-stdout',
|
|
1346
|
+
paramCount: 0,
|
|
1347
|
+
async: false,
|
|
1348
|
+
postReturn: false
|
|
1349
|
+
});
|
|
1350
|
+
}
|
|
1351
|
+
|
|
1352
|
+
|
|
1353
|
+
function trampoline19(arg0) {
|
|
1354
|
+
_debugLog('[iface="wasi:cli/terminal-stderr@0.2.6", function="get-terminal-stderr"] [Instruction::CallInterface] (async? sync, @ enter)');
|
|
1355
|
+
const _interface_call_currentTaskID = startCurrentTask(0, false, 'get-terminal-stderr');
|
|
1356
|
+
const ret = getTerminalStderr();
|
|
1357
|
+
_debugLog('[iface="wasi:cli/terminal-stderr@0.2.6", function="get-terminal-stderr"] [Instruction::CallInterface] (sync, @ post-call)');
|
|
1358
|
+
endCurrentTask(0);
|
|
1359
|
+
var variant1 = ret;
|
|
1360
|
+
if (variant1 === null || variant1=== undefined) {
|
|
1361
|
+
dataView(memory0).setInt8(arg0 + 0, 0, true);
|
|
1362
|
+
} else {
|
|
1363
|
+
const e = variant1;
|
|
1364
|
+
dataView(memory0).setInt8(arg0 + 0, 1, true);
|
|
1365
|
+
if (!(e instanceof TerminalOutput)) {
|
|
1366
|
+
throw new TypeError('Resource error: Not a valid "TerminalOutput" resource.');
|
|
1367
|
+
}
|
|
1368
|
+
var handle0 = e[symbolRscHandle];
|
|
1369
|
+
if (!handle0) {
|
|
1370
|
+
const rep = e[symbolRscRep] || ++captureCnt5;
|
|
1371
|
+
captureTable5.set(rep, e);
|
|
1372
|
+
handle0 = rscTableCreateOwn(handleTable5, rep);
|
|
1373
|
+
}
|
|
1374
|
+
dataView(memory0).setInt32(arg0 + 4, handle0, true);
|
|
1375
|
+
}
|
|
1376
|
+
_debugLog('[iface="wasi:cli/terminal-stderr@0.2.6", function="get-terminal-stderr"][Instruction::Return]', {
|
|
1377
|
+
funcName: 'get-terminal-stderr',
|
|
1378
|
+
paramCount: 0,
|
|
1379
|
+
async: false,
|
|
1380
|
+
postReturn: false
|
|
1381
|
+
});
|
|
1382
|
+
}
|
|
1383
|
+
|
|
1384
|
+
let exports2;
|
|
1035
1385
|
let postReturn0;
|
|
1036
1386
|
let postReturn1;
|
|
1037
1387
|
let postReturn2;
|
|
@@ -1045,12 +1395,12 @@ let gen = (function* _initGenerator () {
|
|
|
1045
1395
|
if (rsc) {
|
|
1046
1396
|
if (rsc[symbolDispose]) rsc[symbolDispose]();
|
|
1047
1397
|
captureTable1.delete(handleEntry.rep);
|
|
1048
|
-
} else if (
|
|
1049
|
-
|
|
1398
|
+
} else if (Error$1[symbolCabiDispose]) {
|
|
1399
|
+
Error$1[symbolCabiDispose](handleEntry.rep);
|
|
1050
1400
|
}
|
|
1051
1401
|
}
|
|
1052
1402
|
}
|
|
1053
|
-
function
|
|
1403
|
+
function trampoline1(handle) {
|
|
1054
1404
|
const handleEntry = rscTableRemove(handleTable0, handle);
|
|
1055
1405
|
if (handleEntry.own) {
|
|
1056
1406
|
|
|
@@ -1058,72 +1408,128 @@ let gen = (function* _initGenerator () {
|
|
|
1058
1408
|
if (rsc) {
|
|
1059
1409
|
if (rsc[symbolDispose]) rsc[symbolDispose]();
|
|
1060
1410
|
captureTable0.delete(handleEntry.rep);
|
|
1061
|
-
} else if (
|
|
1062
|
-
|
|
1411
|
+
} else if (Pollable[symbolCabiDispose]) {
|
|
1412
|
+
Pollable[symbolCabiDispose](handleEntry.rep);
|
|
1413
|
+
}
|
|
1414
|
+
}
|
|
1415
|
+
}
|
|
1416
|
+
function trampoline2(handle) {
|
|
1417
|
+
const handleEntry = rscTableRemove(handleTable2, handle);
|
|
1418
|
+
if (handleEntry.own) {
|
|
1419
|
+
|
|
1420
|
+
const rsc = captureTable2.get(handleEntry.rep);
|
|
1421
|
+
if (rsc) {
|
|
1422
|
+
if (rsc[symbolDispose]) rsc[symbolDispose]();
|
|
1423
|
+
captureTable2.delete(handleEntry.rep);
|
|
1424
|
+
} else if (InputStream[symbolCabiDispose]) {
|
|
1425
|
+
InputStream[symbolCabiDispose](handleEntry.rep);
|
|
1426
|
+
}
|
|
1427
|
+
}
|
|
1428
|
+
}
|
|
1429
|
+
function trampoline3(handle) {
|
|
1430
|
+
const handleEntry = rscTableRemove(handleTable3, handle);
|
|
1431
|
+
if (handleEntry.own) {
|
|
1432
|
+
|
|
1433
|
+
const rsc = captureTable3.get(handleEntry.rep);
|
|
1434
|
+
if (rsc) {
|
|
1435
|
+
if (rsc[symbolDispose]) rsc[symbolDispose]();
|
|
1436
|
+
captureTable3.delete(handleEntry.rep);
|
|
1437
|
+
} else if (OutputStream[symbolCabiDispose]) {
|
|
1438
|
+
OutputStream[symbolCabiDispose](handleEntry.rep);
|
|
1439
|
+
}
|
|
1440
|
+
}
|
|
1441
|
+
}
|
|
1442
|
+
function trampoline4(handle) {
|
|
1443
|
+
const handleEntry = rscTableRemove(handleTable4, handle);
|
|
1444
|
+
if (handleEntry.own) {
|
|
1445
|
+
|
|
1446
|
+
const rsc = captureTable4.get(handleEntry.rep);
|
|
1447
|
+
if (rsc) {
|
|
1448
|
+
if (rsc[symbolDispose]) rsc[symbolDispose]();
|
|
1449
|
+
captureTable4.delete(handleEntry.rep);
|
|
1450
|
+
} else if (TerminalInput[symbolCabiDispose]) {
|
|
1451
|
+
TerminalInput[symbolCabiDispose](handleEntry.rep);
|
|
1452
|
+
}
|
|
1453
|
+
}
|
|
1454
|
+
}
|
|
1455
|
+
function trampoline5(handle) {
|
|
1456
|
+
const handleEntry = rscTableRemove(handleTable5, handle);
|
|
1457
|
+
if (handleEntry.own) {
|
|
1458
|
+
|
|
1459
|
+
const rsc = captureTable5.get(handleEntry.rep);
|
|
1460
|
+
if (rsc) {
|
|
1461
|
+
if (rsc[symbolDispose]) rsc[symbolDispose]();
|
|
1462
|
+
captureTable5.delete(handleEntry.rep);
|
|
1463
|
+
} else if (TerminalOutput[symbolCabiDispose]) {
|
|
1464
|
+
TerminalOutput[symbolCabiDispose](handleEntry.rep);
|
|
1063
1465
|
}
|
|
1064
1466
|
}
|
|
1065
1467
|
}
|
|
1066
|
-
Promise.all([module0, module1, module2
|
|
1067
|
-
({ exports: exports0 } = yield instantiateCore(yield
|
|
1468
|
+
Promise.all([module0, module1, module2]).catch(() => {});
|
|
1469
|
+
({ exports: exports0 } = yield instantiateCore(yield module1));
|
|
1068
1470
|
({ exports: exports1 } = yield instantiateCore(yield module0, {
|
|
1069
|
-
'wasi:cli/
|
|
1070
|
-
'get-
|
|
1471
|
+
'wasi:cli/environment@0.2.0': {
|
|
1472
|
+
'get-environment': exports0['4'],
|
|
1071
1473
|
},
|
|
1072
|
-
'wasi:
|
|
1073
|
-
|
|
1074
|
-
'[resource-drop]error': trampoline2,
|
|
1474
|
+
'wasi:cli/exit@0.2.0': {
|
|
1475
|
+
exit: trampoline6,
|
|
1075
1476
|
},
|
|
1076
|
-
'wasi:
|
|
1077
|
-
'
|
|
1078
|
-
'[resource-drop]output-stream': trampoline0,
|
|
1477
|
+
'wasi:cli/stderr@0.2.0': {
|
|
1478
|
+
'get-stderr': trampoline11,
|
|
1079
1479
|
},
|
|
1080
|
-
'wasi:
|
|
1081
|
-
'
|
|
1480
|
+
'wasi:cli/stdin@0.2.0': {
|
|
1481
|
+
'get-stdin': trampoline9,
|
|
1082
1482
|
},
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
environ_sizes_get: exports0['4'],
|
|
1086
|
-
proc_exit: exports0['5'],
|
|
1483
|
+
'wasi:cli/stdout@0.2.0': {
|
|
1484
|
+
'get-stdout': trampoline10,
|
|
1087
1485
|
},
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1486
|
+
'wasi:cli/terminal-input@0.2.0': {
|
|
1487
|
+
'[resource-drop]terminal-input': trampoline4,
|
|
1488
|
+
},
|
|
1489
|
+
'wasi:cli/terminal-output@0.2.0': {
|
|
1490
|
+
'[resource-drop]terminal-output': trampoline5,
|
|
1092
1491
|
},
|
|
1093
|
-
|
|
1094
|
-
|
|
1492
|
+
'wasi:cli/terminal-stderr@0.2.0': {
|
|
1493
|
+
'get-terminal-stderr': exports0['7'],
|
|
1095
1494
|
},
|
|
1096
|
-
'wasi:cli/
|
|
1097
|
-
'get-
|
|
1495
|
+
'wasi:cli/terminal-stdin@0.2.0': {
|
|
1496
|
+
'get-terminal-stdin': exports0['5'],
|
|
1098
1497
|
},
|
|
1099
|
-
'wasi:cli/
|
|
1100
|
-
|
|
1498
|
+
'wasi:cli/terminal-stdout@0.2.0': {
|
|
1499
|
+
'get-terminal-stdout': exports0['6'],
|
|
1101
1500
|
},
|
|
1102
|
-
'wasi:
|
|
1103
|
-
'
|
|
1501
|
+
'wasi:io/error@0.2.0': {
|
|
1502
|
+
'[resource-drop]error': trampoline0,
|
|
1104
1503
|
},
|
|
1105
|
-
'wasi:io/
|
|
1106
|
-
'[
|
|
1504
|
+
'wasi:io/poll@0.2.0': {
|
|
1505
|
+
'[method]pollable.block': trampoline7,
|
|
1506
|
+
'[resource-drop]pollable': trampoline1,
|
|
1107
1507
|
},
|
|
1108
|
-
'wasi:io/streams@0.2.
|
|
1109
|
-
'[method]output-stream.blocking-
|
|
1110
|
-
'[
|
|
1508
|
+
'wasi:io/streams@0.2.0': {
|
|
1509
|
+
'[method]output-stream.blocking-flush': exports0['3'],
|
|
1510
|
+
'[method]output-stream.check-write': exports0['1'],
|
|
1511
|
+
'[method]output-stream.subscribe': trampoline8,
|
|
1512
|
+
'[method]output-stream.write': exports0['2'],
|
|
1513
|
+
'[resource-drop]input-stream': trampoline2,
|
|
1514
|
+
'[resource-drop]output-stream': trampoline3,
|
|
1515
|
+
},
|
|
1516
|
+
'wasi:random/insecure-seed@0.2.4': {
|
|
1517
|
+
'insecure-seed': exports0['0'],
|
|
1111
1518
|
},
|
|
1112
1519
|
}));
|
|
1113
1520
|
memory0 = exports1.memory;
|
|
1114
1521
|
realloc0 = exports1.cabi_realloc;
|
|
1115
|
-
|
|
1116
|
-
({ exports: exports3 } = yield instantiateCore(yield module3, {
|
|
1522
|
+
({ exports: exports2 } = yield instantiateCore(yield module2, {
|
|
1117
1523
|
'': {
|
|
1118
1524
|
$imports: exports0.$imports,
|
|
1119
|
-
'0':
|
|
1120
|
-
'1':
|
|
1121
|
-
'2':
|
|
1122
|
-
'3':
|
|
1123
|
-
'4':
|
|
1124
|
-
'5':
|
|
1125
|
-
'6':
|
|
1126
|
-
'7':
|
|
1525
|
+
'0': trampoline12,
|
|
1526
|
+
'1': trampoline13,
|
|
1527
|
+
'2': trampoline14,
|
|
1528
|
+
'3': trampoline15,
|
|
1529
|
+
'4': trampoline16,
|
|
1530
|
+
'5': trampoline17,
|
|
1531
|
+
'6': trampoline18,
|
|
1532
|
+
'7': trampoline19,
|
|
1127
1533
|
},
|
|
1128
1534
|
}));
|
|
1129
1535
|
postReturn0 = exports1['cabi_post_get-string-constant'];
|
|
@@ -1202,51 +1608,30 @@ let gen = (function* _initGenerator () {
|
|
|
1202
1608
|
return retCopy;
|
|
1203
1609
|
|
|
1204
1610
|
}
|
|
1205
|
-
let
|
|
1611
|
+
let exports1ContainsTopLevelCallable;
|
|
1206
1612
|
|
|
1207
|
-
function
|
|
1613
|
+
function containsTopLevelCallable(arg0, arg1) {
|
|
1208
1614
|
var ptr0 = utf8Encode(arg0, realloc0, memory0);
|
|
1209
1615
|
var len0 = utf8EncodedLen;
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1616
|
+
var ptr1 = utf8Encode(arg1, realloc0, memory0);
|
|
1617
|
+
var len1 = utf8EncodedLen;
|
|
1618
|
+
_debugLog('[iface="contains-top-level-callable", function="contains-top-level-callable"][Instruction::CallWasm] enter', {
|
|
1619
|
+
funcName: 'contains-top-level-callable',
|
|
1620
|
+
paramCount: 4,
|
|
1213
1621
|
async: false,
|
|
1214
|
-
postReturn:
|
|
1622
|
+
postReturn: false,
|
|
1215
1623
|
});
|
|
1216
|
-
const _wasm_call_currentTaskID = startCurrentTask(0, false, '
|
|
1217
|
-
const ret =
|
|
1624
|
+
const _wasm_call_currentTaskID = startCurrentTask(0, false, 'exports1ContainsTopLevelCallable');
|
|
1625
|
+
const ret = exports1ContainsTopLevelCallable(ptr0, len0, ptr1, len1);
|
|
1218
1626
|
endCurrentTask(0);
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
variant2 = undefined;
|
|
1223
|
-
break;
|
|
1224
|
-
}
|
|
1225
|
-
case 1: {
|
|
1226
|
-
var ptr1 = dataView(memory0).getUint32(ret + 4, true);
|
|
1227
|
-
var len1 = dataView(memory0).getUint32(ret + 8, true);
|
|
1228
|
-
var result1 = utf8Decoder.decode(new Uint8Array(memory0.buffer, ptr1, len1));
|
|
1229
|
-
variant2 = result1;
|
|
1230
|
-
break;
|
|
1231
|
-
}
|
|
1232
|
-
default: {
|
|
1233
|
-
throw new TypeError('invalid variant discriminant for option');
|
|
1234
|
-
}
|
|
1235
|
-
}
|
|
1236
|
-
_debugLog('[iface="parse-django-settings-module", function="parse-django-settings-module"][Instruction::Return]', {
|
|
1237
|
-
funcName: 'parse-django-settings-module',
|
|
1627
|
+
var bool2 = ret;
|
|
1628
|
+
_debugLog('[iface="contains-top-level-callable", function="contains-top-level-callable"][Instruction::Return]', {
|
|
1629
|
+
funcName: 'contains-top-level-callable',
|
|
1238
1630
|
paramCount: 1,
|
|
1239
1631
|
async: false,
|
|
1240
|
-
postReturn:
|
|
1632
|
+
postReturn: false
|
|
1241
1633
|
});
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
let cstate = getOrCreateAsyncState(0);
|
|
1245
|
-
cstate.mayLeave = false;
|
|
1246
|
-
postReturn0(ret);
|
|
1247
|
-
cstate.mayLeave = true;
|
|
1248
|
-
return retCopy;
|
|
1249
|
-
|
|
1634
|
+
return bool2 == 0 ? false : (bool2 == 1 ? true : throwInvalidBool());
|
|
1250
1635
|
}
|
|
1251
1636
|
let exports1ParseDistMetadata;
|
|
1252
1637
|
|
|
@@ -1886,13 +2271,13 @@ let gen = (function* _initGenerator () {
|
|
|
1886
2271
|
}
|
|
1887
2272
|
exports1ContainsAppOrHandler = exports1['contains-app-or-handler'];
|
|
1888
2273
|
exports1GetStringConstant = exports1['get-string-constant'];
|
|
1889
|
-
|
|
2274
|
+
exports1ContainsTopLevelCallable = exports1['contains-top-level-callable'];
|
|
1890
2275
|
exports1ParseDistMetadata = exports1['parse-dist-metadata'];
|
|
1891
2276
|
exports1ParseRecord = exports1['parse-record'];
|
|
1892
2277
|
exports1ParseDirectUrl = exports1['parse-direct-url'];
|
|
1893
2278
|
exports1NormalizePackageName = exports1['normalize-package-name'];
|
|
1894
2279
|
|
|
1895
|
-
return { containsAppOrHandler, getStringConstant, normalizePackageName, parseDirectUrl, parseDistMetadata,
|
|
2280
|
+
return { containsAppOrHandler, containsTopLevelCallable, getStringConstant, normalizePackageName, parseDirectUrl, parseDistMetadata, parseRecord, };
|
|
1896
2281
|
})();
|
|
1897
2282
|
let promise, resolve, reject;
|
|
1898
2283
|
function runNext (value) {
|
package/package.json
CHANGED
|
Binary file
|