mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 20:05:49 +00:00
Bug 1320697 - Remove wrong assertion in jsscript.cpp. r=till
This commit is contained in:
parent
1b94319fed
commit
a4999f2bd1
@ -3126,8 +3126,6 @@ Rebase(JSScript* dst, JSScript* src, T* srcp)
|
||||
static JSObject*
|
||||
CloneInnerInterpretedFunction(JSContext* cx, HandleScope enclosingScope, HandleFunction srcFun)
|
||||
{
|
||||
/* async function should not appear as inner function. */
|
||||
MOZ_ASSERT(!srcFun->isAsync());
|
||||
/* NB: Keep this in sync with XDRInterpretedFunction. */
|
||||
RootedObject cloneProto(cx);
|
||||
if (srcFun->isStarGenerator()) {
|
||||
|
@ -1,7 +1,22 @@
|
||||
// |reftest| skip-if(!xulRuntime.shell) -- needs clone
|
||||
// |reftest| skip-if(!xulRuntime.shell) -- needs clone, cloneAndExecuteScript, drainJobQueue
|
||||
|
||||
// Async function cannot be cloned.
|
||||
assertThrowsInstanceOf(() => clone(async function f() {}), TypeError);
|
||||
|
||||
// unwrapped async function can be cloned.
|
||||
let g = newGlobal();
|
||||
cloneAndExecuteScript(`
|
||||
async function f() {
|
||||
var a = await 1;
|
||||
var b = await 2;
|
||||
var c = await 3;
|
||||
return a + b + c;
|
||||
}
|
||||
var V;
|
||||
f().then(v => V = v);
|
||||
drainJobQueue();
|
||||
`, g);
|
||||
assertEq(g.V, 6);
|
||||
|
||||
if (typeof reportCompare === "function")
|
||||
reportCompare(true, true);
|
||||
|
Loading…
Reference in New Issue
Block a user