summaryrefslogtreecommitdiff
path: root/src/node_modules/es-abstract/2016/ToInt16.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/node_modules/es-abstract/2016/ToInt16.js')
-rw-r--r--src/node_modules/es-abstract/2016/ToInt16.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/node_modules/es-abstract/2016/ToInt16.js b/src/node_modules/es-abstract/2016/ToInt16.js
new file mode 100644
index 0000000..5a112c2
--- /dev/null
+++ b/src/node_modules/es-abstract/2016/ToInt16.js
@@ -0,0 +1,10 @@
+'use strict';
+
+var ToUint16 = require('./ToUint16');
+
+// https://www.ecma-international.org/ecma-262/6.0/#sec-toint16
+
+module.exports = function ToInt16(argument) {
+ var int16bit = ToUint16(argument);
+ return int16bit >= 0x8000 ? int16bit - 0x10000 : int16bit;
+};