Closed Bug 809265 Opened 12 years ago Closed 12 years ago

Update Identity js and jsm modules to use new global object

Categories

(Core Graveyard :: Identity, defect)

defect
Not set
major

Tracking

(blocking-basecamp:+, firefox18 fixed, firefox19 fixed)

RESOLVED FIXED
mozilla19
blocking-basecamp +
Tracking Status
firefox18 --- fixed
firefox19 --- fixed

People

(Reporter: jedp, Assigned: jedp)

References

Details

(Whiteboard: [qa-])

Attachments

(2 files, 1 obsolete file)

Bug 798491 reduces the number of system compartments in the main b2g object by having all JSMs and JS components share a common object.

All Identity modules need to be updated accordingly.


To quote Kyle's announcement explaining the nature of the changes:

Code in Gecko must now set "magic" properties (such as EXPORTED_SYMBOLS, the symbols themselves, and NSGetFactory) on the 'this' object instead of implicitly on the global via 'var', 'let', 'function', 'const', etc

So:

const EXPORTED_SYMBOLS = ["Foo", "Bar"];
let Foo = 3;
function Bar() { dump("hi"); }
var NSGetModule = ...;

becomes

this.EXPORTED_SYMBOLS = ["Foo", "Bar"];
this.Foo = 3;
this.Bar = function Bar() { dump("hi"); }
this.NSGetModule = ...;
Is this blocking issue I saw in IRC that's preventing testing on identity entirely if the identity trusted UI flow is prefed on?
This blocks everything until the Identity code is updated and re-landed, yes.
Attached patch use new global object (obsolete) — Splinter Review
Update identity JSM and JS components for new global object architecture
Attachment #679446 - Flags: review?(benadida)
Replacing previous patch; didn't merge cleanly with m-c, and included a file that shouldn't have been included.
Attachment #679446 - Attachment is obsolete: true
Attachment #679446 - Flags: review?(benadida)
Attachment #679699 - Flags: review?(benadida)
tbpl: https://tbpl.mozilla.org/?tree=Try&rev=4c3a0ce8874b

Note - The try push includes the patch from Bug 809577, which has not yet landed.  This patch ifdefs around gonk-only code when building on desktop.
Comment on attachment 679699 [details] [diff] [review]
use new global object

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

looks great.
Attachment #679699 - Flags: review?(benadida) → review+
No longer blocks: 810139
https://hg.mozilla.org/integration/mozilla-inbound/rev/d4a84844aa40

Jed, can you make sure your future patches have your hg user information and a commit message? Thanks!
https://developer.mozilla.org/en-US/docs/Creating_a_patch_that_can_be_checked_in
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/d4a84844aa40
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla19
Whiteboard: [qa-]
(In reply to Ryan VanderMeulen from comment #8)
> https://hg.mozilla.org/integration/mozilla-inbound/rev/d4a84844aa40
> 
> Jed, can you make sure your future patches have your hg user information and
> a commit message? Thanks!
> https://developer.mozilla.org/en-US/docs/
> Creating_a_patch_that_can_be_checked_in

Sorry about that, Ryan.  Yes, absolutely.
This is marked blocking-basecamp+, but does not apply cleanly to Aurora. Please post a branch-specific patch for uplift.
Whiteboard: [qa-] → [qa-] [needs-aurora-patch]
Whiteboard: [qa-] [needs-aurora-patch] → [qa-] [needs-aurora-patch] [qa-]
Whiteboard: [qa-] [needs-aurora-patch] [qa-] → [qa-] [needs-aurora-patch]
(In reply to Ryan VanderMeulen from comment #11)
> This is marked blocking-basecamp+, but does not apply cleanly to Aurora.
> Please post a branch-specific patch for uplift.

It seems to apply ok once toolkit/identity/IdentityUtils.jsm has been added.  Testing a patch now:

https://tbpl.mozilla.org/?tree=Try&rev=a868799244b9
(In reply to Ryan VanderMeulen from comment #11)
> This is marked blocking-basecamp+, but does not apply cleanly to Aurora.
> Please post a branch-specific patch for uplift.

I think all that was missing was the existence of the file toolkit/identity/IdentityUtils.jsm.  I think Comment #13 has the patch you're looking for.
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.