13 lines
402 B
JavaScript
13 lines
402 B
JavaScript
|
'use strict';
|
||
|
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';
|
||
|
});
|