Skip to content

Commit b4a3a28

Browse files
committed
fix: handle queries with setter that converts value to Number instance
Fix #8150
1 parent 67f8512 commit b4a3a28

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/cast/number.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ module.exports = function castNumber(val) {
2929

3030
assert.ok(!isNaN(val));
3131
if (val instanceof Number) {
32-
return val;
32+
return val.valueOf();
3333
}
3434
if (typeof val === 'number') {
3535
return val;
@@ -38,7 +38,7 @@ module.exports = function castNumber(val) {
3838
return Number(val.valueOf());
3939
}
4040
if (val.toString && !Array.isArray(val) && val.toString() == Number(val)) {
41-
return new Number(val);
41+
return Number(val);
4242
}
4343

4444
assert.ok(false);

0 commit comments

Comments
 (0)