Skip to content

Commit

Permalink
Use consistent quote marks.
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Oct 16, 2014
1 parent ff9198f commit 0e7a01a
Show file tree
Hide file tree
Showing 11 changed files with 81 additions and 81 deletions.
36 changes: 18 additions & 18 deletions es6-shim.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
function Type() {}
Type.prototype = prototype;
var object = new Type();
if (typeof properties !== "undefined") {
if (typeof properties !== 'undefined') {
defineProperties(object, properties);
}
return object;
Expand Down Expand Up @@ -228,7 +228,7 @@
GetIterator: function (o) {
if (isArguments(o)) {
// special case support for `arguments`
return new ArrayIterator(o, "value");
return new ArrayIterator(o, 'value');
}
var it = o[$iterator$]();
if (!ES.TypeIsObject(it)) {
Expand Down Expand Up @@ -542,9 +542,9 @@
defineProperties(String.prototype, {
trim: function () {
if (this === undefined || this === null) {
throw new TypeError("can't convert " + this + " to object");
throw new TypeError("can't convert " + this + ' to object');
}
return String(this).replace(trimRegexp, "");
return String(this).replace(trimRegexp, '');
}
});
}
Expand Down Expand Up @@ -674,11 +674,11 @@
for (; i < len; i++) {
var kind = this.kind;
var retval;
if (kind === "key") {
if (kind === 'key') {
retval = i;
} else if (kind === "value") {
} else if (kind === 'value') {
retval = array[i];
} else if (kind === "entry") {
} else if (kind === 'entry') {
retval = [i, array[i]];
}
this.i = i + 1;
Expand Down Expand Up @@ -767,15 +767,15 @@
},

keys: function () {
return new ArrayIterator(this, "key");
return new ArrayIterator(this, 'key');
},

values: function () {
return new ArrayIterator(this, "value");
return new ArrayIterator(this, 'value');
},

entries: function () {
return new ArrayIterator(this, "entry");
return new ArrayIterator(this, 'entry');
}
};
// Safari 7.1 defines Array#keys and Array#entries natively,
Expand Down Expand Up @@ -1200,10 +1200,10 @@
makeZeroTimeout = function () {
// from http://dbaron.org/log/20100309-faster-timeouts
var timeouts = [];
var messageName = "zero-timeout-message";
var messageName = 'zero-timeout-message';
var setZeroTimeout = function (fn) {
timeouts.push(fn);
window.postMessage(messageName, "*");
window.postMessage(messageName, '*');
};
var handleMessage = function (event) {
if (event.source == window && event.data == messageName) {
Expand All @@ -1213,7 +1213,7 @@
fn();
}
};
window.addEventListener("message", handleMessage, true);
window.addEventListener('message', handleMessage, true);
return setZeroTimeout;
};
}
Expand Down Expand Up @@ -1589,9 +1589,9 @@
while (i.next !== head) {
i = i.next;
if (!i.isRemoved()) {
if (kind === "key") {
if (kind === 'key') {
result = i.key;
} else if (kind === "value") {
} else if (kind === 'value') {
result = i.value;
} else {
result = [i.key, i.value];
Expand Down Expand Up @@ -1764,15 +1764,15 @@
},

keys: function () {
return new MapIterator(this, "key");
return new MapIterator(this, 'key');
},

values: function () {
return new MapIterator(this, "value");
return new MapIterator(this, 'value');
},

entries: function () {
return new MapIterator(this, "key+value");
return new MapIterator(this, 'key+value');
},

forEach: function (callback) {
Expand Down
18 changes: 9 additions & 9 deletions test/collections.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Assertion.addMethod('theSameSet', function (otherArray) {

this.assert(
diff.length === 0,
"expected #{this} to be equal to #{exp} (as sets, i.e. no order)",
'expected #{this} to be equal to #{exp} (as sets, i.e. no order)',
array,
otherArray
);
Expand Down Expand Up @@ -355,7 +355,7 @@ describe('Collections', function () {
result.push(String(1/key) + ' ' + value);
});
expect(result.join(', ')).to.equal(
"Infinity a, Infinity c, 1 b"
'Infinity a, Infinity c, 1 b'
);
});
});
Expand All @@ -382,9 +382,9 @@ describe('Collections', function () {
var keys = [];
var iterator = map.keys();
keys.push(iterator.next().value);
map["delete"]('a');
map["delete"]('b');
map["delete"]('c');
map['delete']('a');
map['delete']('b');
map['delete']('c');
map.set('e');
keys.push(iterator.next().value);
keys.push(iterator.next().value);
Expand All @@ -405,9 +405,9 @@ describe('Collections', function () {
var keys = [];
var iterator = set.keys();
keys.push(iterator.next().value);
set["delete"]('a');
set["delete"]('b');
set["delete"]('c');
set['delete']('a');
set['delete']('b');
set['delete']('c');
set.add('e');
keys.push(iterator.next().value);
keys.push(iterator.next().value);
Expand Down Expand Up @@ -755,7 +755,7 @@ describe('Collections', function () {
result.push(String(1/key));
});
expect(result.join(', ')).to.equal(
"Infinity, Infinity, 1"
'Infinity, Infinity, 1'
);
});
});
Expand Down
32 changes: 16 additions & 16 deletions test/promise/all.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ var failIfThrows = function (done) {
return function (e) { done(e || new Error()); };
};

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

Promise.all(iterable).then(function (value) {
Expand All @@ -16,7 +16,7 @@ describe("Promise.all", function () {
}).then(done, failIfThrows(done));
});

it("fulfills if passed an empty array-like", function (done) {
it('fulfills if passed an empty array-like', function (done) {
var f = function () {
Promise.all(arguments).then(function (value) {
assert(Array.isArray(value));
Expand All @@ -26,7 +26,7 @@ describe("Promise.all", function () {
f();
});

it("fulfills if passed an array of mixed fulfilled promises and values", function (done) {
it('fulfills if passed an array of mixed fulfilled promises and values', function (done) {
var iterable = [0, Promise.resolve(1), 2, Promise.resolve(3)];

Promise.all(iterable).then(function (value) {
Expand All @@ -35,24 +35,24 @@ describe("Promise.all", function () {
}).then(done, failIfThrows(done));
});

it("rejects if any passed promise is rejected", function (done) {
it('rejects if any passed promise is rejected', function (done) {
var foreverPending = new Promise(function () { });
var error = new Error("Rejected");
var error = new Error('Rejected');
var rejected = Promise.reject(error);

var iterable = [foreverPending, rejected];

Promise.all(iterable).then(
function (value) {
assert(false, "should never get here");
assert(false, 'should never get here');
},
function (reason) {
assert.strictEqual(reason, error);
}
).then(done, failIfThrows(done));
});

it("resolves foreign thenables", function (done) {
it('resolves foreign thenables', function (done) {
var normal = Promise.resolve(1);
var foreign = { then: function (f) { f(2); } };

Expand All @@ -63,15 +63,15 @@ describe("Promise.all", function () {
}).then(done, failIfThrows(done));
});

it("fulfills when passed an sparse array, giving `undefined` for the omitted values", function (done) {
it('fulfills when passed an sparse array, giving `undefined` for the omitted values', function (done) {
var iterable = [Promise.resolve(0), , , Promise.resolve(1)];

Promise.all(iterable).then(function (value) {
assert.deepEqual(value, [0, undefined, undefined, 1]);
}).then(done, failIfThrows(done));
});

it("does not modify the input array", function (done) {
it('does not modify the input array', function (done) {
var input = [0, 1];
var iterable = input;

Expand All @@ -81,12 +81,12 @@ describe("Promise.all", function () {
});


it("should reject with a TypeError if given a non-iterable", function (done) {
it('should reject with a TypeError if given a non-iterable', function (done) {
var notIterable = {};

Promise.all(notIterable).then(
function () {
assert(false, "should never get here");
assert(false, 'should never get here');
},
function (reason) {
assert(reason instanceof TypeError);
Expand All @@ -105,14 +105,14 @@ describe("Promise.all", function () {
});
};

it("should be robust against tampering (1)", function (done) {
it('should be robust against tampering (1)', function (done) {
var g = [ tamper(Promise.resolve(0)) ];
// Prevent countdownHolder.[[Countdown]] from ever reaching zero
Promise.all(g).
then(function () { done(); }, failIfThrows(done));
});

it("should be robust against tampering (2)", function (done) {
it('should be robust against tampering (2)', function (done) {
var g = [
Promise.resolve(0),
tamper(Promise.resolve(1)),
Expand All @@ -132,7 +132,7 @@ describe("Promise.all", function () {
then(done, failIfThrows(done));
});

it("should be robust against tampering (3)", function (done) {
it('should be robust against tampering (3)', function (done) {
var g = [
Promise.resolve(0),
tamper(Promise.resolve(1)),
Expand All @@ -147,7 +147,7 @@ describe("Promise.all", function () {
}).then(done, failIfThrows(done));
});

it("should be robust against tampering (4)", function (done) {
it('should be robust against tampering (4)', function (done) {
var hijack = true;
var actualArguments = [];
var P = function (resolver) {
Expand Down
4 changes: 2 additions & 2 deletions test/promise/evil-promises.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*global describe, specify, assert */

describe("Evil promises should not be able to break invariants", function () {
describe('Evil promises should not be able to break invariants', function () {
'use strict';
specify("resolving to a promise that calls onFulfilled twice", function (done) {
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.
var EvilPromise = function (executor) { Promise.call(this, executor); };
Expand Down
4 changes: 2 additions & 2 deletions test/promise/promises-aplus.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

// tests from promises-aplus-tests

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

require("promises-aplus-tests").mocha({
require('promises-aplus-tests').mocha({
// an adapter from es6 spec to Promises/A+
deferred: function () {
var result = {};
Expand Down
6 changes: 3 additions & 3 deletions test/promise/promises-es6.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

// tests from promises-es6-tests
(function () {
"use strict";
'use strict';

describe("Promises/ES6 Tests", function () {
describe('Promises/ES6 Tests', function () {

// an adapter that sets up global.Promise
// since it's already set up, empty functions will suffice
Expand All @@ -15,7 +15,7 @@
}
};

require("promises-es6-tests").mocha(adapter);
require('promises-es6-tests').mocha(adapter);
});

}());

0 comments on commit 0e7a01a

Please sign in to comment.