Index: src/JsValue.cpp |
=================================================================== |
--- a/src/JsValue.cpp |
+++ b/src/JsValue.cpp |
@@ -200,17 +200,17 @@ std::string AdblockPlus::JsValue::GetCla |
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()); |
} |
-AdblockPlus::JsValuePtr AdblockPlus::JsValue::Call(const JsValueList& params, JsValuePtr thisPtr) const |
+AdblockPlus::JsValuePtr AdblockPlus::JsValue::Call(const JsConstValueList& params, JsValuePtr thisPtr) const |
{ |
if (!IsFunction()) |
throw new std::runtime_error("Attempting to call a non-function"); |
const JsContext context(jsEngine); |
if (!thisPtr) |
{ |
v8::Local<v8::Context> localContext = v8::Local<v8::Context>::New( |
@@ -231,15 +231,14 @@ AdblockPlus::JsValuePtr AdblockPlus::JsV |
argv.size() ? &argv.front() : 0); |
if (tryCatch.HasCaught()) |
throw JsError(tryCatch.Exception(), tryCatch.Message()); |
return JsValuePtr(new JsValue(jsEngine, result)); |
} |
-AdblockPlus::JsValuePtr AdblockPlus::JsValue::Call(const JsValue& arg) const |
+AdblockPlus::JsValuePtr AdblockPlus::JsValue::Call(const JsConstValuePtr& arg) const |
{ |
- const JsContext context(jsEngine); |
- JsValueList params; |
- params.push_back(JsValuePtr(new JsValue(arg.jsEngine, arg.UnwrapValue()))); |
+ JsConstValueList params; |
+ params.push_back(arg); |
return Call(params); |
} |