RegExp.prototype[@@replace] needs to call ToLength(lastIndex) for non-global regexp opt

RESOLVED DUPLICATE of bug 1343375

Status

()

RESOLVED DUPLICATE of bug 1343375
2 years ago
2 years ago

People

(Reporter: anba, Unassigned)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(firefox54 affected)

Details

(Reporter)

Description

2 years ago
Test case:
---
var r = /a/;
r.lastIndex = {
    valueOf() {
        print("HI");
        return 0;
    }
};
r[Symbol.replace]("");
---

Expected: Prints "HI"
Actual: Doesn't print "HI"
(Reporter)

Comment 1

2 years ago
Will fix as part of bug 1343375.
Status: NEW → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1343375
You need to log in before you can comment on or make changes to this bug.