diff options
author | Florian Dold <florian.dold@gmail.com> | 2017-08-14 05:01:11 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2017-08-14 05:02:09 +0200 |
commit | 363723fc84f7b8477592e0105aeb331ec9a017af (patch) | |
tree | 29f92724f34131bac64d6a318dd7e30612e631c7 /node_modules/core-js/modules/es6.string.from-code-point.js | |
parent | 5634e77ad96bfe1818f6b6ee70b7379652e5487f (diff) |
node_modules
Diffstat (limited to 'node_modules/core-js/modules/es6.string.from-code-point.js')
-rw-r--r-- | node_modules/core-js/modules/es6.string.from-code-point.js | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/node_modules/core-js/modules/es6.string.from-code-point.js b/node_modules/core-js/modules/es6.string.from-code-point.js index c8776d871..bece66e29 100644 --- a/node_modules/core-js/modules/es6.string.from-code-point.js +++ b/node_modules/core-js/modules/es6.string.from-code-point.js @@ -1,23 +1,23 @@ -var $export = require('./_export') - , toIndex = require('./_to-index') - , fromCharCode = String.fromCharCode - , $fromCodePoint = String.fromCodePoint; +var $export = require('./_export'); +var toAbsoluteIndex = require('./_to-absolute-index'); +var fromCharCode = String.fromCharCode; +var $fromCodePoint = String.fromCodePoint; // length should be 1, old FF problem $export($export.S + $export.F * (!!$fromCodePoint && $fromCodePoint.length != 1), 'String', { // 21.1.2.2 String.fromCodePoint(...codePoints) - fromCodePoint: function fromCodePoint(x){ // eslint-disable-line no-unused-vars - var res = [] - , aLen = arguments.length - , i = 0 - , code; - while(aLen > i){ + fromCodePoint: function fromCodePoint(x) { // eslint-disable-line no-unused-vars + var res = []; + var aLen = arguments.length; + var i = 0; + var code; + while (aLen > i) { code = +arguments[i++]; - if(toIndex(code, 0x10ffff) !== code)throw RangeError(code + ' is not a valid code point'); + if (toAbsoluteIndex(code, 0x10ffff) !== code) throw RangeError(code + ' is not a valid code point'); res.push(code < 0x10000 ? fromCharCode(code) : fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00) ); } return res.join(''); } -});
\ No newline at end of file +}); |