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