Bug 197244 - Add SPI callbacks for before and after module execution
Summary: Add SPI callbacks for before and after module execution
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Saam Barati
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-04-24 13:53 PDT by Saam Barati
Modified: 2019-04-24 15:42 PDT (History)
15 users (show)

See Also:


Attachments
patch (11.77 KB, patch)
2019-04-24 14:59 PDT, Saam Barati
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Saam Barati 2019-04-24 13:53:18 PDT
...
Comment 1 Radar WebKit Bug Importer 2019-04-24 13:53:35 PDT
<rdar://problem/50180511>
Comment 2 Saam Barati 2019-04-24 14:59:45 PDT
Created attachment 368183 [details]
patch
Comment 3 EWS Watchlist 2019-04-24 15:02:38 PDT
Attachment 368183 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/API/tests/testapi.mm:2033:  Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons.  [readability/comparison_to_zero] [5]
ERROR: Source/JavaScriptCore/API/tests/testapi.mm:2034:  Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons.  [readability/comparison_to_zero] [5]
Total errors found: 2 in 7 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 4 Yusuke Suzuki 2019-04-24 15:17:25 PDT
Comment on attachment 368183 [details]
patch

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

r=me. BTW, this use case is actually why we have moduleLoaderEvaluate hook in ModuleLoader APIs. WebCore does the almost same thing to tell the inspector about module evaluation :)

> Source/JavaScriptCore/API/JSAPIGlobalObject.mm:249
> +        String moduleKey = key.toWTFString(exec);
> +        RETURN_IF_EXCEPTION(scope, { });

In JSContext / JSScript module loading API desing, the key is always URL String (not Symbol), is my understanding correct? If so, it is fine.
Comment 5 Saam Barati 2019-04-24 15:30:30 PDT
(In reply to Yusuke Suzuki from comment #4)
> Comment on attachment 368183 [details]
> patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=368183&action=review
> 
> r=me. BTW, this use case is actually why we have moduleLoaderEvaluate hook
> in ModuleLoader APIs. WebCore does the almost same thing to tell the
> inspector about module evaluation :)
Nice.

> 
> > Source/JavaScriptCore/API/JSAPIGlobalObject.mm:249
> > +        String moduleKey = key.toWTFString(exec);
> > +        RETURN_IF_EXCEPTION(scope, { });
> 
> In JSContext / JSScript module loading API desing, the key is always URL
> String (not Symbol), is my understanding correct? If so, it is fine.

That's correct.
Comment 6 WebKit Commit Bot 2019-04-24 15:42:45 PDT
Comment on attachment 368183 [details]
patch

Clearing flags on attachment: 368183

Committed r244620: <https://trac.webkit.org/changeset/244620>
Comment 7 WebKit Commit Bot 2019-04-24 15:42:46 PDT
All reviewed patches have been landed.  Closing bug.