wallet-core/node_modules/core-js/modules/es6.string.raw.js

18 lines
516 B
JavaScript
Raw Normal View History

2017-05-27 17:36:13 +02:00
var $export = require('./_export')
, toIObject = require('./_to-iobject')
, toLength = require('./_to-length');
2016-10-10 03:43:44 +02:00
$export($export.S, 'String', {
// 21.1.2.4 String.raw(callSite, ...substitutions)
raw: function raw(callSite){
2017-05-27 17:36:13 +02:00
var tpl = toIObject(callSite.raw)
, len = toLength(tpl.length)
, aLen = arguments.length
, res = []
, i = 0;
2016-10-10 03:43:44 +02:00
while(len > i){
res.push(String(tpl[i++]));
2017-05-27 17:36:13 +02:00
if(i < aLen)res.push(String(arguments[i]));
2016-10-10 03:43:44 +02:00
} return res.join('');
}
});