ThisNumberValue.js 329 B

123456789101112131415
  1. 'use strict';
  2. var callBound = require('call-bind/callBound');
  3. var $NumberValueOf = callBound('Number.prototype.valueOf');
  4. // https://262.ecma-international.org/15.0/#sec-thisnumbervalue
  5. module.exports = function ThisNumberValue(value) {
  6. if (typeof value === 'number') {
  7. return value;
  8. }
  9. return $NumberValueOf(value);
  10. };