Bug 176573 - `async` should be able to be used as an imported binding name
Summary: `async` should be able to be used as an imported binding name
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: Safari 10
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Yusuke Suzuki
URL:
Keywords: InRadar
: 177986 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-09-07 17:39 PDT by Keanu Lee
Modified: 2017-10-09 22:53 PDT (History)
17 users (show)

See Also:


Attachments
Patch (14.54 KB, patch)
2017-10-05 19:01 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (17.97 KB, patch)
2017-10-05 19:39 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews112 for mac-elcapitan (2.01 MB, application/zip)
2017-10-06 01:15 PDT, Build Bot
no flags Details
Patch (34.44 KB, patch)
2017-10-09 18:12 PDT, Yusuke Suzuki
sbarati: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Keanu Lee 2017-09-07 17:39:46 PDT
According to JS spec (https://tc39.github.io/ecma262/#sec-reserved-words), `async` is not a reserved keyword and should be able to be used as an imported binding name. For example, the following should not throw:

    import * as async from "./client.js";


Repro: https://kindly-physician.glitch.me/ (works in Chrome)

Related: https://github.com/Polymer/polymer-modulizer/issues/197
Comment 1 Radar WebKit Bug Importer 2017-10-05 07:32:50 PDT
<rdar://problem/34833164>
Comment 2 Yusuke Suzuki 2017-10-05 19:01:32 PDT
Created attachment 322964 [details]
Patch

WIP: checking performance
Comment 3 Yusuke Suzuki 2017-10-05 19:22:58 PDT
                         baseline                  patched                                      

closure              0.54239+-0.00583          0.54187+-0.00837       
jquery               7.29268+-0.04093    ^     7.21285+-0.03484       ^ definitely 1.0111x faster

OK, performance is not a problem.
Comment 4 Yusuke Suzuki 2017-10-05 19:23:26 PDT
*** Bug 177986 has been marked as a duplicate of this bug. ***
Comment 5 Yusuke Suzuki 2017-10-05 19:39:15 PDT
Created attachment 322971 [details]
Patch
Comment 6 Caitlin Potter (:caitp) 2017-10-06 00:09:37 PDT
Per `https://tc39.github.io/ecma262/#prod-ImportedBinding`, isn't "await" always an invalid binding name in import declarations? Or am I mis-reading that notation?
Comment 7 Caitlin Potter (:caitp) 2017-10-06 00:30:54 PDT
(In reply to Caitlin Potter (:caitp) from comment #6)
> Per `https://tc39.github.io/ecma262/#prod-ImportedBinding`, isn't "await"
> always an invalid binding name in import declarations? Or am I mis-reading
> that notation?

Ok, I totally misread the title of this bug. Makes perfect sense for "async", nevermind me :)
Comment 8 Build Bot 2017-10-06 01:15:43 PDT
Comment on attachment 322971 [details]
Patch

Attachment 322971 [details] did not pass mac-debug-ews (mac):
Output: http://webkit-queues.webkit.org/results/4778645

New failing tests:
workers/wasm-long-compile.html
Comment 9 Build Bot 2017-10-06 01:15:44 PDT
Created attachment 322996 [details]
Archive of layout-test-results from ews112 for mac-elcapitan

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews112  Port: mac-elcapitan  Platform: Mac OS X 10.11.6
Comment 10 Yusuke Suzuki 2017-10-06 08:20:39 PDT
(In reply to Caitlin Potter (:caitp) from comment #7)
> (In reply to Caitlin Potter (:caitp) from comment #6)
> > Per `https://tc39.github.io/ecma262/#prod-ImportedBinding`, isn't "await"
> > always an invalid binding name in import declarations? Or am I mis-reading
> > that notation?
> 
> Ok, I totally misread the title of this bug. Makes perfect sense for
> "async", nevermind me :)

np ;), this is for “async”.
Comment 11 Yusuke Suzuki 2017-10-06 23:01:54 PDT
(In reply to Build Bot from comment #8)
> Comment on attachment 322971 [details]
> Patch
> 
> Attachment 322971 [details] did not pass mac-debug-ews (mac):
> Output: http://webkit-queues.webkit.org/results/4778645
> 
> New failing tests:
> workers/wasm-long-compile.html

This is unrelated.
Comment 12 WebKit Commit Bot 2017-10-07 14:16:27 PDT
Comment on attachment 322971 [details]
Patch

Clearing flags on attachment: 322971

Committed r223022: <http://trac.webkit.org/changeset/223022>
Comment 13 WebKit Commit Bot 2017-10-07 14:16:29 PDT
All reviewed patches have been landed.  Closing bug.
Comment 14 Ryan Haddad 2017-10-09 09:09:14 PDT
This change introduced 18 test262 failures. Here is the output for one of the tests:

test262.yaml/test262/test/language/expressions/async-arrow-function/escaped-async.js.default: Expected uncaught exception with name 'SyntaxError' but exception value is not instance of this exception class
test262.yaml/test262/test/language/expressions/async-arrow-function/escaped-async.js.default: Exception: Test262: This statement should not be evaluated.
test262.yaml/test262/test/language/expressions/async-arrow-function/escaped-async.js.default: ERROR: Unexpected exit code: 3
FAIL: test262.yaml/test262/test/language/expressions/async-arrow-function/escaped-async.js.default

https://build.webkit.org/builders/Apple%20El%20Capitan%20Debug%20Test262%20%28Tests%29/builds/3621
Comment 15 Ryan Haddad 2017-10-09 13:02:38 PDT
Reverted r223022 for reason:

This change introduced 18 test262 failures.

Committed r223062: <http://trac.webkit.org/changeset/223062>
Comment 16 Yusuke Suzuki 2017-10-09 18:12:59 PDT
Created attachment 323262 [details]
Patch
Comment 17 Yusuke Suzuki 2017-10-09 22:53:17 PDT
Committed r223124: <http://trac.webkit.org/changeset/223124>