Chromium Code Reviews| Index: src/runtime/runtime-observe.cc |
| diff --git a/src/runtime/runtime-observe.cc b/src/runtime/runtime-observe.cc |
| index ab7f2503b18655dcc2958248330e17aad10eae61..b434b22c56906cb574a083a4ed654a44842ac232 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 happenned during |
|
Yang
2014/11/03 12:31:35
s/happenned/thrown/
|
| + // 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); |