Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(116)

Unified Diff: src/runtime/runtime-generator.cc

Issue 929733003: for-of should throw if result object is not an object (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix some comments Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/runtime/runtime-generator.cc
diff --git a/src/runtime/runtime-generator.cc b/src/runtime/runtime-generator.cc
index ff07acd304a235a4b78d684ffd1bdbe726ee1688..c7a1b33c69cd2a2967cb82bc750b8993157903a8 100644
--- a/src/runtime/runtime-generator.cc
+++ b/src/runtime/runtime-generator.cc
@@ -223,5 +223,17 @@ RUNTIME_FUNCTION(RuntimeReference_GeneratorThrow) {
UNREACHABLE(); // Optimization disabled in SetUpGenerators().
return NULL;
}
+
+
+RUNTIME_FUNCTION(Runtime_ThrowIteratorResultNotAnObject) {
adamk 2015/02/23 22:17:11 Can you put this up before the two RuntimeReferenc
arv (Not doing code reviews) 2015/02/23 22:26:09 That is clearly better. My q was more about whic
adamk 2015/02/23 22:35:35 I think the set of runtime-foo.cc files is pretty
arv (Not doing code reviews) 2015/02/23 22:51:54 Moved to runtime-internal.cc which has ThrowRefere
+ HandleScope scope(isolate);
+ DCHECK(args.length() == 1);
+ CONVERT_ARG_HANDLE_CHECKED(Object, value, 0);
+
+ Handle<Object> error_args[] = {value};
+ THROW_NEW_ERROR_RETURN_FAILURE(
+ isolate, NewTypeError("iterator_result_not_an_object",
+ HandleVector(error_args, arraysize(error_args))));
+}
}
} // namespace v8::internal

Powered by Google App Engine
This is Rietveld 408576698