diff --git a/dist/1.index.js b/dist/1.index.js index f2826fa289..db2b6425e8 100644 --- a/dist/1.index.js +++ b/dist/1.index.js @@ -4,11 +4,11 @@ /*!********************!*\ !*** ./pkg/boa.js ***! \********************/ -/*! exports provided: __wbg_log_38ac309e9be4446e, evaluate, __wbindgen_throw */ +/*! exports provided: __wbg_log_961dd0434e74b74e, evaluate, __wbindgen_throw */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* WEBPACK VAR INJECTION */(function(TextDecoder, TextEncoder) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbg_log_38ac309e9be4446e\", function() { return __wbg_log_38ac309e9be4446e; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"evaluate\", function() { return evaluate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbindgen_throw\", function() { return __wbindgen_throw; });\n/* harmony import */ var _boa_bg__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./boa_bg */ \"./pkg/boa_bg.wasm\");\n\n\nlet cachedTextDecoder = new TextDecoder('utf-8');\n\nlet cachegetUint8Memory = null;\nfunction getUint8Memory() {\n if (cachegetUint8Memory === null || cachegetUint8Memory.buffer !== _boa_bg__WEBPACK_IMPORTED_MODULE_0__[\"memory\"].buffer) {\n cachegetUint8Memory = new Uint8Array(_boa_bg__WEBPACK_IMPORTED_MODULE_0__[\"memory\"].buffer);\n }\n return cachegetUint8Memory;\n}\n\nfunction getStringFromWasm(ptr, len) {\n return cachedTextDecoder.decode(getUint8Memory().subarray(ptr, ptr + len));\n}\n\nfunction __wbg_log_38ac309e9be4446e(arg0, arg1) {\n let varg0 = getStringFromWasm(arg0, arg1);\n try {\n console.log(varg0);\n } catch (e) {\n let error = (function () {\n try {\n return e instanceof Error\n ? `${e.message}\n\n Stack:\n ${e.stack}`\n : e.toString();\n } catch(_) {\n return \"\";\n }\n }());\n console.error(\"wasm-bindgen: imported JS function `__wbg_log_38ac309e9be4446e` that was not marked as `catch` threw an error:\", error);\n throw e;\n}\n}\n\nlet WASM_VECTOR_LEN = 0;\n\nlet cachedTextEncoder = new TextEncoder('utf-8');\n\nlet passStringToWasm;\nif (typeof cachedTextEncoder.encodeInto === 'function') {\n passStringToWasm = function(arg) {\n\n\n if (typeof(arg) !== 'string') throw new Error('expected a string argument');\n\n let size = arg.length;\n let ptr = _boa_bg__WEBPACK_IMPORTED_MODULE_0__[\"__wbindgen_malloc\"](size);\n let offset = 0;\n {\n const mem = getUint8Memory();\n for (; offset < arg.length; offset++) {\n const code = arg.charCodeAt(offset);\n if (code > 0x7F) break;\n mem[ptr + offset] = code;\n }\n }\n\n if (offset !== arg.length) {\n arg = arg.slice(offset);\n ptr = _boa_bg__WEBPACK_IMPORTED_MODULE_0__[\"__wbindgen_realloc\"](ptr, size, size = offset + arg.length * 3);\n const view = getUint8Memory().subarray(ptr + offset, ptr + size);\n const ret = cachedTextEncoder.encodeInto(arg, view);\n if (ret.read != arg.length) throw new Error('failed to pass whole string');\n offset += ret.written;\n }\n WASM_VECTOR_LEN = offset;\n return ptr;\n };\n} else {\n passStringToWasm = function(arg) {\n\n\n if (typeof(arg) !== 'string') throw new Error('expected a string argument');\n\n let size = arg.length;\n let ptr = _boa_bg__WEBPACK_IMPORTED_MODULE_0__[\"__wbindgen_malloc\"](size);\n let offset = 0;\n {\n const mem = getUint8Memory();\n for (; offset < arg.length; offset++) {\n const code = arg.charCodeAt(offset);\n if (code > 0x7F) break;\n mem[ptr + offset] = code;\n }\n }\n\n if (offset !== arg.length) {\n const buf = cachedTextEncoder.encode(arg.slice(offset));\n ptr = _boa_bg__WEBPACK_IMPORTED_MODULE_0__[\"__wbindgen_realloc\"](ptr, size, size = offset + buf.length);\n getUint8Memory().set(buf, ptr + offset);\n offset += buf.length;\n }\n WASM_VECTOR_LEN = offset;\n return ptr;\n };\n}\n\nlet cachedGlobalArgumentPtr = null;\nfunction globalArgumentPtr() {\n if (cachedGlobalArgumentPtr === null) {\n cachedGlobalArgumentPtr = _boa_bg__WEBPACK_IMPORTED_MODULE_0__[\"__wbindgen_global_argument_ptr\"]();\n }\n return cachedGlobalArgumentPtr;\n}\n\nlet cachegetUint32Memory = null;\nfunction getUint32Memory() {\n if (cachegetUint32Memory === null || cachegetUint32Memory.buffer !== _boa_bg__WEBPACK_IMPORTED_MODULE_0__[\"memory\"].buffer) {\n cachegetUint32Memory = new Uint32Array(_boa_bg__WEBPACK_IMPORTED_MODULE_0__[\"memory\"].buffer);\n }\n return cachegetUint32Memory;\n}\n/**\n* @param {string} src\n* @returns {string}\n*/\nfunction evaluate(src) {\n const ptr0 = passStringToWasm(src);\n const len0 = WASM_VECTOR_LEN;\n const retptr = globalArgumentPtr();\n try {\n _boa_bg__WEBPACK_IMPORTED_MODULE_0__[\"evaluate\"](retptr, ptr0, len0);\n const mem = getUint32Memory();\n const rustptr = mem[retptr / 4];\n const rustlen = mem[retptr / 4 + 1];\n\n const realRet = getStringFromWasm(rustptr, rustlen).slice();\n _boa_bg__WEBPACK_IMPORTED_MODULE_0__[\"__wbindgen_free\"](rustptr, rustlen * 1);\n return realRet;\n\n\n } finally {\n _boa_bg__WEBPACK_IMPORTED_MODULE_0__[\"__wbindgen_free\"](ptr0, len0 * 1);\n\n }\n\n}\n\nfunction __wbindgen_throw(ptr, len) {\n throw new Error(getStringFromWasm(ptr, len));\n}\n\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! text-encoding */ \"./node_modules/text-encoding/index.js\")[\"TextDecoder\"], __webpack_require__(/*! text-encoding */ \"./node_modules/text-encoding/index.js\")[\"TextEncoder\"]))\n\n//# sourceURL=webpack:///./pkg/boa.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* WEBPACK VAR INJECTION */(function(TextDecoder, TextEncoder) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbg_log_961dd0434e74b74e\", function() { return __wbg_log_961dd0434e74b74e; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"evaluate\", function() { return evaluate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbindgen_throw\", function() { return __wbindgen_throw; });\n/* harmony import */ var _boa_bg__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./boa_bg */ \"./pkg/boa_bg.wasm\");\n\n\nlet cachedTextDecoder = new TextDecoder('utf-8');\n\nlet cachegetUint8Memory = null;\nfunction getUint8Memory() {\n if (cachegetUint8Memory === null || cachegetUint8Memory.buffer !== _boa_bg__WEBPACK_IMPORTED_MODULE_0__[\"memory\"].buffer) {\n cachegetUint8Memory = new Uint8Array(_boa_bg__WEBPACK_IMPORTED_MODULE_0__[\"memory\"].buffer);\n }\n return cachegetUint8Memory;\n}\n\nfunction getStringFromWasm(ptr, len) {\n return cachedTextDecoder.decode(getUint8Memory().subarray(ptr, ptr + len));\n}\n\nfunction __wbg_log_961dd0434e74b74e(arg0, arg1) {\n let varg0 = getStringFromWasm(arg0, arg1);\n try {\n console.log(varg0);\n } catch (e) {\n let error = (function () {\n try {\n return e instanceof Error\n ? `${e.message}\n\n Stack:\n ${e.stack}`\n : e.toString();\n } catch(_) {\n return \"\";\n }\n }());\n console.error(\"wasm-bindgen: imported JS function `__wbg_log_961dd0434e74b74e` that was not marked as `catch` threw an error:\", error);\n throw e;\n}\n}\n\nlet WASM_VECTOR_LEN = 0;\n\nlet cachedTextEncoder = new TextEncoder('utf-8');\n\nlet passStringToWasm;\nif (typeof cachedTextEncoder.encodeInto === 'function') {\n passStringToWasm = function(arg) {\n\n\n if (typeof(arg) !== 'string') throw new Error('expected a string argument');\n\n let size = arg.length;\n let ptr = _boa_bg__WEBPACK_IMPORTED_MODULE_0__[\"__wbindgen_malloc\"](size);\n let offset = 0;\n {\n const mem = getUint8Memory();\n for (; offset < arg.length; offset++) {\n const code = arg.charCodeAt(offset);\n if (code > 0x7F) break;\n mem[ptr + offset] = code;\n }\n }\n\n if (offset !== arg.length) {\n arg = arg.slice(offset);\n ptr = _boa_bg__WEBPACK_IMPORTED_MODULE_0__[\"__wbindgen_realloc\"](ptr, size, size = offset + arg.length * 3);\n const view = getUint8Memory().subarray(ptr + offset, ptr + size);\n const ret = cachedTextEncoder.encodeInto(arg, view);\n if (ret.read != arg.length) throw new Error('failed to pass whole string');\n offset += ret.written;\n }\n WASM_VECTOR_LEN = offset;\n return ptr;\n };\n} else {\n passStringToWasm = function(arg) {\n\n\n if (typeof(arg) !== 'string') throw new Error('expected a string argument');\n\n let size = arg.length;\n let ptr = _boa_bg__WEBPACK_IMPORTED_MODULE_0__[\"__wbindgen_malloc\"](size);\n let offset = 0;\n {\n const mem = getUint8Memory();\n for (; offset < arg.length; offset++) {\n const code = arg.charCodeAt(offset);\n if (code > 0x7F) break;\n mem[ptr + offset] = code;\n }\n }\n\n if (offset !== arg.length) {\n const buf = cachedTextEncoder.encode(arg.slice(offset));\n ptr = _boa_bg__WEBPACK_IMPORTED_MODULE_0__[\"__wbindgen_realloc\"](ptr, size, size = offset + buf.length);\n getUint8Memory().set(buf, ptr + offset);\n offset += buf.length;\n }\n WASM_VECTOR_LEN = offset;\n return ptr;\n };\n}\n\nlet cachedGlobalArgumentPtr = null;\nfunction globalArgumentPtr() {\n if (cachedGlobalArgumentPtr === null) {\n cachedGlobalArgumentPtr = _boa_bg__WEBPACK_IMPORTED_MODULE_0__[\"__wbindgen_global_argument_ptr\"]();\n }\n return cachedGlobalArgumentPtr;\n}\n\nlet cachegetUint32Memory = null;\nfunction getUint32Memory() {\n if (cachegetUint32Memory === null || cachegetUint32Memory.buffer !== _boa_bg__WEBPACK_IMPORTED_MODULE_0__[\"memory\"].buffer) {\n cachegetUint32Memory = new Uint32Array(_boa_bg__WEBPACK_IMPORTED_MODULE_0__[\"memory\"].buffer);\n }\n return cachegetUint32Memory;\n}\n/**\n* @param {string} src\n* @returns {string}\n*/\nfunction evaluate(src) {\n const ptr0 = passStringToWasm(src);\n const len0 = WASM_VECTOR_LEN;\n const retptr = globalArgumentPtr();\n try {\n _boa_bg__WEBPACK_IMPORTED_MODULE_0__[\"evaluate\"](retptr, ptr0, len0);\n const mem = getUint32Memory();\n const rustptr = mem[retptr / 4];\n const rustlen = mem[retptr / 4 + 1];\n\n const realRet = getStringFromWasm(rustptr, rustlen).slice();\n _boa_bg__WEBPACK_IMPORTED_MODULE_0__[\"__wbindgen_free\"](rustptr, rustlen * 1);\n return realRet;\n\n\n } finally {\n _boa_bg__WEBPACK_IMPORTED_MODULE_0__[\"__wbindgen_free\"](ptr0, len0 * 1);\n\n }\n\n}\n\nfunction __wbindgen_throw(ptr, len) {\n throw new Error(getStringFromWasm(ptr, len));\n}\n\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! text-encoding */ \"./node_modules/text-encoding/index.js\")[\"TextDecoder\"], __webpack_require__(/*! text-encoding */ \"./node_modules/text-encoding/index.js\")[\"TextEncoder\"]))\n\n//# sourceURL=webpack:///./pkg/boa.js?"); /***/ }), diff --git a/dist/84dd4a70af06018bf716.module.wasm b/dist/84dd4a70af06018bf716.module.wasm deleted file mode 100644 index 8d1c14be5f..0000000000 Binary files a/dist/84dd4a70af06018bf716.module.wasm and /dev/null differ diff --git a/dist/894cdce282a11561fbdd.module.wasm b/dist/894cdce282a11561fbdd.module.wasm new file mode 100644 index 0000000000..8beaa847ce Binary files /dev/null and b/dist/894cdce282a11561fbdd.module.wasm differ diff --git a/dist/index.js b/dist/index.js index 6d9a11bfd2..6a0b7a4be5 100644 --- a/dist/index.js +++ b/dist/index.js @@ -55,8 +55,8 @@ /******/ "./pkg/boa_bg.wasm": function() { /******/ return { /******/ "./boa": { -/******/ "__wbg_log_38ac309e9be4446e": function(p0i32,p1i32) { -/******/ return installedModules["./pkg/boa.js"].exports["__wbg_log_38ac309e9be4446e"](p0i32,p1i32); +/******/ "__wbg_log_961dd0434e74b74e": function(p0i32,p1i32) { +/******/ return installedModules["./pkg/boa.js"].exports["__wbg_log_961dd0434e74b74e"](p0i32,p1i32); /******/ }, /******/ "__wbindgen_throw": function(p0i32,p1i32) { /******/ return installedModules["./pkg/boa.js"].exports["__wbindgen_throw"](p0i32,p1i32); @@ -122,6 +122,8 @@ /******/ } /******/ script.src = jsonpScriptSrc(chunkId); /******/ +/******/ // create error before stack unwound to get useful stacktrace later +/******/ var error = new Error(); /******/ onScriptComplete = function (event) { /******/ // avoid mem leaks in IE. /******/ script.onerror = script.onload = null; @@ -131,7 +133,7 @@ /******/ if(chunk) { /******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type); /******/ var realSrc = event && event.target && event.target.src; -/******/ var error = new Error('Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')'); +/******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')'; /******/ error.type = errorType; /******/ error.request = realSrc; /******/ chunk[1](error); @@ -159,7 +161,7 @@ /******/ promises.push(installedWasmModuleData); /******/ else { /******/ var importObject = wasmImportObjects[wasmModuleId](); -/******/ var req = fetch(__webpack_require__.p + "" + {"./pkg/boa_bg.wasm":"84dd4a70af06018bf716"}[wasmModuleId] + ".module.wasm"); +/******/ var req = fetch(__webpack_require__.p + "" + {"./pkg/boa_bg.wasm":"894cdce282a11561fbdd"}[wasmModuleId] + ".module.wasm"); /******/ var promise; /******/ if(importObject instanceof Promise && typeof WebAssembly.compileStreaming === 'function') { /******/ promise = Promise.all([WebAssembly.compileStreaming(req), importObject]).then(function(items) {