@noir-lang/noir_wasm 0.3.2-29b1f7df → 0.3.2-41e0020

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 CHANGED
@@ -1,4 +1,4 @@
1
1
  # Noir Lang WASM JavaScript Package
2
2
 
3
3
  ## Tracks
4
- Noir lang Repository [noir-lang/noir@29b1f7df](https://github.com/noir-lang/noir/tree/29b1f7df4d563849a62e64c533cb62932188135b)
4
+ Noir lang Repository [noir-lang/noir@41e0020](https://github.com/noir-lang/noir/tree/41e00207b0eeae4d0285c617acac72c780cb0900)
@@ -26,6 +26,10 @@ export function acir_read_bytes(bytes: Uint8Array): any;
26
26
  */
27
27
  export function acir_write_bytes(acir: any): Uint8Array;
28
28
  /**
29
+ * @param {string} level
30
+ */
31
+ export function init_log_level(level: string): void;
32
+ /**
29
33
  * @returns {any}
30
34
  */
31
35
  export function build_info(): any;
@@ -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/noir-source-resolver`);
5
- const { TextEncoder, TextDecoder } = require(`util`);
5
+ const { TextDecoder, TextEncoder } = require(`util`);
6
6
 
7
7
  const heap = new Array(128).fill(undefined);
8
8
 
@@ -24,7 +24,9 @@ function takeObject(idx) {
24
24
  return ret;
25
25
  }
26
26
 
27
- let WASM_VECTOR_LEN = 0;
27
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
28
+
29
+ cachedTextDecoder.decode();
28
30
 
29
31
  let cachedUint8Memory0 = null;
30
32
 
@@ -35,20 +37,35 @@ function getUint8Memory0() {
35
37
  return cachedUint8Memory0;
36
38
  }
37
39
 
40
+ function getStringFromWasm0(ptr, len) {
41
+ return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
42
+ }
43
+
44
+ function addHeapObject(obj) {
45
+ if (heap_next === heap.length) heap.push(heap.length + 1);
46
+ const idx = heap_next;
47
+ heap_next = heap[idx];
48
+
49
+ heap[idx] = obj;
50
+ return idx;
51
+ }
52
+
53
+ let WASM_VECTOR_LEN = 0;
54
+
38
55
  let cachedTextEncoder = new TextEncoder('utf-8');
39
56
 
40
57
  const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
41
58
  ? function (arg, view) {
42
- return cachedTextEncoder.encodeInto(arg, view);
43
- }
59
+ return cachedTextEncoder.encodeInto(arg, view);
60
+ }
44
61
  : function (arg, view) {
45
- const buf = cachedTextEncoder.encode(arg);
46
- view.set(buf);
47
- return {
48
- read: arg.length,
49
- written: buf.length
50
- };
51
- });
62
+ const buf = cachedTextEncoder.encode(arg);
63
+ view.set(buf);
64
+ return {
65
+ read: arg.length,
66
+ written: buf.length
67
+ };
68
+ });
52
69
 
53
70
  function passStringToWasm0(arg, malloc, realloc) {
54
71
 
@@ -100,28 +117,11 @@ function getInt32Memory0() {
100
117
  }
101
118
  return cachedInt32Memory0;
102
119
  }
103
-
104
- let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
105
-
106
- cachedTextDecoder.decode();
107
-
108
- function getStringFromWasm0(ptr, len) {
109
- return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
110
- }
111
-
112
- function addHeapObject(obj) {
113
- if (heap_next === heap.length) heap.push(heap.length + 1);
114
- const idx = heap_next;
115
- heap_next = heap[idx];
116
-
117
- heap[idx] = obj;
118
- return idx;
119
- }
120
120
  /**
121
121
  * @param {any} args
122
122
  * @returns {any}
123
123
  */
124
- module.exports.compile = function (args) {
124
+ module.exports.compile = function(args) {
125
125
  const ret = wasm.compile(addHeapObject(args));
126
126
  return takeObject(ret);
127
127
  };
@@ -136,7 +136,7 @@ function passArray8ToWasm0(arg, malloc) {
136
136
  * @param {Uint8Array} bytes
137
137
  * @returns {any}
138
138
  */
139
- module.exports.acir_from_bytes = function (bytes) {
139
+ module.exports.acir_from_bytes = function(bytes) {
140
140
  const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_export_0);
141
141
  const len0 = WASM_VECTOR_LEN;
142
142
  const ret = wasm.acir_from_bytes(ptr0, len0);
@@ -150,7 +150,7 @@ function getArrayU8FromWasm0(ptr, len) {
150
150
  * @param {any} acir
151
151
  * @returns {Uint8Array}
152
152
  */
153
- module.exports.acir_to_bytes = function (acir) {
153
+ module.exports.acir_to_bytes = function(acir) {
154
154
  try {
155
155
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
156
156
  wasm.acir_to_bytes(retptr, addHeapObject(acir));
@@ -168,7 +168,7 @@ module.exports.acir_to_bytes = function (acir) {
168
168
  * @param {Uint8Array} bytes
169
169
  * @returns {any}
170
170
  */
171
- module.exports.acir_read_bytes = function (bytes) {
171
+ module.exports.acir_read_bytes = function(bytes) {
172
172
  const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_export_0);
173
173
  const len0 = WASM_VECTOR_LEN;
174
174
  const ret = wasm.acir_read_bytes(ptr0, len0);
@@ -179,7 +179,7 @@ module.exports.acir_read_bytes = function (bytes) {
179
179
  * @param {any} acir
180
180
  * @returns {Uint8Array}
181
181
  */
182
- module.exports.acir_write_bytes = function (acir) {
182
+ module.exports.acir_write_bytes = function(acir) {
183
183
  try {
184
184
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
185
185
  wasm.acir_write_bytes(retptr, addHeapObject(acir));
@@ -193,10 +193,19 @@ module.exports.acir_write_bytes = function (acir) {
193
193
  }
194
194
  };
195
195
 
196
+ /**
197
+ * @param {string} level
198
+ */
199
+ module.exports.init_log_level = function(level) {
200
+ const ptr0 = passStringToWasm0(level, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
201
+ const len0 = WASM_VECTOR_LEN;
202
+ wasm.init_log_level(ptr0, len0);
203
+ };
204
+
196
205
  /**
197
206
  * @returns {any}
198
207
  */
199
- module.exports.build_info = function () {
208
+ module.exports.build_info = function() {
200
209
  const ret = wasm.build_info();
201
210
  return takeObject(ret);
202
211
  };
@@ -209,21 +218,31 @@ function handleError(f, args) {
209
218
  }
210
219
  }
211
220
 
212
- module.exports.__wbindgen_is_undefined = function (arg0) {
221
+ module.exports.__wbindgen_is_undefined = function(arg0) {
213
222
  const ret = getObject(arg0) === undefined;
214
223
  return ret;
215
224
  };
216
225
 
217
- module.exports.__wbindgen_object_drop_ref = function (arg0) {
226
+ module.exports.__wbindgen_is_null = function(arg0) {
227
+ const ret = getObject(arg0) === null;
228
+ return ret;
229
+ };
230
+
231
+ module.exports.__wbindgen_object_drop_ref = function(arg0) {
218
232
  takeObject(arg0);
219
233
  };
220
234
 
221
- module.exports.__wbg_new_abda76e883ba8a5f = function () {
235
+ module.exports.__wbindgen_string_new = function(arg0, arg1) {
236
+ const ret = getStringFromWasm0(arg0, arg1);
237
+ return addHeapObject(ret);
238
+ };
239
+
240
+ module.exports.__wbg_new_abda76e883ba8a5f = function() {
222
241
  const ret = new Error();
223
242
  return addHeapObject(ret);
224
243
  };
225
244
 
226
- module.exports.__wbg_stack_658279fe44541cf6 = function (arg0, arg1) {
245
+ module.exports.__wbg_stack_658279fe44541cf6 = function(arg0, arg1) {
227
246
  const ret = getObject(arg1).stack;
228
247
  const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
229
248
  const len0 = WASM_VECTOR_LEN;
@@ -231,7 +250,7 @@ module.exports.__wbg_stack_658279fe44541cf6 = function (arg0, arg1) {
231
250
  getInt32Memory0()[arg0 / 4 + 0] = ptr0;
232
251
  };
233
252
 
234
- module.exports.__wbg_error_f851667af71bcfc6 = function (arg0, arg1) {
253
+ module.exports.__wbg_error_f851667af71bcfc6 = function(arg0, arg1) {
235
254
  try {
236
255
  console.error(getStringFromWasm0(arg0, arg1));
237
256
  } finally {
@@ -239,40 +258,58 @@ module.exports.__wbg_error_f851667af71bcfc6 = function (arg0, arg1) {
239
258
  }
240
259
  };
241
260
 
242
- module.exports.__wbg_readfile_a43240e6f11dd5eb = function () {
243
- return handleError(function (arg0, arg1, arg2) {
244
- const ret = read_file(getStringFromWasm0(arg1, arg2));
245
- const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
246
- const len0 = WASM_VECTOR_LEN;
247
- getInt32Memory0()[arg0 / 4 + 1] = len0;
248
- getInt32Memory0()[arg0 / 4 + 0] = ptr0;
249
- }, arguments)
261
+ module.exports.__wbg_readfile_a43240e6f11dd5eb = function() { return handleError(function (arg0, arg1, arg2) {
262
+ const ret = read_file(getStringFromWasm0(arg1, arg2));
263
+ const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
264
+ const len0 = WASM_VECTOR_LEN;
265
+ getInt32Memory0()[arg0 / 4 + 1] = len0;
266
+ getInt32Memory0()[arg0 / 4 + 0] = ptr0;
267
+ }, arguments) };
268
+
269
+ module.exports.__wbg_debug_7960d327fd96f71a = function(arg0, arg1, arg2, arg3) {
270
+ console.debug(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
271
+ };
272
+
273
+ module.exports.__wbg_error_fe807da27c4a4ced = function(arg0) {
274
+ console.error(getObject(arg0));
275
+ };
276
+
277
+ module.exports.__wbg_error_fd84ca2a8a977774 = function(arg0, arg1, arg2, arg3) {
278
+ console.error(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
279
+ };
280
+
281
+ module.exports.__wbg_info_5566be377f5b52ae = function(arg0, arg1, arg2, arg3) {
282
+ console.info(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
250
283
  };
251
284
 
252
- module.exports.__wbindgen_string_get = function (arg0, arg1) {
285
+ module.exports.__wbg_log_7b690f184ae4519b = function(arg0, arg1, arg2, arg3) {
286
+ console.log(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
287
+ };
288
+
289
+ module.exports.__wbg_warn_48cbddced45e5414 = function(arg0, arg1, arg2, arg3) {
290
+ console.warn(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
291
+ };
292
+
293
+ module.exports.__wbindgen_string_get = function(arg0, arg1) {
253
294
  const obj = getObject(arg1);
254
- const ret = typeof (obj) === 'string' ? obj : undefined;
295
+ const ret = typeof(obj) === 'string' ? obj : undefined;
255
296
  var ptr0 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
256
297
  var len0 = WASM_VECTOR_LEN;
257
298
  getInt32Memory0()[arg0 / 4 + 1] = len0;
258
299
  getInt32Memory0()[arg0 / 4 + 0] = ptr0;
259
300
  };
260
301
 
261
- module.exports.__wbg_parse_3ac95b51fc312db8 = function () {
262
- return handleError(function (arg0, arg1) {
263
- const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
264
- return addHeapObject(ret);
265
- }, arguments)
266
- };
302
+ module.exports.__wbg_parse_3ac95b51fc312db8 = function() { return handleError(function (arg0, arg1) {
303
+ const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
304
+ return addHeapObject(ret);
305
+ }, arguments) };
267
306
 
268
- module.exports.__wbg_stringify_029a979dfb73aa17 = function () {
269
- return handleError(function (arg0) {
270
- const ret = JSON.stringify(getObject(arg0));
271
- return addHeapObject(ret);
272
- }, arguments)
273
- };
307
+ module.exports.__wbg_stringify_029a979dfb73aa17 = function() { return handleError(function (arg0) {
308
+ const ret = JSON.stringify(getObject(arg0));
309
+ return addHeapObject(ret);
310
+ }, arguments) };
274
311
 
275
- module.exports.__wbindgen_throw = function (arg0, arg1) {
312
+ module.exports.__wbindgen_throw = function(arg0, arg1) {
276
313
  throw new Error(getStringFromWasm0(arg0, arg1));
277
314
  };
278
315
 
Binary file
@@ -6,6 +6,7 @@ export function acir_from_bytes(a: number, b: number): number;
6
6
  export function acir_to_bytes(a: number, b: number): void;
7
7
  export function acir_read_bytes(a: number, b: number): number;
8
8
  export function acir_write_bytes(a: number, b: number): void;
9
+ export function init_log_level(a: number, b: number): void;
9
10
  export function build_info(): number;
10
11
  export function __wbindgen_export_0(a: number): number;
11
12
  export function __wbindgen_export_1(a: number, b: number, c: number): number;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "collaborators": [
4
4
  "The Noir Team <kevtheappdev@gmail.com>"
5
5
  ],
6
- "version": "0.3.2-29b1f7df",
6
+ "version": "0.3.2-41e0020",
7
7
  "files": [
8
8
  "nodejs",
9
9
  "web",
@@ -14,13 +14,13 @@
14
14
  "module": "./web/noir_wasm.js",
15
15
  "sideEffects": false,
16
16
  "peerDependencies": {
17
- "@noir-lang/noir-source-resolver": "1.1.0"
17
+ "@noir-lang/noir-source-resolver": "1.1.1"
18
18
  },
19
19
  "repository": {
20
20
  "type": "git",
21
21
  "url": "https://github.com/noir-lang/noir_wasm.git"
22
22
  },
23
23
  "compiler": {
24
- "versionHash": "29b1f7df4d563849a62e64c533cb62932188135b"
24
+ "versionHash": "41e00207b0eeae4d0285c617acac72c780cb0900"
25
25
  }
26
26
  }
@@ -26,6 +26,10 @@ export function acir_read_bytes(bytes: Uint8Array): any;
26
26
  */
27
27
  export function acir_write_bytes(acir: any): Uint8Array;
28
28
  /**
29
+ * @param {string} level
30
+ */
31
+ export function init_log_level(level: string): void;
32
+ /**
29
33
  * @returns {any}
30
34
  */
31
35
  export function build_info(): any;
@@ -39,6 +43,7 @@ export interface InitOutput {
39
43
  readonly acir_to_bytes: (a: number, b: number) => void;
40
44
  readonly acir_read_bytes: (a: number, b: number) => number;
41
45
  readonly acir_write_bytes: (a: number, b: number) => void;
46
+ readonly init_log_level: (a: number, b: number) => void;
42
47
  readonly build_info: () => number;
43
48
  readonly __wbindgen_export_0: (a: number) => number;
44
49
  readonly __wbindgen_export_1: (a: number, b: number, c: number) => number;
package/web/noir_wasm.js CHANGED
@@ -22,7 +22,9 @@ function takeObject(idx) {
22
22
  return ret;
23
23
  }
24
24
 
25
- let WASM_VECTOR_LEN = 0;
25
+ const cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
26
+
27
+ cachedTextDecoder.decode();
26
28
 
27
29
  let cachedUint8Memory0 = null;
28
30
 
@@ -33,6 +35,21 @@ function getUint8Memory0() {
33
35
  return cachedUint8Memory0;
34
36
  }
35
37
 
38
+ function getStringFromWasm0(ptr, len) {
39
+ return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
40
+ }
41
+
42
+ function addHeapObject(obj) {
43
+ if (heap_next === heap.length) heap.push(heap.length + 1);
44
+ const idx = heap_next;
45
+ heap_next = heap[idx];
46
+
47
+ heap[idx] = obj;
48
+ return idx;
49
+ }
50
+
51
+ let WASM_VECTOR_LEN = 0;
52
+
36
53
  const cachedTextEncoder = new TextEncoder('utf-8');
37
54
 
38
55
  const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
@@ -98,23 +115,6 @@ function getInt32Memory0() {
98
115
  }
99
116
  return cachedInt32Memory0;
100
117
  }
101
-
102
- const cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
103
-
104
- cachedTextDecoder.decode();
105
-
106
- function getStringFromWasm0(ptr, len) {
107
- return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
108
- }
109
-
110
- function addHeapObject(obj) {
111
- if (heap_next === heap.length) heap.push(heap.length + 1);
112
- const idx = heap_next;
113
- heap_next = heap[idx];
114
-
115
- heap[idx] = obj;
116
- return idx;
117
- }
118
118
  /**
119
119
  * @param {any} args
120
120
  * @returns {any}
@@ -191,6 +191,15 @@ export function acir_write_bytes(acir) {
191
191
  }
192
192
  }
193
193
 
194
+ /**
195
+ * @param {string} level
196
+ */
197
+ export function init_log_level(level) {
198
+ const ptr0 = passStringToWasm0(level, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
199
+ const len0 = WASM_VECTOR_LEN;
200
+ wasm.init_log_level(ptr0, len0);
201
+ }
202
+
194
203
  /**
195
204
  * @returns {any}
196
205
  */
@@ -245,9 +254,17 @@ function getImports() {
245
254
  const ret = getObject(arg0) === undefined;
246
255
  return ret;
247
256
  };
257
+ imports.wbg.__wbindgen_is_null = function(arg0) {
258
+ const ret = getObject(arg0) === null;
259
+ return ret;
260
+ };
248
261
  imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
249
262
  takeObject(arg0);
250
263
  };
264
+ imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
265
+ const ret = getStringFromWasm0(arg0, arg1);
266
+ return addHeapObject(ret);
267
+ };
251
268
  imports.wbg.__wbg_new_abda76e883ba8a5f = function() {
252
269
  const ret = new Error();
253
270
  return addHeapObject(ret);
@@ -273,6 +290,24 @@ function getImports() {
273
290
  getInt32Memory0()[arg0 / 4 + 1] = len0;
274
291
  getInt32Memory0()[arg0 / 4 + 0] = ptr0;
275
292
  }, arguments) };
293
+ imports.wbg.__wbg_debug_7960d327fd96f71a = function(arg0, arg1, arg2, arg3) {
294
+ console.debug(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
295
+ };
296
+ imports.wbg.__wbg_error_fe807da27c4a4ced = function(arg0) {
297
+ console.error(getObject(arg0));
298
+ };
299
+ imports.wbg.__wbg_error_fd84ca2a8a977774 = function(arg0, arg1, arg2, arg3) {
300
+ console.error(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
301
+ };
302
+ imports.wbg.__wbg_info_5566be377f5b52ae = function(arg0, arg1, arg2, arg3) {
303
+ console.info(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
304
+ };
305
+ imports.wbg.__wbg_log_7b690f184ae4519b = function(arg0, arg1, arg2, arg3) {
306
+ console.log(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
307
+ };
308
+ imports.wbg.__wbg_warn_48cbddced45e5414 = function(arg0, arg1, arg2, arg3) {
309
+ console.warn(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
310
+ };
276
311
  imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
277
312
  const obj = getObject(arg1);
278
313
  const ret = typeof(obj) === 'string' ? obj : undefined;
Binary file
@@ -6,6 +6,7 @@ export function acir_from_bytes(a: number, b: number): number;
6
6
  export function acir_to_bytes(a: number, b: number): void;
7
7
  export function acir_read_bytes(a: number, b: number): number;
8
8
  export function acir_write_bytes(a: number, b: number): void;
9
+ export function init_log_level(a: number, b: number): void;
9
10
  export function build_info(): number;
10
11
  export function __wbindgen_export_0(a: number): number;
11
12
  export function __wbindgen_export_1(a: number, b: number, c: number): number;