Closed
Bug 795161
Opened 13 years ago
Closed 13 years ago
dom/system/gonk/systemlibs.js is not importable
Categories
(Core Graveyard :: Widget: Gonk, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla18
People
(Reporter: hub, Assigned: hub)
References
Details
Attachments
(1 file, 1 obsolete file)
|
732 bytes,
patch
|
philikon
:
review+
|
Details | Diff | Splinter Review |
Can't import dom/system/gonk/systemlibs.js using Components.Utils.import().
Attaching patch.
| Assignee | ||
Comment 1•13 years ago
|
||
Attachment #665692 -
Flags: review?(philipp)
| Assignee | ||
Updated•13 years ago
|
Version: 16 Branch → Trunk
Comment 2•13 years ago
|
||
Comment on attachment 665692 [details] [diff] [review]
Bug 795161 - Make systemlibs.js importable.
Review of attachment 665692 [details] [diff] [review]:
-----------------------------------------------------------------
The shell.js part seems unrelated to this patch. Also libcutils isn't used in shell.js so far. Maybe you accidentally included this in part in the patch?
::: dom/system/gonk/systemlibs.js
@@ +16,5 @@
> +if (!this.ctypes) {
> + Components.utils.import("resource://gre/modules/ctypes.jsm");
> +}
> +
> +const EXPORTED_SYMBOLS = [ "libcutils", "libnetutils", "netHelpers" ];
I just had a thought. If this gets included inside a worker using importScripts() along with other modules that have similar consts, we're going to get an error because of two conflicting const definitions.
Here's what I suggest:
let EXPORTED_SYMBOLS;
if (!this.ctypes) {
// We're likely being loaded as a JSM.
EXPORTED_SYMBOLS = ["libcutils", "libnetutils", "netHelpers"];
Components.utils.import("resource://gre/modules/ctypes.jsm");
}
Attachment #665692 -
Flags: review?(philipp)
| Assignee | ||
Updated•13 years ago
|
Assignee: nobody → hub
| Assignee | ||
Comment 3•13 years ago
|
||
(In reply to Philipp von Weitershausen [:philikon] from comment #2)
> Comment on attachment 665692 [details] [diff] [review]
> Bug 795161 - Make systemlibs.js importable.
>
> Review of attachment 665692 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> The shell.js part seems unrelated to this patch. Also libcutils isn't used
> in shell.js so far. Maybe you accidentally included this in part in the
> patch?
Oops. this wasn't supposed to be slid in. Will provide a new patch.
>
> ::: dom/system/gonk/systemlibs.js
> @@ +16,5 @@
> > +if (!this.ctypes) {
> > + Components.utils.import("resource://gre/modules/ctypes.jsm");
> > +}
> > +
> > +const EXPORTED_SYMBOLS = [ "libcutils", "libnetutils", "netHelpers" ];
>
> I just had a thought. If this gets included inside a worker using
> importScripts() along with other modules that have similar consts, we're
> going to get an error because of two conflicting const definitions.
>
> Here's what I suggest:
>
> let EXPORTED_SYMBOLS;
> if (!this.ctypes) {
> // We're likely being loaded as a JSM.
> EXPORTED_SYMBOLS = ["libcutils", "libnetutils", "netHelpers"];
> Components.utils.import("resource://gre/modules/ctypes.jsm");
> }
Sounds fair. I'll try that approach.
| Assignee | ||
Comment 4•13 years ago
|
||
removed the irrelevant changes and adopted philikon suggest approach for EXPORTED_SYMBOLS.
Attachment #665692 -
Attachment is obsolete: true
Attachment #665701 -
Flags: review?(philipp)
Updated•13 years ago
|
Attachment #665701 -
Flags: review?(philipp) → review+
| Assignee | ||
Comment 5•13 years ago
|
||
Status: NEW → ASSIGNED
Comment 6•13 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla18
Updated•7 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•