| 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(); |