source: trip-planner-front/node_modules/core-js/modules/es.string.raw.js@ b738035

Last change on this file since b738035 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 726 bytes
Line 
1var $ = require('../internals/export');
2var toIndexedObject = require('../internals/to-indexed-object');
3var toLength = require('../internals/to-length');
4var toString = require('../internals/to-string');
5
6// `String.raw` method
7// https://tc39.es/ecma262/#sec-string.raw
8$({ target: 'String', stat: true }, {
9 raw: function raw(template) {
10 var rawTemplate = toIndexedObject(template.raw);
11 var literalSegments = toLength(rawTemplate.length);
12 var argumentsLength = arguments.length;
13 var elements = [];
14 var i = 0;
15 while (literalSegments > i) {
16 elements.push(toString(rawTemplate[i++]));
17 if (i < argumentsLength) elements.push(toString(arguments[i]));
18 } return elements.join('');
19 }
20});
Note: See TracBrowser for help on using the repository browser.