Index: src/JsEngine.cpp |
=================================================================== |
--- a/src/JsEngine.cpp |
+++ b/src/JsEngine.cpp |
@@ -34,20 +34,21 @@ |
{ |
const v8::Local<v8::String> v8Filename = ToV8String(isolate, filename); |
return v8::Script::Compile(v8Source, v8Filename); |
} |
else |
return v8::Script::Compile(v8Source); |
} |
- void CheckTryCatch(const v8::TryCatch& tryCatch) |
+ void CheckTryCatch(v8::Isolate* isolate, const v8::TryCatch& tryCatch) |
{ |
if (tryCatch.HasCaught()) |
- throw AdblockPlus::JsError(tryCatch.Exception(), tryCatch.Message()); |
+ throw AdblockPlus::JsError(isolate, |
+ tryCatch.Exception(), tryCatch.Message()); |
} |
class V8Initializer |
{ |
V8Initializer() |
: platform{nullptr} |
{ |
std::string cmd = "--use_strict"; |
@@ -188,19 +189,19 @@ |
AdblockPlus::JsValue AdblockPlus::JsEngine::Evaluate(const std::string& source, |
const std::string& filename) |
{ |
const JsContext context(*this); |
const v8::TryCatch tryCatch(GetIsolate()); |
const v8::Local<v8::Script> script = CompileScript(GetIsolate(), source, |
filename); |
- CheckTryCatch(tryCatch); |
+ CheckTryCatch(GetIsolate(), tryCatch); |
v8::Local<v8::Value> result = script->Run(); |
- CheckTryCatch(tryCatch); |
+ CheckTryCatch(GetIsolate(), tryCatch); |
return JsValue(shared_from_this(), result); |
} |
void AdblockPlus::JsEngine::SetEventCallback(const std::string& eventName, |
const AdblockPlus::JsEngine::EventCallback& callback) |
{ |
if (!callback) |
{ |