| Index: src/JsValue.cpp |
| =================================================================== |
| --- a/src/JsValue.cpp |
| +++ b/src/JsValue.cpp |
| @@ -142,25 +142,25 @@ |
| JsValueList properties = JsValuePtr(new JsValue(jsEngine, object->GetOwnPropertyNames()))->AsList(); |
| std::vector<std::string> result; |
| for (const auto& property : properties) |
| result.push_back(property->AsString()); |
| return result; |
| } |
| -AdblockPlus::JsValuePtr AdblockPlus::JsValue::GetProperty(const std::string& name) const |
| +AdblockPlus::JsValue AdblockPlus::JsValue::GetProperty(const std::string& name) const |
| { |
| if (!IsObject()) |
| throw new std::runtime_error("Attempting to get property of a non-object"); |
| const JsContext context(jsEngine); |
| v8::Local<v8::String> property = Utils::ToV8String(jsEngine->GetIsolate(), name); |
| v8::Local<v8::Object> obj = v8::Local<v8::Object>::Cast(UnwrapValue()); |
| - return JsValuePtr(new JsValue(jsEngine, obj->Get(property))); |
| + return JsValue(jsEngine, obj->Get(property)); |
| } |
| void AdblockPlus::JsValue::SetProperty(const std::string& name, v8::Handle<v8::Value> val) |
| { |
| if (!IsObject()) |
| throw new std::runtime_error("Attempting to set property on a non-object"); |
| v8::Local<v8::String> property = Utils::ToV8String(jsEngine->GetIsolate(), name); |
| @@ -185,20 +185,20 @@ |
| } |
| void AdblockPlus::JsValue::SetProperty(const std::string& name, int64_t val) |
| { |
| const JsContext context(jsEngine); |
| SetProperty(name, v8::Number::New(jsEngine->GetIsolate(), val)); |
| } |
| -void AdblockPlus::JsValue::SetProperty(const std::string& name, const JsValuePtr& val) |
| +void AdblockPlus::JsValue::SetProperty(const std::string& name, const JsValue& val) |
| { |
| const JsContext context(jsEngine); |
| - SetProperty(name, val->UnwrapValue()); |
| + SetProperty(name, val.UnwrapValue()); |
| } |
| void AdblockPlus::JsValue::SetProperty(const std::string& name, bool val) |
| { |
| const JsContext context(jsEngine); |
| SetProperty(name, v8::Boolean::New(val)); |
| } |