@noir-lang/noir_wasm
Advanced tools
Comparing version 0.17.0-86704ba.nightly to 0.17.0-b8b7782.aztec
/* tslint:disable */ | ||
/* eslint-disable */ | ||
export const memory: WebAssembly.Memory; | ||
export function __wbg_compileerror_free(a: number): void; | ||
export function __wbg_get_compileerror_message(a: number): number; | ||
export function __wbg_set_compileerror_message(a: number, b: number): void; | ||
export function __wbg_get_compileerror_diagnostics(a: number): number; | ||
export function __wbg_set_compileerror_diagnostics(a: number, b: number): void; | ||
export function compile(a: number, b: number, c: number, d: number, e: number): void; | ||
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_add_to_stack_pointer(a: number): number; | ||
export function __wbindgen_export_2(a: number, b: number): void; | ||
export function __wbindgen_export_3(a: number): void; | ||
export function __wbindgen_export_2(a: number): void; | ||
export function __wbindgen_export_3(a: number, b: number): void; |
/* tslint:disable */ | ||
/* eslint-disable */ | ||
/** | ||
* @param {string} level | ||
*/ | ||
export function init_log_level(level: string): void; | ||
/** | ||
* @param {string} entry_point | ||
* @param {boolean | undefined} contracts | ||
* @param {DependencyGraph | undefined} dependency_graph | ||
* @returns {any} | ||
*/ | ||
export function build_info(): any; | ||
export function compile(entry_point: string, contracts?: boolean, dependency_graph?: DependencyGraph): any; | ||
/** | ||
@@ -22,12 +21,13 @@ * @param {Uint8Array} bytes | ||
/** | ||
* @param {string} entry_point | ||
* @param {boolean | undefined} contracts | ||
* @param {string[] | undefined} dependencies | ||
* @param {string} level | ||
*/ | ||
export function init_log_level(level: string): void; | ||
/** | ||
* @returns {any} | ||
*/ | ||
export function compile(entry_point: string, contracts?: boolean, dependencies?: string[]): any; | ||
export function build_info(): any; | ||
export type Diagnostic = { | ||
message: string; | ||
file_path: string; | ||
file: string; | ||
secondaries: ReadonlyArray<{ | ||
@@ -40,3 +40,4 @@ message: string; | ||
interface CompileError { | ||
export interface CompileError extends Error { | ||
message: string; | ||
diagnostics: ReadonlyArray<Diagnostic>; | ||
@@ -46,12 +47,8 @@ } | ||
/** | ||
*/ | ||
export class CompileError { | ||
free(): void; | ||
/** | ||
*/ | ||
diagnostics: any; | ||
/** | ||
*/ | ||
message: string; | ||
export type DependencyGraph = { | ||
root_dependencies: readonly string[]; | ||
library_dependencies: Readonly<Record<string, readonly string[]>>; | ||
} | ||
@@ -5,3 +5,3 @@ let imports = {}; | ||
const { read_file } = require(`@noir-lang/source-resolver`); | ||
const { TextEncoder, TextDecoder } = require(`util`); | ||
const { TextDecoder, TextEncoder } = require(`util`); | ||
@@ -28,2 +28,20 @@ const heap = new Array(128).fill(undefined); | ||
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }); | ||
cachedTextDecoder.decode(); | ||
let cachedUint8Memory0 = null; | ||
function getUint8Memory0() { | ||
if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) { | ||
cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer); | ||
} | ||
return cachedUint8Memory0; | ||
} | ||
function getStringFromWasm0(ptr, len) { | ||
ptr = ptr >>> 0; | ||
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len)); | ||
} | ||
function addHeapObject(obj) { | ||
@@ -40,11 +58,2 @@ if (heap_next === heap.length) heap.push(heap.length + 1); | ||
let cachedUint8Memory0 = null; | ||
function getUint8Memory0() { | ||
if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) { | ||
cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer); | ||
} | ||
return cachedUint8Memory0; | ||
} | ||
let cachedTextEncoder = new TextEncoder('utf-8'); | ||
@@ -116,27 +125,98 @@ | ||
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)); | ||
function debugString(val) { | ||
// primitive types | ||
const type = typeof val; | ||
if (type == 'number' || type == 'boolean' || val == null) { | ||
return `${val}`; | ||
} | ||
if (type == 'string') { | ||
return `"${val}"`; | ||
} | ||
if (type == 'symbol') { | ||
const description = val.description; | ||
if (description == null) { | ||
return 'Symbol'; | ||
} else { | ||
return `Symbol(${description})`; | ||
} | ||
} | ||
if (type == 'function') { | ||
const name = val.name; | ||
if (typeof name == 'string' && name.length > 0) { | ||
return `Function(${name})`; | ||
} else { | ||
return 'Function'; | ||
} | ||
} | ||
// objects | ||
if (Array.isArray(val)) { | ||
const length = val.length; | ||
let debug = '['; | ||
if (length > 0) { | ||
debug += debugString(val[0]); | ||
} | ||
for(let i = 1; i < length; i++) { | ||
debug += ', ' + debugString(val[i]); | ||
} | ||
debug += ']'; | ||
return debug; | ||
} | ||
// Test for built-in | ||
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val)); | ||
let className; | ||
if (builtInMatches.length > 1) { | ||
className = builtInMatches[1]; | ||
} else { | ||
// Failed to match the standard '[object ClassName]' | ||
return toString.call(val); | ||
} | ||
if (className == 'Object') { | ||
// we're a user defined class or Object | ||
// JSON.stringify avoids problems with cycles, and is generally much | ||
// easier than looping through ownProperties of `val`. | ||
try { | ||
return 'Object(' + JSON.stringify(val) + ')'; | ||
} catch (_) { | ||
return 'Object'; | ||
} | ||
} | ||
// errors | ||
if (val instanceof Error) { | ||
return `${val.name}: ${val.message}\n${val.stack}`; | ||
} | ||
// TODO we could test for more things here, like `Set`s and `Map`s. | ||
return className; | ||
} | ||
/** | ||
* @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); | ||
}; | ||
/** | ||
* @param {string} entry_point | ||
* @param {boolean | undefined} contracts | ||
* @param {DependencyGraph | undefined} dependency_graph | ||
* @returns {any} | ||
*/ | ||
module.exports.build_info = function() { | ||
const ret = wasm.build_info(); | ||
return takeObject(ret); | ||
module.exports.compile = function(entry_point, contracts, dependency_graph) { | ||
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(dependency_graph) ? 0 : addHeapObject(dependency_graph)); | ||
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_2(addHeapObject(e)); | ||
} | ||
} | ||
function passArray8ToWasm0(arg, malloc) { | ||
@@ -174,3 +254,3 @@ const ptr = malloc(arg.length * 1) >>> 0; | ||
var v1 = getArrayU8FromWasm0(r0, r1).slice(); | ||
wasm.__wbindgen_export_2(r0, r1 * 1); | ||
wasm.__wbindgen_export_3(r0, r1 * 1); | ||
return v1; | ||
@@ -183,87 +263,16 @@ } finally { | ||
/** | ||
* @param {string} entry_point | ||
* @param {boolean | undefined} contracts | ||
* @param {string[] | undefined} dependencies | ||
* @returns {any} | ||
* @param {string} level | ||
*/ | ||
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); | ||
} | ||
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); | ||
}; | ||
function handleError(f, args) { | ||
try { | ||
return f.apply(this, args); | ||
} catch (e) { | ||
wasm.__wbindgen_export_3(addHeapObject(e)); | ||
} | ||
} | ||
/** | ||
* @returns {any} | ||
*/ | ||
class CompileError { | ||
static __wrap(ptr) { | ||
ptr = ptr >>> 0; | ||
const obj = Object.create(CompileError.prototype); | ||
obj.__wbg_ptr = ptr; | ||
return obj; | ||
} | ||
__destroy_into_raw() { | ||
const ptr = this.__wbg_ptr; | ||
this.__wbg_ptr = 0; | ||
return ptr; | ||
} | ||
free() { | ||
const ptr = this.__destroy_into_raw(); | ||
wasm.__wbg_compileerror_free(ptr); | ||
} | ||
/** | ||
* @returns {string} | ||
*/ | ||
get message() { | ||
const ret = wasm.__wbg_get_compileerror_message(this.__wbg_ptr); | ||
return takeObject(ret); | ||
} | ||
/** | ||
* @param {string} arg0 | ||
*/ | ||
set message(arg0) { | ||
wasm.__wbg_set_compileerror_message(this.__wbg_ptr, addHeapObject(arg0)); | ||
} | ||
/** | ||
* @returns {any} | ||
*/ | ||
get diagnostics() { | ||
const ret = wasm.__wbg_get_compileerror_diagnostics(this.__wbg_ptr); | ||
return takeObject(ret); | ||
} | ||
/** | ||
* @param {any} arg0 | ||
*/ | ||
set diagnostics(arg0) { | ||
wasm.__wbg_set_compileerror_diagnostics(this.__wbg_ptr, addHeapObject(arg0)); | ||
} | ||
} | ||
module.exports.CompileError = CompileError; | ||
module.exports.__wbg_compileerror_new = function(arg0) { | ||
const ret = CompileError.__wrap(arg0); | ||
return addHeapObject(ret); | ||
module.exports.build_info = function() { | ||
const ret = wasm.build_info(); | ||
return takeObject(ret); | ||
}; | ||
@@ -275,15 +284,14 @@ | ||
module.exports.__wbindgen_object_clone_ref = function(arg0) { | ||
const ret = getObject(arg0); | ||
module.exports.__wbg_constructor_5ae64b4b6121edd9 = function(arg0) { | ||
const ret = new Error(takeObject(arg0)); | ||
return addHeapObject(ret); | ||
}; | ||
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; | ||
module.exports.__wbg_readfile_db7d495e3e198483 = function() { return handleError(function (arg0, arg1, arg2) { | ||
const ret = read_file(getStringFromWasm0(arg1, arg2)); | ||
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); | ||
const len1 = WASM_VECTOR_LEN; | ||
getInt32Memory0()[arg0 / 4 + 1] = len1; | ||
getInt32Memory0()[arg0 / 4 + 0] = ptr1; | ||
}; | ||
}, arguments) }; | ||
@@ -295,10 +303,2 @@ module.exports.__wbindgen_is_undefined = function(arg0) { | ||
module.exports.__wbg_readfile_db7d495e3e198483 = function() { return handleError(function (arg0, arg1, arg2) { | ||
const ret = read_file(getStringFromWasm0(arg1, arg2)); | ||
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); | ||
const len1 = WASM_VECTOR_LEN; | ||
getInt32Memory0()[arg0 / 4 + 1] = len1; | ||
getInt32Memory0()[arg0 / 4 + 0] = ptr1; | ||
}, arguments) }; | ||
module.exports.__wbindgen_string_new = function(arg0, arg1) { | ||
@@ -330,3 +330,3 @@ const ret = getStringFromWasm0(arg0, arg1); | ||
} finally { | ||
wasm.__wbindgen_export_2(deferred0_0, deferred0_1); | ||
wasm.__wbindgen_export_3(deferred0_0, deferred0_1); | ||
} | ||
@@ -359,11 +359,15 @@ }; | ||
module.exports.__wbg_get_7303ed2ef026b2f5 = function(arg0, arg1) { | ||
const ret = getObject(arg0)[arg1 >>> 0]; | ||
return addHeapObject(ret); | ||
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_length_820c786973abdd8a = function(arg0) { | ||
const ret = getObject(arg0).length; | ||
module.exports.__wbg_set_07da13cc24b69217 = function() { return handleError(function (arg0, arg1, arg2) { | ||
const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2)); | ||
return ret; | ||
}; | ||
}, arguments) }; | ||
@@ -380,2 +384,10 @@ module.exports.__wbg_parse_76a8a18ca3f8730b = function() { return handleError(function (arg0, arg1) { | ||
module.exports.__wbindgen_debug_string = function(arg0, arg1) { | ||
const ret = debugString(getObject(arg1)); | ||
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); | ||
const len1 = WASM_VECTOR_LEN; | ||
getInt32Memory0()[arg0 / 4 + 1] = len1; | ||
getInt32Memory0()[arg0 / 4 + 0] = ptr1; | ||
}; | ||
module.exports.__wbindgen_throw = function(arg0, arg1) { | ||
@@ -382,0 +394,0 @@ throw new Error(getStringFromWasm0(arg0, arg1)); |
@@ -6,3 +6,3 @@ { | ||
], | ||
"version": "0.17.0-86704ba.nightly", | ||
"version": "0.17.0-b8b7782.aztec", | ||
"license": "(MIT OR Apache-2.0)", | ||
@@ -35,3 +35,3 @@ "main": "./nodejs/noir_wasm.js", | ||
"peerDependencies": { | ||
"@noir-lang/source-resolver": "0.17.0-86704ba.nightly" | ||
"@noir-lang/source-resolver": "0.17.0-b8b7782.aztec" | ||
}, | ||
@@ -38,0 +38,0 @@ "devDependencies": { |
/* tslint:disable */ | ||
/* eslint-disable */ | ||
export const memory: WebAssembly.Memory; | ||
export function __wbg_compileerror_free(a: number): void; | ||
export function __wbg_get_compileerror_message(a: number): number; | ||
export function __wbg_set_compileerror_message(a: number, b: number): void; | ||
export function __wbg_get_compileerror_diagnostics(a: number): number; | ||
export function __wbg_set_compileerror_diagnostics(a: number, b: number): void; | ||
export function compile(a: number, b: number, c: number, d: number, e: number): void; | ||
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_add_to_stack_pointer(a: number): number; | ||
export function __wbindgen_export_2(a: number, b: number): void; | ||
export function __wbindgen_export_3(a: number): void; | ||
export function __wbindgen_export_2(a: number): void; | ||
export function __wbindgen_export_3(a: number, b: number): void; |
/* tslint:disable */ | ||
/* eslint-disable */ | ||
/** | ||
* @param {string} level | ||
*/ | ||
export function init_log_level(level: string): void; | ||
/** | ||
* @param {string} entry_point | ||
* @param {boolean | undefined} contracts | ||
* @param {DependencyGraph | undefined} dependency_graph | ||
* @returns {any} | ||
*/ | ||
export function build_info(): any; | ||
export function compile(entry_point: string, contracts?: boolean, dependency_graph?: DependencyGraph): any; | ||
/** | ||
@@ -22,12 +21,13 @@ * @param {Uint8Array} bytes | ||
/** | ||
* @param {string} entry_point | ||
* @param {boolean | undefined} contracts | ||
* @param {string[] | undefined} dependencies | ||
* @param {string} level | ||
*/ | ||
export function init_log_level(level: string): void; | ||
/** | ||
* @returns {any} | ||
*/ | ||
export function compile(entry_point: string, contracts?: boolean, dependencies?: string[]): any; | ||
export function build_info(): any; | ||
export type Diagnostic = { | ||
message: string; | ||
file_path: string; | ||
file: string; | ||
secondaries: ReadonlyArray<{ | ||
@@ -40,3 +40,4 @@ message: string; | ||
interface CompileError { | ||
export interface CompileError extends Error { | ||
message: string; | ||
diagnostics: ReadonlyArray<Diagnostic>; | ||
@@ -46,14 +47,10 @@ } | ||
/** | ||
*/ | ||
export class CompileError { | ||
free(): void; | ||
/** | ||
*/ | ||
diagnostics: any; | ||
/** | ||
*/ | ||
message: string; | ||
export type DependencyGraph = { | ||
root_dependencies: readonly string[]; | ||
library_dependencies: Readonly<Record<string, readonly string[]>>; | ||
} | ||
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module; | ||
@@ -63,17 +60,12 @@ | ||
readonly memory: WebAssembly.Memory; | ||
readonly __wbg_compileerror_free: (a: number) => void; | ||
readonly __wbg_get_compileerror_message: (a: number) => number; | ||
readonly __wbg_set_compileerror_message: (a: number, b: number) => void; | ||
readonly __wbg_get_compileerror_diagnostics: (a: number) => number; | ||
readonly __wbg_set_compileerror_diagnostics: (a: number, b: number) => void; | ||
readonly compile: (a: number, b: number, c: number, d: number, e: number) => void; | ||
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_add_to_stack_pointer: (a: number) => number; | ||
readonly __wbindgen_export_2: (a: number, b: number) => void; | ||
readonly __wbindgen_export_3: (a: number) => void; | ||
readonly __wbindgen_export_2: (a: number) => void; | ||
readonly __wbindgen_export_3: (a: number, b: number) => void; | ||
} | ||
@@ -80,0 +72,0 @@ |
@@ -25,2 +25,20 @@ 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') } } ); | ||
if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); }; | ||
let cachedUint8Memory0 = null; | ||
function getUint8Memory0() { | ||
if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) { | ||
cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer); | ||
} | ||
return cachedUint8Memory0; | ||
} | ||
function getStringFromWasm0(ptr, len) { | ||
ptr = ptr >>> 0; | ||
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len)); | ||
} | ||
function addHeapObject(obj) { | ||
@@ -37,11 +55,2 @@ if (heap_next === heap.length) heap.push(heap.length + 1); | ||
let cachedUint8Memory0 = null; | ||
function getUint8Memory0() { | ||
if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) { | ||
cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer); | ||
} | ||
return cachedUint8Memory0; | ||
} | ||
const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } ); | ||
@@ -113,25 +122,96 @@ | ||
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)); | ||
function debugString(val) { | ||
// primitive types | ||
const type = typeof val; | ||
if (type == 'number' || type == 'boolean' || val == null) { | ||
return `${val}`; | ||
} | ||
if (type == 'string') { | ||
return `"${val}"`; | ||
} | ||
if (type == 'symbol') { | ||
const description = val.description; | ||
if (description == null) { | ||
return 'Symbol'; | ||
} else { | ||
return `Symbol(${description})`; | ||
} | ||
} | ||
if (type == 'function') { | ||
const name = val.name; | ||
if (typeof name == 'string' && name.length > 0) { | ||
return `Function(${name})`; | ||
} else { | ||
return 'Function'; | ||
} | ||
} | ||
// objects | ||
if (Array.isArray(val)) { | ||
const length = val.length; | ||
let debug = '['; | ||
if (length > 0) { | ||
debug += debugString(val[0]); | ||
} | ||
for(let i = 1; i < length; i++) { | ||
debug += ', ' + debugString(val[i]); | ||
} | ||
debug += ']'; | ||
return debug; | ||
} | ||
// Test for built-in | ||
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val)); | ||
let className; | ||
if (builtInMatches.length > 1) { | ||
className = builtInMatches[1]; | ||
} else { | ||
// Failed to match the standard '[object ClassName]' | ||
return toString.call(val); | ||
} | ||
if (className == 'Object') { | ||
// we're a user defined class or Object | ||
// JSON.stringify avoids problems with cycles, and is generally much | ||
// easier than looping through ownProperties of `val`. | ||
try { | ||
return 'Object(' + JSON.stringify(val) + ')'; | ||
} catch (_) { | ||
return 'Object'; | ||
} | ||
} | ||
// errors | ||
if (val instanceof Error) { | ||
return `${val.name}: ${val.message}\n${val.stack}`; | ||
} | ||
// TODO we could test for more things here, like `Set`s and `Map`s. | ||
return className; | ||
} | ||
/** | ||
* @param {string} level | ||
* @param {string} entry_point | ||
* @param {boolean | undefined} contracts | ||
* @param {DependencyGraph | undefined} dependency_graph | ||
* @returns {any} | ||
*/ | ||
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); | ||
export function compile(entry_point, contracts, dependency_graph) { | ||
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(dependency_graph) ? 0 : addHeapObject(dependency_graph)); | ||
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); | ||
} | ||
} | ||
/** | ||
* @returns {any} | ||
*/ | ||
export function build_info() { | ||
const ret = wasm.build_info(); | ||
return takeObject(ret); | ||
function handleError(f, args) { | ||
try { | ||
return f.apply(this, args); | ||
} catch (e) { | ||
wasm.__wbindgen_export_2(addHeapObject(e)); | ||
} | ||
} | ||
@@ -171,3 +251,3 @@ | ||
var v1 = getArrayU8FromWasm0(r0, r1).slice(); | ||
wasm.__wbindgen_export_2(r0, r1 * 1); | ||
wasm.__wbindgen_export_3(r0, r1 * 1); | ||
return v1; | ||
@@ -180,81 +260,16 @@ } finally { | ||
/** | ||
* @param {string} entry_point | ||
* @param {boolean | undefined} contracts | ||
* @param {string[] | undefined} dependencies | ||
* @returns {any} | ||
* @param {string} level | ||
*/ | ||
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); | ||
} | ||
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 handleError(f, args) { | ||
try { | ||
return f.apply(this, args); | ||
} catch (e) { | ||
wasm.__wbindgen_export_3(addHeapObject(e)); | ||
} | ||
} | ||
/** | ||
* @returns {any} | ||
*/ | ||
export class CompileError { | ||
static __wrap(ptr) { | ||
ptr = ptr >>> 0; | ||
const obj = Object.create(CompileError.prototype); | ||
obj.__wbg_ptr = ptr; | ||
return obj; | ||
} | ||
__destroy_into_raw() { | ||
const ptr = this.__wbg_ptr; | ||
this.__wbg_ptr = 0; | ||
return ptr; | ||
} | ||
free() { | ||
const ptr = this.__destroy_into_raw(); | ||
wasm.__wbg_compileerror_free(ptr); | ||
} | ||
/** | ||
* @returns {string} | ||
*/ | ||
get message() { | ||
const ret = wasm.__wbg_get_compileerror_message(this.__wbg_ptr); | ||
return takeObject(ret); | ||
} | ||
/** | ||
* @param {string} arg0 | ||
*/ | ||
set message(arg0) { | ||
wasm.__wbg_set_compileerror_message(this.__wbg_ptr, addHeapObject(arg0)); | ||
} | ||
/** | ||
* @returns {any} | ||
*/ | ||
get diagnostics() { | ||
const ret = wasm.__wbg_get_compileerror_diagnostics(this.__wbg_ptr); | ||
return takeObject(ret); | ||
} | ||
/** | ||
* @param {any} arg0 | ||
*/ | ||
set diagnostics(arg0) { | ||
wasm.__wbg_set_compileerror_diagnostics(this.__wbg_ptr, addHeapObject(arg0)); | ||
} | ||
export function build_info() { | ||
const ret = wasm.build_info(); | ||
return takeObject(ret); | ||
} | ||
@@ -296,25 +311,9 @@ | ||
imports.wbg = {}; | ||
imports.wbg.__wbg_compileerror_new = function(arg0) { | ||
const ret = CompileError.__wrap(arg0); | ||
return addHeapObject(ret); | ||
}; | ||
imports.wbg.__wbindgen_object_drop_ref = function(arg0) { | ||
takeObject(arg0); | ||
}; | ||
imports.wbg.__wbindgen_object_clone_ref = function(arg0) { | ||
const ret = getObject(arg0); | ||
imports.wbg.__wbg_constructor_5ae64b4b6121edd9 = function(arg0) { | ||
const ret = new Error(takeObject(arg0)); | ||
return addHeapObject(ret); | ||
}; | ||
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.__wbindgen_is_undefined = function(arg0) { | ||
const ret = getObject(arg0) === undefined; | ||
return ret; | ||
}; | ||
imports.wbg.__wbg_readfile_db7d495e3e198483 = function() { return handleError(function (arg0, arg1, arg2) { | ||
@@ -327,2 +326,6 @@ const ret = read_file(getStringFromWasm0(arg1, arg2)); | ||
}, arguments) }; | ||
imports.wbg.__wbindgen_is_undefined = function(arg0) { | ||
const ret = getObject(arg0) === undefined; | ||
return ret; | ||
}; | ||
imports.wbg.__wbindgen_string_new = function(arg0, arg1) { | ||
@@ -351,3 +354,3 @@ const ret = getStringFromWasm0(arg0, arg1); | ||
} finally { | ||
wasm.__wbindgen_export_2(deferred0_0, deferred0_1); | ||
wasm.__wbindgen_export_3(deferred0_0, deferred0_1); | ||
} | ||
@@ -373,10 +376,14 @@ }; | ||
}; | ||
imports.wbg.__wbg_get_7303ed2ef026b2f5 = function(arg0, arg1) { | ||
const ret = getObject(arg0)[arg1 >>> 0]; | ||
return addHeapObject(ret); | ||
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_length_820c786973abdd8a = function(arg0) { | ||
const ret = getObject(arg0).length; | ||
imports.wbg.__wbg_set_07da13cc24b69217 = function() { return handleError(function (arg0, arg1, arg2) { | ||
const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2)); | ||
return ret; | ||
}; | ||
}, arguments) }; | ||
imports.wbg.__wbg_parse_76a8a18ca3f8730b = function() { return handleError(function (arg0, arg1) { | ||
@@ -390,2 +397,9 @@ const ret = JSON.parse(getStringFromWasm0(arg0, arg1)); | ||
}, arguments) }; | ||
imports.wbg.__wbindgen_debug_string = function(arg0, arg1) { | ||
const ret = debugString(getObject(arg1)); | ||
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); | ||
const len1 = WASM_VECTOR_LEN; | ||
getInt32Memory0()[arg0 / 4 + 1] = len1; | ||
getInt32Memory0()[arg0 / 4 + 0] = ptr1; | ||
}; | ||
imports.wbg.__wbindgen_throw = function(arg0, arg1) { | ||
@@ -392,0 +406,0 @@ throw new Error(getStringFromWasm0(arg0, arg1)); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15506554
873