Skip to content

Commit

Permalink
Fix spec in case strict mode is not supported.
Browse files Browse the repository at this point in the history
  • Loading branch information
rkatic committed Jan 31, 2013
1 parent e1d07a5 commit fa67a27
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions spec/q-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ if (typeof Q === "undefined" && typeof require !== "undefined") {

var REASON = "this is not an error, but it might show up in the console";

var global = this;

var STRICT_MODE_CAPABLE = (function(){
"use strict";
return !this;
})();

afterEach(function () {
Q.onerror = null;
});
Expand Down Expand Up @@ -406,7 +413,7 @@ describe("progress", function () {
deferred.promise,
function () {
expect(progressed).toBe(true);
expect(progressContext).toBe(undefined);
expect(progressContext).toBe(STRICT_MODE_CAPABLE ? undefined : global);
},
function () {
expect(true).toBe(false);
Expand Down Expand Up @@ -2080,4 +2087,3 @@ describe("possible regressions", function () {
});

});

0 comments on commit fa67a27

Please sign in to comment.