Bug 167099 - [JSC] export JSC::importModule API for WebCore dynamic import
Summary: [JSC] export JSC::importModule API for WebCore dynamic import
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Yusuke Suzuki
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-01-16 11:20 PST by Yusuke Suzuki
Modified: 2017-01-21 14:24 PST (History)
7 users (show)

See Also:


Attachments
Patch (12.61 KB, patch)
2017-01-16 11:22 PST, Yusuke Suzuki
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yusuke Suzuki 2017-01-16 11:20:54 PST
[JSC] export JSC::importModule API for WebCore dynamic import
Comment 1 Yusuke Suzuki 2017-01-16 11:22:49 PST
Created attachment 298977 [details]
Patch
Comment 2 Darin Adler 2017-01-21 13:51:47 PST
Comment on attachment 298977 [details]
Patch

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

> Source/JavaScriptCore/jsc.cpp:1443
> +        JSInternalPromiseDeferred* deferred = JSInternalPromiseDeferred::create(exec, globalObject);
> +        return deferred->reject(exec, error);

I think this would read better without the local variable.

> Source/JavaScriptCore/runtime/Completion.cpp:258
> +    JSGlobalObject* globalObject = exec->vmEntryGlobalObject();
> +    return globalObject->moduleLoader()->requestImportModule(exec, moduleKey, scriptFetcher);

I think this would read better without the local variable.

> Source/JavaScriptCore/runtime/JSModuleLoader.cpp:145
> +    ASSERT(callType != CallType::None);

What guarantees this is true?
Comment 3 Yusuke Suzuki 2017-01-21 14:23:02 PST
Comment on attachment 298977 [details]
Patch

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

>> Source/JavaScriptCore/jsc.cpp:1443
>> +        return deferred->reject(exec, error);
> 
> I think this would read better without the local variable.

Fixed.

>> Source/JavaScriptCore/runtime/Completion.cpp:258
>> +    return globalObject->moduleLoader()->requestImportModule(exec, moduleKey, scriptFetcher);
> 
> I think this would read better without the local variable.

Fixed.

>> Source/JavaScriptCore/runtime/JSModuleLoader.cpp:145
>> +    ASSERT(callType != CallType::None);
> 
> What guarantees this is true?

Yes. JSModuleLoader is not visible to users. Thus, JSC can guarantee this condition.
Comment 4 Yusuke Suzuki 2017-01-21 14:24:12 PST
Committed r211018: <http://trac.webkit.org/changeset/211018>