Version 1
[yaffs-website] / node_modules / core-js / library / modules / es6.string.raw.js
1 var $export   = require('./_export')
2   , toIObject = require('./_to-iobject')
3   , toLength  = require('./_to-length');
4
5 $export($export.S, 'String', {
6   // 21.1.2.4 String.raw(callSite, ...substitutions)
7   raw: function raw(callSite){
8     var tpl  = toIObject(callSite.raw)
9       , len  = toLength(tpl.length)
10       , aLen = arguments.length
11       , res  = []
12       , i    = 0;
13     while(len > i){
14       res.push(String(tpl[i++]));
15       if(i < aLen)res.push(String(arguments[i]));
16     } return res.join('');
17   }
18 });