@kevaundray/noir_wasm
Advanced tools
Comparing version 0.15.0-kw-play-around-f87a92a3e to 0.16.0-kw-branched-off-of-last-aztec-tag-f0795c1fe
/* tslint:disable */ | ||
/* eslint-disable */ | ||
export const memory: WebAssembly.Memory; | ||
export function compile(a: number): number; | ||
export function acir_read_bytes(a: number, b: number): number; | ||
export function acir_write_bytes(a: number, b: number): void; | ||
export function init_log_level(a: number, b: number): void; | ||
export function build_info(): number; | ||
export function acir_read_bytes(a: number, b: number): number; | ||
export function acir_write_bytes(a: number, b: number): void; | ||
export function compile(a: number, b: number, c: number, d: number, e: number): void; | ||
export function __wbindgen_export_0(a: number): number; | ||
export function __wbindgen_export_1(a: number, b: number, c: number): number; | ||
export function __wbindgen_export_2(a: number): void; | ||
export function __wbindgen_add_to_stack_pointer(a: number): number; | ||
export function __wbindgen_export_3(a: number, b: number): void; | ||
export function __wbindgen_export_2(a: number, b: number): void; | ||
export function __wbindgen_export_3(a: number): void; |
/* tslint:disable */ | ||
/* eslint-disable */ | ||
/** | ||
* @param {any} args | ||
* @param {Uint8Array} bytes | ||
* @returns {any} | ||
*/ | ||
export function compile(args: any): any; | ||
export function acir_read_bytes(bytes: Uint8Array): any; | ||
/** | ||
* @param {any} acir | ||
* @returns {Uint8Array} | ||
*/ | ||
export function acir_write_bytes(acir: any): Uint8Array; | ||
/** | ||
* @param {string} level | ||
@@ -17,10 +22,11 @@ */ | ||
/** | ||
* @param {Uint8Array} bytes | ||
* @param {string} entry_point | ||
* @param {boolean | undefined} contracts | ||
* @param {string[] | undefined} dependencies | ||
* @returns {any} | ||
*/ | ||
export function acir_read_bytes(bytes: Uint8Array): any; | ||
/** | ||
* @param {any} acir | ||
* @returns {Uint8Array} | ||
*/ | ||
export function acir_write_bytes(acir: any): Uint8Array; | ||
export function compile(entry_point: string, contracts?: boolean, dependencies?: string[]): any; | ||
export type CompileError = Error; | ||
@@ -5,3 +5,3 @@ let imports = {}; | ||
const { read_file } = require(`@noir-lang/source-resolver`); | ||
const { TextDecoder, TextEncoder } = require(`util`); | ||
const { TextEncoder, TextDecoder } = require(`util`); | ||
@@ -28,6 +28,4 @@ const heap = new Array(128).fill(undefined); | ||
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }); | ||
let WASM_VECTOR_LEN = 0; | ||
cachedTextDecoder.decode(); | ||
let cachedUint8Memory0 = null; | ||
@@ -42,18 +40,2 @@ | ||
function getStringFromWasm0(ptr, len) { | ||
ptr = ptr >>> 0; | ||
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'); | ||
@@ -124,35 +106,21 @@ | ||
} | ||
/** | ||
* @param {any} args | ||
* @returns {any} | ||
*/ | ||
module.exports.compile = function(args) { | ||
const ret = wasm.compile(addHeapObject(args)); | ||
return takeObject(ret); | ||
}; | ||
function handleError(f, args) { | ||
try { | ||
return f.apply(this, args); | ||
} catch (e) { | ||
wasm.__wbindgen_export_2(addHeapObject(e)); | ||
} | ||
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }); | ||
cachedTextDecoder.decode(); | ||
function getStringFromWasm0(ptr, len) { | ||
ptr = ptr >>> 0; | ||
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len)); | ||
} | ||
/** | ||
* @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); | ||
}; | ||
/** | ||
* @returns {any} | ||
*/ | ||
module.exports.build_info = function() { | ||
const ret = wasm.build_info(); | ||
return takeObject(ret); | ||
}; | ||
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; | ||
} | ||
function passArray8ToWasm0(arg, malloc) { | ||
@@ -190,3 +158,3 @@ const ptr = malloc(arg.length * 1) >>> 0; | ||
var v1 = getArrayU8FromWasm0(r0, r1).slice(); | ||
wasm.__wbindgen_export_3(r0, r1 * 1); | ||
wasm.__wbindgen_export_2(r0, r1 * 1); | ||
return v1; | ||
@@ -198,2 +166,51 @@ } finally { | ||
/** | ||
* @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); | ||
}; | ||
/** | ||
* @returns {any} | ||
*/ | ||
module.exports.build_info = function() { | ||
const ret = wasm.build_info(); | ||
return takeObject(ret); | ||
}; | ||
/** | ||
* @param {string} entry_point | ||
* @param {boolean | undefined} contracts | ||
* @param {string[] | undefined} dependencies | ||
* @returns {any} | ||
*/ | ||
module.exports.compile = function(entry_point, contracts, dependencies) { | ||
try { | ||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); | ||
const ptr0 = passStringToWasm0(entry_point, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); | ||
const len0 = WASM_VECTOR_LEN; | ||
wasm.compile(retptr, ptr0, len0, isLikeNone(contracts) ? 0xFFFFFF : contracts ? 1 : 0, isLikeNone(dependencies) ? 0 : addHeapObject(dependencies)); | ||
var r0 = getInt32Memory0()[retptr / 4 + 0]; | ||
var r1 = getInt32Memory0()[retptr / 4 + 1]; | ||
var r2 = getInt32Memory0()[retptr / 4 + 2]; | ||
if (r2) { | ||
throw takeObject(r1); | ||
} | ||
return takeObject(r0); | ||
} finally { | ||
wasm.__wbindgen_add_to_stack_pointer(16); | ||
} | ||
}; | ||
function handleError(f, args) { | ||
try { | ||
return f.apply(this, args); | ||
} catch (e) { | ||
wasm.__wbindgen_export_3(addHeapObject(e)); | ||
} | ||
} | ||
module.exports.__wbindgen_is_undefined = function(arg0) { | ||
@@ -204,5 +221,5 @@ const ret = getObject(arg0) === undefined; | ||
module.exports.__wbindgen_is_null = function(arg0) { | ||
const ret = getObject(arg0) === null; | ||
return ret; | ||
module.exports.__wbg_constructor_ac1f808f67a5f1e9 = function(arg0) { | ||
const ret = new Error(takeObject(arg0)); | ||
return addHeapObject(ret); | ||
}; | ||
@@ -214,3 +231,12 @@ | ||
module.exports.__wbg_readfile_e2b010c5826e7b29 = function() { return handleError(function (arg0, arg1, arg2) { | ||
module.exports.__wbindgen_string_get = function(arg0, arg1) { | ||
const obj = getObject(arg1); | ||
const ret = typeof(obj) === 'string' ? obj : undefined; | ||
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); | ||
var len1 = WASM_VECTOR_LEN; | ||
getInt32Memory0()[arg0 / 4 + 1] = len1; | ||
getInt32Memory0()[arg0 / 4 + 0] = ptr1; | ||
}; | ||
module.exports.__wbg_readfile_0c1777c7c5aa8c92 = function() { return handleError(function (arg0, arg1, arg2) { | ||
const ret = read_file(getStringFromWasm0(arg1, arg2)); | ||
@@ -249,3 +275,3 @@ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); | ||
} finally { | ||
wasm.__wbindgen_export_3(deferred0_0, deferred0_1); | ||
wasm.__wbindgen_export_2(deferred0_0, deferred0_1); | ||
} | ||
@@ -278,11 +304,12 @@ }; | ||
module.exports.__wbindgen_string_get = function(arg0, arg1) { | ||
const obj = getObject(arg1); | ||
const ret = typeof(obj) === 'string' ? obj : undefined; | ||
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); | ||
var len1 = WASM_VECTOR_LEN; | ||
getInt32Memory0()[arg0 / 4 + 1] = len1; | ||
getInt32Memory0()[arg0 / 4 + 0] = ptr1; | ||
module.exports.__wbg_get_7303ed2ef026b2f5 = function(arg0, arg1) { | ||
const ret = getObject(arg0)[arg1 >>> 0]; | ||
return addHeapObject(ret); | ||
}; | ||
module.exports.__wbg_length_820c786973abdd8a = function(arg0) { | ||
const ret = getObject(arg0).length; | ||
return ret; | ||
}; | ||
module.exports.__wbg_parse_76a8a18ca3f8730b = function() { return handleError(function (arg0, arg1) { | ||
@@ -289,0 +316,0 @@ const ret = JSON.parse(getStringFromWasm0(arg0, arg1)); |
@@ -6,3 +6,3 @@ { | ||
], | ||
"version": "0.15.0-kw-play-around-f87a92a3e", | ||
"version": "0.16.0-kw-branched-off-of-last-aztec-tag-f0795c1fe", | ||
"license": "(MIT OR Apache-2.0)", | ||
@@ -27,3 +27,3 @@ "main": "./nodejs/noir_wasm.js", | ||
"test:browser": "web-test-runner", | ||
"clean": "chmod u+w web nodejs && rm -rf ./nodejs ./web ./target ./result", | ||
"clean": "chmod u+w web nodejs || true && rm -rf ./nodejs ./web ./target ./result", | ||
"lint": "NODE_NO_WARNINGS=1 eslint . --ext .ts --ignore-path ./.eslintignore --max-warnings 0" | ||
@@ -39,3 +39,2 @@ }, | ||
"@web/test-runner-playwright": "^0.10.0", | ||
"@web/test-runner-webdriver": "^0.7.0", | ||
"mocha": "^10.2.0" | ||
@@ -42,0 +41,0 @@ }, |
/* tslint:disable */ | ||
/* eslint-disable */ | ||
export const memory: WebAssembly.Memory; | ||
export function compile(a: number): number; | ||
export function acir_read_bytes(a: number, b: number): number; | ||
export function acir_write_bytes(a: number, b: number): void; | ||
export function init_log_level(a: number, b: number): void; | ||
export function build_info(): number; | ||
export function acir_read_bytes(a: number, b: number): number; | ||
export function acir_write_bytes(a: number, b: number): void; | ||
export function compile(a: number, b: number, c: number, d: number, e: number): void; | ||
export function __wbindgen_export_0(a: number): number; | ||
export function __wbindgen_export_1(a: number, b: number, c: number): number; | ||
export function __wbindgen_export_2(a: number): void; | ||
export function __wbindgen_add_to_stack_pointer(a: number): number; | ||
export function __wbindgen_export_3(a: number, b: number): void; | ||
export function __wbindgen_export_2(a: number, b: number): void; | ||
export function __wbindgen_export_3(a: number): void; |
/* tslint:disable */ | ||
/* eslint-disable */ | ||
/** | ||
* @param {any} args | ||
* @param {Uint8Array} bytes | ||
* @returns {any} | ||
*/ | ||
export function compile(args: any): any; | ||
export function acir_read_bytes(bytes: Uint8Array): any; | ||
/** | ||
* @param {any} acir | ||
* @returns {Uint8Array} | ||
*/ | ||
export function acir_write_bytes(acir: any): Uint8Array; | ||
/** | ||
* @param {string} level | ||
@@ -17,12 +22,13 @@ */ | ||
/** | ||
* @param {Uint8Array} bytes | ||
* @param {string} entry_point | ||
* @param {boolean | undefined} contracts | ||
* @param {string[] | undefined} dependencies | ||
* @returns {any} | ||
*/ | ||
export function acir_read_bytes(bytes: Uint8Array): any; | ||
/** | ||
* @param {any} acir | ||
* @returns {Uint8Array} | ||
*/ | ||
export function acir_write_bytes(acir: any): Uint8Array; | ||
export function compile(entry_point: string, contracts?: boolean, dependencies?: string[]): any; | ||
export type CompileError = Error; | ||
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module; | ||
@@ -32,12 +38,12 @@ | ||
readonly memory: WebAssembly.Memory; | ||
readonly compile: (a: number) => number; | ||
readonly acir_read_bytes: (a: number, b: number) => number; | ||
readonly acir_write_bytes: (a: number, b: number) => void; | ||
readonly init_log_level: (a: number, b: number) => void; | ||
readonly build_info: () => number; | ||
readonly acir_read_bytes: (a: number, b: number) => number; | ||
readonly acir_write_bytes: (a: number, b: number) => void; | ||
readonly compile: (a: number, b: number, c: number, d: number, e: number) => void; | ||
readonly __wbindgen_export_0: (a: number) => number; | ||
readonly __wbindgen_export_1: (a: number, b: number, c: number) => number; | ||
readonly __wbindgen_export_2: (a: number) => void; | ||
readonly __wbindgen_add_to_stack_pointer: (a: number) => number; | ||
readonly __wbindgen_export_3: (a: number, b: number) => void; | ||
readonly __wbindgen_export_2: (a: number, b: number) => void; | ||
readonly __wbindgen_export_3: (a: number) => void; | ||
} | ||
@@ -44,0 +50,0 @@ |
@@ -25,6 +25,4 @@ import { read_file } from '@noir-lang/source-resolver'; | ||
const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } ); | ||
let WASM_VECTOR_LEN = 0; | ||
if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); }; | ||
let cachedUint8Memory0 = null; | ||
@@ -39,18 +37,2 @@ | ||
function getStringFromWasm0(ptr, len) { | ||
ptr = ptr >>> 0; | ||
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 = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } ); | ||
@@ -121,33 +103,19 @@ | ||
} | ||
/** | ||
* @param {any} args | ||
* @returns {any} | ||
*/ | ||
export function compile(args) { | ||
const ret = wasm.compile(addHeapObject(args)); | ||
return takeObject(ret); | ||
} | ||
function handleError(f, args) { | ||
try { | ||
return f.apply(this, args); | ||
} catch (e) { | ||
wasm.__wbindgen_export_2(addHeapObject(e)); | ||
} | ||
const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } ); | ||
if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); }; | ||
function getStringFromWasm0(ptr, len) { | ||
ptr = ptr >>> 0; | ||
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); | ||
} | ||
/** | ||
* @returns {any} | ||
*/ | ||
export function build_info() { | ||
const ret = wasm.build_info(); | ||
return takeObject(ret); | ||
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; | ||
} | ||
@@ -187,3 +155,3 @@ | ||
var v1 = getArrayU8FromWasm0(r0, r1).slice(); | ||
wasm.__wbindgen_export_3(r0, r1 * 1); | ||
wasm.__wbindgen_export_2(r0, r1 * 1); | ||
return v1; | ||
@@ -195,2 +163,51 @@ } finally { | ||
/** | ||
* @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); | ||
} | ||
/** | ||
* @returns {any} | ||
*/ | ||
export function build_info() { | ||
const ret = wasm.build_info(); | ||
return takeObject(ret); | ||
} | ||
/** | ||
* @param {string} entry_point | ||
* @param {boolean | undefined} contracts | ||
* @param {string[] | undefined} dependencies | ||
* @returns {any} | ||
*/ | ||
export function compile(entry_point, contracts, dependencies) { | ||
try { | ||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); | ||
const ptr0 = passStringToWasm0(entry_point, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); | ||
const len0 = WASM_VECTOR_LEN; | ||
wasm.compile(retptr, ptr0, len0, isLikeNone(contracts) ? 0xFFFFFF : contracts ? 1 : 0, isLikeNone(dependencies) ? 0 : addHeapObject(dependencies)); | ||
var r0 = getInt32Memory0()[retptr / 4 + 0]; | ||
var r1 = getInt32Memory0()[retptr / 4 + 1]; | ||
var r2 = getInt32Memory0()[retptr / 4 + 2]; | ||
if (r2) { | ||
throw takeObject(r1); | ||
} | ||
return takeObject(r0); | ||
} finally { | ||
wasm.__wbindgen_add_to_stack_pointer(16); | ||
} | ||
} | ||
function handleError(f, args) { | ||
try { | ||
return f.apply(this, args); | ||
} catch (e) { | ||
wasm.__wbindgen_export_3(addHeapObject(e)); | ||
} | ||
} | ||
async function __wbg_load(module, imports) { | ||
@@ -234,5 +251,5 @@ if (typeof Response === 'function' && module instanceof Response) { | ||
}; | ||
imports.wbg.__wbindgen_is_null = function(arg0) { | ||
const ret = getObject(arg0) === null; | ||
return ret; | ||
imports.wbg.__wbg_constructor_ac1f808f67a5f1e9 = function(arg0) { | ||
const ret = new Error(takeObject(arg0)); | ||
return addHeapObject(ret); | ||
}; | ||
@@ -242,3 +259,11 @@ imports.wbg.__wbindgen_object_drop_ref = function(arg0) { | ||
}; | ||
imports.wbg.__wbg_readfile_e2b010c5826e7b29 = function() { return handleError(function (arg0, arg1, arg2) { | ||
imports.wbg.__wbindgen_string_get = function(arg0, arg1) { | ||
const obj = getObject(arg1); | ||
const ret = typeof(obj) === 'string' ? obj : undefined; | ||
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); | ||
var len1 = WASM_VECTOR_LEN; | ||
getInt32Memory0()[arg0 / 4 + 1] = len1; | ||
getInt32Memory0()[arg0 / 4 + 0] = ptr1; | ||
}; | ||
imports.wbg.__wbg_readfile_0c1777c7c5aa8c92 = function() { return handleError(function (arg0, arg1, arg2) { | ||
const ret = read_file(getStringFromWasm0(arg1, arg2)); | ||
@@ -273,3 +298,3 @@ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); | ||
} finally { | ||
wasm.__wbindgen_export_3(deferred0_0, deferred0_1); | ||
wasm.__wbindgen_export_2(deferred0_0, deferred0_1); | ||
} | ||
@@ -295,10 +320,10 @@ }; | ||
}; | ||
imports.wbg.__wbindgen_string_get = function(arg0, arg1) { | ||
const obj = getObject(arg1); | ||
const ret = typeof(obj) === 'string' ? obj : undefined; | ||
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); | ||
var len1 = WASM_VECTOR_LEN; | ||
getInt32Memory0()[arg0 / 4 + 1] = len1; | ||
getInt32Memory0()[arg0 / 4 + 0] = ptr1; | ||
imports.wbg.__wbg_get_7303ed2ef026b2f5 = function(arg0, arg1) { | ||
const ret = getObject(arg0)[arg1 >>> 0]; | ||
return addHeapObject(ret); | ||
}; | ||
imports.wbg.__wbg_length_820c786973abdd8a = function(arg0) { | ||
const ret = getObject(arg0).length; | ||
return ret; | ||
}; | ||
imports.wbg.__wbg_parse_76a8a18ca3f8730b = function() { return handleError(function (arg0, arg1) { | ||
@@ -305,0 +330,0 @@ const ret = JSON.parse(getStringFromWasm0(arg0, arg1)); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
5
707
14708116