[Webkit-unassigned] [Bug 217299] New: await expression breaks some surrounding expressions
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Sun Oct 4 15:01:45 PDT 2020
https://bugs.webkit.org/show_bug.cgi?id=217299
Bug ID: 217299
Summary: await expression breaks some surrounding expressions
Product: WebKit
Version: Safari Technology Preview
Hardware: Macintosh
OS: macOS 10.15
Status: NEW
Severity: Normal
Priority: P2
Component: JavaScriptCore
Assignee: webkit-unassigned at lists.webkit.org
Reporter: thatcomputerguy0101 at gmail.com
The `await` operator is not treated like a standard operator, since it breaks whenever used in several expression contexts.
The following two constructs are both broken by this bug, and I expect a few more to be as well:
let {property} = await asyncFunction() // results in SyntaxError: Unexpected identifier 'asyncFunction'. Expected ';' after variable declaration.
const result = await asyncFunction() // results in SyntaxError: Unexpected token ';'. const declared variable 'result' must have an initializer.
I expect this happens because the await operator tries to take some sort of assignment shortcut. The `await` operator is supposed to be just another operator (that happens to take an undefined duration), so it shouldn't matter where it is used. In Chrome, both of the above will work without errors (when run in the appropriate context).
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20201004/8749d93e/attachment-0001.htm>
More information about the webkit-unassigned
mailing list