Closed
Bug 998291
Opened 11 years ago
Closed 11 years ago
Allow importRelative() to import into a given scope
Categories
(Core :: XPConnect, enhancement)
Core
XPConnect
Tracking
()
RESOLVED
FIXED
mozilla31
People
(Reporter: bugzilla, Assigned: bugzilla)
Details
Attachments
(1 file, 2 obsolete files)
3.74 KB,
patch
|
benjamin
:
review+
|
Details | Diff | Splinter Review |
Bug 628669 introduced the useful importRelative() function into XPCOMUtils, but it does require that the specified relative module be imported into the JavaScript Object of the calling JavaScript code module's global scope (ie. the first argument passed). There should be an optional third argument, scope, allowing the module to be imported into a given scope, just the same as with Components.utils.import().
Sorry, I got that description of Components.utils.import() wrong; it doesn't take a third argument, however it does obviously allow you to load a module into a given scope using its second argument.
Patch allowing optional third argument for scope to be specified in importRelative function. Tested and working on my Linux build.
Attachment #8408951 -
Attachment is obsolete: true
Attachment #8408955 -
Flags: review?(benjamin)
Comment 4•11 years ago
|
||
Comment on attachment 8408955 [details] [diff] [review] patch v2 Please add a test for this to http://mxr.mozilla.org/mozilla-central/source/testing/xpcshell/example/unit/import_module.jsm#20
Attachment #8408955 -
Flags: review?(benjamin)
Adding patch with test.
Attachment #8408955 -
Attachment is obsolete: true
Attachment #8410590 -
Flags: review?(bzbarsky)
Attachment #8410590 -
Flags: review?(bzbarsky) → review?(benjamin)
Updated•11 years ago
|
Attachment #8410590 -
Flags: review?(benjamin) → review+
Keywords: checkin-needed
Comment 7•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/8f5f134ee116
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla31
I've updated the documentation here: https://developer.mozilla.org/en-US/docs/Mozilla/JavaScript_code_modules/XPCOMUtils.jsm
You need to log in
before you can comment on or make changes to this bug.
Description
•