GeezerVison is showing github.com — refactor: switch to tests to wast · webpack/webpack@a9d9fee
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: lib/WebpackOptionsDefaulter.js +5Lines changed: 5 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -73,6 +73,11 @@ class WebpackOptionsDefaulter extends OptionsDefaulter { | 73 | 73 | { | 74 | 74 | test: /\.wasm$/i, | 75 | 75 | type: "webassembly/experimental" | | 76 | + }, | | 77 | + { | | 78 | + test: /\.wast$/i, | | 79 | + loader: "@webassemblyjs/wast-loader", | | 80 | + type: "webassembly/experimental" | 76 | 81 | } | 77 | 82 | ]); | 78 | 83 |
| |
Collapse file Copy file name to clipboardExpand all lines: package.json +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 8 | 8 | "@webassemblyjs/ast": "1.4.3", | 9 | 9 | "@webassemblyjs/wasm-edit": "1.4.3", | 10 | 10 | "@webassemblyjs/wasm-parser": "1.4.3", | | 11 | + "@webassemblyjs/wast-loader": "^1.5.4", | 11 | 12 | "acorn": "^5.0.0", | 12 | 13 | "acorn-dynamic-import": "^3.0.0", | 13 | 14 | "ajv": "^6.1.0", | |
Collapse file Copy file name to clipboardExpand all lines: test/cases/wasm/decoding/index.js +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | it("should support wasm compiled from c++", function() { | 2 | | - return import("./memory3.wasm").then(function(wasm) { | | 2 | + return import("./memory3.wast").then(function(wasm) { | 3 | 3 | expect(wasm._Z3getv()).toBe(0); | 4 | 4 | wasm._Z3seti(42); | 5 | 5 | expect(wasm._Z3getv()).toBe(42); | 6 | 6 | }); | 7 | 7 | }); | 8 | 8 |
| 9 | 9 | it("should raw memory export without data", function() { | 10 | | - return import("./memory2.wasm").then(function(wasm) { | | 10 | + return import("./memory2.wast").then(function(wasm) { | 11 | 11 | expect(wasm.memory).toBeInstanceOf(WebAssembly.Memory); | 12 | 12 | expect(wasm.memory.buffer).toBeInstanceOf(ArrayBuffer); | 13 | 13 | expect(wasm.memory.buffer.byteLength).toBe(1 << 16); | |
Collapse file Copy file name to clipboard Collapse file Copy file name to clipboard +3Lines changed: 3 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +(module | | 2 | + (memory $memory (export "memory") 1)) | | 3 | + |
Collapse file Copy file name to clipboard Collapse file Copy file name to clipboard +14Lines changed: 14 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +(module | | 2 | + (type $t0 (func (param i32))) | | 3 | + (type $t1 (func (result i32))) | | 4 | + (func $_Z3seti (export "_Z3seti") (type $t0) (param $p0 i32) | | 5 | + (i32.store offset=12 | | 6 | + (i32.const 0) | | 7 | + (get_local $p0))) | | 8 | + (func $_Z3getv (export "_Z3getv") (type $t1) (result i32) | | 9 | + (i32.load offset=12 | | 10 | + (i32.const 0))) | | 11 | + (table $T0 0 anyfunc) | | 12 | + (memory $memory (export "memory") 1) | | 13 | + (data (i32.const 12) "\00\00\00\00")) | | 14 | + |
Collapse file Copy file name to clipboardExpand all lines: yarn.lock +10Lines changed: 10 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 125 | 125 | "@webassemblyjs/wasm-parser" "1.4.3" | 126 | 126 | webassemblyjs "1.4.3" | 127 | 127 |
| | 128 | +"@webassemblyjs/wast-loader@^1.5.4": | | 129 | + version "1.5.4" | | 130 | + resolved "https://registry.yarnpkg.com/@webassemblyjs/wast-loader/-/wast-loader-1.5.4.tgz#6db66671edc5955cb77cbf90a6c4f627f6335a6a" | | 131 | + dependencies: | | 132 | + wabt "^1.0.0" | | 133 | + | 128 | 134 | | 129 | 135 | version "1.4.3" | 130 | 136 | resolved "https://registry.yarnpkg.com/@webassemblyjs/wast-parser/-/wast-parser-1.4.3.tgz#3250402e2c5ed53dbe2233c9de1fe1f9f0d51745" | @@ -6257,6 +6263,10 @@ w3c-hr-time@^1.0.1: | 6257 | 6263 | dependencies: | 6258 | 6264 | browser-process-hrtime "^0.1.2" | 6259 | 6265 |
| | 6266 | +wabt@^1.0.0: | | 6267 | + version "1.0.0" | | 6268 | + resolved "https://registry.yarnpkg.com/wabt/-/wabt-1.0.0.tgz#f33a5c4a6405370ec80ba97e782d092f1d599ff4" | | 6269 | + | 6260 | 6270 | walker@~1.0.5: | 6261 | 6271 | version "1.0.7" | 6262 | 6272 | resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.7.tgz#2f7f9b8fd10d677262b18a884e28d19618e028fb" | |
|