Index: src/JsValue.cpp |
=================================================================== |
--- a/src/JsValue.cpp |
+++ b/src/JsValue.cpp |
@@ -119,23 +119,23 @@ |
{ |
const JsContext context(*jsEngine); |
return UnwrapValue()->IsFunction(); |
} |
std::string AdblockPlus::JsValue::AsString() const |
{ |
const JsContext context(*jsEngine); |
- return Utils::FromV8String(UnwrapValue()); |
+ return Utils::FromV8String(jsEngine->GetIsolate(), UnwrapValue()); |
} |
StringBuffer AdblockPlus::JsValue::AsStringBuffer() const |
{ |
const JsContext context(*jsEngine); |
- return Utils::StringBufferFromV8String(UnwrapValue()); |
+ return Utils::StringBufferFromV8String(jsEngine->GetIsolate(), UnwrapValue()); |
} |
int64_t AdblockPlus::JsValue::AsInt() const |
{ |
const JsContext context(*jsEngine); |
return UnwrapValue()->IntegerValue(); |
} |
@@ -235,17 +235,17 @@ |
std::string AdblockPlus::JsValue::GetClass() const |
{ |
if (!IsObject()) |
throw std::runtime_error("Cannot get constructor of a non-object"); |
const JsContext context(*jsEngine); |
v8::Local<v8::Object> obj = v8::Local<v8::Object>::Cast(UnwrapValue()); |
- return Utils::FromV8String(obj->GetConstructorName()); |
+ return Utils::FromV8String(jsEngine->GetIsolate(), obj->GetConstructorName()); |
} |
JsValue JsValue::Call(const JsValueList& params) const |
{ |
const JsContext context(*jsEngine); |
std::vector<v8::Local<v8::Value>> argv; |
for (const auto& param : params) |
argv.push_back(param.UnwrapValue()); |
@@ -285,12 +285,12 @@ |
const JsContext context(*jsEngine); |
const v8::TryCatch tryCatch(jsEngine->GetIsolate()); |
v8::Local<v8::Function> func = v8::Local<v8::Function>::Cast(UnwrapValue()); |
v8::Local<v8::Value> result = func->Call(thisObj, args.size(), |
args.size() ? &args[0] : nullptr); |
if (tryCatch.HasCaught()) |
- throw JsError(tryCatch.Exception(), tryCatch.Message()); |
+ throw JsError(jsEngine->GetIsolate(), tryCatch.Exception(), tryCatch.Message()); |
return JsValue(jsEngine, result); |
} |