diff options
author | Michaël Zasso <targos@protonmail.com> | 2018-09-21 10:40:42 +0200 |
---|---|---|
committer | Michaël Zasso <targos@protonmail.com> | 2018-09-22 14:29:37 +0200 |
commit | e758d4ab0adf53f2a4b736433714943bc4b4f06f (patch) | |
tree | b350211f3c0999cc30733eea3419d99a18bd44ac /test | |
parent | 36bdd19a6b3aee18143a3d45d6eedc19a2e95189 (diff) | |
download | android-node-v8-e758d4ab0adf53f2a4b736433714943bc4b4f06f.tar.gz android-node-v8-e758d4ab0adf53f2a4b736433714943bc4b4f06f.tar.bz2 android-node-v8-e758d4ab0adf53f2a4b736433714943bc4b4f06f.zip |
doc,test: fix inspect's sorted compare function
In V8 7.0, the array sorting algorithm was changed to Timsort, which
is stable. A compare function returning only `true` or `false`
(converted to 0 and 1) cannot work properly.
PR-URL: https://github.com/nodejs/node/pull/22992
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Kyle Farnung <kfarnung@microsoft.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/parallel/test-util-inspect.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/test/parallel/test-util-inspect.js b/test/parallel/test-util-inspect.js index cd7d08caf0..1d37e97897 100644 --- a/test/parallel/test-util-inspect.js +++ b/test/parallel/test-util-inspect.js @@ -1688,7 +1688,7 @@ assert.strictEqual( assert.strictEqual( inspect( { a200: 4, a100: 1, a102: 3, a101: 2 }, - { sorted(a, b) { return a < b; } } + { sorted(a, b) { return b.localeCompare(a); } } ), '{ a200: 4, a102: 3, a101: 2, a100: 1 }' ); |