@noir-lang/noir_wasm 0.16.0-1b40af8c1 → 0.16.0-6e2b70a
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/nodejs/noir_wasm.d.ts +15 -9
- package/nodejs/noir_wasm.js +105 -78
- package/nodejs/noir_wasm_bg.wasm +0 -0
- package/nodejs/noir_wasm_bg.wasm.d.ts +5 -5
- package/package.json +2 -2
- package/web/noir_wasm.d.ts +20 -14
- package/web/noir_wasm.js +99 -74
- package/web/noir_wasm_bg.wasm +0 -0
- package/web/noir_wasm_bg.wasm.d.ts +5 -5
package/nodejs/noir_wasm.d.ts
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
/**
|
|
4
|
-
* @param {
|
|
4
|
+
* @param {Uint8Array} bytes
|
|
5
5
|
* @returns {any}
|
|
6
6
|
*/
|
|
7
|
-
export function
|
|
7
|
+
export function acir_read_bytes(bytes: Uint8Array): any;
|
|
8
|
+
/**
|
|
9
|
+
* @param {any} acir
|
|
10
|
+
* @returns {Uint8Array}
|
|
11
|
+
*/
|
|
12
|
+
export function acir_write_bytes(acir: any): Uint8Array;
|
|
8
13
|
/**
|
|
9
14
|
* @param {string} level
|
|
10
15
|
*/
|
|
@@ -14,12 +19,13 @@ export function init_log_level(level: string): void;
|
|
|
14
19
|
*/
|
|
15
20
|
export function build_info(): any;
|
|
16
21
|
/**
|
|
17
|
-
* @param {
|
|
22
|
+
* @param {string} entry_point
|
|
23
|
+
* @param {boolean | undefined} contracts
|
|
24
|
+
* @param {string[] | undefined} dependencies
|
|
18
25
|
* @returns {any}
|
|
19
26
|
*/
|
|
20
|
-
export function
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
export function acir_write_bytes(acir: any): Uint8Array;
|
|
27
|
+
export function compile(entry_point: string, contracts?: boolean, dependencies?: string[]): any;
|
|
28
|
+
|
|
29
|
+
export type CompileError = Error;
|
|
30
|
+
|
|
31
|
+
|
package/nodejs/noir_wasm.js
CHANGED
|
@@ -2,7 +2,7 @@ let imports = {};
|
|
|
2
2
|
imports['__wbindgen_placeholder__'] = module.exports;
|
|
3
3
|
let wasm;
|
|
4
4
|
const { read_file } = require(`@noir-lang/source-resolver`);
|
|
5
|
-
const {
|
|
5
|
+
const { TextEncoder, TextDecoder } = require(`util`);
|
|
6
6
|
|
|
7
7
|
const heap = new Array(128).fill(undefined);
|
|
8
8
|
|
|
@@ -10,23 +10,7 @@ heap.push(undefined, null, true, false);
|
|
|
10
10
|
|
|
11
11
|
function getObject(idx) { return heap[idx]; }
|
|
12
12
|
|
|
13
|
-
let
|
|
14
|
-
|
|
15
|
-
function dropObject(idx) {
|
|
16
|
-
if (idx < 132) return;
|
|
17
|
-
heap[idx] = heap_next;
|
|
18
|
-
heap_next = idx;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
function takeObject(idx) {
|
|
22
|
-
const ret = getObject(idx);
|
|
23
|
-
dropObject(idx);
|
|
24
|
-
return ret;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
28
|
-
|
|
29
|
-
cachedTextDecoder.decode();
|
|
13
|
+
let WASM_VECTOR_LEN = 0;
|
|
30
14
|
|
|
31
15
|
let cachedUint8Memory0 = null;
|
|
32
16
|
|
|
@@ -37,22 +21,6 @@ function getUint8Memory0() {
|
|
|
37
21
|
return cachedUint8Memory0;
|
|
38
22
|
}
|
|
39
23
|
|
|
40
|
-
function getStringFromWasm0(ptr, len) {
|
|
41
|
-
ptr = ptr >>> 0;
|
|
42
|
-
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
function addHeapObject(obj) {
|
|
46
|
-
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
47
|
-
const idx = heap_next;
|
|
48
|
-
heap_next = heap[idx];
|
|
49
|
-
|
|
50
|
-
heap[idx] = obj;
|
|
51
|
-
return idx;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
let WASM_VECTOR_LEN = 0;
|
|
55
|
-
|
|
56
24
|
let cachedTextEncoder = new TextEncoder('utf-8');
|
|
57
25
|
|
|
58
26
|
const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
|
|
@@ -118,38 +86,38 @@ function getInt32Memory0() {
|
|
|
118
86
|
}
|
|
119
87
|
return cachedInt32Memory0;
|
|
120
88
|
}
|
|
121
|
-
/**
|
|
122
|
-
* @param {any} args
|
|
123
|
-
* @returns {any}
|
|
124
|
-
*/
|
|
125
|
-
module.exports.compile = function(args) {
|
|
126
|
-
const ret = wasm.compile(addHeapObject(args));
|
|
127
|
-
return takeObject(ret);
|
|
128
|
-
};
|
|
129
89
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
90
|
+
let heap_next = heap.length;
|
|
91
|
+
|
|
92
|
+
function dropObject(idx) {
|
|
93
|
+
if (idx < 132) return;
|
|
94
|
+
heap[idx] = heap_next;
|
|
95
|
+
heap_next = idx;
|
|
136
96
|
}
|
|
137
|
-
/**
|
|
138
|
-
* @param {string} level
|
|
139
|
-
*/
|
|
140
|
-
module.exports.init_log_level = function(level) {
|
|
141
|
-
const ptr0 = passStringToWasm0(level, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
142
|
-
const len0 = WASM_VECTOR_LEN;
|
|
143
|
-
wasm.init_log_level(ptr0, len0);
|
|
144
|
-
};
|
|
145
97
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
};
|
|
98
|
+
function takeObject(idx) {
|
|
99
|
+
const ret = getObject(idx);
|
|
100
|
+
dropObject(idx);
|
|
101
|
+
return ret;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
105
|
+
|
|
106
|
+
cachedTextDecoder.decode();
|
|
107
|
+
|
|
108
|
+
function getStringFromWasm0(ptr, len) {
|
|
109
|
+
ptr = ptr >>> 0;
|
|
110
|
+
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
function addHeapObject(obj) {
|
|
114
|
+
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
115
|
+
const idx = heap_next;
|
|
116
|
+
heap_next = heap[idx];
|
|
117
|
+
|
|
118
|
+
heap[idx] = obj;
|
|
119
|
+
return idx;
|
|
120
|
+
}
|
|
153
121
|
|
|
154
122
|
function passArray8ToWasm0(arg, malloc) {
|
|
155
123
|
const ptr = malloc(arg.length * 1) >>> 0;
|
|
@@ -183,27 +151,85 @@ module.exports.acir_write_bytes = function(acir) {
|
|
|
183
151
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
184
152
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
185
153
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
186
|
-
wasm.
|
|
154
|
+
wasm.__wbindgen_export_2(r0, r1 * 1);
|
|
187
155
|
return v1;
|
|
188
156
|
} finally {
|
|
189
157
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
190
158
|
}
|
|
191
159
|
};
|
|
192
160
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
161
|
+
/**
|
|
162
|
+
* @param {string} level
|
|
163
|
+
*/
|
|
164
|
+
module.exports.init_log_level = function(level) {
|
|
165
|
+
const ptr0 = passStringToWasm0(level, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
166
|
+
const len0 = WASM_VECTOR_LEN;
|
|
167
|
+
wasm.init_log_level(ptr0, len0);
|
|
196
168
|
};
|
|
197
169
|
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
170
|
+
/**
|
|
171
|
+
* @returns {any}
|
|
172
|
+
*/
|
|
173
|
+
module.exports.build_info = function() {
|
|
174
|
+
const ret = wasm.build_info();
|
|
175
|
+
return takeObject(ret);
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* @param {string} entry_point
|
|
180
|
+
* @param {boolean | undefined} contracts
|
|
181
|
+
* @param {string[] | undefined} dependencies
|
|
182
|
+
* @returns {any}
|
|
183
|
+
*/
|
|
184
|
+
module.exports.compile = function(entry_point, contracts, dependencies) {
|
|
185
|
+
try {
|
|
186
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
187
|
+
const ptr0 = passStringToWasm0(entry_point, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
188
|
+
const len0 = WASM_VECTOR_LEN;
|
|
189
|
+
wasm.compile(retptr, ptr0, len0, isLikeNone(contracts) ? 0xFFFFFF : contracts ? 1 : 0, isLikeNone(dependencies) ? 0 : addHeapObject(dependencies));
|
|
190
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
191
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
192
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
193
|
+
if (r2) {
|
|
194
|
+
throw takeObject(r1);
|
|
195
|
+
}
|
|
196
|
+
return takeObject(r0);
|
|
197
|
+
} finally {
|
|
198
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
199
|
+
}
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
function handleError(f, args) {
|
|
203
|
+
try {
|
|
204
|
+
return f.apply(this, args);
|
|
205
|
+
} catch (e) {
|
|
206
|
+
wasm.__wbindgen_export_3(addHeapObject(e));
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
module.exports.__wbindgen_string_get = function(arg0, arg1) {
|
|
211
|
+
const obj = getObject(arg1);
|
|
212
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
213
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
214
|
+
var len1 = WASM_VECTOR_LEN;
|
|
215
|
+
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
216
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
201
217
|
};
|
|
202
218
|
|
|
203
219
|
module.exports.__wbindgen_object_drop_ref = function(arg0) {
|
|
204
220
|
takeObject(arg0);
|
|
205
221
|
};
|
|
206
222
|
|
|
223
|
+
module.exports.__wbindgen_is_undefined = function(arg0) {
|
|
224
|
+
const ret = getObject(arg0) === undefined;
|
|
225
|
+
return ret;
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
module.exports.__wbg_constructor_ac1f808f67a5f1e9 = function(arg0) {
|
|
229
|
+
const ret = new Error(takeObject(arg0));
|
|
230
|
+
return addHeapObject(ret);
|
|
231
|
+
};
|
|
232
|
+
|
|
207
233
|
module.exports.__wbg_readfile_0c1777c7c5aa8c92 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
208
234
|
const ret = read_file(getStringFromWasm0(arg1, arg2));
|
|
209
235
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
@@ -238,7 +264,7 @@ module.exports.__wbg_error_f851667af71bcfc6 = function(arg0, arg1) {
|
|
|
238
264
|
deferred0_1 = arg1;
|
|
239
265
|
console.error(getStringFromWasm0(arg0, arg1));
|
|
240
266
|
} finally {
|
|
241
|
-
wasm.
|
|
267
|
+
wasm.__wbindgen_export_2(deferred0_0, deferred0_1);
|
|
242
268
|
}
|
|
243
269
|
};
|
|
244
270
|
|
|
@@ -266,13 +292,14 @@ module.exports.__wbg_warn_8342bfbc6028193a = function(arg0, arg1, arg2, arg3) {
|
|
|
266
292
|
console.warn(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
|
|
267
293
|
};
|
|
268
294
|
|
|
269
|
-
module.exports.
|
|
270
|
-
const
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
295
|
+
module.exports.__wbg_get_7303ed2ef026b2f5 = function(arg0, arg1) {
|
|
296
|
+
const ret = getObject(arg0)[arg1 >>> 0];
|
|
297
|
+
return addHeapObject(ret);
|
|
298
|
+
};
|
|
299
|
+
|
|
300
|
+
module.exports.__wbg_length_820c786973abdd8a = function(arg0) {
|
|
301
|
+
const ret = getObject(arg0).length;
|
|
302
|
+
return ret;
|
|
276
303
|
};
|
|
277
304
|
|
|
278
305
|
module.exports.__wbg_parse_76a8a18ca3f8730b = function() { return handleError(function (arg0, arg1) {
|
package/nodejs/noir_wasm_bg.wasm
CHANGED
|
Binary file
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
-
export function compile(a: number): number;
|
|
5
|
-
export function init_log_level(a: number, b: number): void;
|
|
6
|
-
export function build_info(): number;
|
|
7
4
|
export function acir_read_bytes(a: number, b: number): number;
|
|
8
5
|
export function acir_write_bytes(a: number, b: number): void;
|
|
6
|
+
export function init_log_level(a: number, b: number): void;
|
|
7
|
+
export function build_info(): number;
|
|
8
|
+
export function compile(a: number, b: number, c: number, d: number, e: number): void;
|
|
9
9
|
export function __wbindgen_export_0(a: number): number;
|
|
10
10
|
export function __wbindgen_export_1(a: number, b: number, c: number): number;
|
|
11
|
-
export function __wbindgen_export_2(a: number): void;
|
|
12
11
|
export function __wbindgen_add_to_stack_pointer(a: number): number;
|
|
13
|
-
export function
|
|
12
|
+
export function __wbindgen_export_2(a: number, b: number): void;
|
|
13
|
+
export function __wbindgen_export_3(a: number): void;
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"collaborators": [
|
|
4
4
|
"The Noir Team <team@noir-lang.org>"
|
|
5
5
|
],
|
|
6
|
-
"version": "0.16.0-
|
|
6
|
+
"version": "0.16.0-6e2b70a",
|
|
7
7
|
"license": "(MIT OR Apache-2.0)",
|
|
8
8
|
"main": "./nodejs/noir_wasm.js",
|
|
9
9
|
"types": "./web/noir_wasm.d.ts",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"lint": "NODE_NO_WARNINGS=1 eslint . --ext .ts --ignore-path ./.eslintignore --max-warnings 0"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
|
-
"@noir-lang/source-resolver": "0.16.0-
|
|
32
|
+
"@noir-lang/source-resolver": "0.16.0-6e2b70a"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@esm-bundle/chai": "^4.3.4-fix.0",
|
package/web/noir_wasm.d.ts
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
/**
|
|
4
|
-
* @param {
|
|
4
|
+
* @param {Uint8Array} bytes
|
|
5
5
|
* @returns {any}
|
|
6
6
|
*/
|
|
7
|
-
export function
|
|
7
|
+
export function acir_read_bytes(bytes: Uint8Array): any;
|
|
8
|
+
/**
|
|
9
|
+
* @param {any} acir
|
|
10
|
+
* @returns {Uint8Array}
|
|
11
|
+
*/
|
|
12
|
+
export function acir_write_bytes(acir: any): Uint8Array;
|
|
8
13
|
/**
|
|
9
14
|
* @param {string} level
|
|
10
15
|
*/
|
|
@@ -14,30 +19,31 @@ export function init_log_level(level: string): void;
|
|
|
14
19
|
*/
|
|
15
20
|
export function build_info(): any;
|
|
16
21
|
/**
|
|
17
|
-
* @param {
|
|
22
|
+
* @param {string} entry_point
|
|
23
|
+
* @param {boolean | undefined} contracts
|
|
24
|
+
* @param {string[] | undefined} dependencies
|
|
18
25
|
* @returns {any}
|
|
19
26
|
*/
|
|
20
|
-
export function
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
export function acir_write_bytes(acir: any): Uint8Array;
|
|
27
|
+
export function compile(entry_point: string, contracts?: boolean, dependencies?: string[]): any;
|
|
28
|
+
|
|
29
|
+
export type CompileError = Error;
|
|
30
|
+
|
|
31
|
+
|
|
26
32
|
|
|
27
33
|
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
28
34
|
|
|
29
35
|
export interface InitOutput {
|
|
30
36
|
readonly memory: WebAssembly.Memory;
|
|
31
|
-
readonly compile: (a: number) => number;
|
|
32
|
-
readonly init_log_level: (a: number, b: number) => void;
|
|
33
|
-
readonly build_info: () => number;
|
|
34
37
|
readonly acir_read_bytes: (a: number, b: number) => number;
|
|
35
38
|
readonly acir_write_bytes: (a: number, b: number) => void;
|
|
39
|
+
readonly init_log_level: (a: number, b: number) => void;
|
|
40
|
+
readonly build_info: () => number;
|
|
41
|
+
readonly compile: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
36
42
|
readonly __wbindgen_export_0: (a: number) => number;
|
|
37
43
|
readonly __wbindgen_export_1: (a: number, b: number, c: number) => number;
|
|
38
|
-
readonly __wbindgen_export_2: (a: number) => void;
|
|
39
44
|
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
40
|
-
readonly
|
|
45
|
+
readonly __wbindgen_export_2: (a: number, b: number) => void;
|
|
46
|
+
readonly __wbindgen_export_3: (a: number) => void;
|
|
41
47
|
}
|
|
42
48
|
|
|
43
49
|
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
package/web/noir_wasm.js
CHANGED
|
@@ -8,23 +8,7 @@ heap.push(undefined, null, true, false);
|
|
|
8
8
|
|
|
9
9
|
function getObject(idx) { return heap[idx]; }
|
|
10
10
|
|
|
11
|
-
let
|
|
12
|
-
|
|
13
|
-
function dropObject(idx) {
|
|
14
|
-
if (idx < 132) return;
|
|
15
|
-
heap[idx] = heap_next;
|
|
16
|
-
heap_next = idx;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
function takeObject(idx) {
|
|
20
|
-
const ret = getObject(idx);
|
|
21
|
-
dropObject(idx);
|
|
22
|
-
return ret;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
|
|
26
|
-
|
|
27
|
-
if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
|
|
11
|
+
let WASM_VECTOR_LEN = 0;
|
|
28
12
|
|
|
29
13
|
let cachedUint8Memory0 = null;
|
|
30
14
|
|
|
@@ -35,22 +19,6 @@ function getUint8Memory0() {
|
|
|
35
19
|
return cachedUint8Memory0;
|
|
36
20
|
}
|
|
37
21
|
|
|
38
|
-
function getStringFromWasm0(ptr, len) {
|
|
39
|
-
ptr = ptr >>> 0;
|
|
40
|
-
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
function addHeapObject(obj) {
|
|
44
|
-
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
45
|
-
const idx = heap_next;
|
|
46
|
-
heap_next = heap[idx];
|
|
47
|
-
|
|
48
|
-
heap[idx] = obj;
|
|
49
|
-
return idx;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
let WASM_VECTOR_LEN = 0;
|
|
53
|
-
|
|
54
22
|
const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );
|
|
55
23
|
|
|
56
24
|
const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
|
|
@@ -116,37 +84,37 @@ function getInt32Memory0() {
|
|
|
116
84
|
}
|
|
117
85
|
return cachedInt32Memory0;
|
|
118
86
|
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
87
|
+
|
|
88
|
+
let heap_next = heap.length;
|
|
89
|
+
|
|
90
|
+
function dropObject(idx) {
|
|
91
|
+
if (idx < 132) return;
|
|
92
|
+
heap[idx] = heap_next;
|
|
93
|
+
heap_next = idx;
|
|
126
94
|
}
|
|
127
95
|
|
|
128
|
-
function
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
wasm.__wbindgen_export_2(addHeapObject(e));
|
|
133
|
-
}
|
|
96
|
+
function takeObject(idx) {
|
|
97
|
+
const ret = getObject(idx);
|
|
98
|
+
dropObject(idx);
|
|
99
|
+
return ret;
|
|
134
100
|
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
101
|
+
|
|
102
|
+
const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
|
|
103
|
+
|
|
104
|
+
if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
|
|
105
|
+
|
|
106
|
+
function getStringFromWasm0(ptr, len) {
|
|
107
|
+
ptr = ptr >>> 0;
|
|
108
|
+
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
142
109
|
}
|
|
143
110
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
111
|
+
function addHeapObject(obj) {
|
|
112
|
+
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
113
|
+
const idx = heap_next;
|
|
114
|
+
heap_next = heap[idx];
|
|
115
|
+
|
|
116
|
+
heap[idx] = obj;
|
|
117
|
+
return idx;
|
|
150
118
|
}
|
|
151
119
|
|
|
152
120
|
function passArray8ToWasm0(arg, malloc) {
|
|
@@ -181,13 +149,62 @@ export function acir_write_bytes(acir) {
|
|
|
181
149
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
182
150
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
183
151
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
184
|
-
wasm.
|
|
152
|
+
wasm.__wbindgen_export_2(r0, r1 * 1);
|
|
185
153
|
return v1;
|
|
186
154
|
} finally {
|
|
187
155
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
188
156
|
}
|
|
189
157
|
}
|
|
190
158
|
|
|
159
|
+
/**
|
|
160
|
+
* @param {string} level
|
|
161
|
+
*/
|
|
162
|
+
export function init_log_level(level) {
|
|
163
|
+
const ptr0 = passStringToWasm0(level, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
164
|
+
const len0 = WASM_VECTOR_LEN;
|
|
165
|
+
wasm.init_log_level(ptr0, len0);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* @returns {any}
|
|
170
|
+
*/
|
|
171
|
+
export function build_info() {
|
|
172
|
+
const ret = wasm.build_info();
|
|
173
|
+
return takeObject(ret);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* @param {string} entry_point
|
|
178
|
+
* @param {boolean | undefined} contracts
|
|
179
|
+
* @param {string[] | undefined} dependencies
|
|
180
|
+
* @returns {any}
|
|
181
|
+
*/
|
|
182
|
+
export function compile(entry_point, contracts, dependencies) {
|
|
183
|
+
try {
|
|
184
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
185
|
+
const ptr0 = passStringToWasm0(entry_point, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
186
|
+
const len0 = WASM_VECTOR_LEN;
|
|
187
|
+
wasm.compile(retptr, ptr0, len0, isLikeNone(contracts) ? 0xFFFFFF : contracts ? 1 : 0, isLikeNone(dependencies) ? 0 : addHeapObject(dependencies));
|
|
188
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
189
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
190
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
191
|
+
if (r2) {
|
|
192
|
+
throw takeObject(r1);
|
|
193
|
+
}
|
|
194
|
+
return takeObject(r0);
|
|
195
|
+
} finally {
|
|
196
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
function handleError(f, args) {
|
|
201
|
+
try {
|
|
202
|
+
return f.apply(this, args);
|
|
203
|
+
} catch (e) {
|
|
204
|
+
wasm.__wbindgen_export_3(addHeapObject(e));
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
191
208
|
async function __wbg_load(module, imports) {
|
|
192
209
|
if (typeof Response === 'function' && module instanceof Response) {
|
|
193
210
|
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
@@ -222,16 +239,24 @@ async function __wbg_load(module, imports) {
|
|
|
222
239
|
function __wbg_get_imports() {
|
|
223
240
|
const imports = {};
|
|
224
241
|
imports.wbg = {};
|
|
242
|
+
imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
|
|
243
|
+
const obj = getObject(arg1);
|
|
244
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
245
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
246
|
+
var len1 = WASM_VECTOR_LEN;
|
|
247
|
+
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
248
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
249
|
+
};
|
|
250
|
+
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
|
|
251
|
+
takeObject(arg0);
|
|
252
|
+
};
|
|
225
253
|
imports.wbg.__wbindgen_is_undefined = function(arg0) {
|
|
226
254
|
const ret = getObject(arg0) === undefined;
|
|
227
255
|
return ret;
|
|
228
256
|
};
|
|
229
|
-
imports.wbg.
|
|
230
|
-
const ret =
|
|
231
|
-
return ret;
|
|
232
|
-
};
|
|
233
|
-
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
|
|
234
|
-
takeObject(arg0);
|
|
257
|
+
imports.wbg.__wbg_constructor_ac1f808f67a5f1e9 = function(arg0) {
|
|
258
|
+
const ret = new Error(takeObject(arg0));
|
|
259
|
+
return addHeapObject(ret);
|
|
235
260
|
};
|
|
236
261
|
imports.wbg.__wbg_readfile_0c1777c7c5aa8c92 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
237
262
|
const ret = read_file(getStringFromWasm0(arg1, arg2));
|
|
@@ -263,7 +288,7 @@ function __wbg_get_imports() {
|
|
|
263
288
|
deferred0_1 = arg1;
|
|
264
289
|
console.error(getStringFromWasm0(arg0, arg1));
|
|
265
290
|
} finally {
|
|
266
|
-
wasm.
|
|
291
|
+
wasm.__wbindgen_export_2(deferred0_0, deferred0_1);
|
|
267
292
|
}
|
|
268
293
|
};
|
|
269
294
|
imports.wbg.__wbg_debug_efabe4eb183aa5d4 = function(arg0, arg1, arg2, arg3) {
|
|
@@ -284,13 +309,13 @@ function __wbg_get_imports() {
|
|
|
284
309
|
imports.wbg.__wbg_warn_8342bfbc6028193a = function(arg0, arg1, arg2, arg3) {
|
|
285
310
|
console.warn(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
|
|
286
311
|
};
|
|
287
|
-
imports.wbg.
|
|
288
|
-
const
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
312
|
+
imports.wbg.__wbg_get_7303ed2ef026b2f5 = function(arg0, arg1) {
|
|
313
|
+
const ret = getObject(arg0)[arg1 >>> 0];
|
|
314
|
+
return addHeapObject(ret);
|
|
315
|
+
};
|
|
316
|
+
imports.wbg.__wbg_length_820c786973abdd8a = function(arg0) {
|
|
317
|
+
const ret = getObject(arg0).length;
|
|
318
|
+
return ret;
|
|
294
319
|
};
|
|
295
320
|
imports.wbg.__wbg_parse_76a8a18ca3f8730b = function() { return handleError(function (arg0, arg1) {
|
|
296
321
|
const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
|
package/web/noir_wasm_bg.wasm
CHANGED
|
Binary file
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
-
export function compile(a: number): number;
|
|
5
|
-
export function init_log_level(a: number, b: number): void;
|
|
6
|
-
export function build_info(): number;
|
|
7
4
|
export function acir_read_bytes(a: number, b: number): number;
|
|
8
5
|
export function acir_write_bytes(a: number, b: number): void;
|
|
6
|
+
export function init_log_level(a: number, b: number): void;
|
|
7
|
+
export function build_info(): number;
|
|
8
|
+
export function compile(a: number, b: number, c: number, d: number, e: number): void;
|
|
9
9
|
export function __wbindgen_export_0(a: number): number;
|
|
10
10
|
export function __wbindgen_export_1(a: number, b: number, c: number): number;
|
|
11
|
-
export function __wbindgen_export_2(a: number): void;
|
|
12
11
|
export function __wbindgen_add_to_stack_pointer(a: number): number;
|
|
13
|
-
export function
|
|
12
|
+
export function __wbindgen_export_2(a: number, b: number): void;
|
|
13
|
+
export function __wbindgen_export_3(a: number): void;
|