@noir-lang/noir_wasm
Advanced tools
Comparing version 0.16.0-37315f8.nightly to 0.19.4
/* 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 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; | ||
@@ -14,0 +9,0 @@ export function __wbindgen_export_0(a: number): number; |
/* tslint:disable */ | ||
/* eslint-disable */ | ||
/** | ||
* @param {string} level | ||
*/ | ||
export function init_log_level(level: string): void; | ||
/** | ||
* @returns {any} | ||
*/ | ||
export function build_info(): any; | ||
/** | ||
* @param {Uint8Array} bytes | ||
@@ -22,12 +14,20 @@ * @returns {any} | ||
/** | ||
* @param {string} level | ||
*/ | ||
export function init_log_level(level: string): void; | ||
/** | ||
* @returns {any} | ||
*/ | ||
export function build_info(): any; | ||
/** | ||
* @param {string} entry_point | ||
* @param {boolean | undefined} contracts | ||
* @param {string[] | undefined} dependencies | ||
* @returns {any} | ||
* @param {DependencyGraph | undefined} dependency_graph | ||
* @returns {CompileResult} | ||
*/ | ||
export function compile(entry_point: string, contracts?: boolean, dependencies?: string[]): any; | ||
export function compile(entry_point: string, contracts?: boolean, dependency_graph?: DependencyGraph): CompileResult; | ||
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,40 @@ } | ||
/** | ||
*/ | ||
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 CompiledContract = { | ||
noir_version: string; | ||
name: string; | ||
backend: string; | ||
functions: Array<any>; | ||
events: Array<any>; | ||
}; | ||
export type CompiledProgram = { | ||
noir_version: string; | ||
backend: string; | ||
abi: any; | ||
bytecode: string; | ||
} | ||
export type DebugArtifact = { | ||
debug_symbols: Array<any>; | ||
file_map: Record<number, any>; | ||
warnings: Array<any>; | ||
}; | ||
export type CompileResult = ( | ||
| { | ||
contract: CompiledContract; | ||
debug: DebugArtifact; | ||
} | ||
| { | ||
program: CompiledProgram; | ||
debug: DebugArtifact; | ||
} | ||
); | ||
@@ -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,67 @@ | ||
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); | ||
}; | ||
/** | ||
* @returns {any} | ||
*/ | ||
module.exports.build_info = function() { | ||
const ret = wasm.build_info(); | ||
return takeObject(ret); | ||
}; | ||
function passArray8ToWasm0(arg, malloc) { | ||
@@ -182,8 +231,25 @@ const ptr = malloc(arg.length * 1) >>> 0; | ||
/** | ||
* @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} | ||
* @param {DependencyGraph | undefined} dependency_graph | ||
* @returns {CompileResult} | ||
*/ | ||
module.exports.compile = function(entry_point, contracts, dependencies) { | ||
module.exports.compile = function(entry_point, contracts, dependency_graph) { | ||
try { | ||
@@ -193,3 +259,3 @@ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); | ||
const len0 = WASM_VECTOR_LEN; | ||
wasm.compile(retptr, ptr0, len0, isLikeNone(contracts) ? 0xFFFFFF : contracts ? 1 : 0, isLikeNone(dependencies) ? 0 : addHeapObject(dependencies)); | ||
wasm.compile(retptr, ptr0, len0, isLikeNone(contracts) ? 0xFFFFFF : contracts ? 1 : 0, isLikeNone(dependency_graph) ? 0 : addHeapObject(dependency_graph)); | ||
var r0 = getInt32Memory0()[retptr / 4 + 0]; | ||
@@ -214,59 +280,3 @@ var r1 = getInt32Memory0()[retptr / 4 + 1]; | ||
} | ||
/** | ||
*/ | ||
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.__wbindgen_object_drop_ref = function(arg0) { | ||
@@ -276,16 +286,7 @@ takeObject(arg0); | ||
module.exports.__wbindgen_object_clone_ref = function(arg0) { | ||
const ret = getObject(arg0); | ||
module.exports.__wbg_constructor_03a5362405b1b4e4 = 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; | ||
getInt32Memory0()[arg0 / 4 + 1] = len1; | ||
getInt32Memory0()[arg0 / 4 + 0] = ptr1; | ||
}; | ||
module.exports.__wbindgen_is_undefined = function(arg0) { | ||
@@ -296,3 +297,8 @@ const ret = getObject(arg0) === undefined; | ||
module.exports.__wbg_readfile_0c1777c7c5aa8c92 = function() { return handleError(function (arg0, arg1, arg2) { | ||
module.exports.__wbg_constructor_153916a7e8b60b9e = function() { | ||
const ret = new Object(); | ||
return addHeapObject(ret); | ||
}; | ||
module.exports.__wbg_readfile_c0e2234e6d0bb1c2 = function() { return handleError(function (arg0, arg1, arg2) { | ||
const ret = read_file(getStringFromWasm0(arg1, arg2)); | ||
@@ -359,11 +365,15 @@ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); | ||
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 +390,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 +400,0 @@ throw new Error(getStringFromWasm0(arg0, arg1)); |
@@ -6,3 +6,3 @@ { | ||
], | ||
"version": "0.16.0-37315f8.nightly", | ||
"version": "0.19.4", | ||
"license": "(MIT OR Apache-2.0)", | ||
@@ -35,3 +35,3 @@ "main": "./nodejs/noir_wasm.js", | ||
"peerDependencies": { | ||
"@noir-lang/source-resolver": "0.16.0-37315f8.nightly" | ||
"@noir-lang/source-resolver": "0.19.4" | ||
}, | ||
@@ -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 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; | ||
@@ -14,0 +9,0 @@ export function __wbindgen_export_0(a: number): number; |
/* tslint:disable */ | ||
/* eslint-disable */ | ||
/** | ||
* @param {string} level | ||
*/ | ||
export function init_log_level(level: string): void; | ||
/** | ||
* @returns {any} | ||
*/ | ||
export function build_info(): any; | ||
/** | ||
* @param {Uint8Array} bytes | ||
@@ -22,12 +14,20 @@ * @returns {any} | ||
/** | ||
* @param {string} level | ||
*/ | ||
export function init_log_level(level: string): void; | ||
/** | ||
* @returns {any} | ||
*/ | ||
export function build_info(): any; | ||
/** | ||
* @param {string} entry_point | ||
* @param {boolean | undefined} contracts | ||
* @param {string[] | undefined} dependencies | ||
* @returns {any} | ||
* @param {DependencyGraph | undefined} dependency_graph | ||
* @returns {CompileResult} | ||
*/ | ||
export function compile(entry_point: string, contracts?: boolean, dependencies?: string[]): any; | ||
export function compile(entry_point: string, contracts?: boolean, dependency_graph?: DependencyGraph): CompileResult; | ||
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,42 @@ } | ||
/** | ||
*/ | ||
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 CompiledContract = { | ||
noir_version: string; | ||
name: string; | ||
backend: string; | ||
functions: Array<any>; | ||
events: Array<any>; | ||
}; | ||
export type CompiledProgram = { | ||
noir_version: string; | ||
backend: string; | ||
abi: any; | ||
bytecode: string; | ||
} | ||
export type DebugArtifact = { | ||
debug_symbols: Array<any>; | ||
file_map: Record<number, any>; | ||
warnings: Array<any>; | ||
}; | ||
export type CompileResult = ( | ||
| { | ||
contract: CompiledContract; | ||
debug: DebugArtifact; | ||
} | ||
| { | ||
program: CompiledProgram; | ||
debug: DebugArtifact; | ||
} | ||
); | ||
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module; | ||
@@ -63,11 +92,6 @@ | ||
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 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; | ||
@@ -74,0 +98,0 @@ readonly __wbindgen_export_0: (a: number) => number; |
@@ -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,27 +122,67 @@ | ||
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 | ||
*/ | ||
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 passArray8ToWasm0(arg, malloc) { | ||
@@ -179,8 +228,25 @@ const ptr = malloc(arg.length * 1) >>> 0; | ||
/** | ||
* @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} | ||
* @param {DependencyGraph | undefined} dependency_graph | ||
* @returns {CompileResult} | ||
*/ | ||
export function compile(entry_point, contracts, dependencies) { | ||
export function compile(entry_point, contracts, dependency_graph) { | ||
try { | ||
@@ -190,3 +256,3 @@ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); | ||
const len0 = WASM_VECTOR_LEN; | ||
wasm.compile(retptr, ptr0, len0, isLikeNone(contracts) ? 0xFFFFFF : contracts ? 1 : 0, isLikeNone(dependencies) ? 0 : addHeapObject(dependencies)); | ||
wasm.compile(retptr, ptr0, len0, isLikeNone(contracts) ? 0xFFFFFF : contracts ? 1 : 0, isLikeNone(dependency_graph) ? 0 : addHeapObject(dependency_graph)); | ||
var r0 = getInt32Memory0()[retptr / 4 + 0]; | ||
@@ -211,53 +277,3 @@ var r1 = getInt32Memory0()[retptr / 4 + 1]; | ||
} | ||
/** | ||
*/ | ||
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)); | ||
} | ||
} | ||
async function __wbg_load(module, imports) { | ||
@@ -297,21 +313,9 @@ if (typeof Response === 'function' && module instanceof Response) { | ||
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_03a5362405b1b4e4 = 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) { | ||
@@ -321,3 +325,7 @@ const ret = getObject(arg0) === undefined; | ||
}; | ||
imports.wbg.__wbg_readfile_0c1777c7c5aa8c92 = function() { return handleError(function (arg0, arg1, arg2) { | ||
imports.wbg.__wbg_constructor_153916a7e8b60b9e = function() { | ||
const ret = new Object(); | ||
return addHeapObject(ret); | ||
}; | ||
imports.wbg.__wbg_readfile_c0e2234e6d0bb1c2 = function() { return handleError(function (arg0, arg1, arg2) { | ||
const ret = read_file(getStringFromWasm0(arg1, arg2)); | ||
@@ -373,10 +381,14 @@ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); | ||
}; | ||
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 +402,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 +411,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
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
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
17406551
937
2