regexp-unsupported-ncg.js 402 B

123456789101112
  1. 'use strict';
  2. var fails = require('../internals/fails');
  3. var global = require('../internals/global');
  4. // babel-minify and Closure Compiler transpiles RegExp('(?<a>b)', 'g') -> /(?<a>b)/g and it causes SyntaxError
  5. var $RegExp = global.RegExp;
  6. module.exports = fails(function () {
  7. var re = $RegExp('(?<a>b)', 'g');
  8. return re.exec('b').groups.a !== 'b' ||
  9. 'b'.replace(re, '$<a>c') !== 'bc';
  10. });