Closed
Bug 602455
Opened 14 years ago
Closed 14 years ago
With CommonJS global mozmill objects are not in module scope anymore
Categories
(Testing Graveyard :: Mozmill, defect)
Testing Graveyard
Mozmill
Tracking
(Not tracked)
VERIFIED
FIXED
People
(Reporter: whimboo, Assigned: whimboo)
References
Details
(Keywords: regression, Whiteboard: [mozmill-1.5.1+])
Attachments
(2 files)
1.27 KB,
patch
|
Details | Diff | Splinter Review | |
771 bytes,
patch
|
harth
:
review+
|
Details | Diff | Splinter Review |
With the update to CommonJS I'm not able to access the mozmill object from within modules anymore. It's only available inside the tests itself. That's kinda bad because we have some instances where we call mozmill.controller.sleep without having to pass a controller instance into the helper function. See the attachment which contains an example test and module. Once you remove the mozmill parameter from the setup function, the code will fail.
Assignee | ||
Comment 1•14 years ago
|
||
Assignee | ||
Comment 2•14 years ago
|
||
It can be solved by putting the mozmill object into the globals array. We should also check to which other objects modules should have access to.
Assignee | ||
Comment 3•14 years ago
|
||
And one more thing. Would there be a way to set a module id? I would really like to replace the MODULE_NAME with module.id, i.e: OLD: var MODULE_NAME = 'UtilsAPI'; New: module.id = 'utils'; But there is no global module object in the scope. See http://wiki.commonjs.org/wiki/Modules/1.1#Sample_Code
Assignee | ||
Comment 4•14 years ago
|
||
Beside Mozmill it also affects elementslib.
Summary: With CommonJS mozmill object is not in module scope anymore → With CommonJS global mozmill objects are not in module scope anymore
Assignee | ||
Comment 5•14 years ago
|
||
Proposed patch which should at least retain access to the global objects from within the modules.
Attachment #481476 -
Flags: review?
Assignee | ||
Updated•14 years ago
|
Attachment #481476 -
Flags: review? → review?(harthur)
Comment 6•14 years ago
|
||
Comment on attachment 481476 [details] [diff] [review] Patch v1 looks good
Attachment #481476 -
Flags: review?(harthur) → review+
Assignee | ||
Comment 7•14 years ago
|
||
Heather, could you also give me feedback for comment 3? That would be great.
Comment 8•14 years ago
|
||
(In reply to comment #3) > And one more thing. Would there be a way to set a module id? I would really > like to replace the MODULE_NAME with module.id, i.e: > > OLD: var MODULE_NAME = 'UtilsAPI'; > New: module.id = 'utils'; > > But there is no global module object in the scope. See > http://wiki.commonjs.org/wiki/Modules/1.1#Sample_Code Right now we're kind of at the mercy of the Jetpack SDK's module loader, though we could hack in better CommonJS support. Right now you can just name the file what you want the module name to be.
Assignee | ||
Comment 9•14 years ago
|
||
(In reply to comment #8) > Right now we're kind of at the mercy of the Jetpack SDK's module loader, though > we could hack in better CommonJS support. Right now you can just name the file > what you want the module name to be. Alright. That would work. Would it be possible to give this bug approval for Mozmill 1.5.1?
Updated•14 years ago
|
Whiteboard: [mozmill-1.5.1?] → [mozmill-1.5.1+]
Assignee | ||
Updated•14 years ago
|
Assignee: nobody → hskupin
Status: NEW → ASSIGNED
Assignee | ||
Comment 10•14 years ago
|
||
Landed as: http://github.com/mozautomation/mozmill/commit/6a93c3e6cd0c0a6cc6f08ce99f6238b90eab1521 (master) http://github.com/mozautomation/mozmill/commit/23676c4fa3ce6001b15c7359d455b3c5a3b9aebc (hotfix-1.5.1)
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Updated•8 years ago
|
Product: Testing → Testing Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•