@5ive-tech/sdk 1.1.2
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 +279 -0
- package/dist/FiveSDK.d.ts +336 -0
- package/dist/FiveSDK.js +395 -0
- package/dist/accounts/index.d.ts +254 -0
- package/dist/accounts/index.js +543 -0
- package/dist/assets/vm/dummy.file +0 -0
- package/dist/assets/vm/five_vm_wasm.d.ts +762 -0
- package/dist/assets/vm/five_vm_wasm.js +3754 -0
- package/dist/assets/vm/five_vm_wasm_bg.js +3307 -0
- package/dist/assets/vm/five_vm_wasm_bg.wasm +0 -0
- package/dist/assets/vm/five_vm_wasm_bg.wasm.d.ts +247 -0
- package/dist/assets/vm/package.json +11 -0
- package/dist/bin/gen-types.d.ts +2 -0
- package/dist/bin/gen-types.js +35 -0
- package/dist/compiler/BytecodeCompiler.d.ts +83 -0
- package/dist/compiler/BytecodeCompiler.js +379 -0
- package/dist/config/ConfigManager.d.ts +13 -0
- package/dist/config/ConfigManager.js +27 -0
- package/dist/config/ProgramIdResolver.d.ts +62 -0
- package/dist/config/ProgramIdResolver.js +104 -0
- package/dist/crypto/index.d.ts +211 -0
- package/dist/crypto/index.js +451 -0
- package/dist/encoding/ParameterEncoder.d.ts +31 -0
- package/dist/encoding/ParameterEncoder.js +278 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.js +28 -0
- package/dist/lib/bytecode-encoder.d.ts +62 -0
- package/dist/lib/bytecode-encoder.js +281 -0
- package/dist/logging/index.d.ts +9 -0
- package/dist/logging/index.js +10 -0
- package/dist/metadata/index.d.ts +213 -0
- package/dist/metadata/index.js +296 -0
- package/dist/modules/accounts.d.ts +60 -0
- package/dist/modules/accounts.js +275 -0
- package/dist/modules/deploy.d.ts +90 -0
- package/dist/modules/deploy.js +1118 -0
- package/dist/modules/execute.d.ts +90 -0
- package/dist/modules/execute.js +649 -0
- package/dist/modules/fees.d.ts +14 -0
- package/dist/modules/fees.js +112 -0
- package/dist/modules/namespaces.d.ts +39 -0
- package/dist/modules/namespaces.js +190 -0
- package/dist/modules/state-diff.d.ts +35 -0
- package/dist/modules/state-diff.js +342 -0
- package/dist/modules/vm-state.d.ts +7 -0
- package/dist/modules/vm-state.js +44 -0
- package/dist/program/AccountResolver.d.ts +67 -0
- package/dist/program/AccountResolver.js +134 -0
- package/dist/program/BorshSchemaGenerator.d.ts +8 -0
- package/dist/program/BorshSchemaGenerator.js +57 -0
- package/dist/program/FiveProgram.d.ts +144 -0
- package/dist/program/FiveProgram.js +282 -0
- package/dist/program/FunctionBuilder.d.ts +114 -0
- package/dist/program/FunctionBuilder.js +347 -0
- package/dist/program/ProgramAccount.d.ts +38 -0
- package/dist/program/ProgramAccount.js +170 -0
- package/dist/program/TypeGenerator.d.ts +90 -0
- package/dist/program/TypeGenerator.js +195 -0
- package/dist/program/index.d.ts +24 -0
- package/dist/program/index.js +21 -0
- package/dist/project/config.d.ts +5 -0
- package/dist/project/config.js +33 -0
- package/dist/project/toml.d.ts +6 -0
- package/dist/project/toml.js +43 -0
- package/dist/project/workspace.d.ts +160 -0
- package/dist/project/workspace.js +73 -0
- package/dist/testing/AccountMetaGenerator.d.ts +121 -0
- package/dist/testing/AccountMetaGenerator.js +261 -0
- package/dist/testing/AccountTestFixture.d.ts +211 -0
- package/dist/testing/AccountTestFixture.js +530 -0
- package/dist/testing/OnChainAccountManager.d.ts +81 -0
- package/dist/testing/OnChainAccountManager.js +260 -0
- package/dist/testing/StateSerializer.d.ts +65 -0
- package/dist/testing/StateSerializer.js +330 -0
- package/dist/testing/TestDiscovery.d.ts +79 -0
- package/dist/testing/TestDiscovery.js +274 -0
- package/dist/testing/TestRunner.d.ts +117 -0
- package/dist/testing/TestRunner.js +346 -0
- package/dist/testing/index.d.ts +14 -0
- package/dist/testing/index.js +13 -0
- package/dist/types.d.ts +356 -0
- package/dist/types.js +32 -0
- package/dist/utils/abi.d.ts +31 -0
- package/dist/utils/abi.js +92 -0
- package/dist/utils/transaction.d.ts +5 -0
- package/dist/utils/transaction.js +48 -0
- package/dist/validation/InputValidator.d.ts +142 -0
- package/dist/validation/InputValidator.js +332 -0
- package/dist/validation/index.d.ts +4 -0
- package/dist/validation/index.js +4 -0
- package/dist/wasm/compiler/AbiLogic.d.ts +4 -0
- package/dist/wasm/compiler/AbiLogic.js +37 -0
- package/dist/wasm/compiler/AnalysisLogic.d.ts +6 -0
- package/dist/wasm/compiler/AnalysisLogic.js +61 -0
- package/dist/wasm/compiler/CompilationLogic.d.ts +10 -0
- package/dist/wasm/compiler/CompilationLogic.js +431 -0
- package/dist/wasm/compiler/FiveCompiler.d.ts +48 -0
- package/dist/wasm/compiler/FiveCompiler.js +183 -0
- package/dist/wasm/compiler/InfoLogic.d.ts +6 -0
- package/dist/wasm/compiler/InfoLogic.js +24 -0
- package/dist/wasm/compiler/OptimizationLogic.d.ts +2 -0
- package/dist/wasm/compiler/OptimizationLogic.js +13 -0
- package/dist/wasm/compiler/ValidationLogic.d.ts +7 -0
- package/dist/wasm/compiler/ValidationLogic.js +26 -0
- package/dist/wasm/compiler/index.d.ts +2 -0
- package/dist/wasm/compiler/index.js +2 -0
- package/dist/wasm/compiler/types.d.ts +8 -0
- package/dist/wasm/compiler/types.js +1 -0
- package/dist/wasm/compiler/utils.d.ts +8 -0
- package/dist/wasm/compiler/utils.js +75 -0
- package/dist/wasm/index.d.ts +9 -0
- package/dist/wasm/index.js +12 -0
- package/dist/wasm/instance.d.ts +1 -0
- package/dist/wasm/instance.js +26 -0
- package/dist/wasm/loader.d.ts +7 -0
- package/dist/wasm/loader.js +112 -0
- package/dist/wasm/vm.d.ts +33 -0
- package/dist/wasm/vm.js +250 -0
- package/package.json +59 -0
|
@@ -0,0 +1,3307 @@
|
|
|
1
|
+
let wasm;
|
|
2
|
+
export function __wbg_set_wasm(val) {
|
|
3
|
+
wasm = val;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
function addToExternrefTable0(obj) {
|
|
7
|
+
const idx = wasm.__externref_table_alloc();
|
|
8
|
+
wasm.__wbindgen_externrefs.set(idx, obj);
|
|
9
|
+
return idx;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function _assertClass(instance, klass) {
|
|
13
|
+
if (!(instance instanceof klass)) {
|
|
14
|
+
throw new Error(`expected instance of ${klass.name}`);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function debugString(val) {
|
|
19
|
+
// primitive types
|
|
20
|
+
const type = typeof val;
|
|
21
|
+
if (type == 'number' || type == 'boolean' || val == null) {
|
|
22
|
+
return `${val}`;
|
|
23
|
+
}
|
|
24
|
+
if (type == 'string') {
|
|
25
|
+
return `"${val}"`;
|
|
26
|
+
}
|
|
27
|
+
if (type == 'symbol') {
|
|
28
|
+
const description = val.description;
|
|
29
|
+
if (description == null) {
|
|
30
|
+
return 'Symbol';
|
|
31
|
+
} else {
|
|
32
|
+
return `Symbol(${description})`;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
if (type == 'function') {
|
|
36
|
+
const name = val.name;
|
|
37
|
+
if (typeof name == 'string' && name.length > 0) {
|
|
38
|
+
return `Function(${name})`;
|
|
39
|
+
} else {
|
|
40
|
+
return 'Function';
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
// objects
|
|
44
|
+
if (Array.isArray(val)) {
|
|
45
|
+
const length = val.length;
|
|
46
|
+
let debug = '[';
|
|
47
|
+
if (length > 0) {
|
|
48
|
+
debug += debugString(val[0]);
|
|
49
|
+
}
|
|
50
|
+
for(let i = 1; i < length; i++) {
|
|
51
|
+
debug += ', ' + debugString(val[i]);
|
|
52
|
+
}
|
|
53
|
+
debug += ']';
|
|
54
|
+
return debug;
|
|
55
|
+
}
|
|
56
|
+
// Test for built-in
|
|
57
|
+
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
58
|
+
let className;
|
|
59
|
+
if (builtInMatches && builtInMatches.length > 1) {
|
|
60
|
+
className = builtInMatches[1];
|
|
61
|
+
} else {
|
|
62
|
+
// Failed to match the standard '[object ClassName]'
|
|
63
|
+
return toString.call(val);
|
|
64
|
+
}
|
|
65
|
+
if (className == 'Object') {
|
|
66
|
+
// we're a user defined class or Object
|
|
67
|
+
// JSON.stringify avoids problems with cycles, and is generally much
|
|
68
|
+
// easier than looping through ownProperties of `val`.
|
|
69
|
+
try {
|
|
70
|
+
return 'Object(' + JSON.stringify(val) + ')';
|
|
71
|
+
} catch (_) {
|
|
72
|
+
return 'Object';
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
// errors
|
|
76
|
+
if (val instanceof Error) {
|
|
77
|
+
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
78
|
+
}
|
|
79
|
+
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
80
|
+
return className;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function getArrayJsValueFromWasm0(ptr, len) {
|
|
84
|
+
ptr = ptr >>> 0;
|
|
85
|
+
const mem = getDataViewMemory0();
|
|
86
|
+
const result = [];
|
|
87
|
+
for (let i = ptr; i < ptr + 4 * len; i += 4) {
|
|
88
|
+
result.push(wasm.__wbindgen_externrefs.get(mem.getUint32(i, true)));
|
|
89
|
+
}
|
|
90
|
+
wasm.__externref_drop_slice(ptr, len);
|
|
91
|
+
return result;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
95
|
+
ptr = ptr >>> 0;
|
|
96
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
let cachedDataViewMemory0 = null;
|
|
100
|
+
function getDataViewMemory0() {
|
|
101
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
102
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
103
|
+
}
|
|
104
|
+
return cachedDataViewMemory0;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
function getStringFromWasm0(ptr, len) {
|
|
108
|
+
ptr = ptr >>> 0;
|
|
109
|
+
return decodeText(ptr, len);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
let cachedUint8ArrayMemory0 = null;
|
|
113
|
+
function getUint8ArrayMemory0() {
|
|
114
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
115
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
116
|
+
}
|
|
117
|
+
return cachedUint8ArrayMemory0;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function handleError(f, args) {
|
|
121
|
+
try {
|
|
122
|
+
return f.apply(this, args);
|
|
123
|
+
} catch (e) {
|
|
124
|
+
const idx = addToExternrefTable0(e);
|
|
125
|
+
wasm.__wbindgen_exn_store(idx);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
function isLikeNone(x) {
|
|
130
|
+
return x === undefined || x === null;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
134
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
135
|
+
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
136
|
+
WASM_VECTOR_LEN = arg.length;
|
|
137
|
+
return ptr;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
141
|
+
if (realloc === undefined) {
|
|
142
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
143
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
144
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
145
|
+
WASM_VECTOR_LEN = buf.length;
|
|
146
|
+
return ptr;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
let len = arg.length;
|
|
150
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
151
|
+
|
|
152
|
+
const mem = getUint8ArrayMemory0();
|
|
153
|
+
|
|
154
|
+
let offset = 0;
|
|
155
|
+
|
|
156
|
+
for (; offset < len; offset++) {
|
|
157
|
+
const code = arg.charCodeAt(offset);
|
|
158
|
+
if (code > 0x7F) break;
|
|
159
|
+
mem[ptr + offset] = code;
|
|
160
|
+
}
|
|
161
|
+
if (offset !== len) {
|
|
162
|
+
if (offset !== 0) {
|
|
163
|
+
arg = arg.slice(offset);
|
|
164
|
+
}
|
|
165
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
166
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
167
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
168
|
+
|
|
169
|
+
offset += ret.written;
|
|
170
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
WASM_VECTOR_LEN = offset;
|
|
174
|
+
return ptr;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
function takeFromExternrefTable0(idx) {
|
|
178
|
+
const value = wasm.__wbindgen_externrefs.get(idx);
|
|
179
|
+
wasm.__externref_table_dealloc(idx);
|
|
180
|
+
return value;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
184
|
+
cachedTextDecoder.decode();
|
|
185
|
+
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
186
|
+
let numBytesDecoded = 0;
|
|
187
|
+
function decodeText(ptr, len) {
|
|
188
|
+
numBytesDecoded += len;
|
|
189
|
+
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
190
|
+
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
191
|
+
cachedTextDecoder.decode();
|
|
192
|
+
numBytesDecoded = len;
|
|
193
|
+
}
|
|
194
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
const cachedTextEncoder = new TextEncoder();
|
|
198
|
+
|
|
199
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
200
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
201
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
202
|
+
view.set(buf);
|
|
203
|
+
return {
|
|
204
|
+
read: arg.length,
|
|
205
|
+
written: buf.length
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
let WASM_VECTOR_LEN = 0;
|
|
211
|
+
|
|
212
|
+
function findWasmExport(predicate, description) {
|
|
213
|
+
for (const [name, value] of Object.entries(wasm)) {
|
|
214
|
+
if (typeof value === 'function' && predicate(name)) {
|
|
215
|
+
return value;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
throw new Error(`WASM export not found: ${description}`);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
const BytecodeAnalyzerFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
222
|
+
? { register: () => {}, unregister: () => {} }
|
|
223
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_bytecodeanalyzer_free(ptr >>> 0, 1));
|
|
224
|
+
|
|
225
|
+
const FiveVMStateFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
226
|
+
? { register: () => {}, unregister: () => {} }
|
|
227
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_fivevmstate_free(ptr >>> 0, 1));
|
|
228
|
+
|
|
229
|
+
const FiveVMWasmFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
230
|
+
? { register: () => {}, unregister: () => {} }
|
|
231
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_fivevmwasm_free(ptr >>> 0, 1));
|
|
232
|
+
|
|
233
|
+
const ParameterEncoderFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
234
|
+
? { register: () => {}, unregister: () => {} }
|
|
235
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_parameterencoder_free(ptr >>> 0, 1));
|
|
236
|
+
|
|
237
|
+
const TestResultFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
238
|
+
? { register: () => {}, unregister: () => {} }
|
|
239
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_testresult_free(ptr >>> 0, 1));
|
|
240
|
+
|
|
241
|
+
const VarintEncoderFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
242
|
+
? { register: () => {}, unregister: () => {} }
|
|
243
|
+
: new FinalizationRegistry(ptr => findWasmExport((name) => name.endsWith('_encoder_free') && !name.includes('parameter'), 'encoder free')(ptr >>> 0, 1));
|
|
244
|
+
|
|
245
|
+
const WasmAccountFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
246
|
+
? { register: () => {}, unregister: () => {} }
|
|
247
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmaccount_free(ptr >>> 0, 1));
|
|
248
|
+
|
|
249
|
+
const WasmAnalysisResultFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
250
|
+
? { register: () => {}, unregister: () => {} }
|
|
251
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmanalysisresult_free(ptr >>> 0, 1));
|
|
252
|
+
|
|
253
|
+
const WasmCompilationOptionsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
254
|
+
? { register: () => {}, unregister: () => {} }
|
|
255
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmcompilationoptions_free(ptr >>> 0, 1));
|
|
256
|
+
|
|
257
|
+
const WasmCompilationResultFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
258
|
+
? { register: () => {}, unregister: () => {} }
|
|
259
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmcompilationresult_free(ptr >>> 0, 1));
|
|
260
|
+
|
|
261
|
+
const WasmCompilationWithMetricsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
262
|
+
? { register: () => {}, unregister: () => {} }
|
|
263
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmcompilationwithmetrics_free(ptr >>> 0, 1));
|
|
264
|
+
|
|
265
|
+
const WasmCompilerErrorFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
266
|
+
? { register: () => {}, unregister: () => {} }
|
|
267
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmcompilererror_free(ptr >>> 0, 1));
|
|
268
|
+
|
|
269
|
+
const WasmEnhancedCompilationResultFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
270
|
+
? { register: () => {}, unregister: () => {} }
|
|
271
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmenhancedcompilationresult_free(ptr >>> 0, 1));
|
|
272
|
+
|
|
273
|
+
const WasmFiveCompilerFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
274
|
+
? { register: () => {}, unregister: () => {} }
|
|
275
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmfivecompiler_free(ptr >>> 0, 1));
|
|
276
|
+
|
|
277
|
+
const WasmMetricsCollectorFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
278
|
+
? { register: () => {}, unregister: () => {} }
|
|
279
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmmetricscollector_free(ptr >>> 0, 1));
|
|
280
|
+
|
|
281
|
+
const WasmSourceLocationFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
282
|
+
? { register: () => {}, unregister: () => {} }
|
|
283
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmsourcelocation_free(ptr >>> 0, 1));
|
|
284
|
+
|
|
285
|
+
const WasmSuggestionFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
286
|
+
? { register: () => {}, unregister: () => {} }
|
|
287
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmsuggestion_free(ptr >>> 0, 1));
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* Bytecode analyzer for WASM
|
|
291
|
+
*/
|
|
292
|
+
export class BytecodeAnalyzer {
|
|
293
|
+
__destroy_into_raw() {
|
|
294
|
+
const ptr = this.__wbg_ptr;
|
|
295
|
+
this.__wbg_ptr = 0;
|
|
296
|
+
BytecodeAnalyzerFinalization.unregister(this);
|
|
297
|
+
return ptr;
|
|
298
|
+
}
|
|
299
|
+
free() {
|
|
300
|
+
const ptr = this.__destroy_into_raw();
|
|
301
|
+
wasm.__wbg_bytecodeanalyzer_free(ptr, 0);
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* Analyze bytecode and return instruction breakdown (legacy method for compatibility)
|
|
305
|
+
* @param {Uint8Array} bytecode
|
|
306
|
+
* @returns {any}
|
|
307
|
+
*/
|
|
308
|
+
static analyze(bytecode) {
|
|
309
|
+
const ptr0 = passArray8ToWasm0(bytecode, wasm.__wbindgen_malloc);
|
|
310
|
+
const len0 = WASM_VECTOR_LEN;
|
|
311
|
+
const ret = wasm.bytecodeanalyzer_analyze(ptr0, len0);
|
|
312
|
+
if (ret[2]) {
|
|
313
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
314
|
+
}
|
|
315
|
+
return takeFromExternrefTable0(ret[0]);
|
|
316
|
+
}
|
|
317
|
+
/**
|
|
318
|
+
* Advanced semantic analysis with full opcode understanding and instruction flow
|
|
319
|
+
* This provides the intelligent analysis that understands what each opcode does
|
|
320
|
+
* and what operands follow each instruction.
|
|
321
|
+
* @param {Uint8Array} bytecode
|
|
322
|
+
* @returns {any}
|
|
323
|
+
*/
|
|
324
|
+
static analyze_semantic(bytecode) {
|
|
325
|
+
const ptr0 = passArray8ToWasm0(bytecode, wasm.__wbindgen_malloc);
|
|
326
|
+
const len0 = WASM_VECTOR_LEN;
|
|
327
|
+
const ret = wasm.bytecodeanalyzer_analyze_semantic(ptr0, len0);
|
|
328
|
+
if (ret[2]) {
|
|
329
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
330
|
+
}
|
|
331
|
+
return takeFromExternrefTable0(ret[0]);
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* Get detailed information about a specific instruction at an offset
|
|
335
|
+
* @param {Uint8Array} bytecode
|
|
336
|
+
* @param {number} offset
|
|
337
|
+
* @returns {any}
|
|
338
|
+
*/
|
|
339
|
+
static analyze_instruction_at(bytecode, offset) {
|
|
340
|
+
const ptr0 = passArray8ToWasm0(bytecode, wasm.__wbindgen_malloc);
|
|
341
|
+
const len0 = WASM_VECTOR_LEN;
|
|
342
|
+
const ret = wasm.bytecodeanalyzer_analyze_instruction_at(ptr0, len0, offset);
|
|
343
|
+
if (ret[2]) {
|
|
344
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
345
|
+
}
|
|
346
|
+
return takeFromExternrefTable0(ret[0]);
|
|
347
|
+
}
|
|
348
|
+
/**
|
|
349
|
+
* Get summary statistics about the bytecode
|
|
350
|
+
* @param {Uint8Array} bytecode
|
|
351
|
+
* @returns {any}
|
|
352
|
+
*/
|
|
353
|
+
static get_bytecode_summary(bytecode) {
|
|
354
|
+
const ptr0 = passArray8ToWasm0(bytecode, wasm.__wbindgen_malloc);
|
|
355
|
+
const len0 = WASM_VECTOR_LEN;
|
|
356
|
+
const ret = wasm.bytecodeanalyzer_get_bytecode_summary(ptr0, len0);
|
|
357
|
+
if (ret[2]) {
|
|
358
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
359
|
+
}
|
|
360
|
+
return takeFromExternrefTable0(ret[0]);
|
|
361
|
+
}
|
|
362
|
+
/**
|
|
363
|
+
* Get detailed opcode flow analysis - shows execution paths through the bytecode
|
|
364
|
+
* @param {Uint8Array} bytecode
|
|
365
|
+
* @returns {any}
|
|
366
|
+
*/
|
|
367
|
+
static analyze_execution_flow(bytecode) {
|
|
368
|
+
const ptr0 = passArray8ToWasm0(bytecode, wasm.__wbindgen_malloc);
|
|
369
|
+
const len0 = WASM_VECTOR_LEN;
|
|
370
|
+
const ret = wasm.bytecodeanalyzer_analyze_execution_flow(ptr0, len0);
|
|
371
|
+
if (ret[2]) {
|
|
372
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
373
|
+
}
|
|
374
|
+
return takeFromExternrefTable0(ret[0]);
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
if (Symbol.dispose) BytecodeAnalyzer.prototype[Symbol.dispose] = BytecodeAnalyzer.prototype.free;
|
|
378
|
+
|
|
379
|
+
/**
|
|
380
|
+
* Execution result that honestly reports what happened
|
|
381
|
+
* @enum {0 | 1 | 2 | 3 | 4 | 5 | 6}
|
|
382
|
+
*/
|
|
383
|
+
export const ExecutionStatus = Object.freeze({
|
|
384
|
+
/**
|
|
385
|
+
* All operations completed successfully
|
|
386
|
+
*/
|
|
387
|
+
Completed: 0, "0": "Completed",
|
|
388
|
+
/**
|
|
389
|
+
* Execution stopped because it hit a system program call that cannot be executed in WASM
|
|
390
|
+
*/
|
|
391
|
+
StoppedAtSystemCall: 1, "1": "StoppedAtSystemCall",
|
|
392
|
+
/**
|
|
393
|
+
* Execution stopped because it hit an INIT_PDA operation that requires real Solana context
|
|
394
|
+
*/
|
|
395
|
+
StoppedAtInitPDA: 2, "2": "StoppedAtInitPDA",
|
|
396
|
+
/**
|
|
397
|
+
* Execution stopped because it hit an INVOKE operation that requires real RPC
|
|
398
|
+
*/
|
|
399
|
+
StoppedAtInvoke: 3, "3": "StoppedAtInvoke",
|
|
400
|
+
/**
|
|
401
|
+
* Execution stopped because it hit an INVOKE_SIGNED operation that requires real RPC
|
|
402
|
+
*/
|
|
403
|
+
StoppedAtInvokeSigned: 4, "4": "StoppedAtInvokeSigned",
|
|
404
|
+
/**
|
|
405
|
+
* Execution stopped because compute limit was reached
|
|
406
|
+
*/
|
|
407
|
+
ComputeLimitExceeded: 5, "5": "ComputeLimitExceeded",
|
|
408
|
+
/**
|
|
409
|
+
* Execution failed due to an error
|
|
410
|
+
*/
|
|
411
|
+
Failed: 6, "6": "Failed",
|
|
412
|
+
});
|
|
413
|
+
|
|
414
|
+
/**
|
|
415
|
+
* JavaScript-compatible VM state representation
|
|
416
|
+
*/
|
|
417
|
+
export class FiveVMState {
|
|
418
|
+
__destroy_into_raw() {
|
|
419
|
+
const ptr = this.__wbg_ptr;
|
|
420
|
+
this.__wbg_ptr = 0;
|
|
421
|
+
FiveVMStateFinalization.unregister(this);
|
|
422
|
+
return ptr;
|
|
423
|
+
}
|
|
424
|
+
free() {
|
|
425
|
+
const ptr = this.__destroy_into_raw();
|
|
426
|
+
wasm.__wbg_fivevmstate_free(ptr, 0);
|
|
427
|
+
}
|
|
428
|
+
/**
|
|
429
|
+
* @returns {Array<any>}
|
|
430
|
+
*/
|
|
431
|
+
get stack() {
|
|
432
|
+
const ret = wasm.fivevmstate_stack(this.__wbg_ptr);
|
|
433
|
+
return ret;
|
|
434
|
+
}
|
|
435
|
+
/**
|
|
436
|
+
* @returns {number}
|
|
437
|
+
*/
|
|
438
|
+
get instruction_pointer() {
|
|
439
|
+
const ret = wasm.fivevmstate_instruction_pointer(this.__wbg_ptr);
|
|
440
|
+
return ret >>> 0;
|
|
441
|
+
}
|
|
442
|
+
/**
|
|
443
|
+
* @returns {bigint}
|
|
444
|
+
*/
|
|
445
|
+
get compute_units() {
|
|
446
|
+
const ret = wasm.fivevmstate_compute_units(this.__wbg_ptr);
|
|
447
|
+
return BigInt.asUintN(64, ret);
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
if (Symbol.dispose) FiveVMState.prototype[Symbol.dispose] = FiveVMState.prototype.free;
|
|
451
|
+
|
|
452
|
+
/**
|
|
453
|
+
* Main WASM VM wrapper
|
|
454
|
+
*/
|
|
455
|
+
export class FiveVMWasm {
|
|
456
|
+
__destroy_into_raw() {
|
|
457
|
+
const ptr = this.__wbg_ptr;
|
|
458
|
+
this.__wbg_ptr = 0;
|
|
459
|
+
FiveVMWasmFinalization.unregister(this);
|
|
460
|
+
return ptr;
|
|
461
|
+
}
|
|
462
|
+
free() {
|
|
463
|
+
const ptr = this.__destroy_into_raw();
|
|
464
|
+
wasm.__wbg_fivevmwasm_free(ptr, 0);
|
|
465
|
+
}
|
|
466
|
+
/**
|
|
467
|
+
* Create new VM instance with bytecode
|
|
468
|
+
* @param {Uint8Array} _bytecode
|
|
469
|
+
*/
|
|
470
|
+
constructor(_bytecode) {
|
|
471
|
+
const ptr0 = passArray8ToWasm0(_bytecode, wasm.__wbindgen_malloc);
|
|
472
|
+
const len0 = WASM_VECTOR_LEN;
|
|
473
|
+
const ret = wasm.fivevmwasm_new(ptr0, len0);
|
|
474
|
+
if (ret[2]) {
|
|
475
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
476
|
+
}
|
|
477
|
+
this.__wbg_ptr = ret[0] >>> 0;
|
|
478
|
+
FiveVMWasmFinalization.register(this, this.__wbg_ptr, this);
|
|
479
|
+
return this;
|
|
480
|
+
}
|
|
481
|
+
/**
|
|
482
|
+
* Execute VM with input data and accounts (legacy method)
|
|
483
|
+
* @param {Uint8Array} input_data
|
|
484
|
+
* @param {Array<any>} accounts
|
|
485
|
+
* @returns {any}
|
|
486
|
+
*/
|
|
487
|
+
execute(input_data, accounts) {
|
|
488
|
+
const ptr0 = passArray8ToWasm0(input_data, wasm.__wbindgen_malloc);
|
|
489
|
+
const len0 = WASM_VECTOR_LEN;
|
|
490
|
+
const ret = wasm.fivevmwasm_execute(this.__wbg_ptr, ptr0, len0, accounts);
|
|
491
|
+
if (ret[2]) {
|
|
492
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
493
|
+
}
|
|
494
|
+
return takeFromExternrefTable0(ret[0]);
|
|
495
|
+
}
|
|
496
|
+
/**
|
|
497
|
+
* Execute VM with partial execution support - stops at system calls
|
|
498
|
+
* @param {Uint8Array} input_data
|
|
499
|
+
* @param {Array<any>} accounts
|
|
500
|
+
* @returns {TestResult}
|
|
501
|
+
*/
|
|
502
|
+
execute_partial(input_data, accounts) {
|
|
503
|
+
const ptr0 = passArray8ToWasm0(input_data, wasm.__wbindgen_malloc);
|
|
504
|
+
const len0 = WASM_VECTOR_LEN;
|
|
505
|
+
const ret = wasm.fivevmwasm_execute_partial(this.__wbg_ptr, ptr0, len0, accounts);
|
|
506
|
+
if (ret[2]) {
|
|
507
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
508
|
+
}
|
|
509
|
+
return TestResult.__wrap(ret[0]);
|
|
510
|
+
}
|
|
511
|
+
/**
|
|
512
|
+
* Get current VM state
|
|
513
|
+
* @returns {any}
|
|
514
|
+
*/
|
|
515
|
+
get_state() {
|
|
516
|
+
const ret = wasm.fivevmwasm_get_state(this.__wbg_ptr);
|
|
517
|
+
if (ret[2]) {
|
|
518
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
519
|
+
}
|
|
520
|
+
return takeFromExternrefTable0(ret[0]);
|
|
521
|
+
}
|
|
522
|
+
/**
|
|
523
|
+
* Validate bytecode without execution
|
|
524
|
+
* @param {Uint8Array} bytecode
|
|
525
|
+
* @returns {boolean}
|
|
526
|
+
*/
|
|
527
|
+
static validate_bytecode(bytecode) {
|
|
528
|
+
const ptr0 = passArray8ToWasm0(bytecode, wasm.__wbindgen_malloc);
|
|
529
|
+
const len0 = WASM_VECTOR_LEN;
|
|
530
|
+
const ret = wasm.fivevmwasm_validate_bytecode(ptr0, len0);
|
|
531
|
+
if (ret[2]) {
|
|
532
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
533
|
+
}
|
|
534
|
+
return ret[0] !== 0;
|
|
535
|
+
}
|
|
536
|
+
/**
|
|
537
|
+
* Get VM constants for JavaScript
|
|
538
|
+
* @returns {any}
|
|
539
|
+
*/
|
|
540
|
+
static get_constants() {
|
|
541
|
+
const ret = wasm.fivevmwasm_get_constants();
|
|
542
|
+
return ret;
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
if (Symbol.dispose) FiveVMWasm.prototype[Symbol.dispose] = FiveVMWasm.prototype.free;
|
|
546
|
+
|
|
547
|
+
/**
|
|
548
|
+
* Parameter encoding utilities using varint and protocol types
|
|
549
|
+
*/
|
|
550
|
+
export class ParameterEncoder {
|
|
551
|
+
__destroy_into_raw() {
|
|
552
|
+
const ptr = this.__wbg_ptr;
|
|
553
|
+
this.__wbg_ptr = 0;
|
|
554
|
+
ParameterEncoderFinalization.unregister(this);
|
|
555
|
+
return ptr;
|
|
556
|
+
}
|
|
557
|
+
free() {
|
|
558
|
+
const ptr = this.__destroy_into_raw();
|
|
559
|
+
wasm.__wbg_parameterencoder_free(ptr, 0);
|
|
560
|
+
}
|
|
561
|
+
/**
|
|
562
|
+
* Encode function parameters using varint compression
|
|
563
|
+
* Returns ONLY parameter data - SDK handles discriminator AND function index
|
|
564
|
+
* Each parameter value is varint-encoded regardless of its declared type for maximum compression
|
|
565
|
+
* @param {number} _function_index
|
|
566
|
+
* @param {Array<any>} params
|
|
567
|
+
* @returns {Uint8Array}
|
|
568
|
+
*/
|
|
569
|
+
static encode_execute(_function_index, params) {
|
|
570
|
+
const ret = findWasmExport((name) => name.startsWith('parameterencoder_encode_execute_'), 'parameter encode execute')(_function_index, params);
|
|
571
|
+
if (ret[2]) {
|
|
572
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
573
|
+
}
|
|
574
|
+
return takeFromExternrefTable0(ret[0]);
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
if (Symbol.dispose) ParameterEncoder.prototype[Symbol.dispose] = ParameterEncoder.prototype.free;
|
|
578
|
+
|
|
579
|
+
/**
|
|
580
|
+
* Detailed execution result that provides full context
|
|
581
|
+
*/
|
|
582
|
+
export class TestResult {
|
|
583
|
+
static __wrap(ptr) {
|
|
584
|
+
ptr = ptr >>> 0;
|
|
585
|
+
const obj = Object.create(TestResult.prototype);
|
|
586
|
+
obj.__wbg_ptr = ptr;
|
|
587
|
+
TestResultFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
588
|
+
return obj;
|
|
589
|
+
}
|
|
590
|
+
__destroy_into_raw() {
|
|
591
|
+
const ptr = this.__wbg_ptr;
|
|
592
|
+
this.__wbg_ptr = 0;
|
|
593
|
+
TestResultFinalization.unregister(this);
|
|
594
|
+
return ptr;
|
|
595
|
+
}
|
|
596
|
+
free() {
|
|
597
|
+
const ptr = this.__destroy_into_raw();
|
|
598
|
+
wasm.__wbg_testresult_free(ptr, 0);
|
|
599
|
+
}
|
|
600
|
+
/**
|
|
601
|
+
* Compute units consumed
|
|
602
|
+
* @returns {bigint}
|
|
603
|
+
*/
|
|
604
|
+
get compute_units_used() {
|
|
605
|
+
const ret = wasm.__wbg_get_testresult_compute_units_used(this.__wbg_ptr);
|
|
606
|
+
return BigInt.asUintN(64, ret);
|
|
607
|
+
}
|
|
608
|
+
/**
|
|
609
|
+
* Compute units consumed
|
|
610
|
+
* @param {bigint} arg0
|
|
611
|
+
*/
|
|
612
|
+
set compute_units_used(arg0) {
|
|
613
|
+
wasm.__wbg_set_testresult_compute_units_used(this.__wbg_ptr, arg0);
|
|
614
|
+
}
|
|
615
|
+
/**
|
|
616
|
+
* Final instruction pointer
|
|
617
|
+
* @returns {number}
|
|
618
|
+
*/
|
|
619
|
+
get instruction_pointer() {
|
|
620
|
+
const ret = wasm.__wbg_get_testresult_instruction_pointer(this.__wbg_ptr);
|
|
621
|
+
return ret >>> 0;
|
|
622
|
+
}
|
|
623
|
+
/**
|
|
624
|
+
* Final instruction pointer
|
|
625
|
+
* @param {number} arg0
|
|
626
|
+
*/
|
|
627
|
+
set instruction_pointer(arg0) {
|
|
628
|
+
wasm.__wbg_set_testresult_instruction_pointer(this.__wbg_ptr, arg0);
|
|
629
|
+
}
|
|
630
|
+
/**
|
|
631
|
+
* Which opcode caused the stop (if stopped at system call)
|
|
632
|
+
* @returns {number | undefined}
|
|
633
|
+
*/
|
|
634
|
+
get stopped_at_opcode() {
|
|
635
|
+
const ret = wasm.__wbg_get_testresult_stopped_at_opcode(this.__wbg_ptr);
|
|
636
|
+
return ret === 0xFFFFFF ? undefined : ret;
|
|
637
|
+
}
|
|
638
|
+
/**
|
|
639
|
+
* Which opcode caused the stop (if stopped at system call)
|
|
640
|
+
* @param {number | null} [arg0]
|
|
641
|
+
*/
|
|
642
|
+
set stopped_at_opcode(arg0) {
|
|
643
|
+
wasm.__wbg_set_testresult_stopped_at_opcode(this.__wbg_ptr, isLikeNone(arg0) ? 0xFFFFFF : arg0);
|
|
644
|
+
}
|
|
645
|
+
/**
|
|
646
|
+
* @returns {string}
|
|
647
|
+
*/
|
|
648
|
+
get status() {
|
|
649
|
+
let deferred1_0;
|
|
650
|
+
let deferred1_1;
|
|
651
|
+
try {
|
|
652
|
+
const ret = wasm.testresult_status(this.__wbg_ptr);
|
|
653
|
+
deferred1_0 = ret[0];
|
|
654
|
+
deferred1_1 = ret[1];
|
|
655
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
656
|
+
} finally {
|
|
657
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
/**
|
|
661
|
+
* @returns {boolean}
|
|
662
|
+
*/
|
|
663
|
+
get has_result_value() {
|
|
664
|
+
const ret = wasm.testresult_has_result_value(this.__wbg_ptr);
|
|
665
|
+
return ret !== 0;
|
|
666
|
+
}
|
|
667
|
+
/**
|
|
668
|
+
* @returns {any}
|
|
669
|
+
*/
|
|
670
|
+
get get_result_value() {
|
|
671
|
+
const ret = wasm.testresult_get_result_value(this.__wbg_ptr);
|
|
672
|
+
return ret;
|
|
673
|
+
}
|
|
674
|
+
/**
|
|
675
|
+
* @returns {Array<any>}
|
|
676
|
+
*/
|
|
677
|
+
get final_stack() {
|
|
678
|
+
const ret = wasm.testresult_final_stack(this.__wbg_ptr);
|
|
679
|
+
return ret;
|
|
680
|
+
}
|
|
681
|
+
/**
|
|
682
|
+
* @returns {Uint8Array}
|
|
683
|
+
*/
|
|
684
|
+
get final_memory() {
|
|
685
|
+
const ret = wasm.testresult_final_memory(this.__wbg_ptr);
|
|
686
|
+
return ret;
|
|
687
|
+
}
|
|
688
|
+
/**
|
|
689
|
+
* @returns {Array<any>}
|
|
690
|
+
*/
|
|
691
|
+
get final_accounts() {
|
|
692
|
+
const ret = wasm.testresult_final_accounts(this.__wbg_ptr);
|
|
693
|
+
return ret;
|
|
694
|
+
}
|
|
695
|
+
/**
|
|
696
|
+
* @returns {string | undefined}
|
|
697
|
+
*/
|
|
698
|
+
get error_message() {
|
|
699
|
+
const ret = wasm.testresult_error_message(this.__wbg_ptr);
|
|
700
|
+
let v1;
|
|
701
|
+
if (ret[0] !== 0) {
|
|
702
|
+
v1 = getStringFromWasm0(ret[0], ret[1]).slice();
|
|
703
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
704
|
+
}
|
|
705
|
+
return v1;
|
|
706
|
+
}
|
|
707
|
+
/**
|
|
708
|
+
* @returns {string | undefined}
|
|
709
|
+
*/
|
|
710
|
+
get execution_context() {
|
|
711
|
+
const ret = wasm.testresult_execution_context(this.__wbg_ptr);
|
|
712
|
+
let v1;
|
|
713
|
+
if (ret[0] !== 0) {
|
|
714
|
+
v1 = getStringFromWasm0(ret[0], ret[1]).slice();
|
|
715
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
716
|
+
}
|
|
717
|
+
return v1;
|
|
718
|
+
}
|
|
719
|
+
/**
|
|
720
|
+
* @returns {string | undefined}
|
|
721
|
+
*/
|
|
722
|
+
get stopped_at_opcode_name() {
|
|
723
|
+
const ret = wasm.testresult_stopped_at_opcode_name(this.__wbg_ptr);
|
|
724
|
+
let v1;
|
|
725
|
+
if (ret[0] !== 0) {
|
|
726
|
+
v1 = getStringFromWasm0(ret[0], ret[1]).slice();
|
|
727
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
728
|
+
}
|
|
729
|
+
return v1;
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
if (Symbol.dispose) TestResult.prototype[Symbol.dispose] = TestResult.prototype.free;
|
|
733
|
+
|
|
734
|
+
/**
|
|
735
|
+
* Varint encoding utilities for JavaScript
|
|
736
|
+
*/
|
|
737
|
+
export class VarintEncoder {
|
|
738
|
+
__destroy_into_raw() {
|
|
739
|
+
const ptr = this.__wbg_ptr;
|
|
740
|
+
this.__wbg_ptr = 0;
|
|
741
|
+
VarintEncoderFinalization.unregister(this);
|
|
742
|
+
return ptr;
|
|
743
|
+
}
|
|
744
|
+
free() {
|
|
745
|
+
const ptr = this.__destroy_into_raw();
|
|
746
|
+
findWasmExport((name) => name.endsWith('_encoder_free') && !name.includes('parameter'), 'encoder free')(ptr, 0);
|
|
747
|
+
}
|
|
748
|
+
/**
|
|
749
|
+
* Encode a u32 value using Variable-Length Encoding
|
|
750
|
+
* Returns [size, byte1, byte2, byte3] where size is 1-3
|
|
751
|
+
* @param {number} value
|
|
752
|
+
* @returns {Array<any>}
|
|
753
|
+
*/
|
|
754
|
+
static encode_u32(value) {
|
|
755
|
+
const ret = findWasmExport((name) => name.endsWith('encoder_encode_u32'), 'encoder encode_u32')(value);
|
|
756
|
+
return ret;
|
|
757
|
+
}
|
|
758
|
+
/**
|
|
759
|
+
* Encode a u16 value using Variable-Length Encoding
|
|
760
|
+
* Returns [size, byte1, byte2] where size is 1-2
|
|
761
|
+
* @param {number} value
|
|
762
|
+
* @returns {Array<any>}
|
|
763
|
+
*/
|
|
764
|
+
static encode_u16(value) {
|
|
765
|
+
const ret = findWasmExport((name) => name.endsWith('encoder_encode_u16'), 'encoder encode_u16')(value);
|
|
766
|
+
return ret;
|
|
767
|
+
}
|
|
768
|
+
/**
|
|
769
|
+
* Decode a u32 value from Variable-Length Encoding
|
|
770
|
+
* Returns [value, bytes_consumed] or null if invalid
|
|
771
|
+
* @param {Uint8Array} bytes
|
|
772
|
+
* @returns {Array<any> | undefined}
|
|
773
|
+
*/
|
|
774
|
+
static decode_u32(bytes) {
|
|
775
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
776
|
+
const len0 = WASM_VECTOR_LEN;
|
|
777
|
+
const ret = findWasmExport((name) => name.endsWith('encoder_decode_u32'), 'encoder decode_u32')(ptr0, len0);
|
|
778
|
+
return ret;
|
|
779
|
+
}
|
|
780
|
+
/**
|
|
781
|
+
* Decode a u16 value from Variable-Length Encoding
|
|
782
|
+
* Returns [value, bytes_consumed] or null if invalid
|
|
783
|
+
* @param {Uint8Array} bytes
|
|
784
|
+
* @returns {Array<any> | undefined}
|
|
785
|
+
*/
|
|
786
|
+
static decode_u16(bytes) {
|
|
787
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
788
|
+
const len0 = WASM_VECTOR_LEN;
|
|
789
|
+
const ret = findWasmExport((name) => name.endsWith('encoder_decode_u16'), 'encoder decode_u16')(ptr0, len0);
|
|
790
|
+
return ret;
|
|
791
|
+
}
|
|
792
|
+
/**
|
|
793
|
+
* Calculate encoded size without encoding
|
|
794
|
+
* @param {number} value
|
|
795
|
+
* @returns {number}
|
|
796
|
+
*/
|
|
797
|
+
static encoded_size_u32(value) {
|
|
798
|
+
const ret = findWasmExport((name) => name.endsWith('encoder_encoded_size_u32'), 'encoder encoded_size_u32')(value);
|
|
799
|
+
return ret >>> 0;
|
|
800
|
+
}
|
|
801
|
+
/**
|
|
802
|
+
* Calculate encoded size for u16
|
|
803
|
+
* @param {number} value
|
|
804
|
+
* @returns {number}
|
|
805
|
+
*/
|
|
806
|
+
static encoded_size_u16(value) {
|
|
807
|
+
const ret = findWasmExport((name) => name.endsWith('encoder_encoded_size_u16'), 'encoder encoded_size_u16')(value);
|
|
808
|
+
return ret >>> 0;
|
|
809
|
+
}
|
|
810
|
+
}
|
|
811
|
+
if (Symbol.dispose) VarintEncoder.prototype[Symbol.dispose] = VarintEncoder.prototype.free;
|
|
812
|
+
|
|
813
|
+
/**
|
|
814
|
+
* JavaScript-compatible account representation
|
|
815
|
+
*/
|
|
816
|
+
export class WasmAccount {
|
|
817
|
+
__destroy_into_raw() {
|
|
818
|
+
const ptr = this.__wbg_ptr;
|
|
819
|
+
this.__wbg_ptr = 0;
|
|
820
|
+
WasmAccountFinalization.unregister(this);
|
|
821
|
+
return ptr;
|
|
822
|
+
}
|
|
823
|
+
free() {
|
|
824
|
+
const ptr = this.__destroy_into_raw();
|
|
825
|
+
wasm.__wbg_wasmaccount_free(ptr, 0);
|
|
826
|
+
}
|
|
827
|
+
/**
|
|
828
|
+
* @returns {bigint}
|
|
829
|
+
*/
|
|
830
|
+
get lamports() {
|
|
831
|
+
const ret = wasm.__wbg_get_wasmaccount_lamports(this.__wbg_ptr);
|
|
832
|
+
return BigInt.asUintN(64, ret);
|
|
833
|
+
}
|
|
834
|
+
/**
|
|
835
|
+
* @param {bigint} arg0
|
|
836
|
+
*/
|
|
837
|
+
set lamports(arg0) {
|
|
838
|
+
wasm.__wbg_set_wasmaccount_lamports(this.__wbg_ptr, arg0);
|
|
839
|
+
}
|
|
840
|
+
/**
|
|
841
|
+
* @returns {boolean}
|
|
842
|
+
*/
|
|
843
|
+
get is_writable() {
|
|
844
|
+
const ret = wasm.__wbg_get_wasmaccount_is_writable(this.__wbg_ptr);
|
|
845
|
+
return ret !== 0;
|
|
846
|
+
}
|
|
847
|
+
/**
|
|
848
|
+
* @param {boolean} arg0
|
|
849
|
+
*/
|
|
850
|
+
set is_writable(arg0) {
|
|
851
|
+
wasm.__wbg_set_wasmaccount_is_writable(this.__wbg_ptr, arg0);
|
|
852
|
+
}
|
|
853
|
+
/**
|
|
854
|
+
* @returns {boolean}
|
|
855
|
+
*/
|
|
856
|
+
get is_signer() {
|
|
857
|
+
const ret = wasm.__wbg_get_wasmaccount_is_signer(this.__wbg_ptr);
|
|
858
|
+
return ret !== 0;
|
|
859
|
+
}
|
|
860
|
+
/**
|
|
861
|
+
* @param {boolean} arg0
|
|
862
|
+
*/
|
|
863
|
+
set is_signer(arg0) {
|
|
864
|
+
wasm.__wbg_set_wasmaccount_is_signer(this.__wbg_ptr, arg0);
|
|
865
|
+
}
|
|
866
|
+
/**
|
|
867
|
+
* @param {Uint8Array} key
|
|
868
|
+
* @param {Uint8Array} data
|
|
869
|
+
* @param {bigint} lamports
|
|
870
|
+
* @param {boolean} is_writable
|
|
871
|
+
* @param {boolean} is_signer
|
|
872
|
+
* @param {Uint8Array} owner
|
|
873
|
+
*/
|
|
874
|
+
constructor(key, data, lamports, is_writable, is_signer, owner) {
|
|
875
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
876
|
+
const len0 = WASM_VECTOR_LEN;
|
|
877
|
+
const ptr1 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
878
|
+
const len1 = WASM_VECTOR_LEN;
|
|
879
|
+
const ptr2 = passArray8ToWasm0(owner, wasm.__wbindgen_malloc);
|
|
880
|
+
const len2 = WASM_VECTOR_LEN;
|
|
881
|
+
const ret = wasm.wasmaccount_new(ptr0, len0, ptr1, len1, lamports, is_writable, is_signer, ptr2, len2);
|
|
882
|
+
if (ret[2]) {
|
|
883
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
884
|
+
}
|
|
885
|
+
this.__wbg_ptr = ret[0] >>> 0;
|
|
886
|
+
WasmAccountFinalization.register(this, this.__wbg_ptr, this);
|
|
887
|
+
return this;
|
|
888
|
+
}
|
|
889
|
+
/**
|
|
890
|
+
* @returns {Uint8Array}
|
|
891
|
+
*/
|
|
892
|
+
get key() {
|
|
893
|
+
const ret = wasm.wasmaccount_key(this.__wbg_ptr);
|
|
894
|
+
return ret;
|
|
895
|
+
}
|
|
896
|
+
/**
|
|
897
|
+
* @returns {Uint8Array}
|
|
898
|
+
*/
|
|
899
|
+
get data() {
|
|
900
|
+
const ret = wasm.wasmaccount_data(this.__wbg_ptr);
|
|
901
|
+
return ret;
|
|
902
|
+
}
|
|
903
|
+
/**
|
|
904
|
+
* @param {Uint8Array} data
|
|
905
|
+
*/
|
|
906
|
+
set data(data) {
|
|
907
|
+
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
908
|
+
const len0 = WASM_VECTOR_LEN;
|
|
909
|
+
wasm.wasmaccount_set_data(this.__wbg_ptr, ptr0, len0);
|
|
910
|
+
}
|
|
911
|
+
/**
|
|
912
|
+
* @returns {Uint8Array}
|
|
913
|
+
*/
|
|
914
|
+
get owner() {
|
|
915
|
+
const ret = wasm.wasmaccount_owner(this.__wbg_ptr);
|
|
916
|
+
return ret;
|
|
917
|
+
}
|
|
918
|
+
}
|
|
919
|
+
if (Symbol.dispose) WasmAccount.prototype[Symbol.dispose] = WasmAccount.prototype.free;
|
|
920
|
+
|
|
921
|
+
/**
|
|
922
|
+
* WASM source analysis result
|
|
923
|
+
*/
|
|
924
|
+
export class WasmAnalysisResult {
|
|
925
|
+
static __wrap(ptr) {
|
|
926
|
+
ptr = ptr >>> 0;
|
|
927
|
+
const obj = Object.create(WasmAnalysisResult.prototype);
|
|
928
|
+
obj.__wbg_ptr = ptr;
|
|
929
|
+
WasmAnalysisResultFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
930
|
+
return obj;
|
|
931
|
+
}
|
|
932
|
+
__destroy_into_raw() {
|
|
933
|
+
const ptr = this.__wbg_ptr;
|
|
934
|
+
this.__wbg_ptr = 0;
|
|
935
|
+
WasmAnalysisResultFinalization.unregister(this);
|
|
936
|
+
return ptr;
|
|
937
|
+
}
|
|
938
|
+
free() {
|
|
939
|
+
const ptr = this.__destroy_into_raw();
|
|
940
|
+
wasm.__wbg_wasmanalysisresult_free(ptr, 0);
|
|
941
|
+
}
|
|
942
|
+
/**
|
|
943
|
+
* Whether analysis succeeded
|
|
944
|
+
* @returns {boolean}
|
|
945
|
+
*/
|
|
946
|
+
get success() {
|
|
947
|
+
const ret = wasm.__wbg_get_wasmanalysisresult_success(this.__wbg_ptr);
|
|
948
|
+
return ret !== 0;
|
|
949
|
+
}
|
|
950
|
+
/**
|
|
951
|
+
* Whether analysis succeeded
|
|
952
|
+
* @param {boolean} arg0
|
|
953
|
+
*/
|
|
954
|
+
set success(arg0) {
|
|
955
|
+
wasm.__wbg_set_wasmanalysisresult_success(this.__wbg_ptr, arg0);
|
|
956
|
+
}
|
|
957
|
+
/**
|
|
958
|
+
* Analysis time in milliseconds
|
|
959
|
+
* @returns {number}
|
|
960
|
+
*/
|
|
961
|
+
get analysis_time() {
|
|
962
|
+
const ret = wasm.__wbg_get_wasmanalysisresult_analysis_time(this.__wbg_ptr);
|
|
963
|
+
return ret;
|
|
964
|
+
}
|
|
965
|
+
/**
|
|
966
|
+
* Analysis time in milliseconds
|
|
967
|
+
* @param {number} arg0
|
|
968
|
+
*/
|
|
969
|
+
set analysis_time(arg0) {
|
|
970
|
+
wasm.__wbg_set_wasmanalysisresult_analysis_time(this.__wbg_ptr, arg0);
|
|
971
|
+
}
|
|
972
|
+
/**
|
|
973
|
+
* @returns {string}
|
|
974
|
+
*/
|
|
975
|
+
get summary() {
|
|
976
|
+
let deferred1_0;
|
|
977
|
+
let deferred1_1;
|
|
978
|
+
try {
|
|
979
|
+
const ret = wasm.wasmanalysisresult_summary(this.__wbg_ptr);
|
|
980
|
+
deferred1_0 = ret[0];
|
|
981
|
+
deferred1_1 = ret[1];
|
|
982
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
983
|
+
} finally {
|
|
984
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
985
|
+
}
|
|
986
|
+
}
|
|
987
|
+
/**
|
|
988
|
+
* @returns {string}
|
|
989
|
+
*/
|
|
990
|
+
get metrics() {
|
|
991
|
+
let deferred1_0;
|
|
992
|
+
let deferred1_1;
|
|
993
|
+
try {
|
|
994
|
+
const ret = wasm.wasmanalysisresult_metrics(this.__wbg_ptr);
|
|
995
|
+
deferred1_0 = ret[0];
|
|
996
|
+
deferred1_1 = ret[1];
|
|
997
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
998
|
+
} finally {
|
|
999
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1000
|
+
}
|
|
1001
|
+
}
|
|
1002
|
+
/**
|
|
1003
|
+
* @returns {Array<any>}
|
|
1004
|
+
*/
|
|
1005
|
+
get errors() {
|
|
1006
|
+
const ret = wasm.wasmanalysisresult_errors(this.__wbg_ptr);
|
|
1007
|
+
return ret;
|
|
1008
|
+
}
|
|
1009
|
+
/**
|
|
1010
|
+
* Get parsed metrics as JavaScript object
|
|
1011
|
+
* @returns {any}
|
|
1012
|
+
*/
|
|
1013
|
+
get_metrics_object() {
|
|
1014
|
+
const ret = wasm.wasmanalysisresult_get_metrics_object(this.__wbg_ptr);
|
|
1015
|
+
if (ret[2]) {
|
|
1016
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1017
|
+
}
|
|
1018
|
+
return takeFromExternrefTable0(ret[0]);
|
|
1019
|
+
}
|
|
1020
|
+
}
|
|
1021
|
+
if (Symbol.dispose) WasmAnalysisResult.prototype[Symbol.dispose] = WasmAnalysisResult.prototype.free;
|
|
1022
|
+
|
|
1023
|
+
/**
|
|
1024
|
+
* Compilation options for enhanced error reporting and formatting
|
|
1025
|
+
*/
|
|
1026
|
+
export class WasmCompilationOptions {
|
|
1027
|
+
static __wrap(ptr) {
|
|
1028
|
+
ptr = ptr >>> 0;
|
|
1029
|
+
const obj = Object.create(WasmCompilationOptions.prototype);
|
|
1030
|
+
obj.__wbg_ptr = ptr;
|
|
1031
|
+
WasmCompilationOptionsFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1032
|
+
return obj;
|
|
1033
|
+
}
|
|
1034
|
+
__destroy_into_raw() {
|
|
1035
|
+
const ptr = this.__wbg_ptr;
|
|
1036
|
+
this.__wbg_ptr = 0;
|
|
1037
|
+
WasmCompilationOptionsFinalization.unregister(this);
|
|
1038
|
+
return ptr;
|
|
1039
|
+
}
|
|
1040
|
+
free() {
|
|
1041
|
+
const ptr = this.__destroy_into_raw();
|
|
1042
|
+
wasm.__wbg_wasmcompilationoptions_free(ptr, 0);
|
|
1043
|
+
}
|
|
1044
|
+
/**
|
|
1045
|
+
* Enable v2-preview features (nibble immediates, BR_EQ_U8, etc.)
|
|
1046
|
+
* @returns {boolean}
|
|
1047
|
+
*/
|
|
1048
|
+
get v2_preview() {
|
|
1049
|
+
const ret = wasm.__wbg_get_wasmcompilationoptions_v2_preview(this.__wbg_ptr);
|
|
1050
|
+
return ret !== 0;
|
|
1051
|
+
}
|
|
1052
|
+
/**
|
|
1053
|
+
* Enable v2-preview features (nibble immediates, BR_EQ_U8, etc.)
|
|
1054
|
+
* @param {boolean} arg0
|
|
1055
|
+
*/
|
|
1056
|
+
set v2_preview(arg0) {
|
|
1057
|
+
wasm.__wbg_set_wasmcompilationoptions_v2_preview(this.__wbg_ptr, arg0);
|
|
1058
|
+
}
|
|
1059
|
+
/**
|
|
1060
|
+
* Enable constraint caching optimization
|
|
1061
|
+
* @returns {boolean}
|
|
1062
|
+
*/
|
|
1063
|
+
get enable_constraint_cache() {
|
|
1064
|
+
const ret = wasm.__wbg_get_wasmcompilationoptions_enable_constraint_cache(this.__wbg_ptr);
|
|
1065
|
+
return ret !== 0;
|
|
1066
|
+
}
|
|
1067
|
+
/**
|
|
1068
|
+
* Enable constraint caching optimization
|
|
1069
|
+
* @param {boolean} arg0
|
|
1070
|
+
*/
|
|
1071
|
+
set enable_constraint_cache(arg0) {
|
|
1072
|
+
wasm.__wbg_set_wasmcompilationoptions_enable_constraint_cache(this.__wbg_ptr, arg0);
|
|
1073
|
+
}
|
|
1074
|
+
/**
|
|
1075
|
+
* Enable enhanced error reporting with suggestions
|
|
1076
|
+
* @returns {boolean}
|
|
1077
|
+
*/
|
|
1078
|
+
get enhanced_errors() {
|
|
1079
|
+
const ret = wasm.__wbg_get_wasmcompilationoptions_enhanced_errors(this.__wbg_ptr);
|
|
1080
|
+
return ret !== 0;
|
|
1081
|
+
}
|
|
1082
|
+
/**
|
|
1083
|
+
* Enable enhanced error reporting with suggestions
|
|
1084
|
+
* @param {boolean} arg0
|
|
1085
|
+
*/
|
|
1086
|
+
set enhanced_errors(arg0) {
|
|
1087
|
+
wasm.__wbg_set_wasmcompilationoptions_enhanced_errors(this.__wbg_ptr, arg0);
|
|
1088
|
+
}
|
|
1089
|
+
/**
|
|
1090
|
+
* Include basic metrics
|
|
1091
|
+
* @returns {boolean}
|
|
1092
|
+
*/
|
|
1093
|
+
get include_metrics() {
|
|
1094
|
+
const ret = wasm.__wbg_get_wasmcompilationoptions_include_metrics(this.__wbg_ptr);
|
|
1095
|
+
return ret !== 0;
|
|
1096
|
+
}
|
|
1097
|
+
/**
|
|
1098
|
+
* Include basic metrics
|
|
1099
|
+
* @param {boolean} arg0
|
|
1100
|
+
*/
|
|
1101
|
+
set include_metrics(arg0) {
|
|
1102
|
+
wasm.__wbg_set_wasmcompilationoptions_include_metrics(this.__wbg_ptr, arg0);
|
|
1103
|
+
}
|
|
1104
|
+
/**
|
|
1105
|
+
* Include comprehensive metrics collection
|
|
1106
|
+
* @returns {boolean}
|
|
1107
|
+
*/
|
|
1108
|
+
get comprehensive_metrics() {
|
|
1109
|
+
const ret = wasm.__wbg_get_wasmcompilationoptions_comprehensive_metrics(this.__wbg_ptr);
|
|
1110
|
+
return ret !== 0;
|
|
1111
|
+
}
|
|
1112
|
+
/**
|
|
1113
|
+
* Include comprehensive metrics collection
|
|
1114
|
+
* @param {boolean} arg0
|
|
1115
|
+
*/
|
|
1116
|
+
set comprehensive_metrics(arg0) {
|
|
1117
|
+
wasm.__wbg_set_wasmcompilationoptions_comprehensive_metrics(this.__wbg_ptr, arg0);
|
|
1118
|
+
}
|
|
1119
|
+
/**
|
|
1120
|
+
* Include performance analysis
|
|
1121
|
+
* @returns {boolean}
|
|
1122
|
+
*/
|
|
1123
|
+
get performance_analysis() {
|
|
1124
|
+
const ret = wasm.__wbg_get_wasmcompilationoptions_performance_analysis(this.__wbg_ptr);
|
|
1125
|
+
return ret !== 0;
|
|
1126
|
+
}
|
|
1127
|
+
/**
|
|
1128
|
+
* Include performance analysis
|
|
1129
|
+
* @param {boolean} arg0
|
|
1130
|
+
*/
|
|
1131
|
+
set performance_analysis(arg0) {
|
|
1132
|
+
wasm.__wbg_set_wasmcompilationoptions_performance_analysis(this.__wbg_ptr, arg0);
|
|
1133
|
+
}
|
|
1134
|
+
/**
|
|
1135
|
+
* Include complexity analysis
|
|
1136
|
+
* @returns {boolean}
|
|
1137
|
+
*/
|
|
1138
|
+
get complexity_analysis() {
|
|
1139
|
+
const ret = wasm.__wbg_get_wasmcompilationoptions_complexity_analysis(this.__wbg_ptr);
|
|
1140
|
+
return ret !== 0;
|
|
1141
|
+
}
|
|
1142
|
+
/**
|
|
1143
|
+
* Include complexity analysis
|
|
1144
|
+
* @param {boolean} arg0
|
|
1145
|
+
*/
|
|
1146
|
+
set complexity_analysis(arg0) {
|
|
1147
|
+
wasm.__wbg_set_wasmcompilationoptions_complexity_analysis(this.__wbg_ptr, arg0);
|
|
1148
|
+
}
|
|
1149
|
+
/**
|
|
1150
|
+
* Show compilation summary
|
|
1151
|
+
* @returns {boolean}
|
|
1152
|
+
*/
|
|
1153
|
+
get summary() {
|
|
1154
|
+
const ret = wasm.__wbg_get_wasmcompilationoptions_summary(this.__wbg_ptr);
|
|
1155
|
+
return ret !== 0;
|
|
1156
|
+
}
|
|
1157
|
+
/**
|
|
1158
|
+
* Show compilation summary
|
|
1159
|
+
* @param {boolean} arg0
|
|
1160
|
+
*/
|
|
1161
|
+
set summary(arg0) {
|
|
1162
|
+
wasm.__wbg_set_wasmcompilationoptions_summary(this.__wbg_ptr, arg0);
|
|
1163
|
+
}
|
|
1164
|
+
/**
|
|
1165
|
+
* Verbose output
|
|
1166
|
+
* @returns {boolean}
|
|
1167
|
+
*/
|
|
1168
|
+
get verbose() {
|
|
1169
|
+
const ret = wasm.__wbg_get_wasmcompilationoptions_verbose(this.__wbg_ptr);
|
|
1170
|
+
return ret !== 0;
|
|
1171
|
+
}
|
|
1172
|
+
/**
|
|
1173
|
+
* Verbose output
|
|
1174
|
+
* @param {boolean} arg0
|
|
1175
|
+
*/
|
|
1176
|
+
set verbose(arg0) {
|
|
1177
|
+
wasm.__wbg_set_wasmcompilationoptions_verbose(this.__wbg_ptr, arg0);
|
|
1178
|
+
}
|
|
1179
|
+
/**
|
|
1180
|
+
* Suppress non-essential output
|
|
1181
|
+
* @returns {boolean}
|
|
1182
|
+
*/
|
|
1183
|
+
get quiet() {
|
|
1184
|
+
const ret = wasm.__wbg_get_wasmcompilationoptions_quiet(this.__wbg_ptr);
|
|
1185
|
+
return ret !== 0;
|
|
1186
|
+
}
|
|
1187
|
+
/**
|
|
1188
|
+
* Suppress non-essential output
|
|
1189
|
+
* @param {boolean} arg0
|
|
1190
|
+
*/
|
|
1191
|
+
set quiet(arg0) {
|
|
1192
|
+
wasm.__wbg_set_wasmcompilationoptions_quiet(this.__wbg_ptr, arg0);
|
|
1193
|
+
}
|
|
1194
|
+
/**
|
|
1195
|
+
* Include debug information
|
|
1196
|
+
* @returns {boolean}
|
|
1197
|
+
*/
|
|
1198
|
+
get include_debug_info() {
|
|
1199
|
+
const ret = wasm.__wbg_get_wasmcompilationoptions_include_debug_info(this.__wbg_ptr);
|
|
1200
|
+
return ret !== 0;
|
|
1201
|
+
}
|
|
1202
|
+
/**
|
|
1203
|
+
* Include debug information
|
|
1204
|
+
* @param {boolean} arg0
|
|
1205
|
+
*/
|
|
1206
|
+
set include_debug_info(arg0) {
|
|
1207
|
+
wasm.__wbg_set_wasmcompilationoptions_include_debug_info(this.__wbg_ptr, arg0);
|
|
1208
|
+
}
|
|
1209
|
+
/**
|
|
1210
|
+
* Enable bytecode compression
|
|
1211
|
+
* @returns {boolean}
|
|
1212
|
+
*/
|
|
1213
|
+
get compress_output() {
|
|
1214
|
+
const ret = wasm.__wbg_get_wasmcompilationoptions_compress_output(this.__wbg_ptr);
|
|
1215
|
+
return ret !== 0;
|
|
1216
|
+
}
|
|
1217
|
+
/**
|
|
1218
|
+
* Enable bytecode compression
|
|
1219
|
+
* @param {boolean} arg0
|
|
1220
|
+
*/
|
|
1221
|
+
set compress_output(arg0) {
|
|
1222
|
+
wasm.__wbg_set_wasmcompilationoptions_compress_output(this.__wbg_ptr, arg0);
|
|
1223
|
+
}
|
|
1224
|
+
/**
|
|
1225
|
+
* Enable module namespace qualification (module::function)
|
|
1226
|
+
* @returns {boolean}
|
|
1227
|
+
*/
|
|
1228
|
+
get enable_module_namespaces() {
|
|
1229
|
+
const ret = wasm.__wbg_get_wasmcompilationoptions_enable_module_namespaces(this.__wbg_ptr);
|
|
1230
|
+
return ret !== 0;
|
|
1231
|
+
}
|
|
1232
|
+
/**
|
|
1233
|
+
* Enable module namespace qualification (module::function)
|
|
1234
|
+
* @param {boolean} arg0
|
|
1235
|
+
*/
|
|
1236
|
+
set enable_module_namespaces(arg0) {
|
|
1237
|
+
wasm.__wbg_set_wasmcompilationoptions_enable_module_namespaces(this.__wbg_ptr, arg0);
|
|
1238
|
+
}
|
|
1239
|
+
/**
|
|
1240
|
+
* Create default compilation options
|
|
1241
|
+
*/
|
|
1242
|
+
constructor() {
|
|
1243
|
+
const ret = wasm.wasmcompilationoptions_new();
|
|
1244
|
+
this.__wbg_ptr = ret >>> 0;
|
|
1245
|
+
WasmCompilationOptionsFinalization.register(this, this.__wbg_ptr, this);
|
|
1246
|
+
return this;
|
|
1247
|
+
}
|
|
1248
|
+
/**
|
|
1249
|
+
* Set compilation mode
|
|
1250
|
+
* @param {string} mode
|
|
1251
|
+
* @returns {WasmCompilationOptions}
|
|
1252
|
+
*/
|
|
1253
|
+
with_mode(mode) {
|
|
1254
|
+
const ptr = this.__destroy_into_raw();
|
|
1255
|
+
const ptr0 = passStringToWasm0(mode, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1256
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1257
|
+
const ret = wasm.wasmcompilationoptions_with_mode(ptr, ptr0, len0);
|
|
1258
|
+
return WasmCompilationOptions.__wrap(ret);
|
|
1259
|
+
}
|
|
1260
|
+
/**
|
|
1261
|
+
* Set optimization level (production)
|
|
1262
|
+
* @param {string} level
|
|
1263
|
+
* @returns {WasmCompilationOptions}
|
|
1264
|
+
*/
|
|
1265
|
+
with_optimization_level(level) {
|
|
1266
|
+
const ptr = this.__destroy_into_raw();
|
|
1267
|
+
const ptr0 = passStringToWasm0(level, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1268
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1269
|
+
const ret = wasm.wasmcompilationoptions_with_optimization_level(ptr, ptr0, len0);
|
|
1270
|
+
return WasmCompilationOptions.__wrap(ret);
|
|
1271
|
+
}
|
|
1272
|
+
/**
|
|
1273
|
+
* Enable or disable v2-preview features
|
|
1274
|
+
* @param {boolean} enabled
|
|
1275
|
+
* @returns {WasmCompilationOptions}
|
|
1276
|
+
*/
|
|
1277
|
+
with_v2_preview(enabled) {
|
|
1278
|
+
const ptr = this.__destroy_into_raw();
|
|
1279
|
+
const ret = wasm.wasmcompilationoptions_with_v2_preview(ptr, enabled);
|
|
1280
|
+
return WasmCompilationOptions.__wrap(ret);
|
|
1281
|
+
}
|
|
1282
|
+
/**
|
|
1283
|
+
* Enable or disable constraint caching optimization
|
|
1284
|
+
* @param {boolean} enabled
|
|
1285
|
+
* @returns {WasmCompilationOptions}
|
|
1286
|
+
*/
|
|
1287
|
+
with_constraint_cache(enabled) {
|
|
1288
|
+
const ptr = this.__destroy_into_raw();
|
|
1289
|
+
const ret = wasm.wasmcompilationoptions_with_constraint_cache(ptr, enabled);
|
|
1290
|
+
return WasmCompilationOptions.__wrap(ret);
|
|
1291
|
+
}
|
|
1292
|
+
/**
|
|
1293
|
+
* Enable or disable enhanced error reporting
|
|
1294
|
+
* @param {boolean} enabled
|
|
1295
|
+
* @returns {WasmCompilationOptions}
|
|
1296
|
+
*/
|
|
1297
|
+
with_enhanced_errors(enabled) {
|
|
1298
|
+
const ptr = this.__destroy_into_raw();
|
|
1299
|
+
const ret = wasm.wasmcompilationoptions_with_enhanced_errors(ptr, enabled);
|
|
1300
|
+
return WasmCompilationOptions.__wrap(ret);
|
|
1301
|
+
}
|
|
1302
|
+
/**
|
|
1303
|
+
* Set error output format
|
|
1304
|
+
* @param {string} format
|
|
1305
|
+
* @returns {WasmCompilationOptions}
|
|
1306
|
+
*/
|
|
1307
|
+
with_error_format(format) {
|
|
1308
|
+
const ptr = this.__destroy_into_raw();
|
|
1309
|
+
const ptr0 = passStringToWasm0(format, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1310
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1311
|
+
const ret = wasm.wasmcompilationoptions_with_error_format(ptr, ptr0, len0);
|
|
1312
|
+
return WasmCompilationOptions.__wrap(ret);
|
|
1313
|
+
}
|
|
1314
|
+
/**
|
|
1315
|
+
* Set source file name for better error reporting
|
|
1316
|
+
* @param {string} filename
|
|
1317
|
+
* @returns {WasmCompilationOptions}
|
|
1318
|
+
*/
|
|
1319
|
+
with_source_file(filename) {
|
|
1320
|
+
const ptr = this.__destroy_into_raw();
|
|
1321
|
+
const ptr0 = passStringToWasm0(filename, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1322
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1323
|
+
const ret = wasm.wasmcompilationoptions_with_source_file(ptr, ptr0, len0);
|
|
1324
|
+
return WasmCompilationOptions.__wrap(ret);
|
|
1325
|
+
}
|
|
1326
|
+
/**
|
|
1327
|
+
* Enable or disable basic metrics collection
|
|
1328
|
+
* @param {boolean} enabled
|
|
1329
|
+
* @returns {WasmCompilationOptions}
|
|
1330
|
+
*/
|
|
1331
|
+
with_metrics(enabled) {
|
|
1332
|
+
const ptr = this.__destroy_into_raw();
|
|
1333
|
+
const ret = wasm.wasmcompilationoptions_with_metrics(ptr, enabled);
|
|
1334
|
+
return WasmCompilationOptions.__wrap(ret);
|
|
1335
|
+
}
|
|
1336
|
+
/**
|
|
1337
|
+
* Enable or disable comprehensive metrics collection
|
|
1338
|
+
* @param {boolean} enabled
|
|
1339
|
+
* @returns {WasmCompilationOptions}
|
|
1340
|
+
*/
|
|
1341
|
+
with_comprehensive_metrics(enabled) {
|
|
1342
|
+
const ptr = this.__destroy_into_raw();
|
|
1343
|
+
const ret = wasm.wasmcompilationoptions_with_comprehensive_metrics(ptr, enabled);
|
|
1344
|
+
return WasmCompilationOptions.__wrap(ret);
|
|
1345
|
+
}
|
|
1346
|
+
/**
|
|
1347
|
+
* Set metrics export format
|
|
1348
|
+
* @param {string} format
|
|
1349
|
+
* @returns {WasmCompilationOptions}
|
|
1350
|
+
*/
|
|
1351
|
+
with_metrics_format(format) {
|
|
1352
|
+
const ptr = this.__destroy_into_raw();
|
|
1353
|
+
const ptr0 = passStringToWasm0(format, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1354
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1355
|
+
const ret = wasm.wasmcompilationoptions_with_metrics_format(ptr, ptr0, len0);
|
|
1356
|
+
return WasmCompilationOptions.__wrap(ret);
|
|
1357
|
+
}
|
|
1358
|
+
/**
|
|
1359
|
+
* Enable or disable performance analysis
|
|
1360
|
+
* @param {boolean} enabled
|
|
1361
|
+
* @returns {WasmCompilationOptions}
|
|
1362
|
+
*/
|
|
1363
|
+
with_performance_analysis(enabled) {
|
|
1364
|
+
const ptr = this.__destroy_into_raw();
|
|
1365
|
+
const ret = wasm.wasmcompilationoptions_with_performance_analysis(ptr, enabled);
|
|
1366
|
+
return WasmCompilationOptions.__wrap(ret);
|
|
1367
|
+
}
|
|
1368
|
+
/**
|
|
1369
|
+
* Enable or disable complexity analysis
|
|
1370
|
+
* @param {boolean} enabled
|
|
1371
|
+
* @returns {WasmCompilationOptions}
|
|
1372
|
+
*/
|
|
1373
|
+
with_complexity_analysis(enabled) {
|
|
1374
|
+
const ptr = this.__destroy_into_raw();
|
|
1375
|
+
const ret = wasm.wasmcompilationoptions_with_complexity_analysis(ptr, enabled);
|
|
1376
|
+
return WasmCompilationOptions.__wrap(ret);
|
|
1377
|
+
}
|
|
1378
|
+
/**
|
|
1379
|
+
* Enable or disable compilation summary
|
|
1380
|
+
* @param {boolean} enabled
|
|
1381
|
+
* @returns {WasmCompilationOptions}
|
|
1382
|
+
*/
|
|
1383
|
+
with_summary(enabled) {
|
|
1384
|
+
const ptr = this.__destroy_into_raw();
|
|
1385
|
+
const ret = wasm.wasmcompilationoptions_with_summary(ptr, enabled);
|
|
1386
|
+
return WasmCompilationOptions.__wrap(ret);
|
|
1387
|
+
}
|
|
1388
|
+
/**
|
|
1389
|
+
* Enable or disable verbose output
|
|
1390
|
+
* @param {boolean} enabled
|
|
1391
|
+
* @returns {WasmCompilationOptions}
|
|
1392
|
+
*/
|
|
1393
|
+
with_verbose(enabled) {
|
|
1394
|
+
const ptr = this.__destroy_into_raw();
|
|
1395
|
+
const ret = wasm.wasmcompilationoptions_with_verbose(ptr, enabled);
|
|
1396
|
+
return WasmCompilationOptions.__wrap(ret);
|
|
1397
|
+
}
|
|
1398
|
+
/**
|
|
1399
|
+
* Enable or disable quiet mode
|
|
1400
|
+
* @param {boolean} enabled
|
|
1401
|
+
* @returns {WasmCompilationOptions}
|
|
1402
|
+
*/
|
|
1403
|
+
with_quiet(enabled) {
|
|
1404
|
+
const ptr = this.__destroy_into_raw();
|
|
1405
|
+
const ret = wasm.wasmcompilationoptions_with_quiet(ptr, enabled);
|
|
1406
|
+
return WasmCompilationOptions.__wrap(ret);
|
|
1407
|
+
}
|
|
1408
|
+
/**
|
|
1409
|
+
* Set analysis depth level
|
|
1410
|
+
* @param {string} depth
|
|
1411
|
+
* @returns {WasmCompilationOptions}
|
|
1412
|
+
*/
|
|
1413
|
+
with_analysis_depth(depth) {
|
|
1414
|
+
const ptr = this.__destroy_into_raw();
|
|
1415
|
+
const ptr0 = passStringToWasm0(depth, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1416
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1417
|
+
const ret = wasm.wasmcompilationoptions_with_analysis_depth(ptr, ptr0, len0);
|
|
1418
|
+
return WasmCompilationOptions.__wrap(ret);
|
|
1419
|
+
}
|
|
1420
|
+
/**
|
|
1421
|
+
* Set export format
|
|
1422
|
+
* @param {string} format
|
|
1423
|
+
* @returns {WasmCompilationOptions}
|
|
1424
|
+
*/
|
|
1425
|
+
with_export_format(format) {
|
|
1426
|
+
const ptr = this.__destroy_into_raw();
|
|
1427
|
+
const ptr0 = passStringToWasm0(format, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1428
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1429
|
+
const ret = wasm.wasmcompilationoptions_with_export_format(ptr, ptr0, len0);
|
|
1430
|
+
return WasmCompilationOptions.__wrap(ret);
|
|
1431
|
+
}
|
|
1432
|
+
/**
|
|
1433
|
+
* Enable or disable debug information
|
|
1434
|
+
* @param {boolean} enabled
|
|
1435
|
+
* @returns {WasmCompilationOptions}
|
|
1436
|
+
*/
|
|
1437
|
+
with_debug_info(enabled) {
|
|
1438
|
+
const ptr = this.__destroy_into_raw();
|
|
1439
|
+
const ret = wasm.wasmcompilationoptions_with_debug_info(ptr, enabled);
|
|
1440
|
+
return WasmCompilationOptions.__wrap(ret);
|
|
1441
|
+
}
|
|
1442
|
+
/**
|
|
1443
|
+
* Enable or disable bytecode compression
|
|
1444
|
+
* @param {boolean} enabled
|
|
1445
|
+
* @returns {WasmCompilationOptions}
|
|
1446
|
+
*/
|
|
1447
|
+
with_compression(enabled) {
|
|
1448
|
+
const ptr = this.__destroy_into_raw();
|
|
1449
|
+
const ret = wasm.wasmcompilationoptions_with_compression(ptr, enabled);
|
|
1450
|
+
return WasmCompilationOptions.__wrap(ret);
|
|
1451
|
+
}
|
|
1452
|
+
/**
|
|
1453
|
+
* Create production-optimized configuration
|
|
1454
|
+
* @returns {WasmCompilationOptions}
|
|
1455
|
+
*/
|
|
1456
|
+
static production_optimized() {
|
|
1457
|
+
const ret = wasm.wasmcompilationoptions_production_optimized();
|
|
1458
|
+
return WasmCompilationOptions.__wrap(ret);
|
|
1459
|
+
}
|
|
1460
|
+
/**
|
|
1461
|
+
* Create development-debug configuration
|
|
1462
|
+
* @returns {WasmCompilationOptions}
|
|
1463
|
+
*/
|
|
1464
|
+
static development_debug() {
|
|
1465
|
+
const ret = wasm.wasmcompilationoptions_development_debug();
|
|
1466
|
+
return WasmCompilationOptions.__wrap(ret);
|
|
1467
|
+
}
|
|
1468
|
+
/**
|
|
1469
|
+
* Create fast iteration configuration
|
|
1470
|
+
* @returns {WasmCompilationOptions}
|
|
1471
|
+
*/
|
|
1472
|
+
static fast_iteration() {
|
|
1473
|
+
const ret = wasm.wasmcompilationoptions_fast_iteration();
|
|
1474
|
+
return WasmCompilationOptions.__wrap(ret);
|
|
1475
|
+
}
|
|
1476
|
+
/**
|
|
1477
|
+
* @returns {string}
|
|
1478
|
+
*/
|
|
1479
|
+
get mode() {
|
|
1480
|
+
let deferred1_0;
|
|
1481
|
+
let deferred1_1;
|
|
1482
|
+
try {
|
|
1483
|
+
const ret = wasm.wasmcompilationoptions_mode(this.__wbg_ptr);
|
|
1484
|
+
deferred1_0 = ret[0];
|
|
1485
|
+
deferred1_1 = ret[1];
|
|
1486
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1487
|
+
} finally {
|
|
1488
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1489
|
+
}
|
|
1490
|
+
}
|
|
1491
|
+
/**
|
|
1492
|
+
* @returns {string}
|
|
1493
|
+
*/
|
|
1494
|
+
get optimization_level() {
|
|
1495
|
+
let deferred1_0;
|
|
1496
|
+
let deferred1_1;
|
|
1497
|
+
try {
|
|
1498
|
+
const ret = wasm.wasmcompilationoptions_optimization_level(this.__wbg_ptr);
|
|
1499
|
+
deferred1_0 = ret[0];
|
|
1500
|
+
deferred1_1 = ret[1];
|
|
1501
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1502
|
+
} finally {
|
|
1503
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1504
|
+
}
|
|
1505
|
+
}
|
|
1506
|
+
/**
|
|
1507
|
+
* @returns {string}
|
|
1508
|
+
*/
|
|
1509
|
+
get error_format() {
|
|
1510
|
+
let deferred1_0;
|
|
1511
|
+
let deferred1_1;
|
|
1512
|
+
try {
|
|
1513
|
+
const ret = wasm.wasmcompilationoptions_error_format(this.__wbg_ptr);
|
|
1514
|
+
deferred1_0 = ret[0];
|
|
1515
|
+
deferred1_1 = ret[1];
|
|
1516
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1517
|
+
} finally {
|
|
1518
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1519
|
+
}
|
|
1520
|
+
}
|
|
1521
|
+
/**
|
|
1522
|
+
* @returns {string | undefined}
|
|
1523
|
+
*/
|
|
1524
|
+
get source_file() {
|
|
1525
|
+
const ret = wasm.wasmcompilationoptions_source_file(this.__wbg_ptr);
|
|
1526
|
+
let v1;
|
|
1527
|
+
if (ret[0] !== 0) {
|
|
1528
|
+
v1 = getStringFromWasm0(ret[0], ret[1]).slice();
|
|
1529
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1530
|
+
}
|
|
1531
|
+
return v1;
|
|
1532
|
+
}
|
|
1533
|
+
/**
|
|
1534
|
+
* @returns {string}
|
|
1535
|
+
*/
|
|
1536
|
+
get metrics_format() {
|
|
1537
|
+
let deferred1_0;
|
|
1538
|
+
let deferred1_1;
|
|
1539
|
+
try {
|
|
1540
|
+
const ret = wasm.wasmcompilationoptions_metrics_format(this.__wbg_ptr);
|
|
1541
|
+
deferred1_0 = ret[0];
|
|
1542
|
+
deferred1_1 = ret[1];
|
|
1543
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1544
|
+
} finally {
|
|
1545
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1546
|
+
}
|
|
1547
|
+
}
|
|
1548
|
+
/**
|
|
1549
|
+
* @returns {string}
|
|
1550
|
+
*/
|
|
1551
|
+
get analysis_depth() {
|
|
1552
|
+
let deferred1_0;
|
|
1553
|
+
let deferred1_1;
|
|
1554
|
+
try {
|
|
1555
|
+
const ret = wasm.wasmcompilationoptions_analysis_depth(this.__wbg_ptr);
|
|
1556
|
+
deferred1_0 = ret[0];
|
|
1557
|
+
deferred1_1 = ret[1];
|
|
1558
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1559
|
+
} finally {
|
|
1560
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1561
|
+
}
|
|
1562
|
+
}
|
|
1563
|
+
/**
|
|
1564
|
+
* @returns {string}
|
|
1565
|
+
*/
|
|
1566
|
+
get export_format() {
|
|
1567
|
+
let deferred1_0;
|
|
1568
|
+
let deferred1_1;
|
|
1569
|
+
try {
|
|
1570
|
+
const ret = wasm.wasmcompilationoptions_export_format(this.__wbg_ptr);
|
|
1571
|
+
deferred1_0 = ret[0];
|
|
1572
|
+
deferred1_1 = ret[1];
|
|
1573
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1574
|
+
} finally {
|
|
1575
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1576
|
+
}
|
|
1577
|
+
}
|
|
1578
|
+
}
|
|
1579
|
+
if (Symbol.dispose) WasmCompilationOptions.prototype[Symbol.dispose] = WasmCompilationOptions.prototype.free;
|
|
1580
|
+
|
|
1581
|
+
/**
|
|
1582
|
+
* WASM compilation result - unified with enhanced error support
|
|
1583
|
+
*/
|
|
1584
|
+
export class WasmCompilationResult {
|
|
1585
|
+
static __wrap(ptr) {
|
|
1586
|
+
ptr = ptr >>> 0;
|
|
1587
|
+
const obj = Object.create(WasmCompilationResult.prototype);
|
|
1588
|
+
obj.__wbg_ptr = ptr;
|
|
1589
|
+
WasmCompilationResultFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1590
|
+
return obj;
|
|
1591
|
+
}
|
|
1592
|
+
__destroy_into_raw() {
|
|
1593
|
+
const ptr = this.__wbg_ptr;
|
|
1594
|
+
this.__wbg_ptr = 0;
|
|
1595
|
+
WasmCompilationResultFinalization.unregister(this);
|
|
1596
|
+
return ptr;
|
|
1597
|
+
}
|
|
1598
|
+
free() {
|
|
1599
|
+
const ptr = this.__destroy_into_raw();
|
|
1600
|
+
wasm.__wbg_wasmcompilationresult_free(ptr, 0);
|
|
1601
|
+
}
|
|
1602
|
+
/**
|
|
1603
|
+
* Whether compilation succeeded
|
|
1604
|
+
* @returns {boolean}
|
|
1605
|
+
*/
|
|
1606
|
+
get success() {
|
|
1607
|
+
const ret = wasm.__wbg_get_wasmcompilationresult_success(this.__wbg_ptr);
|
|
1608
|
+
return ret !== 0;
|
|
1609
|
+
}
|
|
1610
|
+
/**
|
|
1611
|
+
* Whether compilation succeeded
|
|
1612
|
+
* @param {boolean} arg0
|
|
1613
|
+
*/
|
|
1614
|
+
set success(arg0) {
|
|
1615
|
+
wasm.__wbg_set_wasmcompilationresult_success(this.__wbg_ptr, arg0);
|
|
1616
|
+
}
|
|
1617
|
+
/**
|
|
1618
|
+
* Size of generated bytecode
|
|
1619
|
+
* @returns {number}
|
|
1620
|
+
*/
|
|
1621
|
+
get bytecode_size() {
|
|
1622
|
+
const ret = wasm.__wbg_get_wasmcompilationresult_bytecode_size(this.__wbg_ptr);
|
|
1623
|
+
return ret >>> 0;
|
|
1624
|
+
}
|
|
1625
|
+
/**
|
|
1626
|
+
* Size of generated bytecode
|
|
1627
|
+
* @param {number} arg0
|
|
1628
|
+
*/
|
|
1629
|
+
set bytecode_size(arg0) {
|
|
1630
|
+
wasm.__wbg_set_wasmcompilationresult_bytecode_size(this.__wbg_ptr, arg0);
|
|
1631
|
+
}
|
|
1632
|
+
/**
|
|
1633
|
+
* Compilation time in milliseconds
|
|
1634
|
+
* @returns {number}
|
|
1635
|
+
*/
|
|
1636
|
+
get compilation_time() {
|
|
1637
|
+
const ret = wasm.__wbg_get_wasmanalysisresult_analysis_time(this.__wbg_ptr);
|
|
1638
|
+
return ret;
|
|
1639
|
+
}
|
|
1640
|
+
/**
|
|
1641
|
+
* Compilation time in milliseconds
|
|
1642
|
+
* @param {number} arg0
|
|
1643
|
+
*/
|
|
1644
|
+
set compilation_time(arg0) {
|
|
1645
|
+
wasm.__wbg_set_wasmanalysisresult_analysis_time(this.__wbg_ptr, arg0);
|
|
1646
|
+
}
|
|
1647
|
+
/**
|
|
1648
|
+
* Total error count
|
|
1649
|
+
* @returns {number}
|
|
1650
|
+
*/
|
|
1651
|
+
get error_count() {
|
|
1652
|
+
const ret = wasm.__wbg_get_wasmcompilationresult_error_count(this.__wbg_ptr);
|
|
1653
|
+
return ret >>> 0;
|
|
1654
|
+
}
|
|
1655
|
+
/**
|
|
1656
|
+
* Total error count
|
|
1657
|
+
* @param {number} arg0
|
|
1658
|
+
*/
|
|
1659
|
+
set error_count(arg0) {
|
|
1660
|
+
wasm.__wbg_set_wasmcompilationresult_error_count(this.__wbg_ptr, arg0);
|
|
1661
|
+
}
|
|
1662
|
+
/**
|
|
1663
|
+
* Total warning count
|
|
1664
|
+
* @returns {number}
|
|
1665
|
+
*/
|
|
1666
|
+
get warning_count() {
|
|
1667
|
+
const ret = wasm.__wbg_get_wasmcompilationresult_warning_count(this.__wbg_ptr);
|
|
1668
|
+
return ret >>> 0;
|
|
1669
|
+
}
|
|
1670
|
+
/**
|
|
1671
|
+
* Total warning count
|
|
1672
|
+
* @param {number} arg0
|
|
1673
|
+
*/
|
|
1674
|
+
set warning_count(arg0) {
|
|
1675
|
+
wasm.__wbg_set_wasmcompilationresult_warning_count(this.__wbg_ptr, arg0);
|
|
1676
|
+
}
|
|
1677
|
+
/**
|
|
1678
|
+
* @returns {Uint8Array | undefined}
|
|
1679
|
+
*/
|
|
1680
|
+
get bytecode() {
|
|
1681
|
+
const ret = wasm.wasmcompilationresult_bytecode(this.__wbg_ptr);
|
|
1682
|
+
return ret;
|
|
1683
|
+
}
|
|
1684
|
+
/**
|
|
1685
|
+
* @returns {any}
|
|
1686
|
+
*/
|
|
1687
|
+
get abi() {
|
|
1688
|
+
const ret = wasm.wasmcompilationresult_abi(this.__wbg_ptr);
|
|
1689
|
+
return ret;
|
|
1690
|
+
}
|
|
1691
|
+
/**
|
|
1692
|
+
* @returns {Array<any>}
|
|
1693
|
+
*/
|
|
1694
|
+
get warnings() {
|
|
1695
|
+
const ret = wasm.wasmcompilationresult_warnings(this.__wbg_ptr);
|
|
1696
|
+
return ret;
|
|
1697
|
+
}
|
|
1698
|
+
/**
|
|
1699
|
+
* @returns {Array<any>}
|
|
1700
|
+
*/
|
|
1701
|
+
get errors() {
|
|
1702
|
+
const ret = wasm.wasmcompilationresult_errors(this.__wbg_ptr);
|
|
1703
|
+
return ret;
|
|
1704
|
+
}
|
|
1705
|
+
/**
|
|
1706
|
+
* @returns {WasmCompilerError[]}
|
|
1707
|
+
*/
|
|
1708
|
+
get compiler_errors() {
|
|
1709
|
+
const ret = wasm.wasmcompilationresult_compiler_errors(this.__wbg_ptr);
|
|
1710
|
+
var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
|
|
1711
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
1712
|
+
return v1;
|
|
1713
|
+
}
|
|
1714
|
+
/**
|
|
1715
|
+
* @returns {Array<any>}
|
|
1716
|
+
*/
|
|
1717
|
+
get disassembly() {
|
|
1718
|
+
const ret = wasm.wasmcompilationresult_disassembly(this.__wbg_ptr);
|
|
1719
|
+
return ret;
|
|
1720
|
+
}
|
|
1721
|
+
/**
|
|
1722
|
+
* @returns {string}
|
|
1723
|
+
*/
|
|
1724
|
+
get_formatted_errors_terminal() {
|
|
1725
|
+
let deferred1_0;
|
|
1726
|
+
let deferred1_1;
|
|
1727
|
+
try {
|
|
1728
|
+
const ret = wasm.wasmcompilationresult_get_formatted_errors_terminal(this.__wbg_ptr);
|
|
1729
|
+
deferred1_0 = ret[0];
|
|
1730
|
+
deferred1_1 = ret[1];
|
|
1731
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1732
|
+
} finally {
|
|
1733
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1734
|
+
}
|
|
1735
|
+
}
|
|
1736
|
+
/**
|
|
1737
|
+
* @returns {string}
|
|
1738
|
+
*/
|
|
1739
|
+
get_formatted_errors_json() {
|
|
1740
|
+
let deferred1_0;
|
|
1741
|
+
let deferred1_1;
|
|
1742
|
+
try {
|
|
1743
|
+
const ret = wasm.wasmcompilationresult_get_formatted_errors_json(this.__wbg_ptr);
|
|
1744
|
+
deferred1_0 = ret[0];
|
|
1745
|
+
deferred1_1 = ret[1];
|
|
1746
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1747
|
+
} finally {
|
|
1748
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1749
|
+
}
|
|
1750
|
+
}
|
|
1751
|
+
/**
|
|
1752
|
+
* Get all errors formatted as terminal output
|
|
1753
|
+
* @returns {string}
|
|
1754
|
+
*/
|
|
1755
|
+
format_all_terminal() {
|
|
1756
|
+
let deferred1_0;
|
|
1757
|
+
let deferred1_1;
|
|
1758
|
+
try {
|
|
1759
|
+
const ret = wasm.wasmcompilationresult_format_all_terminal(this.__wbg_ptr);
|
|
1760
|
+
deferred1_0 = ret[0];
|
|
1761
|
+
deferred1_1 = ret[1];
|
|
1762
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1763
|
+
} finally {
|
|
1764
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1765
|
+
}
|
|
1766
|
+
}
|
|
1767
|
+
/**
|
|
1768
|
+
* Get all errors as JSON array
|
|
1769
|
+
* @returns {string}
|
|
1770
|
+
*/
|
|
1771
|
+
format_all_json() {
|
|
1772
|
+
let deferred1_0;
|
|
1773
|
+
let deferred1_1;
|
|
1774
|
+
try {
|
|
1775
|
+
const ret = wasm.wasmcompilationresult_format_all_json(this.__wbg_ptr);
|
|
1776
|
+
deferred1_0 = ret[0];
|
|
1777
|
+
deferred1_1 = ret[1];
|
|
1778
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1779
|
+
} finally {
|
|
1780
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1781
|
+
}
|
|
1782
|
+
}
|
|
1783
|
+
/**
|
|
1784
|
+
* Get parsed metrics as JavaScript object
|
|
1785
|
+
* @returns {any}
|
|
1786
|
+
*/
|
|
1787
|
+
get_metrics_object() {
|
|
1788
|
+
const ret = wasm.wasmcompilationresult_get_metrics_object(this.__wbg_ptr);
|
|
1789
|
+
return ret;
|
|
1790
|
+
}
|
|
1791
|
+
/**
|
|
1792
|
+
* Get fully detailed metrics regardless of export format
|
|
1793
|
+
* @returns {any}
|
|
1794
|
+
*/
|
|
1795
|
+
get_metrics_detailed() {
|
|
1796
|
+
const ret = wasm.wasmcompilationresult_get_metrics_detailed(this.__wbg_ptr);
|
|
1797
|
+
if (ret[2]) {
|
|
1798
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1799
|
+
}
|
|
1800
|
+
return takeFromExternrefTable0(ret[0]);
|
|
1801
|
+
}
|
|
1802
|
+
/**
|
|
1803
|
+
* @returns {string}
|
|
1804
|
+
*/
|
|
1805
|
+
get metrics() {
|
|
1806
|
+
let deferred1_0;
|
|
1807
|
+
let deferred1_1;
|
|
1808
|
+
try {
|
|
1809
|
+
const ret = wasm.wasmcompilationresult_metrics(this.__wbg_ptr);
|
|
1810
|
+
deferred1_0 = ret[0];
|
|
1811
|
+
deferred1_1 = ret[1];
|
|
1812
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1813
|
+
} finally {
|
|
1814
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1815
|
+
}
|
|
1816
|
+
}
|
|
1817
|
+
/**
|
|
1818
|
+
* @returns {string}
|
|
1819
|
+
*/
|
|
1820
|
+
get metrics_format() {
|
|
1821
|
+
let deferred1_0;
|
|
1822
|
+
let deferred1_1;
|
|
1823
|
+
try {
|
|
1824
|
+
const ret = wasm.wasmcompilationresult_metrics_format(this.__wbg_ptr);
|
|
1825
|
+
deferred1_0 = ret[0];
|
|
1826
|
+
deferred1_1 = ret[1];
|
|
1827
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1828
|
+
} finally {
|
|
1829
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1830
|
+
}
|
|
1831
|
+
}
|
|
1832
|
+
}
|
|
1833
|
+
if (Symbol.dispose) WasmCompilationResult.prototype[Symbol.dispose] = WasmCompilationResult.prototype.free;
|
|
1834
|
+
|
|
1835
|
+
/**
|
|
1836
|
+
* WASM compilation result with comprehensive metrics
|
|
1837
|
+
*/
|
|
1838
|
+
export class WasmCompilationWithMetrics {
|
|
1839
|
+
__destroy_into_raw() {
|
|
1840
|
+
const ptr = this.__wbg_ptr;
|
|
1841
|
+
this.__wbg_ptr = 0;
|
|
1842
|
+
WasmCompilationWithMetricsFinalization.unregister(this);
|
|
1843
|
+
return ptr;
|
|
1844
|
+
}
|
|
1845
|
+
free() {
|
|
1846
|
+
const ptr = this.__destroy_into_raw();
|
|
1847
|
+
wasm.__wbg_wasmcompilationwithmetrics_free(ptr, 0);
|
|
1848
|
+
}
|
|
1849
|
+
/**
|
|
1850
|
+
* Whether compilation succeeded
|
|
1851
|
+
* @returns {boolean}
|
|
1852
|
+
*/
|
|
1853
|
+
get success() {
|
|
1854
|
+
const ret = wasm.__wbg_get_wasmcompilationwithmetrics_success(this.__wbg_ptr);
|
|
1855
|
+
return ret !== 0;
|
|
1856
|
+
}
|
|
1857
|
+
/**
|
|
1858
|
+
* Whether compilation succeeded
|
|
1859
|
+
* @param {boolean} arg0
|
|
1860
|
+
*/
|
|
1861
|
+
set success(arg0) {
|
|
1862
|
+
wasm.__wbg_set_wasmcompilationwithmetrics_success(this.__wbg_ptr, arg0);
|
|
1863
|
+
}
|
|
1864
|
+
/**
|
|
1865
|
+
* Size of generated bytecode
|
|
1866
|
+
* @returns {number}
|
|
1867
|
+
*/
|
|
1868
|
+
get bytecode_size() {
|
|
1869
|
+
const ret = wasm.__wbg_get_wasmcompilationwithmetrics_bytecode_size(this.__wbg_ptr);
|
|
1870
|
+
return ret >>> 0;
|
|
1871
|
+
}
|
|
1872
|
+
/**
|
|
1873
|
+
* Size of generated bytecode
|
|
1874
|
+
* @param {number} arg0
|
|
1875
|
+
*/
|
|
1876
|
+
set bytecode_size(arg0) {
|
|
1877
|
+
wasm.__wbg_set_wasmcompilationwithmetrics_bytecode_size(this.__wbg_ptr, arg0);
|
|
1878
|
+
}
|
|
1879
|
+
/**
|
|
1880
|
+
* Compilation time in milliseconds
|
|
1881
|
+
* @returns {number}
|
|
1882
|
+
*/
|
|
1883
|
+
get compilation_time() {
|
|
1884
|
+
const ret = wasm.__wbg_get_wasmanalysisresult_analysis_time(this.__wbg_ptr);
|
|
1885
|
+
return ret;
|
|
1886
|
+
}
|
|
1887
|
+
/**
|
|
1888
|
+
* Compilation time in milliseconds
|
|
1889
|
+
* @param {number} arg0
|
|
1890
|
+
*/
|
|
1891
|
+
set compilation_time(arg0) {
|
|
1892
|
+
wasm.__wbg_set_wasmanalysisresult_analysis_time(this.__wbg_ptr, arg0);
|
|
1893
|
+
}
|
|
1894
|
+
/**
|
|
1895
|
+
* @returns {Uint8Array | undefined}
|
|
1896
|
+
*/
|
|
1897
|
+
get bytecode() {
|
|
1898
|
+
const ret = wasm.wasmcompilationwithmetrics_bytecode(this.__wbg_ptr);
|
|
1899
|
+
return ret;
|
|
1900
|
+
}
|
|
1901
|
+
/**
|
|
1902
|
+
* @returns {Array<any>}
|
|
1903
|
+
*/
|
|
1904
|
+
get warnings() {
|
|
1905
|
+
const ret = wasm.wasmcompilationwithmetrics_warnings(this.__wbg_ptr);
|
|
1906
|
+
return ret;
|
|
1907
|
+
}
|
|
1908
|
+
/**
|
|
1909
|
+
* @returns {Array<any>}
|
|
1910
|
+
*/
|
|
1911
|
+
get errors() {
|
|
1912
|
+
const ret = wasm.wasmcompilationwithmetrics_errors(this.__wbg_ptr);
|
|
1913
|
+
return ret;
|
|
1914
|
+
}
|
|
1915
|
+
/**
|
|
1916
|
+
* @returns {string}
|
|
1917
|
+
*/
|
|
1918
|
+
get metrics() {
|
|
1919
|
+
let deferred1_0;
|
|
1920
|
+
let deferred1_1;
|
|
1921
|
+
try {
|
|
1922
|
+
const ret = wasm.wasmcompilationwithmetrics_metrics(this.__wbg_ptr);
|
|
1923
|
+
deferred1_0 = ret[0];
|
|
1924
|
+
deferred1_1 = ret[1];
|
|
1925
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1926
|
+
} finally {
|
|
1927
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1928
|
+
}
|
|
1929
|
+
}
|
|
1930
|
+
/**
|
|
1931
|
+
* Get parsed metrics as JavaScript object
|
|
1932
|
+
* @returns {any}
|
|
1933
|
+
*/
|
|
1934
|
+
get_metrics_object() {
|
|
1935
|
+
const ret = wasm.wasmcompilationwithmetrics_get_metrics_object(this.__wbg_ptr);
|
|
1936
|
+
if (ret[2]) {
|
|
1937
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1938
|
+
}
|
|
1939
|
+
return takeFromExternrefTable0(ret[0]);
|
|
1940
|
+
}
|
|
1941
|
+
}
|
|
1942
|
+
if (Symbol.dispose) WasmCompilationWithMetrics.prototype[Symbol.dispose] = WasmCompilationWithMetrics.prototype.free;
|
|
1943
|
+
|
|
1944
|
+
/**
|
|
1945
|
+
* Enhanced compiler error for WASM
|
|
1946
|
+
*/
|
|
1947
|
+
export class WasmCompilerError {
|
|
1948
|
+
static __wrap(ptr) {
|
|
1949
|
+
ptr = ptr >>> 0;
|
|
1950
|
+
const obj = Object.create(WasmCompilerError.prototype);
|
|
1951
|
+
obj.__wbg_ptr = ptr;
|
|
1952
|
+
WasmCompilerErrorFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1953
|
+
return obj;
|
|
1954
|
+
}
|
|
1955
|
+
__destroy_into_raw() {
|
|
1956
|
+
const ptr = this.__wbg_ptr;
|
|
1957
|
+
this.__wbg_ptr = 0;
|
|
1958
|
+
WasmCompilerErrorFinalization.unregister(this);
|
|
1959
|
+
return ptr;
|
|
1960
|
+
}
|
|
1961
|
+
free() {
|
|
1962
|
+
const ptr = this.__destroy_into_raw();
|
|
1963
|
+
wasm.__wbg_wasmcompilererror_free(ptr, 0);
|
|
1964
|
+
}
|
|
1965
|
+
/**
|
|
1966
|
+
* @returns {string}
|
|
1967
|
+
*/
|
|
1968
|
+
get code() {
|
|
1969
|
+
let deferred1_0;
|
|
1970
|
+
let deferred1_1;
|
|
1971
|
+
try {
|
|
1972
|
+
const ret = wasm.wasmcompilererror_code(this.__wbg_ptr);
|
|
1973
|
+
deferred1_0 = ret[0];
|
|
1974
|
+
deferred1_1 = ret[1];
|
|
1975
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1976
|
+
} finally {
|
|
1977
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1978
|
+
}
|
|
1979
|
+
}
|
|
1980
|
+
/**
|
|
1981
|
+
* @returns {any}
|
|
1982
|
+
*/
|
|
1983
|
+
get line() {
|
|
1984
|
+
const ret = wasm.wasmcompilererror_line(this.__wbg_ptr);
|
|
1985
|
+
return ret;
|
|
1986
|
+
}
|
|
1987
|
+
/**
|
|
1988
|
+
* @returns {any}
|
|
1989
|
+
*/
|
|
1990
|
+
get column() {
|
|
1991
|
+
const ret = wasm.wasmcompilererror_column(this.__wbg_ptr);
|
|
1992
|
+
return ret;
|
|
1993
|
+
}
|
|
1994
|
+
/**
|
|
1995
|
+
* @returns {string}
|
|
1996
|
+
*/
|
|
1997
|
+
get severity() {
|
|
1998
|
+
let deferred1_0;
|
|
1999
|
+
let deferred1_1;
|
|
2000
|
+
try {
|
|
2001
|
+
const ret = wasm.wasmcompilererror_severity(this.__wbg_ptr);
|
|
2002
|
+
deferred1_0 = ret[0];
|
|
2003
|
+
deferred1_1 = ret[1];
|
|
2004
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
2005
|
+
} finally {
|
|
2006
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
2007
|
+
}
|
|
2008
|
+
}
|
|
2009
|
+
/**
|
|
2010
|
+
* @returns {string}
|
|
2011
|
+
*/
|
|
2012
|
+
get category() {
|
|
2013
|
+
let deferred1_0;
|
|
2014
|
+
let deferred1_1;
|
|
2015
|
+
try {
|
|
2016
|
+
const ret = wasm.wasmcompilererror_category(this.__wbg_ptr);
|
|
2017
|
+
deferred1_0 = ret[0];
|
|
2018
|
+
deferred1_1 = ret[1];
|
|
2019
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
2020
|
+
} finally {
|
|
2021
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
2022
|
+
}
|
|
2023
|
+
}
|
|
2024
|
+
/**
|
|
2025
|
+
* @returns {string}
|
|
2026
|
+
*/
|
|
2027
|
+
get message() {
|
|
2028
|
+
let deferred1_0;
|
|
2029
|
+
let deferred1_1;
|
|
2030
|
+
try {
|
|
2031
|
+
const ret = wasm.wasmcompilererror_message(this.__wbg_ptr);
|
|
2032
|
+
deferred1_0 = ret[0];
|
|
2033
|
+
deferred1_1 = ret[1];
|
|
2034
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
2035
|
+
} finally {
|
|
2036
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
2037
|
+
}
|
|
2038
|
+
}
|
|
2039
|
+
/**
|
|
2040
|
+
* @returns {string | undefined}
|
|
2041
|
+
*/
|
|
2042
|
+
get description() {
|
|
2043
|
+
const ret = wasm.wasmcompilererror_description(this.__wbg_ptr);
|
|
2044
|
+
let v1;
|
|
2045
|
+
if (ret[0] !== 0) {
|
|
2046
|
+
v1 = getStringFromWasm0(ret[0], ret[1]).slice();
|
|
2047
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
2048
|
+
}
|
|
2049
|
+
return v1;
|
|
2050
|
+
}
|
|
2051
|
+
/**
|
|
2052
|
+
* @returns {WasmSourceLocation | undefined}
|
|
2053
|
+
*/
|
|
2054
|
+
get location() {
|
|
2055
|
+
const ret = wasm.wasmcompilererror_location(this.__wbg_ptr);
|
|
2056
|
+
return ret === 0 ? undefined : WasmSourceLocation.__wrap(ret);
|
|
2057
|
+
}
|
|
2058
|
+
/**
|
|
2059
|
+
* @returns {WasmSuggestion[]}
|
|
2060
|
+
*/
|
|
2061
|
+
get suggestions() {
|
|
2062
|
+
const ret = wasm.wasmcompilererror_suggestions(this.__wbg_ptr);
|
|
2063
|
+
var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
|
|
2064
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
2065
|
+
return v1;
|
|
2066
|
+
}
|
|
2067
|
+
/**
|
|
2068
|
+
* @returns {string | undefined}
|
|
2069
|
+
*/
|
|
2070
|
+
get source_line() {
|
|
2071
|
+
const ret = wasm.wasmcompilererror_source_line(this.__wbg_ptr);
|
|
2072
|
+
let v1;
|
|
2073
|
+
if (ret[0] !== 0) {
|
|
2074
|
+
v1 = getStringFromWasm0(ret[0], ret[1]).slice();
|
|
2075
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
2076
|
+
}
|
|
2077
|
+
return v1;
|
|
2078
|
+
}
|
|
2079
|
+
/**
|
|
2080
|
+
* Get formatted error message (terminal style)
|
|
2081
|
+
* Get formatted error message (terminal style)
|
|
2082
|
+
* @returns {string}
|
|
2083
|
+
*/
|
|
2084
|
+
format_terminal() {
|
|
2085
|
+
let deferred1_0;
|
|
2086
|
+
let deferred1_1;
|
|
2087
|
+
try {
|
|
2088
|
+
const ret = wasm.wasmcompilererror_format_terminal(this.__wbg_ptr);
|
|
2089
|
+
deferred1_0 = ret[0];
|
|
2090
|
+
deferred1_1 = ret[1];
|
|
2091
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
2092
|
+
} finally {
|
|
2093
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
2094
|
+
}
|
|
2095
|
+
}
|
|
2096
|
+
/**
|
|
2097
|
+
* Get error as JSON string
|
|
2098
|
+
* @returns {string}
|
|
2099
|
+
*/
|
|
2100
|
+
format_json() {
|
|
2101
|
+
let deferred1_0;
|
|
2102
|
+
let deferred1_1;
|
|
2103
|
+
try {
|
|
2104
|
+
const ret = wasm.wasmcompilererror_format_json(this.__wbg_ptr);
|
|
2105
|
+
deferred1_0 = ret[0];
|
|
2106
|
+
deferred1_1 = ret[1];
|
|
2107
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
2108
|
+
} finally {
|
|
2109
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
2110
|
+
}
|
|
2111
|
+
}
|
|
2112
|
+
}
|
|
2113
|
+
if (Symbol.dispose) WasmCompilerError.prototype[Symbol.dispose] = WasmCompilerError.prototype.free;
|
|
2114
|
+
|
|
2115
|
+
/**
|
|
2116
|
+
* Enhanced compilation result with rich error information
|
|
2117
|
+
*/
|
|
2118
|
+
export class WasmEnhancedCompilationResult {
|
|
2119
|
+
__destroy_into_raw() {
|
|
2120
|
+
const ptr = this.__wbg_ptr;
|
|
2121
|
+
this.__wbg_ptr = 0;
|
|
2122
|
+
WasmEnhancedCompilationResultFinalization.unregister(this);
|
|
2123
|
+
return ptr;
|
|
2124
|
+
}
|
|
2125
|
+
free() {
|
|
2126
|
+
const ptr = this.__destroy_into_raw();
|
|
2127
|
+
wasm.__wbg_wasmenhancedcompilationresult_free(ptr, 0);
|
|
2128
|
+
}
|
|
2129
|
+
/**
|
|
2130
|
+
* Whether compilation succeeded
|
|
2131
|
+
* @returns {boolean}
|
|
2132
|
+
*/
|
|
2133
|
+
get success() {
|
|
2134
|
+
const ret = wasm.__wbg_get_wasmanalysisresult_success(this.__wbg_ptr);
|
|
2135
|
+
return ret !== 0;
|
|
2136
|
+
}
|
|
2137
|
+
/**
|
|
2138
|
+
* Whether compilation succeeded
|
|
2139
|
+
* @param {boolean} arg0
|
|
2140
|
+
*/
|
|
2141
|
+
set success(arg0) {
|
|
2142
|
+
wasm.__wbg_set_wasmanalysisresult_success(this.__wbg_ptr, arg0);
|
|
2143
|
+
}
|
|
2144
|
+
/**
|
|
2145
|
+
* Size of generated bytecode
|
|
2146
|
+
* @returns {number}
|
|
2147
|
+
*/
|
|
2148
|
+
get bytecode_size() {
|
|
2149
|
+
const ret = wasm.__wbg_get_wasmenhancedcompilationresult_bytecode_size(this.__wbg_ptr);
|
|
2150
|
+
return ret >>> 0;
|
|
2151
|
+
}
|
|
2152
|
+
/**
|
|
2153
|
+
* Size of generated bytecode
|
|
2154
|
+
* @param {number} arg0
|
|
2155
|
+
*/
|
|
2156
|
+
set bytecode_size(arg0) {
|
|
2157
|
+
wasm.__wbg_set_wasmenhancedcompilationresult_bytecode_size(this.__wbg_ptr, arg0);
|
|
2158
|
+
}
|
|
2159
|
+
/**
|
|
2160
|
+
* Compilation time in milliseconds
|
|
2161
|
+
* @returns {number}
|
|
2162
|
+
*/
|
|
2163
|
+
get compilation_time() {
|
|
2164
|
+
const ret = wasm.__wbg_get_wasmanalysisresult_analysis_time(this.__wbg_ptr);
|
|
2165
|
+
return ret;
|
|
2166
|
+
}
|
|
2167
|
+
/**
|
|
2168
|
+
* Compilation time in milliseconds
|
|
2169
|
+
* @param {number} arg0
|
|
2170
|
+
*/
|
|
2171
|
+
set compilation_time(arg0) {
|
|
2172
|
+
wasm.__wbg_set_wasmanalysisresult_analysis_time(this.__wbg_ptr, arg0);
|
|
2173
|
+
}
|
|
2174
|
+
/**
|
|
2175
|
+
* Total error count
|
|
2176
|
+
* @returns {number}
|
|
2177
|
+
*/
|
|
2178
|
+
get error_count() {
|
|
2179
|
+
const ret = wasm.__wbg_get_wasmenhancedcompilationresult_error_count(this.__wbg_ptr);
|
|
2180
|
+
return ret >>> 0;
|
|
2181
|
+
}
|
|
2182
|
+
/**
|
|
2183
|
+
* Total error count
|
|
2184
|
+
* @param {number} arg0
|
|
2185
|
+
*/
|
|
2186
|
+
set error_count(arg0) {
|
|
2187
|
+
wasm.__wbg_set_wasmenhancedcompilationresult_error_count(this.__wbg_ptr, arg0);
|
|
2188
|
+
}
|
|
2189
|
+
/**
|
|
2190
|
+
* Total warning count
|
|
2191
|
+
* @returns {number}
|
|
2192
|
+
*/
|
|
2193
|
+
get warning_count() {
|
|
2194
|
+
const ret = wasm.__wbg_get_wasmenhancedcompilationresult_warning_count(this.__wbg_ptr);
|
|
2195
|
+
return ret >>> 0;
|
|
2196
|
+
}
|
|
2197
|
+
/**
|
|
2198
|
+
* Total warning count
|
|
2199
|
+
* @param {number} arg0
|
|
2200
|
+
*/
|
|
2201
|
+
set warning_count(arg0) {
|
|
2202
|
+
wasm.__wbg_set_wasmenhancedcompilationresult_warning_count(this.__wbg_ptr, arg0);
|
|
2203
|
+
}
|
|
2204
|
+
/**
|
|
2205
|
+
* @returns {WasmCompilerError[]}
|
|
2206
|
+
*/
|
|
2207
|
+
get compiler_errors() {
|
|
2208
|
+
const ret = wasm.wasmenhancedcompilationresult_compiler_errors(this.__wbg_ptr);
|
|
2209
|
+
var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
|
|
2210
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
2211
|
+
return v1;
|
|
2212
|
+
}
|
|
2213
|
+
/**
|
|
2214
|
+
* Get all errors formatted as terminal output
|
|
2215
|
+
* @returns {string}
|
|
2216
|
+
*/
|
|
2217
|
+
format_all_terminal() {
|
|
2218
|
+
let deferred1_0;
|
|
2219
|
+
let deferred1_1;
|
|
2220
|
+
try {
|
|
2221
|
+
const ret = wasm.wasmenhancedcompilationresult_format_all_terminal(this.__wbg_ptr);
|
|
2222
|
+
deferred1_0 = ret[0];
|
|
2223
|
+
deferred1_1 = ret[1];
|
|
2224
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
2225
|
+
} finally {
|
|
2226
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
2227
|
+
}
|
|
2228
|
+
}
|
|
2229
|
+
/**
|
|
2230
|
+
* Get all errors as JSON array
|
|
2231
|
+
* @returns {string}
|
|
2232
|
+
*/
|
|
2233
|
+
format_all_json() {
|
|
2234
|
+
let deferred1_0;
|
|
2235
|
+
let deferred1_1;
|
|
2236
|
+
try {
|
|
2237
|
+
const ret = wasm.wasmenhancedcompilationresult_format_all_json(this.__wbg_ptr);
|
|
2238
|
+
deferred1_0 = ret[0];
|
|
2239
|
+
deferred1_1 = ret[1];
|
|
2240
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
2241
|
+
} finally {
|
|
2242
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
2243
|
+
}
|
|
2244
|
+
}
|
|
2245
|
+
}
|
|
2246
|
+
if (Symbol.dispose) WasmEnhancedCompilationResult.prototype[Symbol.dispose] = WasmEnhancedCompilationResult.prototype.free;
|
|
2247
|
+
|
|
2248
|
+
/**
|
|
2249
|
+
* WASM DSL Compiler for client-side compilation
|
|
2250
|
+
*/
|
|
2251
|
+
export class WasmFiveCompiler {
|
|
2252
|
+
__destroy_into_raw() {
|
|
2253
|
+
const ptr = this.__wbg_ptr;
|
|
2254
|
+
this.__wbg_ptr = 0;
|
|
2255
|
+
WasmFiveCompilerFinalization.unregister(this);
|
|
2256
|
+
return ptr;
|
|
2257
|
+
}
|
|
2258
|
+
free() {
|
|
2259
|
+
const ptr = this.__destroy_into_raw();
|
|
2260
|
+
wasm.__wbg_wasmfivecompiler_free(ptr, 0);
|
|
2261
|
+
}
|
|
2262
|
+
/**
|
|
2263
|
+
* Create a new WASM compiler instance
|
|
2264
|
+
*/
|
|
2265
|
+
constructor() {
|
|
2266
|
+
const ret = wasm.wasmfivecompiler_new();
|
|
2267
|
+
this.__wbg_ptr = ret >>> 0;
|
|
2268
|
+
WasmFiveCompilerFinalization.register(this, this.__wbg_ptr, this);
|
|
2269
|
+
return this;
|
|
2270
|
+
}
|
|
2271
|
+
/**
|
|
2272
|
+
* Format an error message using the native terminal formatter
|
|
2273
|
+
* This provides rich Rust-style error output with source context and colors
|
|
2274
|
+
* @param {string} message
|
|
2275
|
+
* @param {string} code
|
|
2276
|
+
* @param {string} severity
|
|
2277
|
+
* @param {number} line
|
|
2278
|
+
* @param {number} column
|
|
2279
|
+
* @param {string} _source
|
|
2280
|
+
* @returns {string}
|
|
2281
|
+
*/
|
|
2282
|
+
format_error_terminal(message, code, severity, line, column, _source) {
|
|
2283
|
+
let deferred5_0;
|
|
2284
|
+
let deferred5_1;
|
|
2285
|
+
try {
|
|
2286
|
+
const ptr0 = passStringToWasm0(message, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2287
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2288
|
+
const ptr1 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2289
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2290
|
+
const ptr2 = passStringToWasm0(severity, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2291
|
+
const len2 = WASM_VECTOR_LEN;
|
|
2292
|
+
const ptr3 = passStringToWasm0(_source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2293
|
+
const len3 = WASM_VECTOR_LEN;
|
|
2294
|
+
const ret = wasm.wasmfivecompiler_format_error_terminal(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, line, column, ptr3, len3);
|
|
2295
|
+
deferred5_0 = ret[0];
|
|
2296
|
+
deferred5_1 = ret[1];
|
|
2297
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
2298
|
+
} finally {
|
|
2299
|
+
wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
|
|
2300
|
+
}
|
|
2301
|
+
}
|
|
2302
|
+
/**
|
|
2303
|
+
* Unified compilation method with enhanced error reporting and metrics
|
|
2304
|
+
* @param {string} source
|
|
2305
|
+
* @param {WasmCompilationOptions} options
|
|
2306
|
+
* @returns {WasmCompilationResult}
|
|
2307
|
+
*/
|
|
2308
|
+
compile(source, options) {
|
|
2309
|
+
const ptr0 = passStringToWasm0(source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2310
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2311
|
+
_assertClass(options, WasmCompilationOptions);
|
|
2312
|
+
const ret = wasm.wasmfivecompiler_compile(this.__wbg_ptr, ptr0, len0, options.__wbg_ptr);
|
|
2313
|
+
return WasmCompilationResult.__wrap(ret);
|
|
2314
|
+
}
|
|
2315
|
+
/**
|
|
2316
|
+
* Compile multi-file project with automatic discovery
|
|
2317
|
+
* @param {string} entry_point
|
|
2318
|
+
* @param {WasmCompilationOptions} options
|
|
2319
|
+
* @returns {WasmCompilationResult}
|
|
2320
|
+
*/
|
|
2321
|
+
compileMultiWithDiscovery(entry_point, options) {
|
|
2322
|
+
const ptr0 = passStringToWasm0(entry_point, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2323
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2324
|
+
_assertClass(options, WasmCompilationOptions);
|
|
2325
|
+
const ret = wasm.wasmfivecompiler_compileMultiWithDiscovery(this.__wbg_ptr, ptr0, len0, options.__wbg_ptr);
|
|
2326
|
+
if (ret[2]) {
|
|
2327
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2328
|
+
}
|
|
2329
|
+
return WasmCompilationResult.__wrap(ret[0]);
|
|
2330
|
+
}
|
|
2331
|
+
/**
|
|
2332
|
+
* Discover modules starting from an entry point
|
|
2333
|
+
* @param {string} entry_point
|
|
2334
|
+
* @returns {any}
|
|
2335
|
+
*/
|
|
2336
|
+
discoverModules(entry_point) {
|
|
2337
|
+
const ptr0 = passStringToWasm0(entry_point, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2338
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2339
|
+
const ret = wasm.wasmfivecompiler_discoverModules(this.__wbg_ptr, ptr0, len0);
|
|
2340
|
+
if (ret[2]) {
|
|
2341
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2342
|
+
}
|
|
2343
|
+
return takeFromExternrefTable0(ret[0]);
|
|
2344
|
+
}
|
|
2345
|
+
/**
|
|
2346
|
+
* Compile multi-file project with explicit module list
|
|
2347
|
+
* @param {any} module_files
|
|
2348
|
+
* @param {string} entry_point
|
|
2349
|
+
* @param {WasmCompilationOptions} options
|
|
2350
|
+
* @returns {WasmCompilationResult}
|
|
2351
|
+
*/
|
|
2352
|
+
compileModules(module_files, entry_point, options) {
|
|
2353
|
+
const ptr0 = passStringToWasm0(entry_point, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2354
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2355
|
+
_assertClass(options, WasmCompilationOptions);
|
|
2356
|
+
const ret = wasm.wasmfivecompiler_compileModules(this.__wbg_ptr, module_files, ptr0, len0, options.__wbg_ptr);
|
|
2357
|
+
if (ret[2]) {
|
|
2358
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2359
|
+
}
|
|
2360
|
+
return WasmCompilationResult.__wrap(ret[0]);
|
|
2361
|
+
}
|
|
2362
|
+
/**
|
|
2363
|
+
* Extract function name metadata from compiled bytecode
|
|
2364
|
+
* Returns a list of discovered functions in the bytecode
|
|
2365
|
+
* @param {Uint8Array} bytecode
|
|
2366
|
+
* @returns {any}
|
|
2367
|
+
*/
|
|
2368
|
+
extractFunctionMetadata(bytecode) {
|
|
2369
|
+
const ptr0 = passArray8ToWasm0(bytecode, wasm.__wbindgen_malloc);
|
|
2370
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2371
|
+
const ret = wasm.wasmfivecompiler_extractFunctionMetadata(this.__wbg_ptr, ptr0, len0);
|
|
2372
|
+
if (ret[2]) {
|
|
2373
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2374
|
+
}
|
|
2375
|
+
return takeFromExternrefTable0(ret[0]);
|
|
2376
|
+
}
|
|
2377
|
+
/**
|
|
2378
|
+
* Multi-file compilation using module merger (main source + modules)
|
|
2379
|
+
* @param {string} main_source
|
|
2380
|
+
* @param {any} modules
|
|
2381
|
+
* @param {WasmCompilationOptions} options
|
|
2382
|
+
* @returns {WasmCompilationResult}
|
|
2383
|
+
*/
|
|
2384
|
+
compile_multi(main_source, modules, options) {
|
|
2385
|
+
const ptr0 = passStringToWasm0(main_source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2386
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2387
|
+
_assertClass(options, WasmCompilationOptions);
|
|
2388
|
+
const ret = wasm.wasmfivecompiler_compile_multi(this.__wbg_ptr, ptr0, len0, modules, options.__wbg_ptr);
|
|
2389
|
+
return WasmCompilationResult.__wrap(ret);
|
|
2390
|
+
}
|
|
2391
|
+
/**
|
|
2392
|
+
* Get detailed analysis of source code
|
|
2393
|
+
* @param {string} source
|
|
2394
|
+
* @returns {WasmAnalysisResult}
|
|
2395
|
+
*/
|
|
2396
|
+
analyze_source(source) {
|
|
2397
|
+
const ptr0 = passStringToWasm0(source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2398
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2399
|
+
const ret = wasm.wasmfivecompiler_analyze_source(this.__wbg_ptr, ptr0, len0);
|
|
2400
|
+
return WasmAnalysisResult.__wrap(ret);
|
|
2401
|
+
}
|
|
2402
|
+
/**
|
|
2403
|
+
* Get opcode usage statistics from compilation
|
|
2404
|
+
* @param {string} source
|
|
2405
|
+
* @returns {any}
|
|
2406
|
+
*/
|
|
2407
|
+
get_opcode_usage(source) {
|
|
2408
|
+
const ptr0 = passStringToWasm0(source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2409
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2410
|
+
const ret = wasm.wasmfivecompiler_get_opcode_usage(this.__wbg_ptr, ptr0, len0);
|
|
2411
|
+
if (ret[2]) {
|
|
2412
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2413
|
+
}
|
|
2414
|
+
return takeFromExternrefTable0(ret[0]);
|
|
2415
|
+
}
|
|
2416
|
+
/**
|
|
2417
|
+
* Get comprehensive compiler statistics including which opcodes are used vs unused
|
|
2418
|
+
* @param {string} source
|
|
2419
|
+
* @returns {any}
|
|
2420
|
+
*/
|
|
2421
|
+
get_opcode_analysis(source) {
|
|
2422
|
+
const ptr0 = passStringToWasm0(source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2423
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2424
|
+
const ret = wasm.wasmfivecompiler_get_opcode_analysis(this.__wbg_ptr, ptr0, len0);
|
|
2425
|
+
if (ret[2]) {
|
|
2426
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2427
|
+
}
|
|
2428
|
+
return takeFromExternrefTable0(ret[0]);
|
|
2429
|
+
}
|
|
2430
|
+
/**
|
|
2431
|
+
* Get detailed analysis of source code with compilation mode selection
|
|
2432
|
+
* @param {string} source
|
|
2433
|
+
* @param {string} mode
|
|
2434
|
+
* @returns {WasmAnalysisResult}
|
|
2435
|
+
*/
|
|
2436
|
+
analyze_source_mode(source, mode) {
|
|
2437
|
+
const ptr0 = passStringToWasm0(source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2438
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2439
|
+
const ptr1 = passStringToWasm0(mode, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2440
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2441
|
+
const ret = wasm.wasmfivecompiler_analyze_source_mode(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
2442
|
+
return WasmAnalysisResult.__wrap(ret);
|
|
2443
|
+
}
|
|
2444
|
+
/**
|
|
2445
|
+
* Parse DSL source code and return AST information
|
|
2446
|
+
* @param {string} source
|
|
2447
|
+
* @returns {any}
|
|
2448
|
+
*/
|
|
2449
|
+
parse_dsl(source) {
|
|
2450
|
+
const ptr0 = passStringToWasm0(source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2451
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2452
|
+
const ret = wasm.wasmfivecompiler_parse_dsl(this.__wbg_ptr, ptr0, len0);
|
|
2453
|
+
if (ret[2]) {
|
|
2454
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2455
|
+
}
|
|
2456
|
+
return takeFromExternrefTable0(ret[0]);
|
|
2457
|
+
}
|
|
2458
|
+
/**
|
|
2459
|
+
* Type-check parsed AST
|
|
2460
|
+
* @param {string} _ast_json
|
|
2461
|
+
* @returns {any}
|
|
2462
|
+
*/
|
|
2463
|
+
type_check(_ast_json) {
|
|
2464
|
+
const ptr0 = passStringToWasm0(_ast_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2465
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2466
|
+
const ret = wasm.wasmfivecompiler_type_check(this.__wbg_ptr, ptr0, len0);
|
|
2467
|
+
if (ret[2]) {
|
|
2468
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2469
|
+
}
|
|
2470
|
+
return takeFromExternrefTable0(ret[0]);
|
|
2471
|
+
}
|
|
2472
|
+
/**
|
|
2473
|
+
* Optimize bytecode
|
|
2474
|
+
* @param {Uint8Array} bytecode
|
|
2475
|
+
* @returns {Uint8Array}
|
|
2476
|
+
*/
|
|
2477
|
+
optimize_bytecode(bytecode) {
|
|
2478
|
+
const ptr0 = passArray8ToWasm0(bytecode, wasm.__wbindgen_malloc);
|
|
2479
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2480
|
+
const ret = wasm.wasmfivecompiler_optimize_bytecode(this.__wbg_ptr, ptr0, len0);
|
|
2481
|
+
if (ret[2]) {
|
|
2482
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2483
|
+
}
|
|
2484
|
+
return takeFromExternrefTable0(ret[0]);
|
|
2485
|
+
}
|
|
2486
|
+
/**
|
|
2487
|
+
* Extract account definitions from DSL source code
|
|
2488
|
+
* @param {string} source
|
|
2489
|
+
* @returns {any}
|
|
2490
|
+
*/
|
|
2491
|
+
extract_account_definitions(source) {
|
|
2492
|
+
const ptr0 = passStringToWasm0(source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2493
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2494
|
+
const ret = wasm.wasmfivecompiler_extract_account_definitions(this.__wbg_ptr, ptr0, len0);
|
|
2495
|
+
if (ret[2]) {
|
|
2496
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2497
|
+
}
|
|
2498
|
+
return takeFromExternrefTable0(ret[0]);
|
|
2499
|
+
}
|
|
2500
|
+
/**
|
|
2501
|
+
* Extract function signatures with account parameters
|
|
2502
|
+
* @param {string} source
|
|
2503
|
+
* @returns {any}
|
|
2504
|
+
*/
|
|
2505
|
+
extract_function_signatures(source) {
|
|
2506
|
+
const ptr0 = passStringToWasm0(source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2507
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2508
|
+
const ret = wasm.wasmfivecompiler_extract_function_signatures(this.__wbg_ptr, ptr0, len0);
|
|
2509
|
+
if (ret[2]) {
|
|
2510
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2511
|
+
}
|
|
2512
|
+
return takeFromExternrefTable0(ret[0]);
|
|
2513
|
+
}
|
|
2514
|
+
/**
|
|
2515
|
+
* Validate account constraints against function parameters
|
|
2516
|
+
* @param {string} source
|
|
2517
|
+
* @param {string} function_name
|
|
2518
|
+
* @param {string} accounts_json
|
|
2519
|
+
* @returns {any}
|
|
2520
|
+
*/
|
|
2521
|
+
validate_account_constraints(source, function_name, accounts_json) {
|
|
2522
|
+
const ptr0 = passStringToWasm0(source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2523
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2524
|
+
const ptr1 = passStringToWasm0(function_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2525
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2526
|
+
const ptr2 = passStringToWasm0(accounts_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2527
|
+
const len2 = WASM_VECTOR_LEN;
|
|
2528
|
+
const ret = wasm.wasmfivecompiler_validate_account_constraints(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
2529
|
+
if (ret[2]) {
|
|
2530
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2531
|
+
}
|
|
2532
|
+
return takeFromExternrefTable0(ret[0]);
|
|
2533
|
+
}
|
|
2534
|
+
/**
|
|
2535
|
+
* Get compiler statistics
|
|
2536
|
+
* @returns {any}
|
|
2537
|
+
*/
|
|
2538
|
+
get_compiler_stats() {
|
|
2539
|
+
const ret = wasm.wasmfivecompiler_get_compiler_stats(this.__wbg_ptr);
|
|
2540
|
+
return ret;
|
|
2541
|
+
}
|
|
2542
|
+
/**
|
|
2543
|
+
* Generate ABI from DSL source code for function calls
|
|
2544
|
+
* @param {string} source
|
|
2545
|
+
* @returns {any}
|
|
2546
|
+
*/
|
|
2547
|
+
generate_abi(source) {
|
|
2548
|
+
const ptr0 = passStringToWasm0(source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2549
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2550
|
+
const ret = wasm.wasmfivecompiler_generate_abi(this.__wbg_ptr, ptr0, len0);
|
|
2551
|
+
if (ret[2]) {
|
|
2552
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2553
|
+
}
|
|
2554
|
+
return takeFromExternrefTable0(ret[0]);
|
|
2555
|
+
}
|
|
2556
|
+
/**
|
|
2557
|
+
* Compile DSL and generate both bytecode and ABI
|
|
2558
|
+
* @param {string} source
|
|
2559
|
+
* @returns {any}
|
|
2560
|
+
*/
|
|
2561
|
+
compile_with_abi(source) {
|
|
2562
|
+
const ptr0 = passStringToWasm0(source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2563
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2564
|
+
const ret = wasm.wasmfivecompiler_compile_with_abi(this.__wbg_ptr, ptr0, len0);
|
|
2565
|
+
if (ret[2]) {
|
|
2566
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2567
|
+
}
|
|
2568
|
+
return takeFromExternrefTable0(ret[0]);
|
|
2569
|
+
}
|
|
2570
|
+
/**
|
|
2571
|
+
* Validate DSL syntax without full compilation
|
|
2572
|
+
* @param {string} source
|
|
2573
|
+
* @returns {any}
|
|
2574
|
+
*/
|
|
2575
|
+
validate_syntax(source) {
|
|
2576
|
+
const ptr0 = passStringToWasm0(source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2577
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2578
|
+
const ret = wasm.wasmfivecompiler_validate_syntax(this.__wbg_ptr, ptr0, len0);
|
|
2579
|
+
return ret;
|
|
2580
|
+
}
|
|
2581
|
+
}
|
|
2582
|
+
if (Symbol.dispose) WasmFiveCompiler.prototype[Symbol.dispose] = WasmFiveCompiler.prototype.free;
|
|
2583
|
+
|
|
2584
|
+
/**
|
|
2585
|
+
* WASM-exposed metrics collector wrapper
|
|
2586
|
+
*/
|
|
2587
|
+
export class WasmMetricsCollector {
|
|
2588
|
+
__destroy_into_raw() {
|
|
2589
|
+
const ptr = this.__wbg_ptr;
|
|
2590
|
+
this.__wbg_ptr = 0;
|
|
2591
|
+
WasmMetricsCollectorFinalization.unregister(this);
|
|
2592
|
+
return ptr;
|
|
2593
|
+
}
|
|
2594
|
+
free() {
|
|
2595
|
+
const ptr = this.__destroy_into_raw();
|
|
2596
|
+
wasm.__wbg_wasmmetricscollector_free(ptr, 0);
|
|
2597
|
+
}
|
|
2598
|
+
constructor() {
|
|
2599
|
+
const ret = wasm.wasmmetricscollector_new();
|
|
2600
|
+
this.__wbg_ptr = ret >>> 0;
|
|
2601
|
+
WasmMetricsCollectorFinalization.register(this, this.__wbg_ptr, this);
|
|
2602
|
+
return this;
|
|
2603
|
+
}
|
|
2604
|
+
/**
|
|
2605
|
+
* Start timing a compilation phase
|
|
2606
|
+
* @param {string} phase_name
|
|
2607
|
+
*/
|
|
2608
|
+
start_phase(phase_name) {
|
|
2609
|
+
const ptr0 = passStringToWasm0(phase_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2610
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2611
|
+
wasm.wasmmetricscollector_start_phase(this.__wbg_ptr, ptr0, len0);
|
|
2612
|
+
}
|
|
2613
|
+
/**
|
|
2614
|
+
* End the current compilation phase
|
|
2615
|
+
*/
|
|
2616
|
+
end_phase() {
|
|
2617
|
+
wasm.wasmmetricscollector_end_phase(this.__wbg_ptr);
|
|
2618
|
+
}
|
|
2619
|
+
/**
|
|
2620
|
+
* Finalize metrics collection
|
|
2621
|
+
*/
|
|
2622
|
+
finalize() {
|
|
2623
|
+
wasm.wasmmetricscollector_finalize(this.__wbg_ptr);
|
|
2624
|
+
}
|
|
2625
|
+
/**
|
|
2626
|
+
* Reset the collector for a new compilation
|
|
2627
|
+
*/
|
|
2628
|
+
reset() {
|
|
2629
|
+
wasm.wasmmetricscollector_reset(this.__wbg_ptr);
|
|
2630
|
+
}
|
|
2631
|
+
/**
|
|
2632
|
+
* Export metrics in the requested format
|
|
2633
|
+
* @param {string} format
|
|
2634
|
+
* @returns {string}
|
|
2635
|
+
*/
|
|
2636
|
+
export(format) {
|
|
2637
|
+
let deferred3_0;
|
|
2638
|
+
let deferred3_1;
|
|
2639
|
+
try {
|
|
2640
|
+
const ptr0 = passStringToWasm0(format, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2641
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2642
|
+
const ret = wasm.wasmmetricscollector_export(this.__wbg_ptr, ptr0, len0);
|
|
2643
|
+
var ptr2 = ret[0];
|
|
2644
|
+
var len2 = ret[1];
|
|
2645
|
+
if (ret[3]) {
|
|
2646
|
+
ptr2 = 0; len2 = 0;
|
|
2647
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
2648
|
+
}
|
|
2649
|
+
deferred3_0 = ptr2;
|
|
2650
|
+
deferred3_1 = len2;
|
|
2651
|
+
return getStringFromWasm0(ptr2, len2);
|
|
2652
|
+
} finally {
|
|
2653
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
2654
|
+
}
|
|
2655
|
+
}
|
|
2656
|
+
/**
|
|
2657
|
+
* Get metrics as a JS object for programmatic use
|
|
2658
|
+
* @returns {any}
|
|
2659
|
+
*/
|
|
2660
|
+
get_metrics_object() {
|
|
2661
|
+
const ret = wasm.wasmmetricscollector_get_metrics_object(this.__wbg_ptr);
|
|
2662
|
+
if (ret[2]) {
|
|
2663
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2664
|
+
}
|
|
2665
|
+
return takeFromExternrefTable0(ret[0]);
|
|
2666
|
+
}
|
|
2667
|
+
}
|
|
2668
|
+
if (Symbol.dispose) WasmMetricsCollector.prototype[Symbol.dispose] = WasmMetricsCollector.prototype.free;
|
|
2669
|
+
|
|
2670
|
+
/**
|
|
2671
|
+
* Enhanced source location for WASM
|
|
2672
|
+
*/
|
|
2673
|
+
export class WasmSourceLocation {
|
|
2674
|
+
static __wrap(ptr) {
|
|
2675
|
+
ptr = ptr >>> 0;
|
|
2676
|
+
const obj = Object.create(WasmSourceLocation.prototype);
|
|
2677
|
+
obj.__wbg_ptr = ptr;
|
|
2678
|
+
WasmSourceLocationFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
2679
|
+
return obj;
|
|
2680
|
+
}
|
|
2681
|
+
__destroy_into_raw() {
|
|
2682
|
+
const ptr = this.__wbg_ptr;
|
|
2683
|
+
this.__wbg_ptr = 0;
|
|
2684
|
+
WasmSourceLocationFinalization.unregister(this);
|
|
2685
|
+
return ptr;
|
|
2686
|
+
}
|
|
2687
|
+
free() {
|
|
2688
|
+
const ptr = this.__destroy_into_raw();
|
|
2689
|
+
wasm.__wbg_wasmsourcelocation_free(ptr, 0);
|
|
2690
|
+
}
|
|
2691
|
+
/**
|
|
2692
|
+
* Line number (1-based)
|
|
2693
|
+
* @returns {number}
|
|
2694
|
+
*/
|
|
2695
|
+
get line() {
|
|
2696
|
+
const ret = wasm.__wbg_get_wasmsourcelocation_line(this.__wbg_ptr);
|
|
2697
|
+
return ret >>> 0;
|
|
2698
|
+
}
|
|
2699
|
+
/**
|
|
2700
|
+
* Line number (1-based)
|
|
2701
|
+
* @param {number} arg0
|
|
2702
|
+
*/
|
|
2703
|
+
set line(arg0) {
|
|
2704
|
+
wasm.__wbg_set_wasmsourcelocation_line(this.__wbg_ptr, arg0);
|
|
2705
|
+
}
|
|
2706
|
+
/**
|
|
2707
|
+
* Column number (1-based)
|
|
2708
|
+
* @returns {number}
|
|
2709
|
+
*/
|
|
2710
|
+
get column() {
|
|
2711
|
+
const ret = wasm.__wbg_get_wasmsourcelocation_column(this.__wbg_ptr);
|
|
2712
|
+
return ret >>> 0;
|
|
2713
|
+
}
|
|
2714
|
+
/**
|
|
2715
|
+
* Column number (1-based)
|
|
2716
|
+
* @param {number} arg0
|
|
2717
|
+
*/
|
|
2718
|
+
set column(arg0) {
|
|
2719
|
+
wasm.__wbg_set_wasmsourcelocation_column(this.__wbg_ptr, arg0);
|
|
2720
|
+
}
|
|
2721
|
+
/**
|
|
2722
|
+
* Byte offset in source
|
|
2723
|
+
* @returns {number}
|
|
2724
|
+
*/
|
|
2725
|
+
get offset() {
|
|
2726
|
+
const ret = wasm.__wbg_get_wasmsourcelocation_offset(this.__wbg_ptr);
|
|
2727
|
+
return ret >>> 0;
|
|
2728
|
+
}
|
|
2729
|
+
/**
|
|
2730
|
+
* Byte offset in source
|
|
2731
|
+
* @param {number} arg0
|
|
2732
|
+
*/
|
|
2733
|
+
set offset(arg0) {
|
|
2734
|
+
wasm.__wbg_set_wasmsourcelocation_offset(this.__wbg_ptr, arg0);
|
|
2735
|
+
}
|
|
2736
|
+
/**
|
|
2737
|
+
* Length of the relevant text
|
|
2738
|
+
* @returns {number}
|
|
2739
|
+
*/
|
|
2740
|
+
get length() {
|
|
2741
|
+
const ret = wasm.__wbg_get_wasmsourcelocation_length(this.__wbg_ptr);
|
|
2742
|
+
return ret >>> 0;
|
|
2743
|
+
}
|
|
2744
|
+
/**
|
|
2745
|
+
* Length of the relevant text
|
|
2746
|
+
* @param {number} arg0
|
|
2747
|
+
*/
|
|
2748
|
+
set length(arg0) {
|
|
2749
|
+
wasm.__wbg_set_wasmsourcelocation_length(this.__wbg_ptr, arg0);
|
|
2750
|
+
}
|
|
2751
|
+
/**
|
|
2752
|
+
* @returns {string | undefined}
|
|
2753
|
+
*/
|
|
2754
|
+
get file() {
|
|
2755
|
+
const ret = wasm.wasmsourcelocation_file(this.__wbg_ptr);
|
|
2756
|
+
let v1;
|
|
2757
|
+
if (ret[0] !== 0) {
|
|
2758
|
+
v1 = getStringFromWasm0(ret[0], ret[1]).slice();
|
|
2759
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
2760
|
+
}
|
|
2761
|
+
return v1;
|
|
2762
|
+
}
|
|
2763
|
+
}
|
|
2764
|
+
if (Symbol.dispose) WasmSourceLocation.prototype[Symbol.dispose] = WasmSourceLocation.prototype.free;
|
|
2765
|
+
|
|
2766
|
+
/**
|
|
2767
|
+
* Enhanced error suggestion for WASM
|
|
2768
|
+
*/
|
|
2769
|
+
export class WasmSuggestion {
|
|
2770
|
+
static __wrap(ptr) {
|
|
2771
|
+
ptr = ptr >>> 0;
|
|
2772
|
+
const obj = Object.create(WasmSuggestion.prototype);
|
|
2773
|
+
obj.__wbg_ptr = ptr;
|
|
2774
|
+
WasmSuggestionFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
2775
|
+
return obj;
|
|
2776
|
+
}
|
|
2777
|
+
__destroy_into_raw() {
|
|
2778
|
+
const ptr = this.__wbg_ptr;
|
|
2779
|
+
this.__wbg_ptr = 0;
|
|
2780
|
+
WasmSuggestionFinalization.unregister(this);
|
|
2781
|
+
return ptr;
|
|
2782
|
+
}
|
|
2783
|
+
free() {
|
|
2784
|
+
const ptr = this.__destroy_into_raw();
|
|
2785
|
+
wasm.__wbg_wasmsuggestion_free(ptr, 0);
|
|
2786
|
+
}
|
|
2787
|
+
/**
|
|
2788
|
+
* Confidence score (0.0 to 1.0)
|
|
2789
|
+
* @returns {number}
|
|
2790
|
+
*/
|
|
2791
|
+
get confidence() {
|
|
2792
|
+
const ret = wasm.__wbg_get_wasmanalysisresult_analysis_time(this.__wbg_ptr);
|
|
2793
|
+
return ret;
|
|
2794
|
+
}
|
|
2795
|
+
/**
|
|
2796
|
+
* Confidence score (0.0 to 1.0)
|
|
2797
|
+
* @param {number} arg0
|
|
2798
|
+
*/
|
|
2799
|
+
set confidence(arg0) {
|
|
2800
|
+
wasm.__wbg_set_wasmanalysisresult_analysis_time(this.__wbg_ptr, arg0);
|
|
2801
|
+
}
|
|
2802
|
+
/**
|
|
2803
|
+
* @returns {string}
|
|
2804
|
+
*/
|
|
2805
|
+
get message() {
|
|
2806
|
+
let deferred1_0;
|
|
2807
|
+
let deferred1_1;
|
|
2808
|
+
try {
|
|
2809
|
+
const ret = wasm.wasmsuggestion_message(this.__wbg_ptr);
|
|
2810
|
+
deferred1_0 = ret[0];
|
|
2811
|
+
deferred1_1 = ret[1];
|
|
2812
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
2813
|
+
} finally {
|
|
2814
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
2815
|
+
}
|
|
2816
|
+
}
|
|
2817
|
+
/**
|
|
2818
|
+
* @returns {string | undefined}
|
|
2819
|
+
*/
|
|
2820
|
+
get explanation() {
|
|
2821
|
+
const ret = wasm.wasmsuggestion_explanation(this.__wbg_ptr);
|
|
2822
|
+
let v1;
|
|
2823
|
+
if (ret[0] !== 0) {
|
|
2824
|
+
v1 = getStringFromWasm0(ret[0], ret[1]).slice();
|
|
2825
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
2826
|
+
}
|
|
2827
|
+
return v1;
|
|
2828
|
+
}
|
|
2829
|
+
/**
|
|
2830
|
+
* @returns {string | undefined}
|
|
2831
|
+
*/
|
|
2832
|
+
get code_suggestion() {
|
|
2833
|
+
const ret = wasm.wasmsuggestion_code_suggestion(this.__wbg_ptr);
|
|
2834
|
+
let v1;
|
|
2835
|
+
if (ret[0] !== 0) {
|
|
2836
|
+
v1 = getStringFromWasm0(ret[0], ret[1]).slice();
|
|
2837
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
2838
|
+
}
|
|
2839
|
+
return v1;
|
|
2840
|
+
}
|
|
2841
|
+
}
|
|
2842
|
+
if (Symbol.dispose) WasmSuggestion.prototype[Symbol.dispose] = WasmSuggestion.prototype.free;
|
|
2843
|
+
|
|
2844
|
+
/**
|
|
2845
|
+
* Get function names from bytecode as a JS value (array of objects)
|
|
2846
|
+
*
|
|
2847
|
+
* This function avoids constructing `FunctionNameInfo` JS instances and instead
|
|
2848
|
+
* marshals the parsed metadata directly into a serde-friendly structure and
|
|
2849
|
+
* returns a `JsValue` via `JsValue::from_serde`.
|
|
2850
|
+
* @param {Uint8Array} bytecode
|
|
2851
|
+
* @returns {any}
|
|
2852
|
+
*/
|
|
2853
|
+
export function get_function_names(bytecode) {
|
|
2854
|
+
const ptr0 = passArray8ToWasm0(bytecode, wasm.__wbindgen_malloc);
|
|
2855
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2856
|
+
const ret = wasm.get_function_names(ptr0, len0);
|
|
2857
|
+
if (ret[2]) {
|
|
2858
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2859
|
+
}
|
|
2860
|
+
return takeFromExternrefTable0(ret[0]);
|
|
2861
|
+
}
|
|
2862
|
+
|
|
2863
|
+
/**
|
|
2864
|
+
* Get the count of public functions from bytecode header
|
|
2865
|
+
* @param {Uint8Array} bytecode
|
|
2866
|
+
* @returns {number}
|
|
2867
|
+
*/
|
|
2868
|
+
export function get_public_function_count(bytecode) {
|
|
2869
|
+
const ptr0 = passArray8ToWasm0(bytecode, wasm.__wbindgen_malloc);
|
|
2870
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2871
|
+
const ret = wasm.get_public_function_count(ptr0, len0);
|
|
2872
|
+
if (ret[2]) {
|
|
2873
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2874
|
+
}
|
|
2875
|
+
return ret[0];
|
|
2876
|
+
}
|
|
2877
|
+
|
|
2878
|
+
/**
|
|
2879
|
+
* Get information about the WASM compiler capabilities
|
|
2880
|
+
* @returns {any}
|
|
2881
|
+
*/
|
|
2882
|
+
export function get_wasm_compiler_info() {
|
|
2883
|
+
const ret = wasm.get_wasm_compiler_info();
|
|
2884
|
+
return ret;
|
|
2885
|
+
}
|
|
2886
|
+
|
|
2887
|
+
/**
|
|
2888
|
+
* Helper function to convert JS value to VM Value
|
|
2889
|
+
* @param {any} js_val
|
|
2890
|
+
* @param {number} value_type
|
|
2891
|
+
* @returns {any}
|
|
2892
|
+
*/
|
|
2893
|
+
export function js_value_to_vm_value(js_val, value_type) {
|
|
2894
|
+
const ret = wasm.js_value_to_vm_value(js_val, value_type);
|
|
2895
|
+
if (ret[2]) {
|
|
2896
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2897
|
+
}
|
|
2898
|
+
return takeFromExternrefTable0(ret[0]);
|
|
2899
|
+
}
|
|
2900
|
+
|
|
2901
|
+
/**
|
|
2902
|
+
* @param {string} message
|
|
2903
|
+
*/
|
|
2904
|
+
export function log_to_console(message) {
|
|
2905
|
+
const ptr0 = passStringToWasm0(message, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2906
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2907
|
+
wasm.log_to_console(ptr0, len0);
|
|
2908
|
+
}
|
|
2909
|
+
|
|
2910
|
+
/**
|
|
2911
|
+
* Parse function names from bytecode metadata
|
|
2912
|
+
*
|
|
2913
|
+
* Returns a JS value which is a JSON string encoding an array of objects:
|
|
2914
|
+
* [ { "name": "...", "function_index": N }, ... ]
|
|
2915
|
+
* We serialize via serde_json and return the JSON string as a `JsValue` to
|
|
2916
|
+
* avoid complex JS object construction in Rust/WASM glue.
|
|
2917
|
+
* @param {Uint8Array} bytecode
|
|
2918
|
+
* @returns {any}
|
|
2919
|
+
*/
|
|
2920
|
+
export function parse_function_names(bytecode) {
|
|
2921
|
+
const ptr0 = passArray8ToWasm0(bytecode, wasm.__wbindgen_malloc);
|
|
2922
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2923
|
+
const ret = wasm.parse_function_names(ptr0, len0);
|
|
2924
|
+
if (ret[2]) {
|
|
2925
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2926
|
+
}
|
|
2927
|
+
return takeFromExternrefTable0(ret[0]);
|
|
2928
|
+
}
|
|
2929
|
+
|
|
2930
|
+
/**
|
|
2931
|
+
* Utility: Validate optimized headers and mirror bytecode back to JS callers
|
|
2932
|
+
* @param {Uint8Array} bytecode
|
|
2933
|
+
* @returns {Uint8Array}
|
|
2934
|
+
*/
|
|
2935
|
+
export function wrap_with_script_header(bytecode) {
|
|
2936
|
+
const ptr0 = passArray8ToWasm0(bytecode, wasm.__wbindgen_malloc);
|
|
2937
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2938
|
+
const ret = wasm.wrap_with_script_header(ptr0, len0);
|
|
2939
|
+
if (ret[2]) {
|
|
2940
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2941
|
+
}
|
|
2942
|
+
return takeFromExternrefTable0(ret[0]);
|
|
2943
|
+
}
|
|
2944
|
+
|
|
2945
|
+
export function __wbg_Error_52673b7de5a0ca89(arg0, arg1) {
|
|
2946
|
+
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
2947
|
+
return ret;
|
|
2948
|
+
};
|
|
2949
|
+
|
|
2950
|
+
export function __wbg_String_fed4d24b68977888(arg0, arg1) {
|
|
2951
|
+
const ret = String(arg1);
|
|
2952
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2953
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2954
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
2955
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
2956
|
+
};
|
|
2957
|
+
|
|
2958
|
+
export function __wbg___wbindgen_bigint_get_as_i64_6e32f5e6aff02e1d(arg0, arg1) {
|
|
2959
|
+
const v = arg1;
|
|
2960
|
+
const ret = typeof(v) === 'bigint' ? v : undefined;
|
|
2961
|
+
getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
|
|
2962
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
2963
|
+
};
|
|
2964
|
+
|
|
2965
|
+
export function __wbg___wbindgen_boolean_get_dea25b33882b895b(arg0) {
|
|
2966
|
+
const v = arg0;
|
|
2967
|
+
const ret = typeof(v) === 'boolean' ? v : undefined;
|
|
2968
|
+
return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
|
|
2969
|
+
};
|
|
2970
|
+
|
|
2971
|
+
export function __wbg___wbindgen_debug_string_adfb662ae34724b6(arg0, arg1) {
|
|
2972
|
+
const ret = debugString(arg1);
|
|
2973
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2974
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2975
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
2976
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
2977
|
+
};
|
|
2978
|
+
|
|
2979
|
+
export function __wbg___wbindgen_in_0d3e1e8f0c669317(arg0, arg1) {
|
|
2980
|
+
const ret = arg0 in arg1;
|
|
2981
|
+
return ret;
|
|
2982
|
+
};
|
|
2983
|
+
|
|
2984
|
+
export function __wbg___wbindgen_is_bigint_0e1a2e3f55cfae27(arg0) {
|
|
2985
|
+
const ret = typeof(arg0) === 'bigint';
|
|
2986
|
+
return ret;
|
|
2987
|
+
};
|
|
2988
|
+
|
|
2989
|
+
export function __wbg___wbindgen_is_function_8d400b8b1af978cd(arg0) {
|
|
2990
|
+
const ret = typeof(arg0) === 'function';
|
|
2991
|
+
return ret;
|
|
2992
|
+
};
|
|
2993
|
+
|
|
2994
|
+
export function __wbg___wbindgen_is_object_ce774f3490692386(arg0) {
|
|
2995
|
+
const val = arg0;
|
|
2996
|
+
const ret = typeof(val) === 'object' && val !== null;
|
|
2997
|
+
return ret;
|
|
2998
|
+
};
|
|
2999
|
+
|
|
3000
|
+
export function __wbg___wbindgen_is_string_704ef9c8fc131030(arg0) {
|
|
3001
|
+
const ret = typeof(arg0) === 'string';
|
|
3002
|
+
return ret;
|
|
3003
|
+
};
|
|
3004
|
+
|
|
3005
|
+
export function __wbg___wbindgen_is_undefined_f6b95eab589e0269(arg0) {
|
|
3006
|
+
const ret = arg0 === undefined;
|
|
3007
|
+
return ret;
|
|
3008
|
+
};
|
|
3009
|
+
|
|
3010
|
+
export function __wbg___wbindgen_jsval_eq_b6101cc9cef1fe36(arg0, arg1) {
|
|
3011
|
+
const ret = arg0 === arg1;
|
|
3012
|
+
return ret;
|
|
3013
|
+
};
|
|
3014
|
+
|
|
3015
|
+
export function __wbg___wbindgen_jsval_loose_eq_766057600fdd1b0d(arg0, arg1) {
|
|
3016
|
+
const ret = arg0 == arg1;
|
|
3017
|
+
return ret;
|
|
3018
|
+
};
|
|
3019
|
+
|
|
3020
|
+
export function __wbg___wbindgen_number_get_9619185a74197f95(arg0, arg1) {
|
|
3021
|
+
const obj = arg1;
|
|
3022
|
+
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
3023
|
+
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
3024
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
3025
|
+
};
|
|
3026
|
+
|
|
3027
|
+
export function __wbg___wbindgen_string_get_a2a31e16edf96e42(arg0, arg1) {
|
|
3028
|
+
const obj = arg1;
|
|
3029
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
3030
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3031
|
+
var len1 = WASM_VECTOR_LEN;
|
|
3032
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
3033
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
3034
|
+
};
|
|
3035
|
+
|
|
3036
|
+
export function __wbg___wbindgen_throw_dd24417ed36fc46e(arg0, arg1) {
|
|
3037
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
3038
|
+
};
|
|
3039
|
+
|
|
3040
|
+
export function __wbg_call_abb4ff46ce38be40() { return handleError(function (arg0, arg1) {
|
|
3041
|
+
const ret = arg0.call(arg1);
|
|
3042
|
+
return ret;
|
|
3043
|
+
}, arguments) };
|
|
3044
|
+
|
|
3045
|
+
export function __wbg_done_62ea16af4ce34b24(arg0) {
|
|
3046
|
+
const ret = arg0.done;
|
|
3047
|
+
return ret;
|
|
3048
|
+
};
|
|
3049
|
+
|
|
3050
|
+
export function __wbg_error_7534b8e9a36f1ab4(arg0, arg1) {
|
|
3051
|
+
let deferred0_0;
|
|
3052
|
+
let deferred0_1;
|
|
3053
|
+
try {
|
|
3054
|
+
deferred0_0 = arg0;
|
|
3055
|
+
deferred0_1 = arg1;
|
|
3056
|
+
console.error(getStringFromWasm0(arg0, arg1));
|
|
3057
|
+
} finally {
|
|
3058
|
+
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
3059
|
+
}
|
|
3060
|
+
};
|
|
3061
|
+
|
|
3062
|
+
export function __wbg_error_7bc7d576a6aaf855(arg0) {
|
|
3063
|
+
console.error(arg0);
|
|
3064
|
+
};
|
|
3065
|
+
|
|
3066
|
+
export function __wbg_getRandomValues_9b655bdd369112f2() { return handleError(function (arg0, arg1) {
|
|
3067
|
+
globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
|
|
3068
|
+
}, arguments) };
|
|
3069
|
+
|
|
3070
|
+
export function __wbg_get_6b7bd52aca3f9671(arg0, arg1) {
|
|
3071
|
+
const ret = arg0[arg1 >>> 0];
|
|
3072
|
+
return ret;
|
|
3073
|
+
};
|
|
3074
|
+
|
|
3075
|
+
export function __wbg_get_af9dab7e9603ea93() { return handleError(function (arg0, arg1) {
|
|
3076
|
+
const ret = Reflect.get(arg0, arg1);
|
|
3077
|
+
return ret;
|
|
3078
|
+
}, arguments) };
|
|
3079
|
+
|
|
3080
|
+
export function __wbg_get_with_ref_key_bb8f74a92cb2e784(arg0, arg1) {
|
|
3081
|
+
const ret = arg0[arg1];
|
|
3082
|
+
return ret;
|
|
3083
|
+
};
|
|
3084
|
+
|
|
3085
|
+
export function __wbg_instanceof_ArrayBuffer_f3320d2419cd0355(arg0) {
|
|
3086
|
+
let result;
|
|
3087
|
+
try {
|
|
3088
|
+
result = arg0 instanceof ArrayBuffer;
|
|
3089
|
+
} catch (_) {
|
|
3090
|
+
result = false;
|
|
3091
|
+
}
|
|
3092
|
+
const ret = result;
|
|
3093
|
+
return ret;
|
|
3094
|
+
};
|
|
3095
|
+
|
|
3096
|
+
export function __wbg_instanceof_Uint8Array_da54ccc9d3e09434(arg0) {
|
|
3097
|
+
let result;
|
|
3098
|
+
try {
|
|
3099
|
+
result = arg0 instanceof Uint8Array;
|
|
3100
|
+
} catch (_) {
|
|
3101
|
+
result = false;
|
|
3102
|
+
}
|
|
3103
|
+
const ret = result;
|
|
3104
|
+
return ret;
|
|
3105
|
+
};
|
|
3106
|
+
|
|
3107
|
+
export function __wbg_isArray_51fd9e6422c0a395(arg0) {
|
|
3108
|
+
const ret = Array.isArray(arg0);
|
|
3109
|
+
return ret;
|
|
3110
|
+
};
|
|
3111
|
+
|
|
3112
|
+
export function __wbg_isSafeInteger_ae7d3f054d55fa16(arg0) {
|
|
3113
|
+
const ret = Number.isSafeInteger(arg0);
|
|
3114
|
+
return ret;
|
|
3115
|
+
};
|
|
3116
|
+
|
|
3117
|
+
export function __wbg_iterator_27b7c8b35ab3e86b() {
|
|
3118
|
+
const ret = Symbol.iterator;
|
|
3119
|
+
return ret;
|
|
3120
|
+
};
|
|
3121
|
+
|
|
3122
|
+
export function __wbg_length_22ac23eaec9d8053(arg0) {
|
|
3123
|
+
const ret = arg0.length;
|
|
3124
|
+
return ret;
|
|
3125
|
+
};
|
|
3126
|
+
|
|
3127
|
+
export function __wbg_length_d45040a40c570362(arg0) {
|
|
3128
|
+
const ret = arg0.length;
|
|
3129
|
+
return ret;
|
|
3130
|
+
};
|
|
3131
|
+
|
|
3132
|
+
export function __wbg_log_1d990106d99dacb7(arg0) {
|
|
3133
|
+
console.log(arg0);
|
|
3134
|
+
};
|
|
3135
|
+
|
|
3136
|
+
export function __wbg_new_1ba21ce319a06297() {
|
|
3137
|
+
const ret = new Object();
|
|
3138
|
+
return ret;
|
|
3139
|
+
};
|
|
3140
|
+
|
|
3141
|
+
export function __wbg_new_25f239778d6112b9() {
|
|
3142
|
+
const ret = new Array();
|
|
3143
|
+
return ret;
|
|
3144
|
+
};
|
|
3145
|
+
|
|
3146
|
+
export function __wbg_new_6421f6084cc5bc5a(arg0) {
|
|
3147
|
+
const ret = new Uint8Array(arg0);
|
|
3148
|
+
return ret;
|
|
3149
|
+
};
|
|
3150
|
+
|
|
3151
|
+
export function __wbg_new_8a6f238a6ece86ea() {
|
|
3152
|
+
const ret = new Error();
|
|
3153
|
+
return ret;
|
|
3154
|
+
};
|
|
3155
|
+
|
|
3156
|
+
export function __wbg_new_b546ae120718850e() {
|
|
3157
|
+
const ret = new Map();
|
|
3158
|
+
return ret;
|
|
3159
|
+
};
|
|
3160
|
+
|
|
3161
|
+
export function __wbg_new_from_slice_f9c22b9153b26992(arg0, arg1) {
|
|
3162
|
+
const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
|
|
3163
|
+
return ret;
|
|
3164
|
+
};
|
|
3165
|
+
|
|
3166
|
+
export function __wbg_new_no_args_cb138f77cf6151ee(arg0, arg1) {
|
|
3167
|
+
const ret = new Function(getStringFromWasm0(arg0, arg1));
|
|
3168
|
+
return ret;
|
|
3169
|
+
};
|
|
3170
|
+
|
|
3171
|
+
export function __wbg_next_138a17bbf04e926c(arg0) {
|
|
3172
|
+
const ret = arg0.next;
|
|
3173
|
+
return ret;
|
|
3174
|
+
};
|
|
3175
|
+
|
|
3176
|
+
export function __wbg_next_3cfe5c0fe2a4cc53() { return handleError(function (arg0) {
|
|
3177
|
+
const ret = arg0.next();
|
|
3178
|
+
return ret;
|
|
3179
|
+
}, arguments) };
|
|
3180
|
+
|
|
3181
|
+
export function __wbg_now_2c95c9de01293173(arg0) {
|
|
3182
|
+
const ret = arg0.now();
|
|
3183
|
+
return ret;
|
|
3184
|
+
};
|
|
3185
|
+
|
|
3186
|
+
export function __wbg_now_69d776cd24f5215b() {
|
|
3187
|
+
const ret = Date.now();
|
|
3188
|
+
return ret;
|
|
3189
|
+
};
|
|
3190
|
+
|
|
3191
|
+
export function __wbg_parse_a09a54cf72639456() { return handleError(function (arg0, arg1) {
|
|
3192
|
+
const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
|
|
3193
|
+
return ret;
|
|
3194
|
+
}, arguments) };
|
|
3195
|
+
|
|
3196
|
+
export function __wbg_performance_7a3ffd0b17f663ad(arg0) {
|
|
3197
|
+
const ret = arg0.performance;
|
|
3198
|
+
return ret;
|
|
3199
|
+
};
|
|
3200
|
+
|
|
3201
|
+
export function __wbg_prototypesetcall_dfe9b766cdc1f1fd(arg0, arg1, arg2) {
|
|
3202
|
+
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
|
|
3203
|
+
};
|
|
3204
|
+
|
|
3205
|
+
export function __wbg_push_7d9be8f38fc13975(arg0, arg1) {
|
|
3206
|
+
const ret = arg0.push(arg1);
|
|
3207
|
+
return ret;
|
|
3208
|
+
};
|
|
3209
|
+
|
|
3210
|
+
export function __wbg_set_3fda3bac07393de4(arg0, arg1, arg2) {
|
|
3211
|
+
arg0[arg1] = arg2;
|
|
3212
|
+
};
|
|
3213
|
+
|
|
3214
|
+
export function __wbg_set_781438a03c0c3c81() { return handleError(function (arg0, arg1, arg2) {
|
|
3215
|
+
const ret = Reflect.set(arg0, arg1, arg2);
|
|
3216
|
+
return ret;
|
|
3217
|
+
}, arguments) };
|
|
3218
|
+
|
|
3219
|
+
export function __wbg_set_7df433eea03a5c14(arg0, arg1, arg2) {
|
|
3220
|
+
arg0[arg1 >>> 0] = arg2;
|
|
3221
|
+
};
|
|
3222
|
+
|
|
3223
|
+
export function __wbg_set_efaaf145b9377369(arg0, arg1, arg2) {
|
|
3224
|
+
const ret = arg0.set(arg1, arg2);
|
|
3225
|
+
return ret;
|
|
3226
|
+
};
|
|
3227
|
+
|
|
3228
|
+
export function __wbg_stack_0ed75d68575b0f3c(arg0, arg1) {
|
|
3229
|
+
const ret = arg1.stack;
|
|
3230
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3231
|
+
const len1 = WASM_VECTOR_LEN;
|
|
3232
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
3233
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
3234
|
+
};
|
|
3235
|
+
|
|
3236
|
+
export function __wbg_static_accessor_GLOBAL_769e6b65d6557335() {
|
|
3237
|
+
const ret = typeof global === 'undefined' ? null : global;
|
|
3238
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
3239
|
+
};
|
|
3240
|
+
|
|
3241
|
+
export function __wbg_static_accessor_GLOBAL_THIS_60cf02db4de8e1c1() {
|
|
3242
|
+
const ret = typeof globalThis === 'undefined' ? null : globalThis;
|
|
3243
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
3244
|
+
};
|
|
3245
|
+
|
|
3246
|
+
export function __wbg_static_accessor_SELF_08f5a74c69739274() {
|
|
3247
|
+
const ret = typeof self === 'undefined' ? null : self;
|
|
3248
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
3249
|
+
};
|
|
3250
|
+
|
|
3251
|
+
export function __wbg_static_accessor_WINDOW_a8924b26aa92d024() {
|
|
3252
|
+
const ret = typeof window === 'undefined' ? null : window;
|
|
3253
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
3254
|
+
};
|
|
3255
|
+
|
|
3256
|
+
export function __wbg_value_57b7b035e117f7ee(arg0) {
|
|
3257
|
+
const ret = arg0.value;
|
|
3258
|
+
return ret;
|
|
3259
|
+
};
|
|
3260
|
+
|
|
3261
|
+
export function __wbg_warn_6e567d0d926ff881(arg0) {
|
|
3262
|
+
console.warn(arg0);
|
|
3263
|
+
};
|
|
3264
|
+
|
|
3265
|
+
export function __wbg_wasmcompilererror_new(arg0) {
|
|
3266
|
+
const ret = WasmCompilerError.__wrap(arg0);
|
|
3267
|
+
return ret;
|
|
3268
|
+
};
|
|
3269
|
+
|
|
3270
|
+
export function __wbg_wasmsuggestion_new(arg0) {
|
|
3271
|
+
const ret = WasmSuggestion.__wrap(arg0);
|
|
3272
|
+
return ret;
|
|
3273
|
+
};
|
|
3274
|
+
|
|
3275
|
+
export function __wbindgen_cast_2241b6af4c4b2941(arg0, arg1) {
|
|
3276
|
+
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
3277
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
3278
|
+
return ret;
|
|
3279
|
+
};
|
|
3280
|
+
|
|
3281
|
+
export function __wbindgen_cast_4625c577ab2ec9ee(arg0) {
|
|
3282
|
+
// Cast intrinsic for `U64 -> Externref`.
|
|
3283
|
+
const ret = BigInt.asUintN(64, arg0);
|
|
3284
|
+
return ret;
|
|
3285
|
+
};
|
|
3286
|
+
|
|
3287
|
+
export function __wbindgen_cast_9ae0607507abb057(arg0) {
|
|
3288
|
+
// Cast intrinsic for `I64 -> Externref`.
|
|
3289
|
+
const ret = arg0;
|
|
3290
|
+
return ret;
|
|
3291
|
+
};
|
|
3292
|
+
|
|
3293
|
+
export function __wbindgen_cast_d6cd19b81560fd6e(arg0) {
|
|
3294
|
+
// Cast intrinsic for `F64 -> Externref`.
|
|
3295
|
+
const ret = arg0;
|
|
3296
|
+
return ret;
|
|
3297
|
+
};
|
|
3298
|
+
|
|
3299
|
+
export function __wbindgen_init_externref_table() {
|
|
3300
|
+
const table = wasm.__wbindgen_externrefs;
|
|
3301
|
+
const offset = table.grow(4);
|
|
3302
|
+
table.set(0, undefined);
|
|
3303
|
+
table.set(offset + 0, undefined);
|
|
3304
|
+
table.set(offset + 1, null);
|
|
3305
|
+
table.set(offset + 2, true);
|
|
3306
|
+
table.set(offset + 3, false);
|
|
3307
|
+
};
|