nodejs / node-chakracore

Node.js on ChakraCore :sparkles::turtle::rocket::sparkles:
Other
1.92k stars 342 forks source link

test: update property order for ChakraCore #585

Closed kfarnung closed 6 years ago

kfarnung commented 6 years ago
Checklist
kfarnung commented 6 years ago

CI: https://ci.nodejs.org/job/chakracore-test-pull-request/305/

MSLaguana commented 6 years ago

The unfortunate answer as to "why do we care about order of enumeration" is that we don't, but node does in a number of implicit ways. These are just some tests that demand this ordering, but there are other tests which are disabled at the moment because node assumes that the "length" property of an array comes before any non-index properties of the array, which isn't true of chakracore at the moment.

kfarnung commented 6 years ago

@boingoing In this case it's just because of the stringification behavior that Node uses.

There is a behavior that they take a dependency on for arrays, they expect the order to be:

  1. Indexed properties
  2. length
  3. All other named properties

They use this to differentiate "hidden" properties from the array members. Since ChakraCore always places length at the end, they consider all properties prior to be indicies in the array.

EDIT: What @MSLaguana said 👍

kfarnung commented 6 years ago

The linter failure appears to have come from master, I'll open a separate PR to deal with those.

MSLaguana commented 6 years ago

Ah, sorry about that >.<