Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: jni/jsEngine.cpp

Issue 9570024: ABP/Android Fix crash on unescaped uri (Closed)
Patch Set: Created March 6, 2013, 2:55 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/org/adblockplus/android/AdblockPlus.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: jni/jsEngine.cpp
===================================================================
--- a/jni/jsEngine.cpp
+++ b/jni/jsEngine.cpp
@@ -164,7 +164,16 @@
const std::string script = getString(pEnv, pScript);
v8::Handle<v8::String> source = v8::String::New(script.c_str(), script.size());
- v8::Handle<v8::Script> compiledScript = v8::Script::Compile(source);
+ v8::Handle<v8::Script> compiledScript;
+ {
+ v8::TryCatch try_catch;
Felix Dahlke 2013/03/06 15:06:35 You could just use the same TryCatch for both Comp
+ compiledScript = v8::Script::Compile(source);
+ if (try_catch.HasCaught())
+ {
+ reportException(&try_catch);
+ return NULL;
+ }
+ }
{
v8::TryCatch try_catch;
v8::Handle<v8::Value> result = compiledScript->Run();
« no previous file with comments | « no previous file | src/org/adblockplus/android/AdblockPlus.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld