Skip to content

Commit b1bb7ec

Browse files
committed
Bug 1965844 - Part 3: Don't overwrite a pending exception in Array.prototype.with. r=jandem
Test case in <tc39/test262#4477>. Differential Revision: https://phabricator.services.mozilla.com/D248928
1 parent 8456077 commit b1bb7ec

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

js/src/builtin/Array.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3740,8 +3740,8 @@ static bool array_toSpliced(JSContext* cx, unsigned argc, Value* vp) {
37403740
return true;
37413741
}
37423742

3743-
// https://github.com/tc39/proposal-change-array-by-copy
3744-
// Array.prototype.with()
3743+
// ES2026 draft rev a562082b031d89d00ee667181ce8a6158656bd4b
3744+
// Array.prototype.with ( index, value )
37453745
static bool array_with(JSContext* cx, unsigned argc, Value* vp) {
37463746
AutoJSMethodProfilerEntry pseudoFrame(cx, "Array.prototype", "with");
37473747
CallArgs args = CallArgsFromVp(argc, vp);
@@ -3761,7 +3761,6 @@ static bool array_with(JSContext* cx, unsigned argc, Value* vp) {
37613761
// Step 3. Let relativeIndex be ? ToIntegerOrInfinity(index).
37623762
double relativeIndex;
37633763
if (!ToInteger(cx, args.get(0), &relativeIndex)) {
3764-
JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_BAD_INDEX);
37653764
return false;
37663765
}
37673766

0 commit comments

Comments
 (0)