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

Unified Diff: src/JsEngine.cpp

Issue 29810573: Issue 6526 - Remove deprecated Utf8Value() usage (Closed) Base URL: https://hg.adblockplus.org/libadblockplus/
Patch Set: Created June 19, 2018, 5:11 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 | « src/FileSystemJsObject.cpp ('k') | src/JsError.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
{
« no previous file with comments | « src/FileSystemJsObject.cpp ('k') | src/JsError.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld