Skip to content
This repository has been archived by the owner on Jun 6, 2019. It is now read-only.

Commit

Permalink
WebWorkers don't have window.
Browse files Browse the repository at this point in the history
Assume `this` is the global object.
  • Loading branch information
fd committed Jul 25, 2014
1 parent bd26fad commit 51ab442
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion url.js
Original file line number Diff line number Diff line change
Expand Up @@ -562,4 +562,4 @@

scope.URL = jURL;

})(window);
})(this);

1 comment on commit 51ab442

@addyosmani
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change LGTM, however note that you're opting for this semantics here (current context) vs self that's typically used to refer to window. This is passing our tests and works in Web Workers regardless.

Please sign in to comment.