Skip to content

Commit

Permalink
Safety net for unanticipated environments
Browse files Browse the repository at this point in the history
  • Loading branch information
kriskowal committed Nov 10, 2014
1 parent 51de2e3 commit bc0dd84
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions q.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@
*/

(function (definition) {
// Turn off strict mode for this function so we can assign to global.Q
/* jshint strict: false */
"use strict";

// This file will function properly as a <script> tag, or a module
// using CommonJS and NodeJS or RequireJS module formats. In
Expand Down Expand Up @@ -56,8 +55,11 @@
}

// <script>
} else {
} else if (typeof window !== "undefined") {
window.Q = Q = definition();

} else {
throw new Error("This environment was not anticiapted by Q. Please file a bug.");
}

})(function () {
Expand Down

0 comments on commit bc0dd84

Please sign in to comment.