Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/es-abstract/2019/thisNumberValue.js')
-rw-r--r--node_modules/es-abstract/2019/thisNumberValue.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/node_modules/es-abstract/2019/thisNumberValue.js b/node_modules/es-abstract/2019/thisNumberValue.js
new file mode 100644
index 000000000..0345e523f
--- /dev/null
+++ b/node_modules/es-abstract/2019/thisNumberValue.js
@@ -0,0 +1,18 @@
+'use strict';
+
+var callBound = require('../helpers/callBound');
+
+var Type = require('./Type');
+
+var $NumberValueOf = callBound('Number.prototype.valueOf');
+
+// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-number-prototype-object
+
+module.exports = function thisNumberValue(value) {
+ if (Type(value) === 'Number') {
+ return value;
+ }
+
+ return $NumberValueOf(value);
+};
+