Version 1
[yaffs-website] / node_modules / core-js / modules / es6.string.raw.js
diff --git a/node_modules/core-js/modules/es6.string.raw.js b/node_modules/core-js/modules/es6.string.raw.js
new file mode 100644 (file)
index 0000000..1016acf
--- /dev/null
@@ -0,0 +1,18 @@
+var $export   = require('./_export')
+  , toIObject = require('./_to-iobject')
+  , toLength  = require('./_to-length');
+
+$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)
+      , aLen = arguments.length
+      , res  = []
+      , i    = 0;
+    while(len > i){
+      res.push(String(tpl[i++]));
+      if(i < aLen)res.push(String(arguments[i]));
+    } return res.join('');
+  }
+});
\ No newline at end of file