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

Side by Side Diff: src/runtime/runtime.cc

Issue 607913002: Report promise reject with no handler (behind a flag). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: more comments Created 6 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « src/runtime/runtime.h ('k') | test/cctest/test-api.cc » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 <stdlib.h> 5 #include <stdlib.h>
6 #include <limits> 6 #include <limits>
7 7
8 #include "src/v8.h" 8 #include "src/v8.h"
9 9
10 #include "src/accessors.h" 10 #include "src/accessors.h"
(...skipping 5323 matching lines...) Expand 10 before | Expand all | Expand 10 after
5334 5334
5335 RUNTIME_FUNCTION(Runtime_DebugPromiseEvent) { 5335 RUNTIME_FUNCTION(Runtime_DebugPromiseEvent) {
5336 DCHECK(args.length() == 1); 5336 DCHECK(args.length() == 1);
5337 HandleScope scope(isolate); 5337 HandleScope scope(isolate);
5338 CONVERT_ARG_HANDLE_CHECKED(JSObject, data, 0); 5338 CONVERT_ARG_HANDLE_CHECKED(JSObject, data, 0);
5339 isolate->debug()->OnPromiseEvent(data); 5339 isolate->debug()->OnPromiseEvent(data);
5340 return isolate->heap()->undefined_value(); 5340 return isolate->heap()->undefined_value();
5341 } 5341 }
5342 5342
5343 5343
5344 RUNTIME_FUNCTION(Runtime_DebugPromiseRejectEvent) { 5344 RUNTIME_FUNCTION(Runtime_PromiseRejectEvent) {
5345 DCHECK(args.length() == 2); 5345 DCHECK(args.length() == 2);
5346 HandleScope scope(isolate); 5346 HandleScope scope(isolate);
5347 CONVERT_ARG_HANDLE_CHECKED(JSObject, promise, 0); 5347 CONVERT_ARG_HANDLE_CHECKED(JSObject, promise, 0);
5348 CONVERT_ARG_HANDLE_CHECKED(Object, value, 1); 5348 CONVERT_ARG_HANDLE_CHECKED(Object, value, 1);
5349 isolate->debug()->OnPromiseReject(promise, value); 5349 // Check whether the promise has been marked as having triggered a message.
5350 Handle<Symbol> key = isolate->factory()->promise_debug_symbol();
5351 Maybe<bool> marked = JSObject::HasOwnProperty(promise, key);
5352 DCHECK(marked.has_value);
5353 if (!marked.value) {
5354 isolate->debug()->OnPromiseReject(promise, value);
5355 isolate->ReportPromiseReject(promise, value, NULL);
5356 }
5350 return isolate->heap()->undefined_value(); 5357 return isolate->heap()->undefined_value();
5351 } 5358 }
5352 5359
5353 5360
5354 RUNTIME_FUNCTION(Runtime_DebugAsyncTaskEvent) { 5361 RUNTIME_FUNCTION(Runtime_DebugAsyncTaskEvent) {
5355 DCHECK(args.length() == 1); 5362 DCHECK(args.length() == 1);
5356 HandleScope scope(isolate); 5363 HandleScope scope(isolate);
5357 CONVERT_ARG_HANDLE_CHECKED(JSObject, data, 0); 5364 CONVERT_ARG_HANDLE_CHECKED(JSObject, data, 0);
5358 isolate->debug()->OnAsyncTaskEvent(data); 5365 isolate->debug()->OnAsyncTaskEvent(data);
5359 return isolate->heap()->undefined_value(); 5366 return isolate->heap()->undefined_value();
(...skipping 9212 matching lines...) Expand 10 before | Expand all | Expand 10 after
14572 } 14579 }
14573 return NULL; 14580 return NULL;
14574 } 14581 }
14575 14582
14576 14583
14577 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { 14584 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) {
14578 return &(kIntrinsicFunctions[static_cast<int>(id)]); 14585 return &(kIntrinsicFunctions[static_cast<int>(id)]);
14579 } 14586 }
14580 } 14587 }
14581 } // namespace v8::internal 14588 } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/runtime/runtime.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698