[JSC] always wrap AwaitExpression operand in a new Promise
authorcaitp@igalia.com <caitp@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 30 Nov 2016 03:42:55 +0000 (03:42 +0000)
committercaitp@igalia.com <caitp@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 30 Nov 2016 03:42:55 +0000 (03:42 +0000)
commite312c548cbf9c4e9fd9e967555cac51da0b7cf09
tree569f81bceb09e1ba8b76d365d4e0ed37556b4444
parent7b97c3d83fe07d77baf7db1875431488d6597a80
[JSC] always wrap AwaitExpression operand in a new Promise
https://bugs.webkit.org/show_bug.cgi?id=165181

Reviewed by Yusuke Suzuki.

JSTests:

* stress/async-await-basic.js:
(async.awaitedPromisesAreWrapped):

Source/JavaScriptCore:

Ensure operand of AwaitExpression is wrapped in a new Promise by
explicitly creating a new Promise Capability and invoking its
resolve callback. This avoids the specified short-circuit for
Promise.resolve().

* builtins/AsyncFunctionPrototype.js:
(globalPrivate.asyncFunctionResume):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209113 268f45cc-cd09-0410-ab3c-d52691b4dbfc
JSTests/ChangeLog
JSTests/stress/async-await-basic.js
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/builtins/AsyncFunctionPrototype.js