Since bug 1108467 the following test was added to the codebase: assertEq(RegExp.prototype.flags, ""); However, `RegExp.prototype.flags` should throw since it accesses `RegExp.prototype.global` which throws in step 3 of its algorithm (since `R = RegExp.prototype` in this situation): 3. If R does not have an [[OriginalFlags]] internal slot throw a TypeError exception. Consider removing this broken test and behavior.
Since none of the major ECMAScript engines seem to implement the part of the algorithm described above, maybe the spec should be changed. I’ve filed https://bugs.ecmascript.org/show_bug.cgi?id=3432.
See Also: → https://bugs.ecmascript.org/show_bug.cgi?id=3432
A recent amendment of the spec (https://github.com/tc39/ecma262/pull/511) made this bug invalid: now RegExp.prototype.flags should produce "".
Claude is right.
Status: NEW → RESOLVED
Last Resolved: a year ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.