aboutsummaryrefslogtreecommitdiff
path: root/platform/javascript/engine.js
diff options
context:
space:
mode:
authorLeon Krause2017-10-02 13:09:59 +0200
committerLeon Krause2017-10-02 13:09:59 +0200
commit11ab7b6efc3353ac19aed6f88c5a38bfbe879ebd (patch)
treeeeefb0d8a724ed6abea3573e3c03a33679e57393 /platform/javascript/engine.js
parent3d75b210b5c6468aac3bcb95124075f4e5eb7df8 (diff)
downloadgodot-11ab7b6efc3353ac19aed6f88c5a38bfbe879ebd.tar.gz
godot-11ab7b6efc3353ac19aed6f88c5a38bfbe879ebd.tar.zst
godot-11ab7b6efc3353ac19aed6f88c5a38bfbe879ebd.zip
Diffstat (limited to 'platform/javascript/engine.js')
-rw-r--r--platform/javascript/engine.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/platform/javascript/engine.js b/platform/javascript/engine.js
index 552f5a7e0..99d1c20bb 100644
--- a/platform/javascript/engine.js
+++ b/platform/javascript/engine.js
@@ -84,10 +84,10 @@
rtenvOpts.print = stdout;
if (typeof stderr === 'function')
rtenvOpts.printErr = stderr;
- if (typeof WebAssembly === 'object' && initializer instanceof WebAssembly.Module) {
+ if (typeof WebAssembly === 'object' && initializer instanceof ArrayBuffer) {
rtenvOpts.instantiateWasm = function(imports, onSuccess) {
WebAssembly.instantiate(initializer, imports).then(function(result) {
- onSuccess(result);
+ onSuccess(result.instance);
});
return {};
};
@@ -241,7 +241,7 @@
return Promise.reject(new Error("Browser doesn't support WebAssembly"));
// TODO cache/retrieve module to/from idb
engineLoadPromise = loadPromise(basePath + '.wasm').then(function(xhr) {
- return WebAssembly.compile(xhr.response);
+ return xhr.response;
});
} else {
var asmjsPromise = loadPromise(basePath + '.asm.js').then(function(xhr) {