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

Unified Diff: src/JsEngine.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/JsEngine.cpp
diff --git a/src/JsEngine.cpp b/src/JsEngine.cpp
index 621df56ec8d33aaeb7353fe2ca58bc6014c3f79a..b1c95226ccf226cfc4199ab03aa122e1914397c5 100644
--- a/src/JsEngine.cpp
+++ b/src/JsEngine.cpp
@@ -39,10 +39,10 @@ namespace
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
@@ -190,12 +190,13 @@ 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,
+ auto isolate = GetIsolate();
+ const v8::TryCatch tryCatch(isolate);
+ const v8::Local<v8::Script> script = CompileScript(isolate, source,
filename);
- CheckTryCatch(tryCatch);
+ CheckTryCatch(isolate, tryCatch);
v8::Local<v8::Value> result = script->Run();
- CheckTryCatch(tryCatch);
+ CheckTryCatch(isolate, tryCatch);
return JsValue(shared_from_this(), result);
}
« src/FileSystemJsObject.cpp ('K') | « src/FileSystemJsObject.cpp ('k') | src/JsError.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld