Comparing version 1.4.0 to 1.4.1
## 1.4.1 | ||
- Address an issue that prevented Q from being used as a `<script>` for | ||
Firefox add-ons. Q can now be used in any environment that provides `window` | ||
or `self` globals, favoring `window` since add-ons have an an immutable | ||
`self` that is distinct from `window`. | ||
## 1.4.0 | ||
@@ -3,0 +10,0 @@ |
{ | ||
"name": "q", | ||
"version": "1.4.0", | ||
"version": "1.4.1", | ||
"description": "A library for promises (CommonJS/Promises/A,B,D)", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/kriskowal/q", |
14
q.js
@@ -58,12 +58,16 @@ // vim:ts=4:sts=4:sw=4: | ||
// <script> | ||
} else if (typeof self !== "undefined") { | ||
} else if (typeof window !== "undefined" || typeof self !== "undefined") { | ||
// Prefer window over self for add-on scripts. Use self for | ||
// non-windowed contexts. | ||
var global = typeof window !== "undefined" ? window : self; | ||
// Get the `window` object, save the previous Q global | ||
// and initialize Q as a global. | ||
var previousQ = self.Q; | ||
self.Q = definition(); | ||
var previousQ = global.Q; | ||
global.Q = definition(); | ||
// Add a noConflict function so Q can be removed from the | ||
// global namespace. | ||
self.Q.noConflict = function () { | ||
self.Q = previousQ; | ||
global.Q.noConflict = function () { | ||
global.Q = previousQ; | ||
return this; | ||
@@ -70,0 +74,0 @@ }; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
122073
1855