Closed
Bug 1109577
Opened 11 years ago
Closed 9 years ago
Accessing `RegExp.prototype.flags` directly should throw
Categories
(Core :: JavaScript: Standard Library, defect)
Tracking
()
RESOLVED
INVALID
People
(Reporter: mathias, Unassigned)
References
Details
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.
Reporter | ||
Comment 2•11 years ago
|
||
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.
Reporter | ||
Updated•11 years ago
|
See Also: → https://bugs.ecmascript.org/show_bug.cgi?id=3432
Comment 3•9 years ago
|
||
A recent amendment of the spec (https://github.com/tc39/ecma262/pull/511) made this bug invalid: now RegExp.prototype.flags should produce "".
Comment 4•9 years ago
|
||
Claude is right.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → INVALID
You need to log in
before you can comment on or make changes to this bug.
Description
•