Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7431 from xtuc/fix-wasm-preserve-global-order
wasm: preserve global ordering
- Loading branch information
Showing
7 changed files
with
126 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export const a = 1; | ||
export const b = 2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
it("should preserve the ordering of globals", function() { | ||
return import("./module.wat").then(function(e) { | ||
expect(e.c).toBe(3); | ||
expect(e.d).toBe(4); | ||
}); | ||
}); |
10 changes: 10 additions & 0 deletions
10
test/cases/wasm/imported-global-preserve-ordering/module.wat
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
(module | ||
(import "./env.js" "a" (global i32)) | ||
(import "./env.js" "b" (global i32)) | ||
|
||
(global $c i32 (i32.const 3)) | ||
(global $d i32 (i32.const 4)) | ||
|
||
(export "c" (global $c)) | ||
(export "d" (global $d)) | ||
) |
5 changes: 5 additions & 0 deletions
5
test/cases/wasm/imported-global-preserve-ordering/test.filter.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
var supportsWebAssembly = require("../../../helpers/supportsWebAssembly"); | ||
|
||
module.exports = function(config) { | ||
return supportsWebAssembly(); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters