@noir-lang/noir_wasm 0.2.0-007ab75 → 0.2.0-2688dc4

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@007ab75](https://github.com/noir-lang/noir/tree/007ab75abc6581c604791b14ecc5e8e73157e7c8)
4
+ Noir lang Repository [noir-lang/noir@2688dc4](https://github.com/noir-lang/noir/tree/2688dc405968dcd9b7a9486cc9cabffd9698dce8)
@@ -1,10 +1,10 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  /**
4
- * @param {string} src
4
+ * @param {any} args
5
5
  * @returns {any}
6
6
  */
7
- export function compile(src: string): any;
7
+ export function compile(args: any): any;
8
8
  /**
9
9
  * @param {Uint8Array} bytes
10
10
  * @returns {any}
@@ -108,14 +108,21 @@ cachedTextDecoder.decode();
108
108
  function getStringFromWasm0(ptr, len) {
109
109
  return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
110
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
+ }
111
120
  /**
112
- * @param {string} src
121
+ * @param {any} args
113
122
  * @returns {any}
114
123
  */
115
- module.exports.compile = function(src) {
116
- const ptr0 = passStringToWasm0(src, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
117
- const len0 = WASM_VECTOR_LEN;
118
- const ret = wasm.compile(ptr0, len0);
124
+ module.exports.compile = function(args) {
125
+ const ret = wasm.compile(addHeapObject(args));
119
126
  return takeObject(ret);
120
127
  };
121
128
 
@@ -136,15 +143,6 @@ module.exports.acir_from_bytes = function(bytes) {
136
143
  return takeObject(ret);
137
144
  };
138
145
 
139
- function addHeapObject(obj) {
140
- if (heap_next === heap.length) heap.push(heap.length + 1);
141
- const idx = heap_next;
142
- heap_next = heap[idx];
143
-
144
- heap[idx] = obj;
145
- return idx;
146
- }
147
-
148
146
  function getArrayU8FromWasm0(ptr, len) {
149
147
  return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
150
148
  }
@@ -211,22 +209,14 @@ function handleError(f, args) {
211
209
  }
212
210
  }
213
211
 
214
- module.exports.__wbindgen_object_drop_ref = function(arg0) {
215
- takeObject(arg0);
216
- };
217
-
218
212
  module.exports.__wbindgen_is_undefined = function(arg0) {
219
213
  const ret = getObject(arg0) === undefined;
220
214
  return ret;
221
215
  };
222
216
 
223
- module.exports.__wbg_readfile_1ed72752a157b319 = function() { return handleError(function (arg0, arg1, arg2) {
224
- const ret = read_file(getStringFromWasm0(arg1, arg2));
225
- const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
226
- const len0 = WASM_VECTOR_LEN;
227
- getInt32Memory0()[arg0 / 4 + 1] = len0;
228
- getInt32Memory0()[arg0 / 4 + 0] = ptr0;
229
- }, arguments) };
217
+ module.exports.__wbindgen_object_drop_ref = function(arg0) {
218
+ takeObject(arg0);
219
+ };
230
220
 
231
221
  module.exports.__wbg_new_abda76e883ba8a5f = function() {
232
222
  const ret = new Error();
@@ -249,6 +239,14 @@ module.exports.__wbg_error_f851667af71bcfc6 = function(arg0, arg1) {
249
239
  }
250
240
  };
251
241
 
242
+ module.exports.__wbg_readfile_1ed72752a157b319 = function() { return handleError(function (arg0, arg1, arg2) {
243
+ const ret = read_file(getStringFromWasm0(arg1, arg2));
244
+ const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
245
+ const len0 = WASM_VECTOR_LEN;
246
+ getInt32Memory0()[arg0 / 4 + 1] = len0;
247
+ getInt32Memory0()[arg0 / 4 + 0] = ptr0;
248
+ }, arguments) };
249
+
252
250
  module.exports.__wbindgen_string_get = function(arg0, arg1) {
253
251
  const obj = getObject(arg1);
254
252
  const ret = typeof(obj) === 'string' ? obj : undefined;
Binary file
@@ -1,7 +1,7 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  export const memory: WebAssembly.Memory;
4
- export function compile(a: number, b: number): number;
4
+ export function compile(a: number): number;
5
5
  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;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "collaborators": [
4
4
  "The Noir Team <kevtheappdev@gmail.com>"
5
5
  ],
6
- "version": "0.2.0-007ab75",
6
+ "version": "0.2.0-2688dc4",
7
7
  "files": [
8
8
  "nodejs",
9
9
  "web",
@@ -21,6 +21,6 @@
21
21
  "url": "https://github.com/noir-lang/noir_wasm.git"
22
22
  },
23
23
  "compiler": {
24
- "versionHash": "007ab75abc6581c604791b14ecc5e8e73157e7c8"
24
+ "versionHash": "2688dc405968dcd9b7a9486cc9cabffd9698dce8"
25
25
  }
26
26
  }
@@ -1,10 +1,10 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  /**
4
- * @param {string} src
4
+ * @param {any} args
5
5
  * @returns {any}
6
6
  */
7
- export function compile(src: string): any;
7
+ export function compile(args: any): any;
8
8
  /**
9
9
  * @param {Uint8Array} bytes
10
10
  * @returns {any}
@@ -34,7 +34,7 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
34
34
 
35
35
  export interface InitOutput {
36
36
  readonly memory: WebAssembly.Memory;
37
- readonly compile: (a: number, b: number) => number;
37
+ readonly compile: (a: number) => number;
38
38
  readonly acir_from_bytes: (a: number, b: number) => number;
39
39
  readonly acir_to_bytes: (a: number, b: number) => void;
40
40
  readonly acir_read_bytes: (a: number, b: number) => number;
package/web/noir_wasm.js CHANGED
@@ -106,14 +106,21 @@ cachedTextDecoder.decode();
106
106
  function getStringFromWasm0(ptr, len) {
107
107
  return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
108
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
+ }
109
118
  /**
110
- * @param {string} src
119
+ * @param {any} args
111
120
  * @returns {any}
112
121
  */
113
- export function compile(src) {
114
- const ptr0 = passStringToWasm0(src, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
115
- const len0 = WASM_VECTOR_LEN;
116
- const ret = wasm.compile(ptr0, len0);
122
+ export function compile(args) {
123
+ const ret = wasm.compile(addHeapObject(args));
117
124
  return takeObject(ret);
118
125
  }
119
126
 
@@ -134,15 +141,6 @@ export function acir_from_bytes(bytes) {
134
141
  return takeObject(ret);
135
142
  }
136
143
 
137
- function addHeapObject(obj) {
138
- if (heap_next === heap.length) heap.push(heap.length + 1);
139
- const idx = heap_next;
140
- heap_next = heap[idx];
141
-
142
- heap[idx] = obj;
143
- return idx;
144
- }
145
-
146
144
  function getArrayU8FromWasm0(ptr, len) {
147
145
  return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
148
146
  }
@@ -243,20 +241,13 @@ async function load(module, imports) {
243
241
  function getImports() {
244
242
  const imports = {};
245
243
  imports.wbg = {};
246
- imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
247
- takeObject(arg0);
248
- };
249
244
  imports.wbg.__wbindgen_is_undefined = function(arg0) {
250
245
  const ret = getObject(arg0) === undefined;
251
246
  return ret;
252
247
  };
253
- imports.wbg.__wbg_readfile_1ed72752a157b319 = function() { return handleError(function (arg0, arg1, arg2) {
254
- const ret = read_file(getStringFromWasm0(arg1, arg2));
255
- const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
256
- const len0 = WASM_VECTOR_LEN;
257
- getInt32Memory0()[arg0 / 4 + 1] = len0;
258
- getInt32Memory0()[arg0 / 4 + 0] = ptr0;
259
- }, arguments) };
248
+ imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
249
+ takeObject(arg0);
250
+ };
260
251
  imports.wbg.__wbg_new_abda76e883ba8a5f = function() {
261
252
  const ret = new Error();
262
253
  return addHeapObject(ret);
@@ -275,6 +266,13 @@ function getImports() {
275
266
  wasm.__wbindgen_export_2(arg0, arg1);
276
267
  }
277
268
  };
269
+ imports.wbg.__wbg_readfile_1ed72752a157b319 = function() { return handleError(function (arg0, arg1, arg2) {
270
+ const ret = read_file(getStringFromWasm0(arg1, arg2));
271
+ const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
272
+ const len0 = WASM_VECTOR_LEN;
273
+ getInt32Memory0()[arg0 / 4 + 1] = len0;
274
+ getInt32Memory0()[arg0 / 4 + 0] = ptr0;
275
+ }, arguments) };
278
276
  imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
279
277
  const obj = getObject(arg1);
280
278
  const ret = typeof(obj) === 'string' ? obj : undefined;
Binary file
@@ -1,7 +1,7 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  export const memory: WebAssembly.Memory;
4
- export function compile(a: number, b: number): number;
4
+ export function compile(a: number): number;
5
5
  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;