Skip to content

Commit

Permalink
builtins/array: clarify sort perf unspecness
Browse files Browse the repository at this point in the history
  • Loading branch information
CanadaHonk committed Jun 7, 2024
1 parent c7d8775 commit 592cabd
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions compiler/builtins/array.ts
Original file line number Diff line number Diff line change
Expand Up @@ -388,9 +388,12 @@ export const __Array_prototype_sort = (_this: any[], callbackFn: any) => {
else {
// 4. If comparefn is not undefined, then
// a. Let v be ? ToNumber(? Call(comparefn, undefined, « x, y »)).
// perf: unneeded as we just check >= 0
// v = Number(callbackFn(x, y));
v = callbackFn(x, y);

// b. If v is NaN, return +0𝔽.
// perf: unneeded as we just check >= 0
// if (Number.isNaN(v)) v = 0;

// c. Return v.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "porffor",
"description": "a basic experimental wip aot optimizing js -> wasm engine/compiler/runtime in js",
"version": "0.18.8+024a81666",
"version": "0.18.10+c0227b1a9",
"author": "CanadaHonk",
"license": "MIT",
"scripts": {},
Expand Down
2 changes: 1 addition & 1 deletion runner/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env node
import fs from 'node:fs';
globalThis.version = '0.18.8+024a81666';
globalThis.version = '0.18.10+c0227b1a9';

// deno compat
if (typeof process === 'undefined' && typeof Deno !== 'undefined') {
Expand Down
2 changes: 1 addition & 1 deletion test262/history.json

Large diffs are not rendered by default.

0 comments on commit 592cabd

Please sign in to comment.