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

Unified Diff: gin/runner.cc

Issue 120043008: Add a simple one shot and repeating timer API for Mojo.js. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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 | « gin/modules/timer_unittest.cc ('k') | gin/shell/gin_main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gin/runner.cc
diff --git a/gin/runner.cc b/gin/runner.cc
index 37e16a09c748ae1c33bf963d22729e4061b99860..d2dda36c8ff2315fb4b9f82789bbd6a8ce1000c7 100644
--- a/gin/runner.cc
+++ b/gin/runner.cc
@@ -37,6 +37,7 @@ void RunnerDelegate::DidRunScript(Runner* runner) {
}
void RunnerDelegate::UnhandledException(Runner* runner, TryCatch& try_catch) {
+ CHECK(false) << try_catch.GetStackTrace();
Aaron Boodman 2013/12/21 01:44:30 This seems like a better default behavior than wha
}
Runner::Runner(RunnerDelegate* delegate, Isolate* isolate)
@@ -59,8 +60,12 @@ Runner::~Runner() {
}
void Runner::Run(const std::string& source, const std::string& resource_name) {
+ TryCatch try_catch;
Run(Script::New(StringToV8(isolate(), source),
StringToV8(isolate(), resource_name)));
+ if (try_catch.HasCaught()) {
+ delegate_->UnhandledException(this, try_catch);
+ }
}
void Runner::Run(v8::Handle<Script> script) {
@@ -70,8 +75,9 @@ void Runner::Run(v8::Handle<Script> script) {
script->Run();
delegate_->DidRunScript(this);
- if (try_catch.HasCaught())
+ if (try_catch.HasCaught()) {
delegate_->UnhandledException(this, try_catch);
+ }
}
v8::Handle<v8::Value> Runner::Call(v8::Handle<v8::Function> function,
« no previous file with comments | « gin/modules/timer_unittest.cc ('k') | gin/shell/gin_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698