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

Side by Side 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: 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/arguments.h" 7 #include "src/arguments.h"
8 #include "src/frames-inl.h" 8 #include "src/frames-inl.h"
9 #include "src/runtime/runtime-utils.h" 9 #include "src/runtime/runtime-utils.h"
10 10
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 RUNTIME_FUNCTION(RuntimeReference_GeneratorNext) { 216 RUNTIME_FUNCTION(RuntimeReference_GeneratorNext) {
217 UNREACHABLE(); // Optimization disabled in SetUpGenerators(). 217 UNREACHABLE(); // Optimization disabled in SetUpGenerators().
218 return NULL; 218 return NULL;
219 } 219 }
220 220
221 221
222 RUNTIME_FUNCTION(RuntimeReference_GeneratorThrow) { 222 RUNTIME_FUNCTION(RuntimeReference_GeneratorThrow) {
223 UNREACHABLE(); // Optimization disabled in SetUpGenerators(). 223 UNREACHABLE(); // Optimization disabled in SetUpGenerators().
224 return NULL; 224 return NULL;
225 } 225 }
226
227
228 RUNTIME_FUNCTION(Runtime_ThrowIteratorResultNotAnObject) {
arv (Not doing code reviews) 2015/02/23 22:02:24 I wasn't sure if this was the best place to put th
229 HandleScope scope(isolate);
230 DCHECK(args.length() == 1);
231 CONVERT_ARG_HANDLE_CHECKED(Object, value, 0);
232
233 Handle<Object> error_args[] = {value};
234 THROW_NEW_ERROR_RETURN_FAILURE(
235 isolate, NewTypeError("iterator_result_not_an_object",
236 HandleVector(error_args, arraysize(error_args))));
237 }
226 } 238 }
227 } // namespace v8::internal 239 } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698