Skip to content
This repository has been archived by the owner on May 30, 2023. It is now read-only.

PhantomJS array.sort different with chrome #15173

Closed
c-zhuo opened this issue Oct 26, 2017 · 1 comment
Closed

PhantomJS array.sort different with chrome #15173

c-zhuo opened this issue Oct 26, 2017 · 1 comment
Labels

Comments

@c-zhuo
Copy link

c-zhuo commented Oct 26, 2017

  1. Which version of PhantomJS are you using? Tip: run phantomjs --version.
    2.1.1

  2. What steps will reproduce the problem?
    JSON.stringify(
    [
    {a: 1,b: 1},
    {a: 2,b: 1},
    {a: 3,b: 1}
    ].sort(
    function (i,j) {
    return i.b > j.b ? 1 : -1;
    }
    )
    )

in PhantomJS 2.1.1
"[{"a":3,"b":1},{"a":2,"b":1},{"a":1,"b":1}]"

in Chrome
"[{"a":1,"b":1},{"a":2,"b":1},{"a":3,"b":1}]"

  1. Which operating system are you using?
    Mac OS X 10.10.5

  2. Did you use binary PhantomJS or did you compile it from source?
    binary

  3. Please provide any additional information below.
    if change the compare function to
    if (i.b===j.b) return 0; return i.b > j.b ? 1 : -1
    the result is the same.
    so, maybe this is not a REAL problem?

@stale stale bot added the stale label Dec 26, 2019
@stale
Copy link

stale bot commented Dec 29, 2019

Due to our very limited maintenance capacity, we need to prioritize our development focus on other tasks. Therefore, this issue will be automatically closed (see #15395 for more details). In the future, if we see the need to attend to this issue again, then it will be reopened. Thank you for your contribution!

@stale stale bot closed this as completed Dec 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant