Index: src/JsValue.cpp |
=================================================================== |
--- a/src/JsValue.cpp |
+++ b/src/JsValue.cpp |
@@ -168,32 +168,37 @@ |
obj->Set(property, val); |
} |
v8::Local<v8::Value> AdblockPlus::JsValue::UnwrapValue() const |
{ |
return v8::Local<v8::Value>::New(jsEngine->GetIsolate(), *value); |
} |
+JsValue AdblockPlus::JsValue::Clone() const |
+{ |
+ return JsValue(jsEngine, UnwrapValue()); |
+} |
+ |
void AdblockPlus::JsValue::SetProperty(const std::string& name, const std::string& val) |
{ |
const JsContext context(jsEngine); |
SetProperty(name, Utils::ToV8String(jsEngine->GetIsolate(), val)); |
} |
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)); |
} |