Array.prototype.find icon indicating copy to clipboard operation
Array.prototype.find copied to clipboard

Using tests from test262

Open juandopazo opened this issue 11 years ago • 6 comments

Hi!

Here are some changes based on the latest spec changes:

  • Array operations no longer use ToUint32. Instead, they use ToLength which makes much more sense.
  • Uncallable predicates must throw even when the array is empty.

juandopazo avatar Dec 10 '14 01:12 juandopazo

Can the test262 tests not be brought in as an npm dependency rather than a hardcoded file?

Also, please feel free to look at the es6-shim implementation and verify if it needs any corrections, since you're freshly informed on it.

ljharb avatar Dec 10 '14 02:12 ljharb

@ljharb I wish we could! Test262 is not based on Mocha. I just wrote a thin wrapper and modified a couple of tests to make it work in Mocha+Node.

juandopazo avatar Dec 10 '14 02:12 juandopazo

ping @bterlson @smikes for another use case for npm-runnable test262 tests :-)

ljharb avatar Dec 10 '14 02:12 ljharb

What is needed from bterlson/test262-harness to make it work for this project?

bterlson avatar Dec 10 '14 04:12 bterlson

The changes to the implementation have been applied in master:

Array operations no longer use ToUint32. Instead, they use ToLength which makes much more sense. -- https://github.com/paulmillr/Array.prototype.find/blob/master/implementation.js#L8 Uncallable predicates must throw even when the array is empty. -- https://github.com/paulmillr/Array.prototype.find/blob/master/implementation.js#L9

JakeChampion avatar Jan 19 '16 22:01 JakeChampion

@juandopazo would you mind freshly rebasing this on top of master so it can be reconsidered?

ljharb avatar Jan 31 '16 22:01 ljharb