aswi2020vldc-gitlab/templetes/node_modules/es-abstract/2016/thisNumberValue.js @ 0b434236
1 | 3a515b92 | cagy | 'use strict'; |
---|---|---|---|
2 | |||
3 | var callBound = require('../helpers/callBound'); |
||
4 | |||
5 | var Type = require('./Type'); |
||
6 | |||
7 | var $NumberValueOf = callBound('Number.prototype.valueOf'); |
||
8 | |||
9 | // https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-number-prototype-object
|
||
10 | |||
11 | module.exports = function thisNumberValue(value) { |
||
12 | if (Type(value) === 'Number') { |
||
13 | return value; |
||
14 | }
|
||
15 | |||
16 | return $NumberValueOf(value); |
||
17 | };
|