Bug 191792 - globalFuncImportModule() should return a promise when it clears exceptions.
Summary: globalFuncImportModule() should return a promise when it clears exceptions.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Mark Lam
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-11-16 16:26 PST by Mark Lam
Modified: 2018-11-19 23:10 PST (History)
10 users (show)

See Also:


Attachments
proposed patch. (6.12 KB, patch)
2018-11-16 16:38 PST, Mark Lam
fpizlo: review+
ews-watchlist: commit-queue-
Details | Formatted Diff | Diff
proposed patch w/ test failure fixes. (20.33 KB, patch)
2018-11-18 00:12 PST, Mark Lam
ews-watchlist: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from ews102 for mac-sierra (2.45 MB, application/zip)
2018-11-18 01:15 PST, EWS Watchlist
no flags Details
Archive of layout-test-results from ews105 for mac-sierra-wk2 (3.00 MB, application/zip)
2018-11-18 01:24 PST, EWS Watchlist
no flags Details
Archive of layout-test-results from ews117 for mac-sierra (2.20 MB, application/zip)
2018-11-18 02:05 PST, EWS Watchlist
no flags Details
Archive of layout-test-results from ews206 for win-future (12.82 MB, application/zip)
2018-11-18 02:07 PST, EWS Watchlist
no flags Details
Archive of layout-test-results from ews125 for ios-simulator-wk2 (2.46 MB, application/zip)
2018-11-18 02:20 PST, EWS Watchlist
no flags Details
proposed patch w/ test failure fixes. (20.32 KB, patch)
2018-11-19 13:11 PST, Mark Lam
msaboff: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Lam 2018-11-16 16:26:32 PST
<rdar://problem/46090763>
Comment 1 Mark Lam 2018-11-16 16:38:33 PST
Created attachment 355161 [details]
proposed patch.
Comment 2 Keith Miller 2018-11-16 16:44:43 PST
Comment on attachment 355161 [details]
proposed patch.

View in context: https://bugs.webkit.org/attachment.cgi?id=355161&action=review

> Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp:813
> +        if (Exception* exception = catchScope.exception()) {
> +            catchScope.clearException();
> +            promise->reject(exec, exception->value());
> +            CLEAR_AND_RETURN_IF_EXCEPTION(catchScope, JSValue::encode(promise->promise()));
> +        }

nit: You could make this a lambda so you don't duplicate the code.
Comment 3 Mark Lam 2018-11-16 16:48:23 PST
Comment on attachment 355161 [details]
proposed patch.

View in context: https://bugs.webkit.org/attachment.cgi?id=355161&action=review

Thanks for the reviews.

>> Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp:813
>> +        }
> 
> nit: You could make this a lambda so you don't duplicate the code.

It's only replicated once, and I'm not sure the lambda overhead is necessarily cheaper.  So, I'll keep this as is.
Comment 4 EWS Watchlist 2018-11-16 19:04:19 PST
Comment on attachment 355161 [details]
proposed patch.

Attachment 355161 [details] did not pass jsc-ews (mac):
Output: https://webkit-queues.webkit.org/results/10027602

New failing tests:
stress/global-import-function-should-return-a-promise-when-clearing-exceptions.js.default
stress/global-import-function-should-return-a-promise-when-clearing-exceptions.js.dfg-maximal-flush-validate-no-cjit
stress/global-import-function-should-return-a-promise-when-clearing-exceptions.js.ftl-no-cjit-small-pool
stress/global-import-function-should-return-a-promise-when-clearing-exceptions.js.no-ftl
apiTests
Comment 5 Mark Lam 2018-11-18 00:12:39 PST
Created attachment 355231 [details]
proposed patch w/ test failure fixes.

Let's test this on the EWS before I get another review.
Comment 6 EWS Watchlist 2018-11-18 01:15:38 PST
Comment on attachment 355231 [details]
proposed patch w/ test failure fixes.

Attachment 355231 [details] did not pass mac-ews (mac):
Output: https://webkit-queues.webkit.org/results/10055642

New failing tests:
imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/module/dynamic-import/dynamic-imports-script-error.html
js/dom/modules/module-incorrect-relative-specifier.html
imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/module/specifier-error.html
Comment 7 EWS Watchlist 2018-11-18 01:15:39 PST
Created attachment 355233 [details]
Archive of layout-test-results from ews102 for mac-sierra

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews102  Port: mac-sierra  Platform: Mac OS X 10.12.6
Comment 8 EWS Watchlist 2018-11-18 01:24:35 PST
Comment on attachment 355231 [details]
proposed patch w/ test failure fixes.

Attachment 355231 [details] did not pass mac-wk2-ews (mac-wk2):
Output: https://webkit-queues.webkit.org/results/10055664

New failing tests:
imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/module/dynamic-import/dynamic-imports-script-error.html
js/dom/modules/module-incorrect-relative-specifier.html
imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/module/specifier-error.html
Comment 9 EWS Watchlist 2018-11-18 01:24:37 PST
Created attachment 355235 [details]
Archive of layout-test-results from ews105 for mac-sierra-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews105  Port: mac-sierra-wk2  Platform: Mac OS X 10.12.6
Comment 10 EWS Watchlist 2018-11-18 02:05:13 PST
Comment on attachment 355231 [details]
proposed patch w/ test failure fixes.

Attachment 355231 [details] did not pass mac-debug-ews (mac):
Output: https://webkit-queues.webkit.org/results/10055835

New failing tests:
imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/module/dynamic-import/dynamic-imports-script-error.html
js/dom/modules/module-incorrect-relative-specifier.html
imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/module/specifier-error.html
Comment 11 EWS Watchlist 2018-11-18 02:05:15 PST
Created attachment 355236 [details]
Archive of layout-test-results from ews117 for mac-sierra

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews117  Port: mac-sierra  Platform: Mac OS X 10.12.6
Comment 12 EWS Watchlist 2018-11-18 02:07:16 PST
Comment on attachment 355231 [details]
proposed patch w/ test failure fixes.

Attachment 355231 [details] did not pass win-ews (win):
Output: https://webkit-queues.webkit.org/results/10056137

New failing tests:
js/dom/modules/module-incorrect-relative-specifier.html
Comment 13 EWS Watchlist 2018-11-18 02:07:29 PST
Created attachment 355237 [details]
Archive of layout-test-results from ews206 for win-future

The attached test failures were seen while running run-webkit-tests on the win-ews.
Bot: ews206  Port: win-future  Platform: CYGWIN_NT-6.1-2.9.0-0.318-5-3-x86_64-64bit
Comment 14 EWS Watchlist 2018-11-18 02:20:10 PST
Comment on attachment 355231 [details]
proposed patch w/ test failure fixes.

Attachment 355231 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: https://webkit-queues.webkit.org/results/10055922

New failing tests:
imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/module/specifier-error.html
js/dom/modules/module-incorrect-relative-specifier.html
imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/module/dynamic-import/dynamic-imports-script-error.html
Comment 15 EWS Watchlist 2018-11-18 02:20:12 PST
Created attachment 355238 [details]
Archive of layout-test-results from ews125 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews125  Port: ios-simulator-wk2  Platform: Mac OS X 10.13.6
Comment 16 Mark Lam 2018-11-19 13:11:24 PST
Created attachment 355290 [details]
proposed patch w/ test failure fixes.
Comment 17 Michael Saboff 2018-11-19 21:05:20 PST
Comment on attachment 355290 [details]
proposed patch w/ test failure fixes.

View in context: https://bugs.webkit.org/attachment.cgi?id=355290&action=review

r=me

> Source/JavaScriptCore/ChangeLog:11
> +        be return the empty JSValue in this case: instead, we should return a Promise as

Wording, delete "be".
Comment 18 Mark Lam 2018-11-19 23:10:39 PST
Thanks for the review.  Landed in r238391: <http://trac.webkit.org/r238391>.