Array sort with comparator works with remote debugging on but doesn't work with it off #21428
Closed
3 tasks
Labels
Resolution: Locked
This issue was locked by the bot.
Environment
React Native Environment Info:
System:
OS: Windows 7
CPU: x64 Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz
Memory: 18.15 GB / 31.89 GB
Binaries:
Yarn: yarn install v0.21.3
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
info "fsevents@1.2.4" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
Done in 58.85s. - ~\AppData\Roaming\npm\yarn.CMD
npm: 5.4.2 - C:\Program Files\nodejs\npm.CMD
IDEs:
Android Studio: Version 3.2.0.0 AI-181.5540.7.32.5014246
I am running RN 0.57
Description
It seems if you are running on an android device, I've tested on the emulator and my physical devices and you call sort on an array with a comparator function ie:
const a = [4,6,2,3]; a.sort((a, b) => a > b); Alert.alert(a.join(','))
If you are remote debugging, it'll run correctly and output 2,3,4,6
However, if you are not remote debugging, it'll output 4,6,2,3
Reproducible Demo
In any react native project, make a button and in the callback have it run something like
const a = [4,6,2,3]; a.sort((a, b) => a > b); Alert.alert(a.join(','))
The text was updated successfully, but these errors were encountered: