aboutsummaryrefslogtreecommitdiff
path: root/node_modules/core-js/internals/this-number-value.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/core-js/internals/this-number-value.js')
-rw-r--r--node_modules/core-js/internals/this-number-value.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/node_modules/core-js/internals/this-number-value.js b/node_modules/core-js/internals/this-number-value.js
new file mode 100644
index 0000000..7734b32
--- /dev/null
+++ b/node_modules/core-js/internals/this-number-value.js
@@ -0,0 +1,10 @@
+var classof = require('../internals/classof-raw');
+
+// `thisNumberValue` abstract operation
+// https://tc39.github.io/ecma262/#sec-thisnumbervalue
+module.exports = function (value) {
+ if (typeof value != 'number' && classof(value) != 'Number') {
+ throw TypeError('Incorrect invocation');
+ }
+ return +value;
+};