-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Description
es.regexp.sticky
ua: Mozilla/5.0 (Linux; U; Android 11; zh-CN; M2102K1AC Build/RKQ1.201112.002) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/57.0.2987.108 UCBrowser/12.5.5.1035 Mobile Safari/537.36
'es.regexp.sticky': function () {
return new RegExp('a', 'y').sticky === true; // false
}
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky
But the examples on the website can pass the test
{
'es.regexp.sticky': function () {
return new RegExp('a', 'y').sticky === true; // false
}
}
```js
{
'es.regexp.sticky': function () {
// return new RegExp('a', 'y').sticky === true;
var str = '#foo#';
var regex = /foo/y;
regex.lastIndex = 1;
var flag1 = regex.test(str)
regex.lastIndex = 5;
return !regex.test(str) && flag1; // true
}
}
by the way: In this browser,
es.regexp.constructor
:
var re1 = /a/g;
RegExp(re1, 'i') == '/a/i' // false
The full core-JS patch is still not supported
Metadata
Metadata
Assignees
Labels
No labels