@noir-lang/noir_wasm
Advanced tools
Comparing version 0.3.2-29b1f7df to 0.3.2-bcdfd526
/* tslint:disable */ | ||
/* eslint-disable */ | ||
export const memory: WebAssembly.Memory; | ||
export function init_log_level(a: number, b: number): void; | ||
export function compile(a: number): number; | ||
@@ -5,0 +6,0 @@ export function acir_from_bytes(a: number, b: number): number; |
/* tslint:disable */ | ||
/* eslint-disable */ | ||
/** | ||
* @param {string} level | ||
*/ | ||
export function init_log_level(level: string): void; | ||
/** | ||
* @param {any} args | ||
@@ -5,0 +9,0 @@ * @returns {any} |
@@ -5,3 +5,3 @@ let imports = {}; | ||
const { read_file } = require(`@noir-lang/noir-source-resolver`); | ||
const { TextEncoder, TextDecoder } = require(`util`); | ||
const { TextDecoder, TextEncoder } = require(`util`); | ||
@@ -28,4 +28,6 @@ const heap = new Array(128).fill(undefined); | ||
let WASM_VECTOR_LEN = 0; | ||
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }); | ||
cachedTextDecoder.decode(); | ||
let cachedUint8Memory0 = null; | ||
@@ -40,2 +42,17 @@ | ||
function getStringFromWasm0(ptr, len) { | ||
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len)); | ||
} | ||
function addHeapObject(obj) { | ||
if (heap_next === heap.length) heap.push(heap.length + 1); | ||
const idx = heap_next; | ||
heap_next = heap[idx]; | ||
heap[idx] = obj; | ||
return idx; | ||
} | ||
let WASM_VECTOR_LEN = 0; | ||
let cachedTextEncoder = new TextEncoder('utf-8'); | ||
@@ -45,12 +62,12 @@ | ||
? function (arg, view) { | ||
return cachedTextEncoder.encodeInto(arg, view); | ||
} | ||
return cachedTextEncoder.encodeInto(arg, view); | ||
} | ||
: function (arg, view) { | ||
const buf = cachedTextEncoder.encode(arg); | ||
view.set(buf); | ||
return { | ||
read: arg.length, | ||
written: buf.length | ||
}; | ||
}); | ||
const buf = cachedTextEncoder.encode(arg); | ||
view.set(buf); | ||
return { | ||
read: arg.length, | ||
written: buf.length | ||
}; | ||
}); | ||
@@ -107,19 +124,11 @@ function passStringToWasm0(arg, malloc, realloc) { | ||
} | ||
/** | ||
* @param {string} level | ||
*/ | ||
module.exports.init_log_level = function(level) { | ||
const ptr0 = passStringToWasm0(level, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); | ||
const len0 = WASM_VECTOR_LEN; | ||
wasm.init_log_level(ptr0, len0); | ||
}; | ||
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }); | ||
cachedTextDecoder.decode(); | ||
function getStringFromWasm0(ptr, len) { | ||
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len)); | ||
} | ||
function addHeapObject(obj) { | ||
if (heap_next === heap.length) heap.push(heap.length + 1); | ||
const idx = heap_next; | ||
heap_next = heap[idx]; | ||
heap[idx] = obj; | ||
return idx; | ||
} | ||
/** | ||
@@ -129,3 +138,3 @@ * @param {any} args | ||
*/ | ||
module.exports.compile = function (args) { | ||
module.exports.compile = function(args) { | ||
const ret = wasm.compile(addHeapObject(args)); | ||
@@ -145,3 +154,3 @@ return takeObject(ret); | ||
*/ | ||
module.exports.acir_from_bytes = function (bytes) { | ||
module.exports.acir_from_bytes = function(bytes) { | ||
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_export_0); | ||
@@ -160,3 +169,3 @@ const len0 = WASM_VECTOR_LEN; | ||
*/ | ||
module.exports.acir_to_bytes = function (acir) { | ||
module.exports.acir_to_bytes = function(acir) { | ||
try { | ||
@@ -179,3 +188,3 @@ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); | ||
*/ | ||
module.exports.acir_read_bytes = function (bytes) { | ||
module.exports.acir_read_bytes = function(bytes) { | ||
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_export_0); | ||
@@ -191,3 +200,3 @@ const len0 = WASM_VECTOR_LEN; | ||
*/ | ||
module.exports.acir_write_bytes = function (acir) { | ||
module.exports.acir_write_bytes = function(acir) { | ||
try { | ||
@@ -209,3 +218,3 @@ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); | ||
*/ | ||
module.exports.build_info = function () { | ||
module.exports.build_info = function() { | ||
const ret = wasm.build_info(); | ||
@@ -223,3 +232,3 @@ return takeObject(ret); | ||
module.exports.__wbindgen_is_undefined = function (arg0) { | ||
module.exports.__wbindgen_is_undefined = function(arg0) { | ||
const ret = getObject(arg0) === undefined; | ||
@@ -229,7 +238,12 @@ return ret; | ||
module.exports.__wbindgen_object_drop_ref = function (arg0) { | ||
module.exports.__wbindgen_is_null = function(arg0) { | ||
const ret = getObject(arg0) === null; | ||
return ret; | ||
}; | ||
module.exports.__wbindgen_object_drop_ref = function(arg0) { | ||
takeObject(arg0); | ||
}; | ||
module.exports.__wbg_new_abda76e883ba8a5f = function () { | ||
module.exports.__wbg_new_abda76e883ba8a5f = function() { | ||
const ret = new Error(); | ||
@@ -239,3 +253,3 @@ return addHeapObject(ret); | ||
module.exports.__wbg_stack_658279fe44541cf6 = function (arg0, arg1) { | ||
module.exports.__wbg_stack_658279fe44541cf6 = function(arg0, arg1) { | ||
const ret = getObject(arg1).stack; | ||
@@ -248,3 +262,3 @@ const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); | ||
module.exports.__wbg_error_f851667af71bcfc6 = function (arg0, arg1) { | ||
module.exports.__wbg_error_f851667af71bcfc6 = function(arg0, arg1) { | ||
try { | ||
@@ -257,15 +271,42 @@ console.error(getStringFromWasm0(arg0, arg1)); | ||
module.exports.__wbg_readfile_a43240e6f11dd5eb = function () { | ||
return handleError(function (arg0, arg1, arg2) { | ||
const ret = read_file(getStringFromWasm0(arg1, arg2)); | ||
const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); | ||
const len0 = WASM_VECTOR_LEN; | ||
getInt32Memory0()[arg0 / 4 + 1] = len0; | ||
getInt32Memory0()[arg0 / 4 + 0] = ptr0; | ||
}, arguments) | ||
module.exports.__wbindgen_string_new = function(arg0, arg1) { | ||
const ret = getStringFromWasm0(arg0, arg1); | ||
return addHeapObject(ret); | ||
}; | ||
module.exports.__wbindgen_string_get = function (arg0, arg1) { | ||
module.exports.__wbg_readfile_a43240e6f11dd5eb = function() { return handleError(function (arg0, arg1, arg2) { | ||
const ret = read_file(getStringFromWasm0(arg1, arg2)); | ||
const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); | ||
const len0 = WASM_VECTOR_LEN; | ||
getInt32Memory0()[arg0 / 4 + 1] = len0; | ||
getInt32Memory0()[arg0 / 4 + 0] = ptr0; | ||
}, arguments) }; | ||
module.exports.__wbg_debug_7960d327fd96f71a = function(arg0, arg1, arg2, arg3) { | ||
console.debug(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3)); | ||
}; | ||
module.exports.__wbg_error_fe807da27c4a4ced = function(arg0) { | ||
console.error(getObject(arg0)); | ||
}; | ||
module.exports.__wbg_error_fd84ca2a8a977774 = function(arg0, arg1, arg2, arg3) { | ||
console.error(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3)); | ||
}; | ||
module.exports.__wbg_info_5566be377f5b52ae = function(arg0, arg1, arg2, arg3) { | ||
console.info(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3)); | ||
}; | ||
module.exports.__wbg_log_7b690f184ae4519b = function(arg0, arg1, arg2, arg3) { | ||
console.log(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3)); | ||
}; | ||
module.exports.__wbg_warn_48cbddced45e5414 = function(arg0, arg1, arg2, arg3) { | ||
console.warn(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3)); | ||
}; | ||
module.exports.__wbindgen_string_get = function(arg0, arg1) { | ||
const obj = getObject(arg1); | ||
const ret = typeof (obj) === 'string' ? obj : undefined; | ||
const ret = typeof(obj) === 'string' ? obj : undefined; | ||
var ptr0 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); | ||
@@ -277,17 +318,13 @@ var len0 = WASM_VECTOR_LEN; | ||
module.exports.__wbg_parse_3ac95b51fc312db8 = function () { | ||
return handleError(function (arg0, arg1) { | ||
const ret = JSON.parse(getStringFromWasm0(arg0, arg1)); | ||
return addHeapObject(ret); | ||
}, arguments) | ||
}; | ||
module.exports.__wbg_parse_3ac95b51fc312db8 = function() { return handleError(function (arg0, arg1) { | ||
const ret = JSON.parse(getStringFromWasm0(arg0, arg1)); | ||
return addHeapObject(ret); | ||
}, arguments) }; | ||
module.exports.__wbg_stringify_029a979dfb73aa17 = function () { | ||
return handleError(function (arg0) { | ||
const ret = JSON.stringify(getObject(arg0)); | ||
return addHeapObject(ret); | ||
}, arguments) | ||
}; | ||
module.exports.__wbg_stringify_029a979dfb73aa17 = function() { return handleError(function (arg0) { | ||
const ret = JSON.stringify(getObject(arg0)); | ||
return addHeapObject(ret); | ||
}, arguments) }; | ||
module.exports.__wbindgen_throw = function (arg0, arg1) { | ||
module.exports.__wbindgen_throw = function(arg0, arg1) { | ||
throw new Error(getStringFromWasm0(arg0, arg1)); | ||
@@ -294,0 +331,0 @@ }; |
@@ -6,3 +6,3 @@ { | ||
], | ||
"version": "0.3.2-29b1f7df", | ||
"version": "0.3.2-bcdfd526", | ||
"files": [ | ||
@@ -25,4 +25,4 @@ "nodejs", | ||
"compiler": { | ||
"versionHash": "29b1f7df4d563849a62e64c533cb62932188135b" | ||
"versionHash": "bcdfd526fe2b5339cfad487a00e9fcbdb70c45dc" | ||
} | ||
} |
# Noir Lang WASM JavaScript Package | ||
## Tracks | ||
Noir lang Repository [noir-lang/noir@29b1f7df](https://github.com/noir-lang/noir/tree/29b1f7df4d563849a62e64c533cb62932188135b) | ||
Noir lang Repository [noir-lang/noir@bcdfd526](https://github.com/noir-lang/noir/tree/bcdfd526fe2b5339cfad487a00e9fcbdb70c45dc) |
/* tslint:disable */ | ||
/* eslint-disable */ | ||
export const memory: WebAssembly.Memory; | ||
export function init_log_level(a: number, b: number): void; | ||
export function compile(a: number): number; | ||
@@ -5,0 +6,0 @@ export function acir_from_bytes(a: number, b: number): number; |
/* tslint:disable */ | ||
/* eslint-disable */ | ||
/** | ||
* @param {string} level | ||
*/ | ||
export function init_log_level(level: string): void; | ||
/** | ||
* @param {any} args | ||
@@ -37,2 +41,3 @@ * @returns {any} | ||
readonly memory: WebAssembly.Memory; | ||
readonly init_log_level: (a: number, b: number) => void; | ||
readonly compile: (a: number) => number; | ||
@@ -39,0 +44,0 @@ readonly acir_from_bytes: (a: number, b: number) => number; |
@@ -25,4 +25,6 @@ import { read_file } from '@noir-lang/noir-source-resolver'; | ||
let WASM_VECTOR_LEN = 0; | ||
const cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }); | ||
cachedTextDecoder.decode(); | ||
let cachedUint8Memory0 = null; | ||
@@ -37,2 +39,17 @@ | ||
function getStringFromWasm0(ptr, len) { | ||
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len)); | ||
} | ||
function addHeapObject(obj) { | ||
if (heap_next === heap.length) heap.push(heap.length + 1); | ||
const idx = heap_next; | ||
heap_next = heap[idx]; | ||
heap[idx] = obj; | ||
return idx; | ||
} | ||
let WASM_VECTOR_LEN = 0; | ||
const cachedTextEncoder = new TextEncoder('utf-8'); | ||
@@ -103,19 +120,11 @@ | ||
} | ||
const cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }); | ||
cachedTextDecoder.decode(); | ||
function getStringFromWasm0(ptr, len) { | ||
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len)); | ||
/** | ||
* @param {string} level | ||
*/ | ||
export function init_log_level(level) { | ||
const ptr0 = passStringToWasm0(level, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); | ||
const len0 = WASM_VECTOR_LEN; | ||
wasm.init_log_level(ptr0, len0); | ||
} | ||
function addHeapObject(obj) { | ||
if (heap_next === heap.length) heap.push(heap.length + 1); | ||
const idx = heap_next; | ||
heap_next = heap[idx]; | ||
heap[idx] = obj; | ||
return idx; | ||
} | ||
/** | ||
@@ -251,2 +260,6 @@ * @param {any} args | ||
}; | ||
imports.wbg.__wbindgen_is_null = function(arg0) { | ||
const ret = getObject(arg0) === null; | ||
return ret; | ||
}; | ||
imports.wbg.__wbindgen_object_drop_ref = function(arg0) { | ||
@@ -273,2 +286,6 @@ takeObject(arg0); | ||
}; | ||
imports.wbg.__wbindgen_string_new = function(arg0, arg1) { | ||
const ret = getStringFromWasm0(arg0, arg1); | ||
return addHeapObject(ret); | ||
}; | ||
imports.wbg.__wbg_readfile_a43240e6f11dd5eb = function() { return handleError(function (arg0, arg1, arg2) { | ||
@@ -281,2 +298,20 @@ const ret = read_file(getStringFromWasm0(arg1, arg2)); | ||
}, arguments) }; | ||
imports.wbg.__wbg_debug_7960d327fd96f71a = function(arg0, arg1, arg2, arg3) { | ||
console.debug(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3)); | ||
}; | ||
imports.wbg.__wbg_error_fe807da27c4a4ced = function(arg0) { | ||
console.error(getObject(arg0)); | ||
}; | ||
imports.wbg.__wbg_error_fd84ca2a8a977774 = function(arg0, arg1, arg2, arg3) { | ||
console.error(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3)); | ||
}; | ||
imports.wbg.__wbg_info_5566be377f5b52ae = function(arg0, arg1, arg2, arg3) { | ||
console.info(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3)); | ||
}; | ||
imports.wbg.__wbg_log_7b690f184ae4519b = function(arg0, arg1, arg2, arg3) { | ||
console.log(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3)); | ||
}; | ||
imports.wbg.__wbg_warn_48cbddced45e5414 = function(arg0, arg1, arg2, arg3) { | ||
console.warn(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3)); | ||
}; | ||
imports.wbg.__wbindgen_string_get = function(arg0, arg1) { | ||
@@ -283,0 +318,0 @@ const obj = getObject(arg1); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
6659955
721