Skip to content

Commit

Permalink
Use self instead of window to support web workers
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Joel committed Sep 8, 2017
1 parent 47e7257 commit 1deb860
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion templates/amdWeb.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
// Browser globals
root.amdWeb = factory(root.b);
}
}(typeof window !== 'undefined' ? window : this, function (b) {
}(typeof self !== 'undefined' ? self : this, function (b) {
// Use b in some fashion.

// Just return a value to define the module export.
Expand Down
2 changes: 1 addition & 1 deletion templates/amdWebGlobal.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
// Browser globals
root.amdWebGlobal = factory(root.b);
}
}(typeof window !== 'undefined' ? window : this, function (b) {
}(typeof self !== 'undefined' ? self : this, function (b) {
// Use b in some fashion.

// Just return a value to define the module export.
Expand Down
2 changes: 1 addition & 1 deletion templates/commonjsStrict.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
// Browser globals
factory((root.commonJsStrict = {}), root.b);
}
}(typeof window !== 'undefined' ? window : this, function (exports, b) {
}(typeof self !== 'undefined' ? self : this, function (exports, b) {
// Use b in some fashion.

// attach properties to the exports object to define
Expand Down
2 changes: 1 addition & 1 deletion templates/commonjsStrictGlobal.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
// Browser globals
factory((root.commonJsStrictGlobal = {}), root.b);
}
}(typeof window !== 'undefined' ? window : this, function (exports, b) {
}(typeof self !== 'undefined' ? self : this, function (exports, b) {
// Use b in some fashion.

// attach properties to the exports object to define
Expand Down
4 changes: 2 additions & 2 deletions templates/returnExports.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
// Browser globals (root is window)
root.returnExports = factory(root.b);
}
}(typeof window !== 'undefined' ? window : this, function (b) {
}(typeof self !== 'undefined' ? self : this, function (b) {
// Use b in some fashion.

// Just return a value to define the module export.
Expand All @@ -51,7 +51,7 @@
// Browser globals (root is window)
root.returnExports = factory();
}
}(typeof window !== 'undefined' ? window : this, function () {
}(typeof self !== 'undefined' ? self : this, function () {

// Just return a value to define the module export.
// This example returns an object, but the module
Expand Down
2 changes: 1 addition & 1 deletion templates/returnExportsGlobal.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
// Browser globals
root.returnExportsGlobal = factory(root.b);
}
}(typeof window !== 'undefined' ? window : this, function (b) {
}(typeof self !== 'undefined' ? self : this, function (b) {
// Use b in some fashion.

// Just return a value to define the module export.
Expand Down

0 comments on commit 1deb860

Please sign in to comment.