RESOLVED FIXED 202484
Implement the Top-level await proposal
https://bugs.webkit.org/show_bug.cgi?id=202484
Summary Implement the Top-level await proposal
Myles Borins
Reported 2019-10-02 11:09:36 PDT
The proposal is currently Stage-3 in the TC39 process which means it is ready for engines to implement. https://github.com/tc39/proposal-top-level-await I'm the champion from the TC39 committee so please feel free to ask me any questions you might have.
Attachments
WIP (11.26 KB, patch)
2021-02-01 15:48 PST, Keith Miller
no flags
WIP (63.52 KB, patch)
2021-02-21 13:56 PST, Keith Miller
no flags
Patch (81.38 KB, patch)
2021-02-21 15:34 PST, Keith Miller
no flags
Patch (80.16 KB, patch)
2021-02-21 15:44 PST, Keith Miller
ews-feeder: commit-queue-
Patch (80.93 KB, patch)
2021-02-21 15:53 PST, Keith Miller
ews-feeder: commit-queue-
Patch (82.05 KB, patch)
2021-02-21 16:02 PST, Keith Miller
no flags
Patch (101.97 KB, patch)
2021-02-21 16:05 PST, Keith Miller
ews-feeder: commit-queue-
Patch for landing (93.58 KB, patch)
2021-02-21 16:36 PST, Keith Miller
ews-feeder: commit-queue-
Radar WebKit Bug Importer
Comment 1 2019-10-04 17:08:27 PDT
Keith Miller
Comment 2 2021-02-01 15:48:35 PST
Keith Miller
Comment 3 2021-02-21 13:56:42 PST
Keith Miller
Comment 4 2021-02-21 15:34:43 PST
Keith Miller
Comment 5 2021-02-21 15:44:05 PST
Keith Miller
Comment 6 2021-02-21 15:53:44 PST
Keith Miller
Comment 7 2021-02-21 16:02:44 PST
Keith Miller
Comment 8 2021-02-21 16:05:41 PST
Yusuke Suzuki
Comment 9 2021-02-21 16:13:36 PST
Comment on attachment 421156 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=421156&action=review Please check WebCore side too since now Workers support modules? > Source/JavaScriptCore/API/JSAPIGlobalObject.mm:261 > + // FIXME: We should update the delegate callbacks for async modules. Can you file a bug and paste URL? > Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp:958 > + for (unsigned i = 0; i <= JSGenerator::Argument::NumberOfArguments; ++i) Why isn't it `< jsgenerator::Argument::NumberOfArguments`? If it is because |this| parameter, I think, initializeNextParameter(); // |this| for (unsigned i = 0; i < JSGenerator::Argument::NumberOfArguments; ++i) initializeNextParameter(); would be better. > Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp:3747 > + // RELEASE_ASSERT(m_scopeNode->isFunctionNode()); Why is it necessary? If this comment-out is right, can you remove this assert? > Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp:5066 > + // FIXME: It seems like this will create a lot of constants if there are many yield points. Maybe we should op_inc the old state. Can you file a bug and paste URL?
Keith Miller
Comment 10 2021-02-21 16:32:51 PST
Comment on attachment 421156 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=421156&action=review >> Source/JavaScriptCore/API/JSAPIGlobalObject.mm:261 >> + // FIXME: We should update the delegate callbacks for async modules. > > Can you file a bug and paste URL? Done. >> Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp:958 >> + for (unsigned i = 0; i <= JSGenerator::Argument::NumberOfArguments; ++i) > > Why isn't it `< jsgenerator::Argument::NumberOfArguments`? If it is because |this| parameter, I think, > > initializeNextParameter(); // |this| > for (unsigned i = 0; i < JSGenerator::Argument::NumberOfArguments; ++i) > initializeNextParameter(); > > would be better. Yeah, that's the reason. I'll change. >> Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp:3747 >> + // RELEASE_ASSERT(m_scopeNode->isFunctionNode()); > > Why is it necessary? If this comment-out is right, can you remove this assert? Yeah missed that during cleanup. Deleted. >> Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp:5066 >> + // FIXME: It seems like this will create a lot of constants if there are many yield points. Maybe we should op_inc the old state. > > Can you file a bug and paste URL? Done.
Keith Miller
Comment 11 2021-02-21 16:36:10 PST
Created attachment 421159 [details] Patch for landing
Keith Miller
Comment 12 2021-02-21 16:41:55 PST
Landed in r273225
Aakash Jain
Comment 13 2021-02-22 04:27:32 PST
Seems like there was a follow-up fix: https://trac.webkit.org/r273226 (mentioning here just for reference)
Aakash Jain
Comment 14 2021-02-22 04:33:17 PST
(In reply to Keith Miller from comment #12) > Landed in r273225 This broke 5 layout-tests on mac and ios, as also indicated by ews. Should have waited for EWS to complete. - imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/module/evaluation-order-4-tla.html - imported/w3c/web-platform-tests/html/webappapis/dynamic-markup-insertion/document-write/module-tla-delayed.html - imported/w3c/web-platform-tests/html/webappapis/dynamic-markup-insertion/document-write/module-tla-import.html - imported/w3c/web-platform-tests/html/webappapis/dynamic-markup-insertion/document-write/module-tla-promise.html - imported/w3c/web-platform-tests/html/webappapis/dynamic-markup-insertion/document-write/module-tla-immediate-promise.html
Keith Miller
Comment 15 2021-02-22 10:26:23 PST
(In reply to Aakash Jain from comment #14) > (In reply to Keith Miller from comment #12) > > Landed in r273225 > This broke 5 layout-tests on mac and ios, as also indicated by ews. Should > have waited for EWS to complete. > > - > imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script- > element/module/evaluation-order-4-tla.html > - > imported/w3c/web-platform-tests/html/webappapis/dynamic-markup-insertion/ > document-write/module-tla-delayed.html > - > imported/w3c/web-platform-tests/html/webappapis/dynamic-markup-insertion/ > document-write/module-tla-import.html > - > imported/w3c/web-platform-tests/html/webappapis/dynamic-markup-insertion/ > document-write/module-tla-promise.html > - > imported/w3c/web-platform-tests/html/webappapis/dynamic-markup-insertion/ > document-write/module-tla-immediate-promise.html Weird that those didn't show up for me locally. They just need to be rebaselined.
Ryan Haddad
Comment 16 2021-02-22 10:41:39 PST
(In reply to Aakash Jain from comment #14) > (In reply to Keith Miller from comment #12) > > Landed in r273225 > This broke 5 layout-tests on mac and ios, as also indicated by ews. Should > have waited for EWS to complete. Rebaselined these tests in r273261
Note You need to log in before you can comment on or make changes to this bug.