web 3d图形渲染器
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
672 B

  1. var $ = require('../internals/export');
  2. var toIndexedObject = require('../internals/to-indexed-object');
  3. var toLength = require('../internals/to-length');
  4. // `String.raw` method
  5. // https://tc39.es/ecma262/#sec-string.raw
  6. $({ target: 'String', stat: true }, {
  7. raw: function raw(template) {
  8. var rawTemplate = toIndexedObject(template.raw);
  9. var literalSegments = toLength(rawTemplate.length);
  10. var argumentsLength = arguments.length;
  11. var elements = [];
  12. var i = 0;
  13. while (literalSegments > i) {
  14. elements.push(String(rawTemplate[i++]));
  15. if (i < argumentsLength) elements.push(String(arguments[i]));
  16. } return elements.join('');
  17. }
  18. });