Skip to content

Commit

Permalink
Remove Number type coercion.
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Jul 25, 2015
1 parent 648d002 commit 481295d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
3 changes: 1 addition & 2 deletions index.js
@@ -1,7 +1,6 @@
'use strict';

module.exports = function isNegativeZero(value) {
var number = Number(value);
module.exports = function isNegativeZero(number) {
return number === 0 && (1 / number) === -Infinity;
};

6 changes: 0 additions & 6 deletions test.js
Expand Up @@ -21,12 +21,6 @@ test('not negative zero', function (t) {
t.end();
});

test('things whose valueOf is negative zero', function (t) {
t.ok(isNegativeZero({ valueOf: function () { return -0; } }), 'object with valueOf of negative zero is negative zero');
t.ok(isNegativeZero('-0'), 'string negative zero is negative zero');
t.end();
});

test('negative zero', function (t) {
t.ok(isNegativeZero(-0), 'negative zero is negative zero');
t.end();
Expand Down

0 comments on commit 481295d

Please sign in to comment.