GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Merge pull request #7379 from xtuc/refactor-use-wast-in-tests · webpack/webpack@4cd0cf5

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • package.json
  • test
    • TestCases.template.js
    • cases/wasm
      • import-wasm-wasm
        • index.js
        • wasm.wasm
        • wasm.wat
        • wasm2.wasm
        • wasm2.wat
      • imports-circular
        • module.js
        • wasm.wasm
        • wasm.wat
      • imports
        • index.js
        • wasm.wasm
        • wasm.wat
      • memory
        • mem-access.wasm
        • mem-access.wat
        • memory.wasm
        • memory.wat
        • run.js
      • order
        • a.js
        • wasm.wasm
      • simple
        • index.js
        • module.js
        • wasm.wasm
        • wasm.wat
      • table
        • index.js
        • wasm-table-export.wasm
        • wasm-table-export.wat
        • wasm-table-imported.wasm
        • wasm-table-imported.wat
        • wasm-table.wasm
        • wasm-table.wat
  • yarn.lock
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎package.json‎

Copy file name to clipboardExpand all lines: package.json
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
"url-loader": "^0.6.2",
7373
"val-loader": "^1.0.2",
7474
"vm-browserify": "~0.0.0",
75+
"wast-loader": "^1.5.5",
7576
"webpack-dev-middleware": "^1.9.0",
7677
"worker-loader": "^1.1.1",
7778
"xxhashjs": "^0.2.1"
Collapse file

‎test/TestCases.template.js‎

Copy file name to clipboardExpand all lines: test/TestCases.template.js
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,11 @@ const describeCases = config => {
143143
{
144144
test: /\.pug/,
145145
loader: "pug-loader"
146+
},
147+
{
148+
test: /\.wat$/i,
149+
loader: "wast-loader",
150+
type: "webassembly/experimental"
146151
}
147152
]
148153
},
Collapse file

‎test/cases/wasm/import-wasm-wasm/index.js‎

Copy file name to clipboardExpand all lines: test/cases/wasm/import-wasm-wasm/index.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
it("should allow to run a WebAssembly module with imports", function() {
2-
return import("./wasm.wasm").then(function(wasm) {
2+
return import("./wasm.wat").then(function(wasm) {
33
const result = wasm.addNumber(20);
44
expect(result).toEqual(42);
55
});
Collapse file

‎test/cases/wasm/import-wasm-wasm/wasm.wasm‎

Copy file name to clipboard
-78 Bytes
Binary file not shown.
Collapse file

‎test/cases/wasm/import-wasm-wasm/wasm.wat‎

Copy file name to clipboard
+9Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
(module
2+
(type $t0 (func (result i32)))
3+
(type $t1 (func (param i32) (result i32)))
4+
(import "./wasm2.wat" "getNumber" (func $./wasm2.wasm.getNumber (type $t0)))
5+
(func $addNumber (export "addNumber") (type $t1) (param $p0 i32) (result i32)
6+
(i32.add
7+
(get_local $p0)
8+
(call $./wasm2.wasm.getNumber))))
9+
Collapse file

‎test/cases/wasm/import-wasm-wasm/wasm2.wasm‎

Copy file name to clipboard
-42 Bytes
Binary file not shown.
Collapse file

‎test/cases/wasm/import-wasm-wasm/wasm2.wat‎

Copy file name to clipboard
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
(module
2+
(type $t0 (func (result i32)))
3+
(func $getNumber (export "getNumber") (type $t0) (result i32)
4+
(i32.const 22)))
5+
Collapse file

‎test/cases/wasm/imports-circular/module.js‎

Copy file name to clipboardExpand all lines: test/cases/wasm/imports-circular/module.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { addNumber } from "./wasm.wasm";
1+
import { addNumber } from "./wasm.wat";
22

33
export var result = addNumber(22);
44

Collapse file

‎test/cases/wasm/imports-circular/wasm.wasm‎

Copy file name to clipboard
-74 Bytes
Binary file not shown.
Collapse file

‎test/cases/wasm/imports-circular/wasm.wat‎

Copy file name to clipboard
+9Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
(module
2+
(type $t0 (func (result i32)))
3+
(type $t1 (func (param i32) (result i32)))
4+
(import "./module" "getNumber" (func $./module.getNumber (type $t0)))
5+
(func $addNumber (export "addNumber") (type $t1) (param $p0 i32) (result i32)
6+
(i32.add
7+
(get_local $p0)
8+
(call $./module.getNumber))))
9+

0 commit comments

Comments
0 (0)
You are visitor 01402605 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.