[Webkit-unassigned] [Bug 272206] New: Need to call flags and unicode getters in RegExp.prototype[Symbol.match]

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Apr 4 20:56:44 PDT 2024


            Bug ID: 272206
           Summary: Need to call flags and unicode getters in
           Product: WebKit
           Version: WebKit Local Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: JavaScriptCore
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: aosukeke at gmail.com

According to the spec[1], RegExp.prototype[Symbol.match] calls the flags getter and the unicode getter.
However, the current implementation does not work that way. This causes some test262 test cases to fail:

- test/built-ins/RegExp/prototype/Symbol.match/flags-tostring-error.js
- test/built-ins/RegExp/prototype/Symbol.match/get-flags-err.js
- test/built-ins/RegExp/prototype/Symbol.match/get-unicode-error.js

[1]: https://tc39.es/ecma262/#sec-regexp.prototype-@@match

function shouldBe(actual, expected) {
    if (actual !== expected)
        throw new Error('bad value: ' + actual);

const re = /./;

let flagsCount = 0;
let unicodeCount = 0;

Object.defineProperties(re, {
    flags: {
        get() {
            return '';
    unicode: {
        get() {
            return false;

for (let i = 0; i < 1e3; i++) {
shouldBe(flagsCount, 1e3);
shouldBe(unicodeCount, 1e3);

You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20240405/9b81e14c/attachment.htm>

More information about the webkit-unassigned mailing list