Mark S. Miller (2015-06-13T06:21:56.000Z)
Good idea bug infinite recursion bug. Fixed:

  function re(first, ...args) {
    let flags = first;
    function tag(template, ...subs) {
      const parts = [];
      const numSubs = subs.length;
      for (let i = 0; i < numSubs; i++) {
        parts.push(template.raw[i]);
        parts.push(subs[i].replace(/[\/\\^$*+?.()|[\]{}]/g, '\\$&'));
      }
      parts.push(template.raw[numSubs]);
      return RegExp(parts.join(''), flags);
    }
    if (typeof first === 'string') {
      return tag;
    } else {
      flags = void 0;  // Should this be '' ?
      return tag(first, ...args);
    }
  }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20150612/200646db/attachment-0001.html>
d at domenic.me (2015-06-16T16:53:42.410Z)
Good idea bug infinite recursion bug. Fixed:

```js
  function re(first, ...args) {
    let flags = first;
    function tag(template, ...subs) {
      const parts = [];
      const numSubs = subs.length;
      for (let i = 0; i < numSubs; i++) {
        parts.push(template.raw[i]);
        parts.push(subs[i].replace(/[\/\\^$*+?.()|[\]{}]/g, '\\$&'));
      }
      parts.push(template.raw[numSubs]);
      return RegExp(parts.join(''), flags);
    }
    if (typeof first === 'string') {
      return tag;
    } else {
      flags = void 0;  // Should this be '' ?
      return tag(first, ...args);
    }
  }
```