Skip to content

Commit 5c0e940

Browse files
committed
fix bug where yield inside try block doesn't set ResumeYieldData
1 parent 4ed51ed commit 5c0e940

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

lib/Runtime/Language/InterpreterLoop.inl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,7 @@ SWAP_BP_FOR_OPCODE:
307307
#ifndef INTERPRETER_ASMJS
308308
case INTERPRETER_OPCODE::Yield:
309309
{
310+
this->retOffset = m_reader.GetCurrentOffset();
310311
m_reader.Reg2_Small(ip);
311312
return GetReg(GetFunctionBody()->GetYieldRegister());
312313
}

test/es7/misc_bugs.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,19 @@ var tests = [
2626
}`); });
2727
}
2828
},
29+
{
30+
name: "Await in class body should not crash",
31+
body: function () {
32+
async function trigger(a=class b{
33+
[a = class b{
34+
[await 0](){}
35+
}](){}
36+
}) {
37+
}
38+
39+
trigger();
40+
}
41+
},
2942

3043
];
3144

0 commit comments

Comments
 (0)