From cff987a27b90d2dd79195ca8f346f5ae703ceaf5 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Tue, 8 Mar 2016 15:30:28 -0800 Subject: [PATCH] Update wasm.js for v8's change to 2-level FFI namespace --- arch/wasm32/wasm.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/wasm32/wasm.js b/arch/wasm32/wasm.js index 418264ef..f98623a5 100644 --- a/arch/wasm32/wasm.js +++ b/arch/wasm32/wasm.js @@ -914,7 +914,7 @@ var syscall = (function() { // Start with the stub implementations. Further module loads may shadow them. var ffi = (function() { - var functions = {}; + var functions = {env:{}}; var libraries = [ musl_hack, // Keep first, overriden later. builtins, ctype, math, runtime, stdio, stdlib, string, unix, @@ -923,7 +923,7 @@ var ffi = (function() { for (var l in libraries) for (var f in libraries[l]) if (libraries[l].hasOwnProperty(f) && libraries[l][f] instanceof Function) - functions[f] = libraries[l][f]; + functions["env"][f] = libraries[l][f]; return functions; })(); @@ -935,7 +935,7 @@ function load_wasm(file_path) { // dependencies. That would make it easier to do lazy loading. We could do // this by catching load exceptions + adding to ffi and trying again, but // we're talking silly there: modules should just tell us what they want. - return _WASMEXP_.instantiateModule(readbuffer(file_path), ffi, heap); + return Wasm.instantiateModule(readbuffer(file_path), ffi, heap); } // Load modules in reverse, adding their exports to the ffi object.