Browse files

capitalization fixes

  • Loading branch information...
1 parent c9d2720 commit 1a3c9d1c907bf909d0f0d077fb23be597cea5900 @davidchambers davidchambers committed Feb 1, 2014
Showing with 30 additions and 30 deletions.
  1. +1 −1 index.html
  2. +4 −4 test/collections.js
  3. +21 −21 test/objects.js
  4. +1 −1 test/utility.js
  5. +3 −3 underscore.js
View
2 index.html
@@ -1153,7 +1153,7 @@ <h2 id="functions">Function (uh, ahem) Functions</h2>
Creates a version of the function that can only be called one time.
Repeated calls to the modified function will have no effect, returning
the value from the original call. Useful for initialization functions,
- instead of having to set a boolean flag and then check it later.
+ instead of having to set a Boolean flag and then check it later.
</p>
<pre>
var initialize = _.once(createApplication);
View
8 test/collections.js
@@ -195,8 +195,8 @@
ok(!_.all([true, false, true], _.identity), 'one false value');
ok(_.all([0, 10, 28], function(num){ return num % 2 == 0; }), 'even numbers');
ok(!_.all([0, 11, 28], function(num){ return num % 2 == 0; }), 'an odd number');
- ok(_.all([1], _.identity) === true, 'cast to boolean - true');
- ok(_.all([0], _.identity) === false, 'cast to boolean - false');
+ ok(_.all([1], _.identity) === true, 'cast to Boolean - true');
+ ok(_.all([0], _.identity) === false, 'cast to Boolean - false');
ok(_.every([true, true, true], _.identity), 'aliased as "every"');
ok(!_.all([undefined, undefined, undefined], _.identity), 'works with arrays of undefined');
});
@@ -211,8 +211,8 @@
ok(!_.any([null, 0, '', false]), 'falsy values');
ok(!_.any([1, 11, 29], function(num){ return num % 2 == 0; }), 'all odd numbers');
ok(_.any([1, 10, 29], function(num){ return num % 2 == 0; }), 'an even number');
- ok(_.any([1], _.identity) === true, 'cast to boolean - true');
- ok(_.any([0], _.identity) === false, 'cast to boolean - false');
+ ok(_.any([1], _.identity) === true, 'cast to Boolean - true');
+ ok(_.any([0], _.identity) === false, 'cast to Boolean - false');
ok(_.some([false, false, true]), 'aliased as "some"');
Array.prototype.some = nativeSome;
});
View
42 test/objects.js
@@ -176,19 +176,19 @@
ok(!_.isEqual(Infinity, NaN), '`Infinity` is not equal to `NaN`');
// Boolean object and primitive comparisons.
- ok(_.isEqual(true, true), 'Identical boolean primitives are equal');
+ ok(_.isEqual(true, true), 'Identical Boolean primitives are equal');
ok(_.isEqual(new Boolean, new Boolean), 'Boolean objects with identical primitive values are equal');
ok(_.isEqual(true, new Boolean(true)), 'Boolean primitives and their corresponding object wrappers are equal');
- ok(_.isEqual(new Boolean(true), true), 'Commutative equality is implemented for booleans');
+ ok(_.isEqual(new Boolean(true), true), 'Commutative equality is implemented for Booleans');
ok(!_.isEqual(new Boolean(true), new Boolean), 'Boolean objects with different primitive values are not equal');
// Common type coercions.
- ok(!_.isEqual(true, new Boolean(false)), 'Boolean objects are not equal to the boolean primitive `true`');
+ ok(!_.isEqual(true, new Boolean(false)), 'Boolean objects are not equal to the Boolean primitive `true`');
ok(!_.isEqual('75', 75), 'String and number primitives with like values are not equal');
ok(!_.isEqual(new Number(63), new String(63)), 'String and number objects with like values are not equal');
ok(!_.isEqual(75, '75'), 'Commutative equality is implemented for like string and number values');
ok(!_.isEqual(0, ''), 'Number and string primitives with like values are not equal');
- ok(!_.isEqual(1, true), 'Number and boolean primitives with like values are not equal');
+ ok(!_.isEqual(1, true), 'Number and Boolean primitives with like values are not equal');
ok(!_.isEqual(new Boolean(false), new Number(0)), 'Boolean and number objects with like values are not equal');
ok(!_.isEqual(false, new String('')), 'Boolean primitives and string objects with like values are not equal');
ok(!_.isEqual(12564504e5, new Date(2009, 9, 25)), 'Dates and their corresponding numeric primitive values are not equal');
@@ -441,7 +441,7 @@
ok(!_.isObject(undefined), 'and not undefined');
ok(!_.isObject('string'), 'and not string');
ok(!_.isObject(12), 'and not number');
- ok(!_.isObject(true), 'and not boolean');
+ ok(!_.isObject(true), 'and not Boolean');
ok(_.isObject(new String('string')), 'but new String()');
});
@@ -473,14 +473,14 @@
});
test('isBoolean', function() {
- ok(!_.isBoolean(2), 'a number is not a boolean');
- ok(!_.isBoolean('string'), 'a string is not a boolean');
- ok(!_.isBoolean('false'), 'the string "false" is not a boolean');
- ok(!_.isBoolean('true'), 'the string "true" is not a boolean');
- ok(!_.isBoolean(arguments), 'the arguments object is not a boolean');
- ok(!_.isBoolean(undefined), 'undefined is not a boolean');
- ok(!_.isBoolean(NaN), 'NaN is not a boolean');
- ok(!_.isBoolean(null), 'null is not a boolean');
+ ok(!_.isBoolean(2), 'a number is not a Boolean');
+ ok(!_.isBoolean('string'), 'a string is not a Boolean');
+ ok(!_.isBoolean('false'), 'the string "false" is not a Boolean');
+ ok(!_.isBoolean('true'), 'the string "true" is not a Boolean');
+ ok(!_.isBoolean(arguments), 'the arguments object is not a Boolean');
+ ok(!_.isBoolean(undefined), 'undefined is not a Boolean');
+ ok(!_.isBoolean(NaN), 'NaN is not a Boolean');
+ ok(!_.isBoolean(null), 'null is not a Boolean');
ok(_.isBoolean(true), 'but true is');
ok(_.isBoolean(false), 'and so is false');
ok(_.isBoolean(iBoolean), 'even from another frame');
@@ -509,19 +509,19 @@
});
test('isFinite', function() {
- ok(!_.isFinite(undefined), 'undefined is not Finite');
- ok(!_.isFinite(null), 'null is not Finite');
- ok(!_.isFinite(NaN), 'NaN is not Finite');
- ok(!_.isFinite(Infinity), 'Infinity is not Finite');
- ok(!_.isFinite(-Infinity), '-Infinity is not Finite');
+ ok(!_.isFinite(undefined), 'undefined is not finite');
+ ok(!_.isFinite(null), 'null is not finite');
+ ok(!_.isFinite(NaN), 'NaN is not finite');
+ ok(!_.isFinite(Infinity), 'Infinity is not finite');
+ ok(!_.isFinite(-Infinity), '-Infinity is not finite');
ok(_.isFinite('12'), 'Numeric strings are numbers');
ok(!_.isFinite('1a'), 'Non numeric strings are not numbers');
ok(!_.isFinite(''), 'Empty strings are not numbers');
var obj = new Number(5);
ok(_.isFinite(obj), 'Number instances can be finite');
- ok(_.isFinite(0), '0 is Finite');
- ok(_.isFinite(123), 'Ints are Finite');
- ok(_.isFinite(-12.44), 'Floats are Finite');
+ ok(_.isFinite(0), '0 is finite');
+ ok(_.isFinite(123), 'Ints are finite');
+ ok(_.isFinite(-12.44), 'Floats are finite');
});
test('isNaN', function() {
View
2 test/utility.js
@@ -124,7 +124,7 @@
var escapedCharsInJavascriptTemplate = _.template('<ul><% _.each(numbers.split("\\n"), function(item) { %><li><%= item %></li><% }) %></ul>');
result = escapedCharsInJavascriptTemplate({numbers: 'one\ntwo\nthree\nfour'});
- equal(result, '<ul><li>one</li><li>two</li><li>three</li><li>four</li></ul>', 'Can use escaped characters (e.g. \\n) in Javascript');
+ equal(result, '<ul><li>one</li><li>two</li><li>three</li><li>four</li></ul>', 'Can use escaped characters (e.g. \\n) in JavaScript');
var namespaceCollisionTemplate = _.template('<%= pageCount %> <%= thumbnails[pageCount] %> <% _.each(thumbnails, function(p) { %><div class="thumbnail" rel="<%= p %>"></div><% }); %>');
result = namespaceCollisionTemplate({
View
6 underscore.js
@@ -914,7 +914,7 @@
var className = toString.call(a);
if (className != toString.call(b)) return false;
switch (className) {
- // Strings, numbers, dates, and booleans are compared by value.
+ // Strings, numbers, dates, and Booleans are compared by value.
case '[object String]':
// Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is
// equivalent to `new String("5")`.
@@ -925,7 +925,7 @@
return a != +a ? b != +b : (a == 0 ? 1 / a == 1 / b : a == +b);
case '[object Date]':
case '[object Boolean]':
- // Coerce dates and booleans to numeric primitive values. Dates are compared by their
+ // Coerce dates and Booleans to numeric primitive values. Dates are compared by their
// millisecond representations. Note that invalid dates with millisecond representations
// of `NaN` are not equivalent.
return +a == +b;
@@ -1054,7 +1054,7 @@
return _.isNumber(obj) && obj != +obj;
};
- // Is a given value a boolean?
+ // Is a given value a Boolean?
_.isBoolean = function(obj) {
return obj === true || obj === false || toString.call(obj) == '[object Boolean]';
};

0 comments on commit 1a3c9d1

Please sign in to comment.