"this" missing after await in async arrow function
authorgskachkov@gmail.com <gskachkov@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 Jan 2017 17:10:31 +0000 (17:10 +0000)
committergskachkov@gmail.com <gskachkov@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 Jan 2017 17:10:31 +0000 (17:10 +0000)
commitf39f8f1041683d7de8537a7dc61e630393a6cc10
treebf66f860789a2778fd23bb7abd1356c2ffa71223
parent31e9538904124ab6ac1618bb65a1febca37852fa
"this" missing after await in async arrow function
https://bugs.webkit.org/show_bug.cgi?id=166919

Reviewed by Saam Barati.

Source/JavaScriptCore:

This patch fixed issue in async arrow function. Issue appears because in arrow
function _this_ is loaded from arrow function virtual scope.
Async arrow function can be suspended and when resuming should be used _this_ from
virtual scope, to allow this we load _this_ from virtual scope before store it to
generator.generatorThis property

* bytecompiler/NodesCodegen.cpp:
(JSC::FunctionNode::emitBytecode):

JSTests:

* stress/async-arrow-functions-lexical-binding-in-class.js:
(ChildClass.prototype.asyncThisPropWithAwaitBody):
(ChildClass.prototype.asyncThisPropInEvalWithAwaitBody):
(ChildClass.prototype.asyncThisValueBodyWithAwait):
(ChildClass.prototype.asyncThisValueInEvalWithAwaitBody):
(ChildClass):
(ChildClass3):
(ChildClass3.prototype.classValue):
(ChildClass3.prototype.get classProperty):
* stress/async-arrow-functions-lexical-new.target-binding.js:
(C2WithAwait):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210925 268f45cc-cd09-0410-ab3c-d52691b4dbfc
JSTests/ChangeLog
JSTests/stress/async-arrow-functions-lexical-binding-in-class.js
JSTests/stress/async-arrow-functions-lexical-new.target-binding.js
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp