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

Unified Diff: webkit/port/bindings/v8/v8_proxy.cpp

Issue 27326: Isolate exceptions when evaluating javascript code from C++.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 10 months 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/port/bindings/v8/v8_proxy.cpp
===================================================================
--- webkit/port/bindings/v8/v8_proxy.cpp (revision 10695)
+++ webkit/port/bindings/v8/v8_proxy.cpp (working copy)
@@ -1372,7 +1372,15 @@
// and false for <script>doSomething</script>. For some reason, fileName
// gives us this information.
ChromiumBridge::traceEventBegin("v8.run", n, "");
- v8::Local<v8::Value> result = RunScript(script, fileName.isNull());
+ v8::Local<v8::Value> result;
+ {
+ // Isolate exceptions that occur when executing the code. These
+ // exceptions should not interfere with javascript code we might
+ // evaluate from C++ when returning from here
+ v8::TryCatch try_catch;
+ try_catch.SetVerbose(true);
+ result = RunScript(script, fileName.isNull());
+ }
ChromiumBridge::traceEventEnd("v8.run", n, "");
return result;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698