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

Side by Side Diff: src/runtime/runtime-internal.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: add strings and move runtime function Created 5 years, 9 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
« no previous file with comments | « src/runtime/runtime.h ('k') | test/mjsunit/es6/iteration-semantics.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/bootstrapper.h" 8 #include "src/bootstrapper.h"
9 #include "src/debug.h" 9 #include "src/debug.h"
10 #include "src/messages.h" 10 #include "src/messages.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 48
49 RUNTIME_FUNCTION(Runtime_ThrowReferenceError) { 49 RUNTIME_FUNCTION(Runtime_ThrowReferenceError) {
50 HandleScope scope(isolate); 50 HandleScope scope(isolate);
51 DCHECK(args.length() == 1); 51 DCHECK(args.length() == 1);
52 CONVERT_ARG_HANDLE_CHECKED(Object, name, 0); 52 CONVERT_ARG_HANDLE_CHECKED(Object, name, 0);
53 THROW_NEW_ERROR_RETURN_FAILURE( 53 THROW_NEW_ERROR_RETURN_FAILURE(
54 isolate, NewReferenceError("not_defined", HandleVector(&name, 1))); 54 isolate, NewReferenceError("not_defined", HandleVector(&name, 1)));
55 } 55 }
56 56
57 57
58 RUNTIME_FUNCTION(Runtime_ThrowIteratorResultNotAnObject) {
59 HandleScope scope(isolate);
60 DCHECK(args.length() == 1);
61 CONVERT_ARG_HANDLE_CHECKED(Object, value, 0);
62 THROW_NEW_ERROR_RETURN_FAILURE(
63 isolate,
64 NewTypeError("iterator_result_not_an_object", HandleVector(&value, 1)));
65 }
66
67
58 RUNTIME_FUNCTION(Runtime_PromiseRejectEvent) { 68 RUNTIME_FUNCTION(Runtime_PromiseRejectEvent) {
59 DCHECK(args.length() == 3); 69 DCHECK(args.length() == 3);
60 HandleScope scope(isolate); 70 HandleScope scope(isolate);
61 CONVERT_ARG_HANDLE_CHECKED(JSObject, promise, 0); 71 CONVERT_ARG_HANDLE_CHECKED(JSObject, promise, 0);
62 CONVERT_ARG_HANDLE_CHECKED(Object, value, 1); 72 CONVERT_ARG_HANDLE_CHECKED(Object, value, 1);
63 CONVERT_BOOLEAN_ARG_CHECKED(debug_event, 2); 73 CONVERT_BOOLEAN_ARG_CHECKED(debug_event, 2);
64 if (debug_event) isolate->debug()->OnPromiseReject(promise, value); 74 if (debug_event) isolate->debug()->OnPromiseReject(promise, value);
65 Handle<Symbol> key = isolate->factory()->promise_has_handler_symbol(); 75 Handle<Symbol> key = isolate->factory()->promise_has_handler_symbol();
66 // Do not report if we actually have a handler. 76 // Do not report if we actually have a handler.
67 if (JSObject::GetDataProperty(promise, key)->IsUndefined()) { 77 if (JSObject::GetDataProperty(promise, key)->IsUndefined()) {
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 316
307 RUNTIME_FUNCTION(RuntimeReference_GetFromCache) { 317 RUNTIME_FUNCTION(RuntimeReference_GetFromCache) {
308 HandleScope scope(isolate); 318 HandleScope scope(isolate);
309 DCHECK(args.length() == 2); 319 DCHECK(args.length() == 2);
310 CONVERT_SMI_ARG_CHECKED(id, 0); 320 CONVERT_SMI_ARG_CHECKED(id, 0);
311 args[0] = isolate->native_context()->jsfunction_result_caches()->get(id); 321 args[0] = isolate->native_context()->jsfunction_result_caches()->get(id);
312 return __RT_impl_Runtime_GetFromCache(args, isolate); 322 return __RT_impl_Runtime_GetFromCache(args, isolate);
313 } 323 }
314 } 324 }
315 } // namespace v8::internal 325 } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/runtime/runtime.h ('k') | test/mjsunit/es6/iteration-semantics.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698