Skip to content

es.regexp.sticky feature verification fails #1008

@chenyulun

Description

@chenyulun

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

23423423r34r
1223werw

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions