Open Bug 1670485 Opened 4 years ago Updated 1 year ago

Compartment/realm handling for various RegExp annex B functions/accessor functions appears to be wrong

Categories

(Core :: JavaScript Engine, defect, P3)

defect

Tracking

()

People

(Reporter: Waldo, Unassigned)

References

(Blocks 1 open bug)

Details

Updating test262 hits a bunch of new test failures for /foo/.compile and various RegExp.<prop> accessors. Filing to get a bug number to cite when updating...

Blocks: test262

anba notes these tests are for the legacy-regexp feature, and for now at least (after bug 1670504 lands) we can just mark it as unsupported, so in some sense these are no longer failures (in that we won't have to list them in jstests.list manually).

Severity: -- → S4
Priority: -- → P3

I was looking into this and have a spec question. For something like get RegExp.prototype.dotAll, step 3.a. says:

a. If SameValue(R, %RegExp.prototype%) is true, return undefined.

Is that condition only true if R (this) is equal to the same-realm %RegExp.prototype%?

(In reply to Tom Schuster [:evilpie] from comment #2)

Is that condition only true if R (this) is equal to the same-realm %RegExp.prototype%?

Yes. From https://tc39.es/ecma262/#sec-well-known-intrinsic-objects:

Within this specification a reference such as %name% means the intrinsic object, associated with the current realm, corresponding to the name.

I was a bit off-track in my previous comments. This is about the test introduced by #2650. This for the Legacy RegExp features in JavaScript proposal. These are for "static" getters like RegExp.lastMatch. I opened bug 1675240 for the RegExp.prototype getters.

You need to log in before you can comment on or make changes to this bug.