Chromium Code Reviews| 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, |