@noir-lang/noir_wasm
Advanced tools
Comparing version 0.10.0-ae93368 to 0.10.0-f5d04f1
@@ -5,8 +5,26 @@ let imports = {}; | ||
const { read_file } = require(`@noir-lang/noir-source-resolver`); | ||
const { TextDecoder, TextEncoder } = require(`util`); | ||
const { TextEncoder, TextDecoder } = require(`util`); | ||
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }); | ||
const heap = new Array(32).fill(undefined); | ||
cachedTextDecoder.decode(); | ||
heap.push(undefined, null, true, false); | ||
function getObject(idx) { return heap[idx]; } | ||
let heap_next = heap.length; | ||
function dropObject(idx) { | ||
if (idx < 36) return; | ||
heap[idx] = heap_next; | ||
heap_next = idx; | ||
} | ||
function takeObject(idx) { | ||
const ret = getObject(idx); | ||
dropObject(idx); | ||
return ret; | ||
} | ||
let WASM_VECTOR_LEN = 0; | ||
let cachedUint8Memory0 = new Uint8Array(); | ||
@@ -21,25 +39,2 @@ | ||
function getStringFromWasm0(ptr, len) { | ||
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len)); | ||
} | ||
const heap = new Array(32).fill(undefined); | ||
heap.push(undefined, null, true, false); | ||
let heap_next = heap.length; | ||
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 getObject(idx) { return heap[idx]; } | ||
let WASM_VECTOR_LEN = 0; | ||
let cachedTextEncoder = new TextEncoder('utf-8'); | ||
@@ -98,2 +93,6 @@ | ||
function isLikeNone(x) { | ||
return x === undefined || x === null; | ||
} | ||
let cachedInt32Memory0 = new Int32Array(); | ||
@@ -108,12 +107,8 @@ | ||
function dropObject(idx) { | ||
if (idx < 36) return; | ||
heap[idx] = heap_next; | ||
heap_next = idx; | ||
} | ||
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }); | ||
function takeObject(idx) { | ||
const ret = getObject(idx); | ||
dropObject(idx); | ||
return ret; | ||
cachedTextDecoder.decode(); | ||
function getStringFromWasm0(ptr, len) { | ||
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len)); | ||
} | ||
@@ -148,2 +143,11 @@ /** | ||
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 getArrayU8FromWasm0(ptr, len) { | ||
@@ -178,16 +182,7 @@ return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len); | ||
module.exports.__wbindgen_json_parse = function(arg0, arg1) { | ||
const ret = JSON.parse(getStringFromWasm0(arg0, arg1)); | ||
return addHeapObject(ret); | ||
module.exports.__wbindgen_is_undefined = function(arg0) { | ||
const ret = getObject(arg0) === undefined; | ||
return ret; | ||
}; | ||
module.exports.__wbindgen_json_serialize = function(arg0, arg1) { | ||
const obj = getObject(arg1); | ||
const ret = JSON.stringify(obj === undefined ? null : obj); | ||
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; | ||
}; | ||
module.exports.__wbindgen_object_drop_ref = function(arg0) { | ||
@@ -226,2 +221,25 @@ takeObject(arg0); | ||
module.exports.__wbindgen_string_get = function(arg0, arg1) { | ||
const obj = getObject(arg1); | ||
const ret = typeof(obj) === 'string' ? obj : undefined; | ||
var ptr0 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); | ||
var len0 = WASM_VECTOR_LEN; | ||
getInt32Memory0()[arg0 / 4 + 1] = len0; | ||
getInt32Memory0()[arg0 / 4 + 0] = ptr0; | ||
}; | ||
module.exports.__wbg_parse_e23be3fecd886e2a = function() { return handleError(function (arg0, arg1) { | ||
const ret = JSON.parse(getStringFromWasm0(arg0, arg1)); | ||
return addHeapObject(ret); | ||
}, arguments) }; | ||
module.exports.__wbg_stringify_d6471d300ded9b68 = function() { return handleError(function (arg0) { | ||
const ret = JSON.stringify(getObject(arg0)); | ||
return addHeapObject(ret); | ||
}, arguments) }; | ||
module.exports.__wbindgen_throw = function(arg0, arg1) { | ||
throw new Error(getStringFromWasm0(arg0, arg1)); | ||
}; | ||
const path = require('path').join(__dirname, 'noir_wasm_bg.wasm'); | ||
@@ -228,0 +246,0 @@ const bytes = require('fs').readFileSync(path); |
{ | ||
"name": "@noir-lang/noir_wasm", | ||
"version": "0.10.0-ae93368", | ||
"version": "0.10.0-f5d04f1", | ||
"files": [ | ||
@@ -15,3 +15,7 @@ "nodejs", | ||
"@noir-lang/noir-source-resolver": "1.0.0" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/noir-lang/noir_wasm.git" | ||
} | ||
} |
# Noir Lang WASM JavaScript Package | ||
## Tracks | ||
Noir lang Repository [noir-lang/noir@ae93368](https://github.com/noir-lang/noir/tree/ae93368436acf3f5147a1cf9e6ad0d755ed04646) | ||
Noir lang Repository [noir-lang/noir@f5d04f1](https://github.com/noir-lang/noir/tree/f5d04f1ec406cb7325de8f81497c7861b89b3a48) |
@@ -5,6 +5,24 @@ import { read_file } from '@noir-lang/noir-source-resolver'; | ||
const cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }); | ||
const heap = new Array(32).fill(undefined); | ||
cachedTextDecoder.decode(); | ||
heap.push(undefined, null, true, false); | ||
function getObject(idx) { return heap[idx]; } | ||
let heap_next = heap.length; | ||
function dropObject(idx) { | ||
if (idx < 36) return; | ||
heap[idx] = heap_next; | ||
heap_next = idx; | ||
} | ||
function takeObject(idx) { | ||
const ret = getObject(idx); | ||
dropObject(idx); | ||
return ret; | ||
} | ||
let WASM_VECTOR_LEN = 0; | ||
let cachedUint8Memory0 = new Uint8Array(); | ||
@@ -19,25 +37,2 @@ | ||
function getStringFromWasm0(ptr, len) { | ||
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len)); | ||
} | ||
const heap = new Array(32).fill(undefined); | ||
heap.push(undefined, null, true, false); | ||
let heap_next = heap.length; | ||
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 getObject(idx) { return heap[idx]; } | ||
let WASM_VECTOR_LEN = 0; | ||
const cachedTextEncoder = new TextEncoder('utf-8'); | ||
@@ -96,2 +91,6 @@ | ||
function isLikeNone(x) { | ||
return x === undefined || x === null; | ||
} | ||
let cachedInt32Memory0 = new Int32Array(); | ||
@@ -106,12 +105,8 @@ | ||
function dropObject(idx) { | ||
if (idx < 36) return; | ||
heap[idx] = heap_next; | ||
heap_next = idx; | ||
} | ||
const cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }); | ||
function takeObject(idx) { | ||
const ret = getObject(idx); | ||
dropObject(idx); | ||
return ret; | ||
cachedTextDecoder.decode(); | ||
function getStringFromWasm0(ptr, len) { | ||
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len)); | ||
} | ||
@@ -146,2 +141,11 @@ /** | ||
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 getArrayU8FromWasm0(ptr, len) { | ||
@@ -210,14 +214,6 @@ return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len); | ||
imports.wbg = {}; | ||
imports.wbg.__wbindgen_json_parse = function(arg0, arg1) { | ||
const ret = JSON.parse(getStringFromWasm0(arg0, arg1)); | ||
return addHeapObject(ret); | ||
imports.wbg.__wbindgen_is_undefined = function(arg0) { | ||
const ret = getObject(arg0) === undefined; | ||
return ret; | ||
}; | ||
imports.wbg.__wbindgen_json_serialize = function(arg0, arg1) { | ||
const obj = getObject(arg1); | ||
const ret = JSON.stringify(obj === undefined ? null : obj); | ||
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; | ||
}; | ||
imports.wbg.__wbindgen_object_drop_ref = function(arg0) { | ||
@@ -251,2 +247,21 @@ takeObject(arg0); | ||
}; | ||
imports.wbg.__wbindgen_string_get = function(arg0, arg1) { | ||
const obj = getObject(arg1); | ||
const ret = typeof(obj) === 'string' ? obj : undefined; | ||
var ptr0 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); | ||
var len0 = WASM_VECTOR_LEN; | ||
getInt32Memory0()[arg0 / 4 + 1] = len0; | ||
getInt32Memory0()[arg0 / 4 + 0] = ptr0; | ||
}; | ||
imports.wbg.__wbg_parse_e23be3fecd886e2a = function() { return handleError(function (arg0, arg1) { | ||
const ret = JSON.parse(getStringFromWasm0(arg0, arg1)); | ||
return addHeapObject(ret); | ||
}, arguments) }; | ||
imports.wbg.__wbg_stringify_d6471d300ded9b68 = function() { return handleError(function (arg0) { | ||
const ret = JSON.stringify(getObject(arg0)); | ||
return addHeapObject(ret); | ||
}, arguments) }; | ||
imports.wbg.__wbindgen_throw = function(arg0, arg1) { | ||
throw new Error(getStringFromWasm0(arg0, arg1)); | ||
}; | ||
@@ -253,0 +268,0 @@ return imports; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
5968542
553
3