Skip to content

Commit fe73959

Browse files
committed
Candidate for 0xc AngryBots
This is the same change as https://github.com/WebAssembly/webassembly.github.io/pull/14. Note that it includes the changes described in WebAssembly/design#740 however it doesn't have any user-defined or names sections, so it's unaffected by the details of how those are handled.
1 parent 9d5bac8 commit fe73959

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

demo/AngryBots/AngryBots-0xc.wast.gz

7.33 MB
Binary file not shown.

demo/AngryBots/AngryBots12.wasm

10.1 MB
Binary file not shown.

demo/AngryBots/Release/AngryBots.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,16 @@ function integrateWasmJS(Module) {
9797
};
9898
info["global.Math"] = global.Math;
9999
info["env"] = env;
100-
var instance;
101-
instance = Wasm.instantiateModule(binary, info).exports;
102-
mergeMemory(instance.memory);
100+
if (Wasm.experimentalVersion < 0xc || typeof WebAssembly == "undefined") {
101+
var exports = Wasm.instantiateModule(binary, info).exports;
102+
mergeMemory(exports.memory);
103+
applyMappedGlobals();
104+
return exports;
105+
}
106+
var exports = new WebAssembly.Instance(new WebAssembly.Module(binary), info).exports;
107+
mergeMemory(exports.memory.buffer);
103108
applyMappedGlobals();
104-
return instance;
109+
return exports;
105110
});
106111
}
107112
Module["preRun"].push((function() {

0 commit comments

Comments
 (0)