Ensure _.toNumber works with symbol objects without a valueOf method.

This commit is contained in:
John-David Dalton
2016-03-05 16:16:49 -08:00
parent 19a8b3886e
commit 7eba5a2221
2 changed files with 13 additions and 4 deletions

View File

@@ -21990,7 +21990,15 @@
assert.expect(1);
if (Symbol) {
assert.deepEqual(func(symbol), isToNumber ? NaN : 0);
var object1 = Object(symbol),
object2 = Object(symbol),
values = [symbol, object1, object2],
expected = lodashStable.map(values, lodashStable.constant(isToNumber ? NaN : 0));
object2.valueOf = undefined;
var actual = lodashStable.map(values, func);
assert.deepEqual(actual, expected);
}
else {
skipAssert(assert);