test262/implementation-contributed/javascriptcore/stress/function-caller-generator-method-body.js
Leo Balter d1261bb49d Update files for the curation process
Remove more stress tests with existing coverage or out of context for test262
2018-09-11 18:20:20 -04:00

28 lines
494 B
JavaScript

// Reviewed
//@ runDefault
(function thingy() {
function bar()
{
return bar.caller;
}
class C {
*foo()
{
bar();
}
}
var ok = false;
try {
new C().foo().next();
ok = true;
} catch (e) {
if (e.toString() != "TypeError: Function.caller used to retrieve generator body")
throw "Error: bad error: " + e;
}
if (ok)
throw "Error: did not throw error";
})();