Closed Bug 1469004 Opened 2 years ago Closed Last year

Provide an API to create a module namespace object for a module

Categories

(Core :: JavaScript Engine, enhancement)

61 Branch
enhancement
Not set

Tracking

()

RESOLVED FIXED
mozilla63
Tracking Status
firefox63 --- fixed

People

(Reporter: jonco, Assigned: jonco)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

As requested by Ted for JSM/ES6 modules integration.  This is also necessary for implementing dynamic import.
Blocks: 1342012
Patch to add ModuleObject::GetOrCreateModuleNamespace().
Assignee: nobody → jcoppeard
Rebased patch.  This isn't used at the moment but is required by future patches.
Attachment #8998912 - Flags: review?(andrebargull)
Comment on attachment 8998912 [details] [diff] [review]
bug1469004-create-namespace v2

Review of attachment 8998912 [details] [diff] [review]:
-----------------------------------------------------------------

LGTM!

::: js/src/builtin/ModuleObject.cpp
@@ +1157,5 @@
> +    FixedInvokeArgs<1> args(cx);
> +    args[0].setObject(*self);
> +
> +    RootedValue result(cx);
> +    if (!CallSelfHostedFunction(cx, cx->names().GetModuleNamespace, thisv, args, &result))

Instead of the otherwise unused |thisv|, you can use |UndefinedHandleValue| for the this-argument.
Attachment #8998912 - Flags: review?(andrebargull) → review+
Pushed by jcoppeard@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/8289b70dc0db
Add an API to create a module namespace object r=anba
Pushed by jcoppeard@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/08bf805f6f0e
Add an API to create a module namespace object r=anba
https://hg.mozilla.org/mozilla-central/rev/08bf805f6f0e
Status: NEW → RESOLVED
Closed: Last year
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
You need to log in before you can comment on or make changes to this bug.