Skip to content

Commit

Permalink
Bug 1781061 - Part 1: Add missing callContentFunction in sort. r=jandem
Browse files Browse the repository at this point in the history
  • Loading branch information
arai-a committed Aug 4, 2022
1 parent 2b6cd60 commit c6ffb07
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion js/src/builtin/Array.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ function SortArray(obj, comparefn) {
}

/* Step 4.a. */
var v = ToNumber(wrappedCompareFn(x, y));
var v = ToNumber(callContentFunction(wrappedCompareFn, undefined, x, y));

/* Step 4.b-c. */
return v !== v ? 0 : v;
Expand Down
5 changes: 4 additions & 1 deletion js/src/jit-test/tests/debug/Object-isSameNative.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,8 @@ dbg.onNativeCall = (callee, reason) => {
for (let i = 0; i < 5; i++) {
rv.length = 0;
gdbg.executeInGlobal(`f()`);
assertEqArray(rv, ["print", "print", "push", "sort"]);
assertEqArray(rv, [
"print", "print", "push",
"sort", "print", "print",
]);
}

0 comments on commit c6ffb07

Please sign in to comment.