Safari 10 /11 problem with if (!await get(something)).
authorgskachkov@gmail.com <gskachkov@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 9 Oct 2017 09:59:26 +0000 (09:59 +0000)
committergskachkov@gmail.com <gskachkov@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 9 Oct 2017 09:59:26 +0000 (09:59 +0000)
commitb8550f23017de61c512c949017e7ee5b3fc7c9d4
tree0d42d7418abb86ce1be850793ba1f96e4345636f
parent87545190c048e8cd4e121e49cf30fb887682164c
Safari 10 /11 problem with if (!await get(something)).
https://bugs.webkit.org/show_bug.cgi?id=176685

Reviewed by Saam Barati.

JSTests:

* stress/async-await-basic.js:
(awaitEpression.async):
* stress/async-await-syntax.js:
(testTopLevelAsyncAwaitSyntaxSloppyMode.testSyntax):
(prototype.testTopLevelAsyncAwaitSyntaxStrictMode):

Source/JavaScriptCore:

Using unary operator before `await` lead to count it as identifier.
According to spec https://tc39.github.io/ecma262/#sec-async-function-definitions
and Note 1 `await` is as AwaitExpression and it is allowed to use unary operator

* parser/Parser.cpp:
(JSC::Parser<LexerType>::parsePrimaryExpression):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@223043 268f45cc-cd09-0410-ab3c-d52691b4dbfc
JSTests/ChangeLog
JSTests/stress/async-await-basic.js
JSTests/stress/async-await-syntax.js
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/parser/Parser.cpp