Closed Bug 903273 Opened 11 years ago Closed 11 years ago

[Session Restore] Use strict mode

Categories

(Firefox :: Session Restore, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 26

People

(Reporter: ttaubert, Assigned: ttaubert)

Details

Attachments

(1 file)

Strict mode FTW. That should help us catch silly mistakes a little earlier.
Attachment #787955 - Flags: review?(smacleod) → review+
https://hg.mozilla.org/mozilla-central/rev/742a0082788f
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 26
Comment on attachment 787955 [details] [diff] [review]
Use strict mode in SessionStore files

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

::: browser/components/sessionstore/src/SessionStore.jsm
@@ +881,5 @@
> +      aWindow.removeEventListener("load", onload);
> +      this.onLoad(aWindow);
> +    };
> +
> +    aWindow.addEventListener("load", onload);

Just fyi: this can also be

aWindow.addEventListener("load", function onload(aEvent) {
  //                                      ^^^^^^
  aWindow.removeEventListener("load", onload);
  // ...
}
(In reply to :Ms2ger from comment #4)
> Just fyi: this can also be
> 
> aWindow.addEventListener("load", function onload(aEvent) {
>   //                                      ^^^^^^
>   aWindow.removeEventListener("load", onload);
>   // ...
> }

Well then I'd either have to '.bind(this)' and save that to a variable or do a 'let self = this' and call self.onLoad().
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: