@noir-lang/noir_wasm 0.22.0 → 0.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/build/cjs/package.json +15 -0
  2. package/build/esm/package.json +18 -0
  3. package/dist/node/index_bg.wasm +0 -0
  4. package/dist/node/main.js +12857 -0
  5. package/dist/node/main.js.map +1 -0
  6. package/dist/types/build/cjs/index.d.ts +93 -0
  7. package/dist/types/build/esm/index.d.ts +92 -0
  8. package/dist/types/src/index.d.cts +8 -0
  9. package/dist/types/src/index.d.mts +8 -0
  10. package/dist/types/src/noir/debug.d.ts +2 -0
  11. package/dist/types/src/noir/dependencies/dependency-manager.d.ts +48 -0
  12. package/dist/types/src/noir/dependencies/dependency-resolver.d.ts +22 -0
  13. package/dist/types/src/noir/dependencies/github-dependency-resolver.d.ts +29 -0
  14. package/dist/types/src/noir/dependencies/local-dependency-resolver.d.ts +12 -0
  15. package/dist/types/src/noir/file-manager/file-manager.d.ts +74 -0
  16. package/dist/types/src/noir/file-manager/memfs-file-manager.d.ts +8 -0
  17. package/dist/types/src/noir/file-manager/nodejs-file-manager.d.ts +7 -0
  18. package/dist/types/src/noir/noir-wasm-compiler.d.ts +31 -0
  19. package/dist/types/src/noir/package.d.ts +81 -0
  20. package/dist/types/src/types/noir_artifact.d.ts +173 -0
  21. package/dist/types/src/types/noir_package_config.d.ts +44 -0
  22. package/dist/types/src/utils.d.ts +5 -0
  23. package/dist/types/web-test-runner.config.d.mts +9 -0
  24. package/dist/types/webpack.config.d.ts +4 -0
  25. package/dist/web/index.html +9 -0
  26. package/dist/web/main.mjs +35340 -0
  27. package/dist/web/main.mjs.map +1 -0
  28. package/package.json +64 -19
  29. package/nodejs/noir_wasm.d.ts +0 -149
  30. package/nodejs/noir_wasm.js +0 -606
  31. package/nodejs/noir_wasm_bg.wasm +0 -0
  32. package/nodejs/noir_wasm_bg.wasm.d.ts +0 -25
  33. package/web/noir_wasm.d.ts +0 -198
  34. package/web/noir_wasm.js +0 -661
  35. package/web/noir_wasm_bg.wasm +0 -0
  36. package/web/noir_wasm_bg.wasm.d.ts +0 -25
package/web/noir_wasm.js DELETED
@@ -1,661 +0,0 @@
1
- let wasm;
2
-
3
- const heap = new Array(128).fill(undefined);
4
-
5
- heap.push(undefined, null, true, false);
6
-
7
- function getObject(idx) { return heap[idx]; }
8
-
9
- let heap_next = heap.length;
10
-
11
- function dropObject(idx) {
12
- if (idx < 132) return;
13
- heap[idx] = heap_next;
14
- heap_next = idx;
15
- }
16
-
17
- function takeObject(idx) {
18
- const ret = getObject(idx);
19
- dropObject(idx);
20
- return ret;
21
- }
22
-
23
- const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
24
-
25
- if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
26
-
27
- let cachedUint8Memory0 = null;
28
-
29
- function getUint8Memory0() {
30
- if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
31
- cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
32
- }
33
- return cachedUint8Memory0;
34
- }
35
-
36
- function getStringFromWasm0(ptr, len) {
37
- ptr = ptr >>> 0;
38
- return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
39
- }
40
-
41
- function addHeapObject(obj) {
42
- if (heap_next === heap.length) heap.push(heap.length + 1);
43
- const idx = heap_next;
44
- heap_next = heap[idx];
45
-
46
- heap[idx] = obj;
47
- return idx;
48
- }
49
-
50
- let WASM_VECTOR_LEN = 0;
51
-
52
- const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );
53
-
54
- const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
55
- ? function (arg, view) {
56
- return cachedTextEncoder.encodeInto(arg, view);
57
- }
58
- : function (arg, view) {
59
- const buf = cachedTextEncoder.encode(arg);
60
- view.set(buf);
61
- return {
62
- read: arg.length,
63
- written: buf.length
64
- };
65
- });
66
-
67
- function passStringToWasm0(arg, malloc, realloc) {
68
-
69
- if (realloc === undefined) {
70
- const buf = cachedTextEncoder.encode(arg);
71
- const ptr = malloc(buf.length) >>> 0;
72
- getUint8Memory0().subarray(ptr, ptr + buf.length).set(buf);
73
- WASM_VECTOR_LEN = buf.length;
74
- return ptr;
75
- }
76
-
77
- let len = arg.length;
78
- let ptr = malloc(len) >>> 0;
79
-
80
- const mem = getUint8Memory0();
81
-
82
- let offset = 0;
83
-
84
- for (; offset < len; offset++) {
85
- const code = arg.charCodeAt(offset);
86
- if (code > 0x7F) break;
87
- mem[ptr + offset] = code;
88
- }
89
-
90
- if (offset !== len) {
91
- if (offset !== 0) {
92
- arg = arg.slice(offset);
93
- }
94
- ptr = realloc(ptr, len, len = offset + arg.length * 3) >>> 0;
95
- const view = getUint8Memory0().subarray(ptr + offset, ptr + len);
96
- const ret = encodeString(arg, view);
97
-
98
- offset += ret.written;
99
- }
100
-
101
- WASM_VECTOR_LEN = offset;
102
- return ptr;
103
- }
104
-
105
- function isLikeNone(x) {
106
- return x === undefined || x === null;
107
- }
108
-
109
- let cachedInt32Memory0 = null;
110
-
111
- function getInt32Memory0() {
112
- if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
113
- cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
114
- }
115
- return cachedInt32Memory0;
116
- }
117
-
118
- function debugString(val) {
119
- // primitive types
120
- const type = typeof val;
121
- if (type == 'number' || type == 'boolean' || val == null) {
122
- return `${val}`;
123
- }
124
- if (type == 'string') {
125
- return `"${val}"`;
126
- }
127
- if (type == 'symbol') {
128
- const description = val.description;
129
- if (description == null) {
130
- return 'Symbol';
131
- } else {
132
- return `Symbol(${description})`;
133
- }
134
- }
135
- if (type == 'function') {
136
- const name = val.name;
137
- if (typeof name == 'string' && name.length > 0) {
138
- return `Function(${name})`;
139
- } else {
140
- return 'Function';
141
- }
142
- }
143
- // objects
144
- if (Array.isArray(val)) {
145
- const length = val.length;
146
- let debug = '[';
147
- if (length > 0) {
148
- debug += debugString(val[0]);
149
- }
150
- for(let i = 1; i < length; i++) {
151
- debug += ', ' + debugString(val[i]);
152
- }
153
- debug += ']';
154
- return debug;
155
- }
156
- // Test for built-in
157
- const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
158
- let className;
159
- if (builtInMatches.length > 1) {
160
- className = builtInMatches[1];
161
- } else {
162
- // Failed to match the standard '[object ClassName]'
163
- return toString.call(val);
164
- }
165
- if (className == 'Object') {
166
- // we're a user defined class or Object
167
- // JSON.stringify avoids problems with cycles, and is generally much
168
- // easier than looping through ownProperties of `val`.
169
- try {
170
- return 'Object(' + JSON.stringify(val) + ')';
171
- } catch (_) {
172
- return 'Object';
173
- }
174
- }
175
- // errors
176
- if (val instanceof Error) {
177
- return `${val.name}: ${val.message}\n${val.stack}`;
178
- }
179
- // TODO we could test for more things here, like `Set`s and `Map`s.
180
- return className;
181
- }
182
-
183
- function passArray8ToWasm0(arg, malloc) {
184
- const ptr = malloc(arg.length * 1) >>> 0;
185
- getUint8Memory0().set(arg, ptr / 1);
186
- WASM_VECTOR_LEN = arg.length;
187
- return ptr;
188
- }
189
- /**
190
- * @param {Uint8Array} bytes
191
- * @returns {any}
192
- */
193
- export function acir_read_bytes(bytes) {
194
- const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_export_0);
195
- const len0 = WASM_VECTOR_LEN;
196
- const ret = wasm.acir_read_bytes(ptr0, len0);
197
- return takeObject(ret);
198
- }
199
-
200
- function getArrayU8FromWasm0(ptr, len) {
201
- ptr = ptr >>> 0;
202
- return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
203
- }
204
- /**
205
- * @param {any} acir
206
- * @returns {Uint8Array}
207
- */
208
- export function acir_write_bytes(acir) {
209
- try {
210
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
211
- wasm.acir_write_bytes(retptr, addHeapObject(acir));
212
- var r0 = getInt32Memory0()[retptr / 4 + 0];
213
- var r1 = getInt32Memory0()[retptr / 4 + 1];
214
- var v1 = getArrayU8FromWasm0(r0, r1).slice();
215
- wasm.__wbindgen_export_2(r0, r1 * 1);
216
- return v1;
217
- } finally {
218
- wasm.__wbindgen_add_to_stack_pointer(16);
219
- }
220
- }
221
-
222
- function _assertClass(instance, klass) {
223
- if (!(instance instanceof klass)) {
224
- throw new Error(`expected instance of ${klass.name}`);
225
- }
226
- return instance.ptr;
227
- }
228
- /**
229
- * This is a method that exposes the same API as `compile`
230
- * But uses the Context based APi internally
231
- * @param {string} entry_point
232
- * @param {boolean | undefined} contracts
233
- * @param {DependencyGraph | undefined} dependency_graph
234
- * @param {PathToFileSourceMap} file_source_map
235
- * @returns {CompileResult}
236
- */
237
- export function compile_(entry_point, contracts, dependency_graph, file_source_map) {
238
- try {
239
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
240
- const ptr0 = passStringToWasm0(entry_point, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
241
- const len0 = WASM_VECTOR_LEN;
242
- _assertClass(file_source_map, PathToFileSourceMap);
243
- var ptr1 = file_source_map.__destroy_into_raw();
244
- wasm.compile_(retptr, ptr0, len0, isLikeNone(contracts) ? 0xFFFFFF : contracts ? 1 : 0, isLikeNone(dependency_graph) ? 0 : addHeapObject(dependency_graph), ptr1);
245
- var r0 = getInt32Memory0()[retptr / 4 + 0];
246
- var r1 = getInt32Memory0()[retptr / 4 + 1];
247
- var r2 = getInt32Memory0()[retptr / 4 + 2];
248
- if (r2) {
249
- throw takeObject(r1);
250
- }
251
- return takeObject(r0);
252
- } finally {
253
- wasm.__wbindgen_add_to_stack_pointer(16);
254
- }
255
- }
256
-
257
- /**
258
- * @param {string} level
259
- */
260
- export function init_log_level(level) {
261
- const ptr0 = passStringToWasm0(level, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
262
- const len0 = WASM_VECTOR_LEN;
263
- wasm.init_log_level(ptr0, len0);
264
- }
265
-
266
- /**
267
- * @returns {any}
268
- */
269
- export function build_info() {
270
- const ret = wasm.build_info();
271
- return takeObject(ret);
272
- }
273
-
274
- /**
275
- * @param {string} entry_point
276
- * @param {boolean | undefined} contracts
277
- * @param {DependencyGraph | undefined} dependency_graph
278
- * @param {PathToFileSourceMap} file_source_map
279
- * @returns {CompileResult}
280
- */
281
- export function compile(entry_point, contracts, dependency_graph, file_source_map) {
282
- try {
283
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
284
- const ptr0 = passStringToWasm0(entry_point, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
285
- const len0 = WASM_VECTOR_LEN;
286
- _assertClass(file_source_map, PathToFileSourceMap);
287
- var ptr1 = file_source_map.__destroy_into_raw();
288
- wasm.compile(retptr, ptr0, len0, isLikeNone(contracts) ? 0xFFFFFF : contracts ? 1 : 0, isLikeNone(dependency_graph) ? 0 : addHeapObject(dependency_graph), ptr1);
289
- var r0 = getInt32Memory0()[retptr / 4 + 0];
290
- var r1 = getInt32Memory0()[retptr / 4 + 1];
291
- var r2 = getInt32Memory0()[retptr / 4 + 2];
292
- if (r2) {
293
- throw takeObject(r1);
294
- }
295
- return takeObject(r0);
296
- } finally {
297
- wasm.__wbindgen_add_to_stack_pointer(16);
298
- }
299
- }
300
-
301
- function handleError(f, args) {
302
- try {
303
- return f.apply(this, args);
304
- } catch (e) {
305
- wasm.__wbindgen_export_3(addHeapObject(e));
306
- }
307
- }
308
- /**
309
- * This is a wrapper class that is wasm-bindgen compatible
310
- * We do not use js_name and rename it like CrateId because
311
- * then the impl block is not picked up in javascript.
312
- */
313
- export class CompilerContext {
314
-
315
- static __wrap(ptr) {
316
- ptr = ptr >>> 0;
317
- const obj = Object.create(CompilerContext.prototype);
318
- obj.__wbg_ptr = ptr;
319
-
320
- return obj;
321
- }
322
-
323
- __destroy_into_raw() {
324
- const ptr = this.__wbg_ptr;
325
- this.__wbg_ptr = 0;
326
-
327
- return ptr;
328
- }
329
-
330
- free() {
331
- const ptr = this.__destroy_into_raw();
332
- wasm.__wbg_compilercontext_free(ptr);
333
- }
334
- /**
335
- * @param {PathToFileSourceMap} source_map
336
- */
337
- constructor(source_map) {
338
- _assertClass(source_map, PathToFileSourceMap);
339
- var ptr0 = source_map.__destroy_into_raw();
340
- const ret = wasm.compilercontext_new(ptr0);
341
- return CompilerContext.__wrap(ret);
342
- }
343
- /**
344
- * @param {string} path_to_crate
345
- * @returns {CrateId}
346
- */
347
- process_root_crate(path_to_crate) {
348
- const ptr0 = passStringToWasm0(path_to_crate, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
349
- const len0 = WASM_VECTOR_LEN;
350
- const ret = wasm.compilercontext_process_root_crate(this.__wbg_ptr, ptr0, len0);
351
- return CrateId.__wrap(ret);
352
- }
353
- /**
354
- * @param {string} path_to_crate
355
- * @returns {CrateId}
356
- */
357
- process_dependency_crate(path_to_crate) {
358
- const ptr0 = passStringToWasm0(path_to_crate, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
359
- const len0 = WASM_VECTOR_LEN;
360
- const ret = wasm.compilercontext_process_dependency_crate(this.__wbg_ptr, ptr0, len0);
361
- return CrateId.__wrap(ret);
362
- }
363
- /**
364
- * @param {string} crate_name
365
- * @param {CrateId} from
366
- * @param {CrateId} to
367
- */
368
- add_dependency_edge(crate_name, from, to) {
369
- const ptr0 = passStringToWasm0(crate_name, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
370
- const len0 = WASM_VECTOR_LEN;
371
- _assertClass(from, CrateId);
372
- _assertClass(to, CrateId);
373
- wasm.compilercontext_add_dependency_edge(this.__wbg_ptr, ptr0, len0, from.__wbg_ptr, to.__wbg_ptr);
374
- }
375
- /**
376
- * @param {number} program_width
377
- * @returns {CompileResult}
378
- */
379
- compile_program(program_width) {
380
- try {
381
- const ptr = this.__destroy_into_raw();
382
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
383
- wasm.compilercontext_compile_program(retptr, ptr, program_width);
384
- var r0 = getInt32Memory0()[retptr / 4 + 0];
385
- var r1 = getInt32Memory0()[retptr / 4 + 1];
386
- var r2 = getInt32Memory0()[retptr / 4 + 2];
387
- if (r2) {
388
- throw takeObject(r1);
389
- }
390
- return takeObject(r0);
391
- } finally {
392
- wasm.__wbindgen_add_to_stack_pointer(16);
393
- }
394
- }
395
- /**
396
- * @param {number} program_width
397
- * @returns {CompileResult}
398
- */
399
- compile_contract(program_width) {
400
- try {
401
- const ptr = this.__destroy_into_raw();
402
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
403
- wasm.compilercontext_compile_contract(retptr, ptr, program_width);
404
- var r0 = getInt32Memory0()[retptr / 4 + 0];
405
- var r1 = getInt32Memory0()[retptr / 4 + 1];
406
- var r2 = getInt32Memory0()[retptr / 4 + 2];
407
- if (r2) {
408
- throw takeObject(r1);
409
- }
410
- return takeObject(r0);
411
- } finally {
412
- wasm.__wbindgen_add_to_stack_pointer(16);
413
- }
414
- }
415
- }
416
- /**
417
- */
418
- export class CrateId {
419
-
420
- static __wrap(ptr) {
421
- ptr = ptr >>> 0;
422
- const obj = Object.create(CrateId.prototype);
423
- obj.__wbg_ptr = ptr;
424
-
425
- return obj;
426
- }
427
-
428
- __destroy_into_raw() {
429
- const ptr = this.__wbg_ptr;
430
- this.__wbg_ptr = 0;
431
-
432
- return ptr;
433
- }
434
-
435
- free() {
436
- const ptr = this.__destroy_into_raw();
437
- wasm.__wbg_crateid_free(ptr);
438
- }
439
- }
440
- /**
441
- */
442
- export class PathToFileSourceMap {
443
-
444
- static __wrap(ptr) {
445
- ptr = ptr >>> 0;
446
- const obj = Object.create(PathToFileSourceMap.prototype);
447
- obj.__wbg_ptr = ptr;
448
-
449
- return obj;
450
- }
451
-
452
- __destroy_into_raw() {
453
- const ptr = this.__wbg_ptr;
454
- this.__wbg_ptr = 0;
455
-
456
- return ptr;
457
- }
458
-
459
- free() {
460
- const ptr = this.__destroy_into_raw();
461
- wasm.__wbg_pathtofilesourcemap_free(ptr);
462
- }
463
- /**
464
- */
465
- constructor() {
466
- const ret = wasm.pathtofilesourcemap_new();
467
- return PathToFileSourceMap.__wrap(ret);
468
- }
469
- /**
470
- * @param {string} path
471
- * @param {string} source_code
472
- * @returns {boolean}
473
- */
474
- add_source_code(path, source_code) {
475
- const ptr0 = passStringToWasm0(path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
476
- const len0 = WASM_VECTOR_LEN;
477
- const ptr1 = passStringToWasm0(source_code, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
478
- const len1 = WASM_VECTOR_LEN;
479
- const ret = wasm.pathtofilesourcemap_add_source_code(this.__wbg_ptr, ptr0, len0, ptr1, len1);
480
- return ret !== 0;
481
- }
482
- }
483
-
484
- async function __wbg_load(module, imports) {
485
- if (typeof Response === 'function' && module instanceof Response) {
486
- if (typeof WebAssembly.instantiateStreaming === 'function') {
487
- try {
488
- return await WebAssembly.instantiateStreaming(module, imports);
489
-
490
- } catch (e) {
491
- if (module.headers.get('Content-Type') != 'application/wasm') {
492
- console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
493
-
494
- } else {
495
- throw e;
496
- }
497
- }
498
- }
499
-
500
- const bytes = await module.arrayBuffer();
501
- return await WebAssembly.instantiate(bytes, imports);
502
-
503
- } else {
504
- const instance = await WebAssembly.instantiate(module, imports);
505
-
506
- if (instance instanceof WebAssembly.Instance) {
507
- return { instance, module };
508
-
509
- } else {
510
- return instance;
511
- }
512
- }
513
- }
514
-
515
- function __wbg_get_imports() {
516
- const imports = {};
517
- imports.wbg = {};
518
- imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
519
- takeObject(arg0);
520
- };
521
- imports.wbg.__wbg_constructor_a29cdb41a75eb0e8 = function(arg0) {
522
- const ret = new Error(takeObject(arg0));
523
- return addHeapObject(ret);
524
- };
525
- imports.wbg.__wbindgen_is_undefined = function(arg0) {
526
- const ret = getObject(arg0) === undefined;
527
- return ret;
528
- };
529
- imports.wbg.__wbg_constructor_a3b5b211c5053ce8 = function() {
530
- const ret = new Object();
531
- return addHeapObject(ret);
532
- };
533
- imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
534
- const ret = getStringFromWasm0(arg0, arg1);
535
- return addHeapObject(ret);
536
- };
537
- imports.wbg.__wbg_new_abda76e883ba8a5f = function() {
538
- const ret = new Error();
539
- return addHeapObject(ret);
540
- };
541
- imports.wbg.__wbg_stack_658279fe44541cf6 = function(arg0, arg1) {
542
- const ret = getObject(arg1).stack;
543
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
544
- const len1 = WASM_VECTOR_LEN;
545
- getInt32Memory0()[arg0 / 4 + 1] = len1;
546
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
547
- };
548
- imports.wbg.__wbg_error_f851667af71bcfc6 = function(arg0, arg1) {
549
- let deferred0_0;
550
- let deferred0_1;
551
- try {
552
- deferred0_0 = arg0;
553
- deferred0_1 = arg1;
554
- console.error(getStringFromWasm0(arg0, arg1));
555
- } finally {
556
- wasm.__wbindgen_export_2(deferred0_0, deferred0_1);
557
- }
558
- };
559
- imports.wbg.__wbg_debug_efabe4eb183aa5d4 = function(arg0, arg1, arg2, arg3) {
560
- console.debug(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
561
- };
562
- imports.wbg.__wbg_error_a7e23606158b68b9 = function(arg0) {
563
- console.error(getObject(arg0));
564
- };
565
- imports.wbg.__wbg_error_50f42b952a595a23 = function(arg0, arg1, arg2, arg3) {
566
- console.error(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
567
- };
568
- imports.wbg.__wbg_info_24d8f53d98f12b95 = function(arg0, arg1, arg2, arg3) {
569
- console.info(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
570
- };
571
- imports.wbg.__wbg_log_9b164efbe6db702f = function(arg0, arg1, arg2, arg3) {
572
- console.log(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
573
- };
574
- imports.wbg.__wbg_warn_8342bfbc6028193a = function(arg0, arg1, arg2, arg3) {
575
- console.warn(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
576
- };
577
- imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
578
- const obj = getObject(arg1);
579
- const ret = typeof(obj) === 'string' ? obj : undefined;
580
- var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
581
- var len1 = WASM_VECTOR_LEN;
582
- getInt32Memory0()[arg0 / 4 + 1] = len1;
583
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
584
- };
585
- imports.wbg.__wbg_set_07da13cc24b69217 = function() { return handleError(function (arg0, arg1, arg2) {
586
- const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
587
- return ret;
588
- }, arguments) };
589
- imports.wbg.__wbg_parse_76a8a18ca3f8730b = function() { return handleError(function (arg0, arg1) {
590
- const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
591
- return addHeapObject(ret);
592
- }, arguments) };
593
- imports.wbg.__wbg_stringify_d06ad2addc54d51e = function() { return handleError(function (arg0) {
594
- const ret = JSON.stringify(getObject(arg0));
595
- return addHeapObject(ret);
596
- }, arguments) };
597
- imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
598
- const ret = debugString(getObject(arg1));
599
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
600
- const len1 = WASM_VECTOR_LEN;
601
- getInt32Memory0()[arg0 / 4 + 1] = len1;
602
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
603
- };
604
- imports.wbg.__wbindgen_throw = function(arg0, arg1) {
605
- throw new Error(getStringFromWasm0(arg0, arg1));
606
- };
607
-
608
- return imports;
609
- }
610
-
611
- function __wbg_init_memory(imports, maybe_memory) {
612
-
613
- }
614
-
615
- function __wbg_finalize_init(instance, module) {
616
- wasm = instance.exports;
617
- __wbg_init.__wbindgen_wasm_module = module;
618
- cachedInt32Memory0 = null;
619
- cachedUint8Memory0 = null;
620
-
621
-
622
- return wasm;
623
- }
624
-
625
- function initSync(module) {
626
- if (wasm !== undefined) return wasm;
627
-
628
- const imports = __wbg_get_imports();
629
-
630
- __wbg_init_memory(imports);
631
-
632
- if (!(module instanceof WebAssembly.Module)) {
633
- module = new WebAssembly.Module(module);
634
- }
635
-
636
- const instance = new WebAssembly.Instance(module, imports);
637
-
638
- return __wbg_finalize_init(instance, module);
639
- }
640
-
641
- async function __wbg_init(input) {
642
- if (wasm !== undefined) return wasm;
643
-
644
- if (typeof input === 'undefined') {
645
- input = new URL('noir_wasm_bg.wasm', import.meta.url);
646
- }
647
- const imports = __wbg_get_imports();
648
-
649
- if (typeof input === 'string' || (typeof Request === 'function' && input instanceof Request) || (typeof URL === 'function' && input instanceof URL)) {
650
- input = fetch(input);
651
- }
652
-
653
- __wbg_init_memory(imports);
654
-
655
- const { instance, module } = await __wbg_load(await input, imports);
656
-
657
- return __wbg_finalize_init(instance, module);
658
- }
659
-
660
- export { initSync }
661
- export default __wbg_init;
Binary file
@@ -1,25 +0,0 @@
1
- /* tslint:disable */
2
- /* eslint-disable */
3
- export const memory: WebAssembly.Memory;
4
- export function acir_read_bytes(a: number, b: number): number;
5
- export function acir_write_bytes(a: number, b: number): void;
6
- export function __wbg_compilercontext_free(a: number): void;
7
- export function __wbg_crateid_free(a: number): void;
8
- export function compilercontext_new(a: number): number;
9
- export function compilercontext_process_root_crate(a: number, b: number, c: number): number;
10
- export function compilercontext_process_dependency_crate(a: number, b: number, c: number): number;
11
- export function compilercontext_add_dependency_edge(a: number, b: number, c: number, d: number, e: number): void;
12
- export function compilercontext_compile_program(a: number, b: number, c: number): void;
13
- export function compilercontext_compile_contract(a: number, b: number, c: number): void;
14
- export function compile_(a: number, b: number, c: number, d: number, e: number, f: number): void;
15
- export function init_log_level(a: number, b: number): void;
16
- export function build_info(): number;
17
- export function __wbg_pathtofilesourcemap_free(a: number): void;
18
- export function pathtofilesourcemap_new(): number;
19
- export function pathtofilesourcemap_add_source_code(a: number, b: number, c: number, d: number, e: number): number;
20
- export function compile(a: number, b: number, c: number, d: number, e: number, f: number): void;
21
- export function __wbindgen_export_0(a: number): number;
22
- export function __wbindgen_export_1(a: number, b: number, c: number): number;
23
- export function __wbindgen_add_to_stack_pointer(a: number): number;
24
- export function __wbindgen_export_2(a: number, b: number): void;
25
- export function __wbindgen_export_3(a: number): void;