2017-04-20 03:09:25 +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-04-20 03:09:25 +02:00
|
|
|
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++]));
|
2017-04-20 03:09:25 +02:00
|
|
|
if(i < $$len)res.push(String($$[i]));
|
2016-10-10 03:43:44 +02:00
|
|
|
} return res.join('');
|
|
|
|
}
|
|
|
|
});
|