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

Unified Diff: src/JsValue.cpp

Issue 29409580: Issue 5013 - Make parameter const ref when applicable. (Closed) Base URL: https://hg.adblockplus.org/libadblockplus/
Patch Set: Created April 11, 2017, 1:58 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/JsValue.cpp
===================================================================
--- a/src/JsValue.cpp
+++ b/src/JsValue.cpp
@@ -202,17 +202,17 @@
if (!IsObject())
throw new 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());
}
-JsValue JsValue::Call(const JsConstValueList& params, JsValuePtr thisPtr) const
+JsValue JsValue::Call(const JsConstValueList& params, const JsValuePtr& thisPtr) const
{
const JsContext context(jsEngine);
v8::Local<v8::Object> thisObj = thisPtr ?
v8::Local<v8::Object>::Cast(thisPtr->UnwrapValue()) :
context.GetV8Context()->Global();
std::vector<v8::Handle<v8::Value>> argv;
for (const auto& param : params)

Powered by Google App Engine
This is Rietveld