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

bool FB::JSAPIAuto::HasProperty ( int  idx) const
virtual

Query if the property at "idx" exists.

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

document.getElementById("plugin")[12];
Parameters
idxZero-based index of the property to check for
Returns
true if property exists, false if not.

Implements FB::JSAPI.

Definition at line 178 of file JSAPIAuto.cpp.

179 {
180  boost::recursive_mutex::scoped_lock lock(m_zoneMutex);
181  if(!m_valid)
182  return false;
183 
184  // To be able to set dynamic properties, we have to respond true always
185  if (m_allowDynamicAttributes)
186  return true;
187 
188  return m_attributes.find(boost::lexical_cast<std::string>(idx)) != m_attributes.end();
189 }
  • No labels