Bug 1362807 - Keep wasm scripts live so the GC cannot kill one before findScripts sees it, r=yury

--HG--
extra : rebase_source : 76eed5ac5d7f22ae3a3d0f87f2565ee448975249
This commit is contained in:
Steve Fink 2017-05-06 15:59:12 -07:00
parent 31873f0e6b
commit ef72c77b25

View File

@ -6,7 +6,7 @@ if (!wasmIsSupported())
var g = newGlobal();
g.eval(`
function initWasm(s) { return new WebAssembly.Instance(new WebAssembly.Module(wasmTextToBinary(s))); }
o = initWasm('(module (func) (export "" 0))');
o1 = initWasm('(module (func) (export "" 0))');
o2 = initWasm('(module (func) (func) (export "" 1))');
`);
@ -14,7 +14,7 @@ function isWasm(script) { return script.format === "wasm"; }
function isValidWasmURL(url) {
// The URLs will have the following format:
// wasm: [<uri-econded-filename-of-host> ":"] <64-bit-hash>
// wasm: [<uri-encoded-filename-of-host> ":"] <64-bit-hash>
return /^wasm:(?:[^:]*:)*?[0-9a-f]{16}$/.test(url);
}