|
| 1 | +--- pkg/html_rewriter.js 2021-07-21 19:45:46.000000000 +0100 |
| 2 | ++++ pkg2/html_rewriter.js 2021-07-21 19:44:41.000000000 +0100 |
| 3 | +@@ -1,7 +1,7 @@ |
| 4 | + let imports = {}; |
| 5 | + imports['__wbindgen_placeholder__'] = module.exports; |
| 6 | + let wasm; |
| 7 | +-const { awaitPromise } = require(String.raw`./asyncify.js`); |
| 8 | ++const { awaitPromise, setWasmExports, wrap } = require(String.raw`./asyncify.js`); |
| 9 | + const { TextDecoder, TextEncoder } = require(String.raw`util`); |
| 10 | + |
| 11 | + const heap = new Array(32).fill(undefined); |
| 12 | +@@ -233,6 +233,7 @@ |
| 13 | + var ptr0 = passStringToWasm0(content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); |
| 14 | + var len0 = WASM_VECTOR_LEN; |
| 15 | + wasm.comment_before(this.ptr, ptr0, len0, isLikeNone(content_type) ? 0 : addHeapObject(content_type)); |
| 16 | ++ return this; |
| 17 | + } |
| 18 | + /** |
| 19 | + * @param {string} content |
| 20 | +@@ -242,6 +243,7 @@ |
| 21 | + var ptr0 = passStringToWasm0(content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); |
| 22 | + var len0 = WASM_VECTOR_LEN; |
| 23 | + wasm.comment_after(this.ptr, ptr0, len0, isLikeNone(content_type) ? 0 : addHeapObject(content_type)); |
| 24 | ++ return this; |
| 25 | + } |
| 26 | + /** |
| 27 | + * @param {string} content |
| 28 | +@@ -251,11 +253,13 @@ |
| 29 | + var ptr0 = passStringToWasm0(content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); |
| 30 | + var len0 = WASM_VECTOR_LEN; |
| 31 | + wasm.comment_replace(this.ptr, ptr0, len0, isLikeNone(content_type) ? 0 : addHeapObject(content_type)); |
| 32 | ++ return this; |
| 33 | + } |
| 34 | + /** |
| 35 | + */ |
| 36 | + remove() { |
| 37 | + wasm.comment_remove(this.ptr); |
| 38 | ++ return this; |
| 39 | + } |
| 40 | + /** |
| 41 | + * @returns {boolean} |
| 42 | +@@ -364,6 +368,7 @@ |
| 43 | + var ptr0 = passStringToWasm0(content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); |
| 44 | + var len0 = WASM_VECTOR_LEN; |
| 45 | + wasm.documentend_append(this.ptr, ptr0, len0, isLikeNone(content_type) ? 0 : addHeapObject(content_type)); |
| 46 | ++ return this; |
| 47 | + } |
| 48 | + } |
| 49 | + module.exports.DocumentEnd = DocumentEnd; |
| 50 | +@@ -397,6 +402,7 @@ |
| 51 | + var ptr0 = passStringToWasm0(content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); |
| 52 | + var len0 = WASM_VECTOR_LEN; |
| 53 | + wasm.element_before(this.ptr, ptr0, len0, isLikeNone(content_type) ? 0 : addHeapObject(content_type)); |
| 54 | ++ return this; |
| 55 | + } |
| 56 | + /** |
| 57 | + * @param {string} content |
| 58 | +@@ -406,6 +412,7 @@ |
| 59 | + var ptr0 = passStringToWasm0(content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); |
| 60 | + var len0 = WASM_VECTOR_LEN; |
| 61 | + wasm.element_after(this.ptr, ptr0, len0, isLikeNone(content_type) ? 0 : addHeapObject(content_type)); |
| 62 | ++ return this; |
| 63 | + } |
| 64 | + /** |
| 65 | + * @param {string} content |
| 66 | +@@ -415,11 +422,13 @@ |
| 67 | + var ptr0 = passStringToWasm0(content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); |
| 68 | + var len0 = WASM_VECTOR_LEN; |
| 69 | + wasm.element_replace(this.ptr, ptr0, len0, isLikeNone(content_type) ? 0 : addHeapObject(content_type)); |
| 70 | ++ return this; |
| 71 | + } |
| 72 | + /** |
| 73 | + */ |
| 74 | + remove() { |
| 75 | + wasm.element_remove(this.ptr); |
| 76 | ++ return this; |
| 77 | + } |
| 78 | + /** |
| 79 | + * @returns {boolean} |
| 80 | +@@ -495,6 +504,7 @@ |
| 81 | + var ptr1 = passStringToWasm0(value, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); |
| 82 | + var len1 = WASM_VECTOR_LEN; |
| 83 | + wasm.element_setAttribute(this.ptr, ptr0, len0, ptr1, len1); |
| 84 | ++ return this; |
| 85 | + } |
| 86 | + /** |
| 87 | + * @param {string} name |
| 88 | +@@ -503,6 +513,7 @@ |
| 89 | + var ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); |
| 90 | + var len0 = WASM_VECTOR_LEN; |
| 91 | + wasm.element_removeAttribute(this.ptr, ptr0, len0); |
| 92 | ++ return this; |
| 93 | + } |
| 94 | + /** |
| 95 | + * @param {string} content |
| 96 | +@@ -512,6 +523,7 @@ |
| 97 | + var ptr0 = passStringToWasm0(content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); |
| 98 | + var len0 = WASM_VECTOR_LEN; |
| 99 | + wasm.element_prepend(this.ptr, ptr0, len0, isLikeNone(content_type) ? 0 : addHeapObject(content_type)); |
| 100 | ++ return this; |
| 101 | + } |
| 102 | + /** |
| 103 | + * @param {string} content |
| 104 | +@@ -521,6 +533,7 @@ |
| 105 | + var ptr0 = passStringToWasm0(content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); |
| 106 | + var len0 = WASM_VECTOR_LEN; |
| 107 | + wasm.element_append(this.ptr, ptr0, len0, isLikeNone(content_type) ? 0 : addHeapObject(content_type)); |
| 108 | ++ return this; |
| 109 | + } |
| 110 | + /** |
| 111 | + * @param {string} content |
| 112 | +@@ -530,11 +543,13 @@ |
| 113 | + var ptr0 = passStringToWasm0(content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); |
| 114 | + var len0 = WASM_VECTOR_LEN; |
| 115 | + wasm.element_setInnerContent(this.ptr, ptr0, len0, isLikeNone(content_type) ? 0 : addHeapObject(content_type)); |
| 116 | ++ return this; |
| 117 | + } |
| 118 | + /** |
| 119 | + */ |
| 120 | + removeAndKeepContent() { |
| 121 | + wasm.element_removeAndKeepContent(this.ptr); |
| 122 | ++ return this; |
| 123 | + } |
| 124 | + } |
| 125 | + module.exports.Element = Element; |
| 126 | +@@ -579,25 +594,27 @@ |
| 127 | + var ptr0 = passStringToWasm0(selector, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); |
| 128 | + var len0 = WASM_VECTOR_LEN; |
| 129 | + wasm.htmlrewriter_on(this.ptr, ptr0, len0, addHeapObject(handlers)); |
| 130 | ++ return this; |
| 131 | + } |
| 132 | + /** |
| 133 | + * @param {any} handlers |
| 134 | + */ |
| 135 | + onDocument(handlers) { |
| 136 | + wasm.htmlrewriter_onDocument(this.ptr, addHeapObject(handlers)); |
| 137 | ++ return this; |
| 138 | + } |
| 139 | + /** |
| 140 | + * @param {Uint8Array} chunk |
| 141 | + */ |
| 142 | +- write(chunk) { |
| 143 | ++ async write(chunk) { |
| 144 | + var ptr0 = passArray8ToWasm0(chunk, wasm.__wbindgen_malloc); |
| 145 | + var len0 = WASM_VECTOR_LEN; |
| 146 | +- wasm.htmlrewriter_write(this.ptr, ptr0, len0); |
| 147 | ++ await wrap(this, wasm.htmlrewriter_write, this.ptr, ptr0, len0); |
| 148 | + } |
| 149 | + /** |
| 150 | + */ |
| 151 | +- end() { |
| 152 | +- wasm.htmlrewriter_end(this.ptr); |
| 153 | ++ async end() { |
| 154 | ++ await wrap(this, wasm.htmlrewriter_end, this.ptr); |
| 155 | + } |
| 156 | + /** |
| 157 | + * @returns {number} |
| 158 | +@@ -638,6 +655,7 @@ |
| 159 | + var ptr0 = passStringToWasm0(content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); |
| 160 | + var len0 = WASM_VECTOR_LEN; |
| 161 | + wasm.textchunk_before(this.ptr, ptr0, len0, isLikeNone(content_type) ? 0 : addHeapObject(content_type)); |
| 162 | ++ return this; |
| 163 | + } |
| 164 | + /** |
| 165 | + * @param {string} content |
| 166 | +@@ -647,6 +665,7 @@ |
| 167 | + var ptr0 = passStringToWasm0(content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); |
| 168 | + var len0 = WASM_VECTOR_LEN; |
| 169 | + wasm.textchunk_after(this.ptr, ptr0, len0, isLikeNone(content_type) ? 0 : addHeapObject(content_type)); |
| 170 | ++ return this; |
| 171 | + } |
| 172 | + /** |
| 173 | + * @param {string} content |
| 174 | +@@ -656,11 +675,13 @@ |
| 175 | + var ptr0 = passStringToWasm0(content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); |
| 176 | + var len0 = WASM_VECTOR_LEN; |
| 177 | + wasm.textchunk_replace(this.ptr, ptr0, len0, isLikeNone(content_type) ? 0 : addHeapObject(content_type)); |
| 178 | ++ return this; |
| 179 | + } |
| 180 | + /** |
| 181 | + */ |
| 182 | + remove() { |
| 183 | + wasm.textchunk_remove(this.ptr); |
| 184 | ++ return this; |
| 185 | + } |
| 186 | + /** |
| 187 | + * @returns {boolean} |
| 188 | +@@ -847,5 +868,6 @@ |
| 189 | + const wasmModule = new WebAssembly.Module(bytes); |
| 190 | + const wasmInstance = new WebAssembly.Instance(wasmModule, imports); |
| 191 | + wasm = wasmInstance.exports; |
| 192 | ++setWasmExports(wasm); |
| 193 | + module.exports.__wasm = wasm; |
| 194 | + |
0 commit comments