You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
861 B
32 lines
861 B
4 weeks ago
|
'use strict';
|
||
|
var fails = require('../internals/fails');
|
||
|
var globalThis = require('../internals/global-this');
|
||
|
|
||
|
// babel-minify and Closure Compiler transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
|
||
|
var $RegExp = globalThis.RegExp;
|
||
|
|
||
|
var UNSUPPORTED_Y = fails(function () {
|
||
|
var re = $RegExp('a', 'y');
|
||
|
re.lastIndex = 2;
|
||
|
return re.exec('abcd') !== null;
|
||
|
});
|
||
|
|
||
|
// UC Browser bug
|
||
|
// https://github.com/zloirock/core-js/issues/1008
|
||
|
var MISSED_STICKY = UNSUPPORTED_Y || fails(function () {
|
||
|
return !$RegExp('a', 'y').sticky;
|
||
|
});
|
||
|
|
||
|
var BROKEN_CARET = UNSUPPORTED_Y || fails(function () {
|
||
|
// https://bugzilla.mozilla.org/show_bug.cgi?id=773687
|
||
|
var re = $RegExp('^r', 'gy');
|
||
|
re.lastIndex = 2;
|
||
|
return re.exec('str') !== null;
|
||
|
});
|
||
|
|
||
|
module.exports = {
|
||
|
BROKEN_CARET: BROKEN_CARET,
|
||
|
MISSED_STICKY: MISSED_STICKY,
|
||
|
UNSUPPORTED_Y: UNSUPPORTED_Y
|
||
|
};
|