Comparing version 1.3.0 to 1.4.0
@@ -1,3 +0,6 @@ | ||
<!-- vim:ts=4:sts=4:sw=4:et:tw=70 --> | ||
## 1.4.0 | ||
- Add `noConflict` support for use in `<script>` (@jahnjw). | ||
## 1.3.0 | ||
@@ -4,0 +7,0 @@ |
{ | ||
"name": "q", | ||
"version": "1.3.0", | ||
"version": "1.4.0", | ||
"description": "A library for promises (CommonJS/Promises/A,B,D)", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/kriskowal/q", |
14
q.js
@@ -59,4 +59,14 @@ // vim:ts=4:sts=4:sw=4: | ||
} else if (typeof self !== "undefined") { | ||
// Get the `window` object, save the previous Q global | ||
// and initialize Q as a global. | ||
var previousQ = self.Q; | ||
self.Q = definition(); | ||
// Add a noConflict function so Q can be removed from the | ||
// global namespace. | ||
self.Q.noConflict = function () { | ||
self.Q = previousQ; | ||
return this; | ||
}; | ||
} else { | ||
@@ -2026,2 +2036,6 @@ throw new Error("This environment was not anticipated by Q. Please file a bug."); | ||
Q.noConflict = function() { | ||
throw new Error("Q.noConflict only works when Q is used as a global"); | ||
}; | ||
// All code before this point will be filtered from stack traces. | ||
@@ -2028,0 +2042,0 @@ var qEndingLine = captureLine(); |
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
121580
1852