Repository navigation
Implement Builtin Iterator.prototype.filter, Iterator.prototype.reduce method - #1454
Conversation
| struct IteratorFilterData : public gc { | ||
| StorePositiveNumberAsOddNumber counter; | ||
| Value predicate; | ||
|
|
||
| IteratorFilterData(Value predicate) |
There was a problem hiding this comment.
This struct looks same as IteratorMapData.
What about reusing the IteratorMapData instead?
(the name of structure needs to be changed too)
There was a problem hiding this comment.
This struct looks same as
IteratorMapData. What about reusing theIteratorMapDatainstead? (the name of structure needs to be changed too)
Is it fine combining two structs into IteratorData struct?
And I'd like to change Value variable name to callback.
There was a problem hiding this comment.
Is it fine combining two structs into IteratorData struct?
no problem!
The name of Value should be redefined accordingly :)
| if (selected.toBoolean()) { | ||
| return std::make_pair(value.value(), false); | ||
| } else { | ||
| return iteratorFilterClosure(state, obj, data); | ||
| } |
There was a problem hiding this comment.
Would you please re-check this part?
It seems that its different from the spec
There was a problem hiding this comment.
Would you please re-check this part? It seems that its different from the spec
Can you tell me which part is exactly matter?
I wonder where is problem part, absence of completion error check or return recursive else part.
There was a problem hiding this comment.
I cannot find the recursive call part in the spec..
| if (selected.toBoolean()) { | ||
| return std::make_pair(value.value(), false); | ||
| } |
There was a problem hiding this comment.
This part seems to be related to the generator feature, but it's not sufficient
we may update it further later on
These commits implement filter, reduce method for javascript iterator.
built-ins/Iterator/prototype/filter/argument-validation-failure-closes-underlying,
built-ins/Iterator/prototype/reduce/argument-validation-failure-closes-underlying
test because other methods which are already implemented also did not remove that test from exclude list.