mirror of
https://github.com/Samsung/escargot.git
synced 2026-06-22 10:01:50 +00:00
implement Array.prototype.indexOf, Array.prototype.lastIndexOf
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
This commit is contained in:
parent
61ab2372d2
commit
2057250e48
10 changed files with 196 additions and 28 deletions
|
|
@ -712,8 +712,9 @@ double Object::nextIndexForward(ExecutionState& state, Object* obj, const double
|
|||
return true;
|
||||
}
|
||||
if (index > cur) {
|
||||
ret = index;
|
||||
return false;
|
||||
if (ret > index) {
|
||||
ret = index;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
@ -736,8 +737,9 @@ double Object::nextIndexBackward(ExecutionState& state, Object* obj, const doubl
|
|||
return true;
|
||||
}
|
||||
if (index < cur) {
|
||||
ret = index;
|
||||
return false;
|
||||
if (ret < index) {
|
||||
ret = index;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue