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

19 lines
537 B
JavaScript
Raw Normal View History

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){
var tpl = toIObject(callSite.raw)
, len = toLength(tpl.length)
, $$ = arguments
, $$len = $$.length
, res = []
, i = 0;
2016-10-10 03:43:44 +02:00
while(len > i){
res.push(String(tpl[i++]));
if(i < $$len)res.push(String($$[i]));
2016-10-10 03:43:44 +02:00
} return res.join('');
}
});