Skip to content

Commit

Permalink
Use the function form of "use strict".
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Oct 16, 2014
1 parent 2fa9260 commit d13035e
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 6 deletions.
3 changes: 2 additions & 1 deletion test/promise/all.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
"use strict";
/*global it, describe, assert */

var failIfThrows = function (done) {
'use strict';
return function (e) { done(e || new Error()); };
};

describe("Promise.all", function () {
'use strict';
it("fulfills if passed an empty array", function (done) {
var iterable = [];

Expand Down
2 changes: 1 addition & 1 deletion test/promise/evil-promises.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use strict";
/*global describe, specify, assert */

describe("Evil promises should not be able to break invariants", function () {
'use strict';
specify("resolving to a promise that calls onFulfilled twice", function (done) {
// note that we have to create a trivial subclass, as otherwise the
// Promise.resolve(evilPromise) is just the identity function.
Expand Down
3 changes: 2 additions & 1 deletion test/promise/promises-aplus.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
/*global describe, require */

// tests from promises-aplus-tests
"use strict";

describe("Promises/A+ Tests", function () {
'use strict';

require("promises-aplus-tests").mocha({
// an adapter from es6 spec to Promises/A+
deferred: function () {
Expand Down
4 changes: 3 additions & 1 deletion test/promise/race.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
"use strict";
/*global describe, it, setTimeout, assert */

var failIfThrows = function (done) {
'use strict';
return function (e) { done(e || new Error()); };
};

var delayPromise = function (value, ms) {
'use strict';
return new Promise(function (resolve) {
setTimeout(function () {
resolve(value);
Expand All @@ -14,6 +15,7 @@ var delayPromise = function (value, ms) {
};

describe("Promise.race", function () {
'use strict';
it("should fulfill if all promises are settled and the ordinally-first is fulfilled", function (done) {
var iterable = [Promise.resolve(1), Promise.reject(2), Promise.resolve(3)];

Expand Down
3 changes: 2 additions & 1 deletion test/promise/simple.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
"use strict";
/*global describe, specify, assert */


var failIfThrows = function (done) {
'use strict';
return function (e) { done(e || new Error()); };
};

describe("Promise", function () {
'use strict';

specify("sanity check: a fulfilled promise calls its fulfillment handler", function (done) {
Promise.resolve(5).then(function (value) {
Expand Down
2 changes: 1 addition & 1 deletion test/promise/subclass.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use strict";
/*global it, describe */

describe("Support user subclassing of Promise", function () {
'use strict';
it("should work if you do it right", function (done) {
// This is the "correct" es6-compatible way; see gh #170
// (Thanks, @domenic!)
Expand Down

0 comments on commit d13035e

Please sign in to comment.