Added support for property setting.

This commit is contained in:
Per Lundberg
2013-05-11 09:46:47 +03:00
committed by Per Lundberg
parent 35dfcebe1a
commit 36bf863329
2 changed files with 34 additions and 3 deletions
+9 -1
View File
@@ -314,7 +314,15 @@ namespace CefSharp
{
// TODO: Handle read-only properties correctly here.
auto nameStr = toNative(propertyName);
javascriptObject->SetValue(nameStr, V8_ACCESS_CONTROL_DEFAULT, V8_PROPERTY_ATTRIBUTE_NONE);
cef_v8_propertyattribute_t propertyAttribute = V8_PROPERTY_ATTRIBUTE_NONE;
if (properties[propertyName]->GetSetMethod() == nullptr)
{
propertyAttribute = V8_PROPERTY_ATTRIBUTE_READONLY;
}
javascriptObject->SetValue(nameStr, V8_ACCESS_CONTROL_DEFAULT, propertyAttribute);
}
}
}