regexp-unsupported-ncg.js 388 B

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