Page tree
Skip to end of metadata
Go to start of metadata

void FB::JSAPIAuto::RemoveProperty ( int  idx)
virtual

Removes an indexed property.

This can be used for providing array-style access on your object. For example, the following will result in a call to RemoveProperty with idx = 12:

delete document.getElementById("plugin")[12];
Parameters
idxZero-based index of the property to remove
Since
1.5

Implements FB::JSAPI.

Definition at line 314 of file JSAPIAuto.cpp.

315 {
316  if (!m_valid)
317  throw object_invalidated();
318 
319  boost::recursive_mutex::scoped_lock lock(m_zoneMutex);
320 
321  std::string id(boost::lexical_cast<std::string>(idx));
322  if (m_allowDynamicAttributes && m_attributes.find(id) != m_attributes.end() && !m_attributes[id].readonly) {
323  unregisterAttribute(id);
324  } else {
325  throw invalid_member(FB::variant(idx).convert_cast<std::string>());
326  }
327 }
Accepts any datatype, used in all interactions with javascript. Provides tools for getting back out t...
Definition: variant.h:198
  • No labels