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

Unified Diff: src/JsValue.cpp

Issue 29809555: Issue #6526 - pass v8::Isolate to more functions because old approach is deprecated (Closed) Base URL: https://github.com/adblockplus/libadblockplus@4d9bcc12e77369cbc4bc04bace9a3e7fa03de17b
Patch Set: Created June 18, 2018, 10:22 a.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
Index: src/JsValue.cpp
diff --git a/src/JsValue.cpp b/src/JsValue.cpp
index c7c2aab62ccccc62fb618528e6307d5a2019eebc..c8b95e7af4c686e0e7751377c2e169fa31326c4f 100644
--- a/src/JsValue.cpp
+++ b/src/JsValue.cpp
@@ -124,13 +124,13 @@ bool AdblockPlus::JsValue::IsFunction() const
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
@@ -240,7 +240,7 @@ std::string AdblockPlus::JsValue::GetClass() const
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
@@ -288,9 +288,8 @@ JsValue JsValue::Call(std::vector<v8::Local<v8::Value>>& args, v8::Local<v8::Obj
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);
}
« src/FileSystemJsObject.cpp ('K') | « src/JsError.cpp ('k') | src/Utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld