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

Unified Diff: gin/runner.cc

Issue 114883003: Implement more of the JavaScript GL API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: asdf 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/file_module_provider.cc ('k') | mojo/apps/js/bindings/codec.js » ('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..d1ac4aa1f841854276b33ae9c140fa1a5498c763 100644
--- a/gin/runner.cc
+++ b/gin/runner.cc
@@ -59,8 +59,15 @@ Runner::~Runner() {
}
void Runner::Run(const std::string& source, const std::string& resource_name) {
- Run(Script::New(StringToV8(isolate(), source),
- StringToV8(isolate(), resource_name)));
+ TryCatch try_catch;
+ v8::Handle<Script> script = Script::New(StringToV8(isolate(), source),
+ StringToV8(isolate(), resource_name));
+ if (try_catch.HasCaught()) {
+ delegate_->UnhandledException(this, try_catch);
+ return;
+ }
+
+ Run(script);
}
void Runner::Run(v8::Handle<Script> script) {
@@ -84,8 +91,9 @@ v8::Handle<v8::Value> Runner::Call(v8::Handle<v8::Function> function,
v8::Handle<v8::Value> result = function->Call(receiver, argc, argv);
delegate_->DidRunScript(this);
- if (try_catch.HasCaught())
+ if (try_catch.HasCaught()) {
delegate_->UnhandledException(this, try_catch);
+ }
return result;
}
« no previous file with comments | « gin/modules/file_module_provider.cc ('k') | mojo/apps/js/bindings/codec.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698