Skip to content

Commit

Permalink
simplify thisNumberValue
Browse files Browse the repository at this point in the history
  • Loading branch information
zloirock committed Sep 2, 2021
1 parent c526e7a commit f562bc0
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions packages/core-js/internals/this-number-value.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
var classof = require('../internals/classof-raw');
var valueOf = 1.0.valueOf;

// `thisNumberValue` abstract operation
// https://tc39.es/ecma262/#sec-thisnumbervalue
module.exports = function (value) {
if (typeof value != 'number' && classof(value) != 'Number') {
throw TypeError('Incorrect invocation');
}
return +value;
return valueOf.call(value);
};

0 comments on commit f562bc0

Please sign in to comment.