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

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

Issue 692313003: Allow uncaught exception messaging in Object.observe callbacks. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: addressed Created 6 years, 1 month 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
« no previous file with comments | « src/runtime/runtime.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-observe.cc
diff --git a/src/runtime/runtime-observe.cc b/src/runtime/runtime-observe.cc
index ab7f2503b18655dcc2958248330e17aad10eae61..4579136d9aa8efd1ad5b3f47d5d6e6189d8df674 100644
--- a/src/runtime/runtime-observe.cc
+++ b/src/runtime/runtime-observe.cc
@@ -52,6 +52,28 @@ RUNTIME_FUNCTION(Runtime_RunMicrotasks) {
}
+RUNTIME_FUNCTION(Runtime_DeliverObservationChangeRecords) {
+ HandleScope scope(isolate);
+ DCHECK(args.length() == 2);
+ CONVERT_ARG_HANDLE_CHECKED(JSFunction, callback, 0);
+ CONVERT_ARG_HANDLE_CHECKED(Object, argument, 1);
+ v8::TryCatch catcher;
+ // We should send a message on uncaught exception thrown during
+ // Object.observe delivery while not interrupting further delivery, thus
+ // we make a call inside a verbose TryCatch.
+ catcher.SetVerbose(true);
+ Handle<Object> argv[] = {argument};
+ USE(Execution::Call(isolate, callback, isolate->factory()->undefined_value(),
+ arraysize(argv), argv));
+ if (isolate->has_pending_exception()) {
+ isolate->ReportPendingMessages();
+ isolate->clear_pending_exception();
+ isolate->set_external_caught_exception(false);
+ }
+ return isolate->heap()->undefined_value();
+}
+
+
RUNTIME_FUNCTION(Runtime_GetObservationState) {
SealHandleScope shs(isolate);
DCHECK(args.length() == 0);
« 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