FireBreath  1.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Pages
void FB::JSAPIAuto::RemoveProperty ( const std::string &  propertyName)
virtual

Removes a property.

Parameters
propertyNameName of the property.
Since
1.5

Implements FB::JSAPI.

Definition at line 254 of file JSAPIAuto.cpp.

255 {
256  boost::recursive_mutex::scoped_lock lock(m_zoneMutex);
257  if(!m_valid)
258  throw object_invalidated();
259 
260  // If there is nothing with this name available in the current security context,
261  // we throw an exception -- whether or not a real property exists
262  if (!memberAccessible(m_zoneMap.find(propertyName)))
263  throw invalid_member(propertyName);
264 
265  if(m_allowRemoveProperties && m_propertyFunctorsMap.find(propertyName) != m_propertyFunctorsMap.end()) {
266  unregisterProperty(propertyName);
267  } else if (m_allowDynamicAttributes && m_attributes.find(propertyName) != m_attributes.end()
268  && !m_attributes[propertyName].readonly) {
269  unregisterAttribute(propertyName);
270  }
271 
272  // If nothing is found matching, we'll just let it slide -- no sense causing exceptions
273  // when the end goal is reached already.
274 }