Add 'instance' to externs, don't quote it

This commit is contained in:
Fabian 2018-03-06 13:51:40 -05:00
parent caf3a9e1f3
commit 89e3105bde
2 changed files with 9 additions and 2 deletions

View file

@ -1308,7 +1308,7 @@ CPU.prototype.codegen_finalize = function(wasm_table_index, start, end, first_op
jit_imports["next_block_not_branched"] = this.jit_imports["next_block_not_branched"];
const result = WebAssembly.instantiate(code, { "e": jit_imports }).then(result => {
const f = result["instance"].exports["f"];
const f = result.instance.exports["f"];
this.wm.exports["_codegen_finalize_finished"](
wasm_table_index, start, first_opcode, state_flags, page_dirtiness);

View file

@ -16,7 +16,14 @@ var exports = {};
var define = {};
var module = {};
var WebAssembly = { Memory() {}, Table() {}, instantiate() {}, compile() {}, Instance() {}, Module() {} };
var WebAssembly = {
Memory() {},
Table() {},
instantiate() { return { instance: null, module: null }; },
compile() {},
Instance() {},
Module() {},
};
WebAssembly.Module.customSections = function(module, section) {};
var wabt = {