Commit d1d2addb authored by neis's avatar neis Committed by Commit bot

[runtime] Avoid code duplication in %CreateIterResultObject.

R=jgruber@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2407153003
Cr-Commit-Position: refs/heads/master@{#40243}
parent df1494d6
......@@ -870,11 +870,7 @@ RUNTIME_FUNCTION(Runtime_CreateIterResultObject) {
DCHECK_EQ(2, args.length());
CONVERT_ARG_HANDLE_CHECKED(Object, value, 0);
CONVERT_ARG_HANDLE_CHECKED(Object, done, 1);
Handle<JSObject> result =
isolate->factory()->NewJSObjectFromMap(isolate->iterator_result_map());
result->InObjectPropertyAtPut(JSIteratorResult::kValueIndex, *value);
result->InObjectPropertyAtPut(JSIteratorResult::kDoneIndex, *done);
return *result;
return *isolate->factory()->NewJSIteratorResult(value, done->BooleanValue());
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment