After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 700862 - importer: Only allow importing native modules on the root importer
importer: Only allow importing native modules on the root importer
Status: RESOLVED FIXED
Product: gjs
Classification: Bindings
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gjs-maint
gjs-maint
Depends on:
Blocks:
 
 
Reported: 2013-05-22 21:16 UTC by Jasper St. Pierre (not reading bugmail)
Modified: 2013-05-23 15:59 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Remove some leftover cruft from external native modules (2.37 KB, patch)
2013-05-22 21:16 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
importer: Only allow importing native modules on the root importer (3.32 KB, patch)
2013-05-22 21:16 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review

Description Jasper St. Pierre (not reading bugmail) 2013-05-22 21:16:36 UTC
While working on gnome-shell, I added a file in js/ui/ called "system.js",
which collided with the name of a native module and made it impossible to
import anything but.

This is a bit of a hack relying on the fact that native modules only exist
at the root, which is a guarantee I made a little while ago.

I want to replace this mess with require() so bad, you have no idea.
Comment 1 Jasper St. Pierre (not reading bugmail) 2013-05-22 21:16:38 UTC
Created attachment 245088 [details] [review]
Remove some leftover cruft from external native modules
Comment 2 Jasper St. Pierre (not reading bugmail) 2013-05-22 21:16:41 UTC
Created attachment 245089 [details] [review]
importer: Only allow importing native modules on the root importer

Otherwise, native modules could take priority over another submodule
with the same name, e.g. a module named "system".
Comment 3 Giovanni Campagna 2013-05-23 15:12:55 UTC
Review of attachment 245088 [details] [review]:

Yes
Comment 4 Giovanni Campagna 2013-05-23 15:15:30 UTC
Review of attachment 245089 [details] [review]:

This is correct, but system is a JS module, not native, so this should not collide.
Comment 5 Giovanni Campagna 2013-05-23 15:57:40 UTC
My mistake, system is a native only module, so the diagnosis is correct.
Comment 6 Jasper St. Pierre (not reading bugmail) 2013-05-23 15:59:44 UTC
Attachment 245088 [details] pushed as ce589d4 - Remove some leftover cruft from external native modules
Attachment 245089 [details] pushed as 270416b - importer: Only allow importing native modules on the root importer