Index: src/JsValue.cpp |
=================================================================== |
--- a/src/JsValue.cpp |
+++ b/src/JsValue.cpp |
@@ -134,17 +134,17 @@ std::vector<std::string> AdblockPlus::Js |
{ |
if (!IsObject()) |
throw new std::runtime_error("Attempting to get propert list for a non-object"); |
const JsContext context(jsEngine); |
v8::Local<v8::Object> object = v8::Local<v8::Object>::Cast(UnwrapValue()); |
JsValueList properties = JsValuePtr(new JsValue(jsEngine, object->GetOwnPropertyNames()))->AsList(); |
std::vector<std::string> result; |
- for (JsValueList::iterator it = properties.begin(); it != properties.end(); ++it) |
+ for (auto it = properties.cbegin(); it != properties.cend(); ++it) |
result.push_back((*it)->AsString()); |
return result; |
} |
AdblockPlus::JsValuePtr AdblockPlus::JsValue::GetProperty(const std::string& name) const |
{ |
if (!IsObject()) |
@@ -217,17 +217,17 @@ AdblockPlus::JsValuePtr AdblockPlus::JsV |
jsEngine->GetIsolate(), *jsEngine->context); |
thisPtr = JsValuePtr(new JsValue(jsEngine, localContext->Global())); |
} |
if (!thisPtr->IsObject()) |
throw new std::runtime_error("`this` pointer has to be an object"); |
v8::Local<v8::Object> thisObj = v8::Local<v8::Object>::Cast(thisPtr->UnwrapValue()); |
std::vector<v8::Handle<v8::Value>> argv; |
- for (JsValueList::const_iterator it = params.begin(); it != params.end(); ++it) |
+ for (auto it = params.cbegin(); it != params.cend(); ++it) |
argv.push_back((*it)->UnwrapValue()); |
const v8::TryCatch tryCatch; |
v8::Local<v8::Function> func = v8::Local<v8::Function>::Cast(UnwrapValue()); |
v8::Local<v8::Value> result = func->Call(thisObj, argv.size(), |
argv.size() ? &argv.front() : 0); |
if (tryCatch.HasCaught()) |