Ensure _.toInteger can return -0.

This commit is contained in:
John-David Dalton
2015-10-21 22:04:14 -07:00
parent 1513e46605
commit 5ec6f1085a
2 changed files with 12 additions and 3 deletions

View File

@@ -19063,6 +19063,12 @@
assert.strictEqual(_.toInteger(Infinity), MAX_INTEGER);
assert.strictEqual(_.toInteger(-Infinity), -MAX_INTEGER);
});
QUnit.test('should not coerce `-0` to `0`', function(assert) {
assert.expect(1);
assert.strictEqual(1 / _.toInteger(-0), -Infinity);
});
}());
/*--------------------------------------------------------------------------*/