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

Unified Diff: src/JsEngine.cpp

Issue 29417624: Issue 5034 - Part 4: JsEngine::Evaluate() return a JsValue (Closed) Base URL: https://hg.adblockplus.org/libadblockplus/
Patch Set: Created April 19, 2017, 6:18 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
Index: src/JsEngine.cpp
===================================================================
--- a/src/JsEngine.cpp
+++ b/src/JsEngine.cpp
@@ -151,27 +151,27 @@
}
AdblockPlus::JsValue AdblockPlus::JsEngine::GetGlobalObject()
{
JsContext context(shared_from_this());
return JsValue(shared_from_this(), context.GetV8Context()->Global());
}
-AdblockPlus::JsValuePtr AdblockPlus::JsEngine::Evaluate(const std::string& source,
+AdblockPlus::JsValue AdblockPlus::JsEngine::Evaluate(const std::string& source,
const std::string& filename)
{
const JsContext context(shared_from_this());
const v8::TryCatch tryCatch;
const v8::Handle<v8::Script> script = CompileScript(GetIsolate(), source,
filename);
CheckTryCatch(tryCatch);
v8::Local<v8::Value> result = script->Run();
CheckTryCatch(tryCatch);
- return JsValuePtr(new JsValue(shared_from_this(), result));
+ return JsValue(shared_from_this(), result);
}
void AdblockPlus::JsEngine::SetEventCallback(const std::string& eventName,
const AdblockPlus::JsEngine::EventCallback& callback)
{
if (!callback)
{
RemoveEventCallback(eventName);
« include/AdblockPlus/JsValue.h ('K') | « src/FilterEngine.cpp ('k') | src/JsValue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld