implement Array.prototype.indexOf, Array.prototype.lastIndexOf

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
This commit is contained in:
seonghyun kim 2017-01-04 14:41:57 +09:00
commit 2057250e48
10 changed files with 196 additions and 28 deletions

View file

@ -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;