You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implementing these should fix most of the remaining test262 tests with feature array-find-from-last.
Example code
// From test/built-ins/TypedArray/prototype/findLastIndex/return-index-predicate-result-is-true.jsvarsample=newInt32Array([39,3,9]);varcalled=0;varresult=sample.findLastIndex(function(){called++;returntrue;});assert.sameValue(result,2,"returned true on sample[2]");assert.sameValue(called,1,"predicate was called once");
The text was updated successfully, but these errors were encountered:
At some point the spec changed to use FindViaPredicate ( O, len, direction, predicate, thisArg ) for Array.prototype.find, Array.prototype.findLast, %TypedArray%.prototype.findLast, et al. Do we want to refactor the existing implementations to use this?
If so, where would be a good place to add this? Under built-ins/array/mod.rs as a pub(crate) fn find_via_predicate? I don't have any experience with Rust modules yet, so a bit unsure what the way to go would be.
At some point the spec changed to use FindViaPredicate ( O, len, direction, predicate, thisArg ) for Array.prototype.find, Array.prototype.findLast, %TypedArray%.prototype.findLast, et al. Do we want to refactor the existing implementations to use this?
Yes, that would be optimal, This could be done In a separate PR.
If so, where would be a good place to add this? Under built-ins/array/mod.rs as a pub(crate) fn find_via_predicate? I don't have any experience with Rust modules yet, so a bit unsure what the way to go would be.
Yes, that's a good place :) , I usually put the helper fuctions based where it is defined in the spec then by frequency of use, since they are both used equally. array module is best.
ECMASCript feature
Implement missing
%TypedArray%.prototype.findLast ( predicate [ , thisArg ] )
andArray.prototype.findLastIndex ( predicate [ , thisArg ] )
features.Implementing these should fix most of the remaining test262 tests with feature
array-find-from-last
.Example code
The text was updated successfully, but these errors were encountered: