css-inline
Advanced tools
Comparing version 0.8.0 to 0.8.1
@@ -14,8 +14,8 @@ let imports = {}; | ||
let cachegetUint8Memory0 = null; | ||
let cachedUint8Memory0; | ||
function getUint8Memory0() { | ||
if (cachegetUint8Memory0 === null || cachegetUint8Memory0.buffer !== wasm.memory.buffer) { | ||
cachegetUint8Memory0 = new Uint8Array(wasm.memory.buffer); | ||
if (cachedUint8Memory0.byteLength === 0) { | ||
cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer); | ||
} | ||
return cachegetUint8Memory0; | ||
return cachedUint8Memory0; | ||
} | ||
@@ -76,8 +76,8 @@ | ||
let cachegetInt32Memory0 = null; | ||
let cachedInt32Memory0; | ||
function getInt32Memory0() { | ||
if (cachegetInt32Memory0 === null || cachegetInt32Memory0.buffer !== wasm.memory.buffer) { | ||
cachegetInt32Memory0 = new Int32Array(wasm.memory.buffer); | ||
if (cachedInt32Memory0.byteLength === 0) { | ||
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer); | ||
} | ||
return cachegetInt32Memory0; | ||
return cachedInt32Memory0; | ||
} | ||
@@ -104,2 +104,10 @@ | ||
let stack_pointer = 32; | ||
function addBorrowedObject(obj) { | ||
if (stack_pointer == 1) throw new Error('out of js stack'); | ||
heap[--stack_pointer] = obj; | ||
return stack_pointer; | ||
} | ||
function dropObject(idx) { | ||
@@ -116,10 +124,2 @@ if (idx < 36) return; | ||
} | ||
let stack_pointer = 32; | ||
function addBorrowedObject(obj) { | ||
if (stack_pointer == 1) throw new Error('out of js stack'); | ||
heap[--stack_pointer] = obj; | ||
return stack_pointer; | ||
} | ||
/** | ||
@@ -134,12 +134,20 @@ * Inline CSS styles from <style> tags to matching elements in the HTML tree and return a string. | ||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); | ||
var ptr0 = passStringToWasm0(html, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); | ||
var len0 = WASM_VECTOR_LEN; | ||
const ptr0 = passStringToWasm0(html, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); | ||
const len0 = WASM_VECTOR_LEN; | ||
wasm.inline(retptr, ptr0, len0, addBorrowedObject(options)); | ||
var r0 = getInt32Memory0()[retptr / 4 + 0]; | ||
var r1 = getInt32Memory0()[retptr / 4 + 1]; | ||
return getStringFromWasm0(r0, r1); | ||
var r2 = getInt32Memory0()[retptr / 4 + 2]; | ||
var r3 = getInt32Memory0()[retptr / 4 + 3]; | ||
var ptr1 = r0; | ||
var len1 = r1; | ||
if (r3) { | ||
ptr1 = 0; len1 = 0; | ||
throw takeObject(r2); | ||
} | ||
return getStringFromWasm0(ptr1, len1); | ||
} finally { | ||
wasm.__wbindgen_add_to_stack_pointer(16); | ||
heap[stack_pointer++] = undefined; | ||
wasm.__wbindgen_free(r0, r1); | ||
wasm.__wbindgen_free(ptr1, len1); | ||
} | ||
@@ -149,3 +157,3 @@ }; | ||
module.exports.__wbindgen_is_undefined = function(arg0) { | ||
var ret = getObject(arg0) === undefined; | ||
const ret = getObject(arg0) === undefined; | ||
return ret; | ||
@@ -156,5 +164,5 @@ }; | ||
const obj = getObject(arg1); | ||
var ret = JSON.stringify(obj === undefined ? null : obj); | ||
var ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); | ||
var len0 = WASM_VECTOR_LEN; | ||
const ret = JSON.stringify(obj === undefined ? null : obj); | ||
const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); | ||
const len0 = WASM_VECTOR_LEN; | ||
getInt32Memory0()[arg0 / 4 + 1] = len0; | ||
@@ -165,3 +173,3 @@ getInt32Memory0()[arg0 / 4 + 0] = ptr0; | ||
module.exports.__wbindgen_string_new = function(arg0, arg1) { | ||
var ret = getStringFromWasm0(arg0, arg1); | ||
const ret = getStringFromWasm0(arg0, arg1); | ||
return addHeapObject(ret); | ||
@@ -174,6 +182,2 @@ }; | ||
module.exports.__wbindgen_rethrow = function(arg0) { | ||
throw takeObject(arg0); | ||
}; | ||
const path = require('path').join(__dirname, 'css_inline_bg.wasm'); | ||
@@ -187,1 +191,4 @@ const bytes = require('fs').readFileSync(path); | ||
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer); | ||
cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer); | ||
@@ -7,3 +7,3 @@ { | ||
"description": "A WASM package for inlining CSS into HTML documents", | ||
"version": "0.8.0", | ||
"version": "0.8.1", | ||
"license": "MIT", | ||
@@ -10,0 +10,0 @@ "repository": { |
Sorry, the diff of this file is not supported yet
159
1140068