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