Closed Bug 691682 Opened 13 years ago Closed 9 years ago

Investigate RegExp.prototype.compile compatibility with data properties

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: cdleary, Unassigned)

Details

I think I remember Waldo talking about this a while back, and I'm wondering about it in this work I'm doing. The regexp flag slots are non-configurable non-writable, but RegExp.prototype.compile will swap out the regexp guts, so the behavior observed through execution won't be consistent with the flag property values.

Waldo, did you find anything definitive here?
So, for our current data point of interest, tests/js1_2/regexp/compile.js creates an empty-pattern |new RegExp()|, then runs |.compile(nonEmptyPattern)| on it, and expects the object's source attribute to be the |nonEmptyPattern|. This implies that we need to change the non-configurable non-writable data properties of the regexp behind the user's back for backwards compatibility.
For reference, the original attempt to remove it was bug 623435 and, sadly, bug 630284 happened.
Assignee: general → nobody
Regular expressions flags are now represented as accessor properties (bug 886976), so this is no longer an issue. Basically TC39 gave in and accepted RegExp.prototype.compile because of web compatibility, but to fix the problem described in comment #0, the flags are now accessors. 

Resolving as Won't Fix.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.