void IndexToNameMap::unMap(ExecState* exec, const Identifier& index) { bool indexIsNumber; unsigned indexAsNumber = index.toStrictUInt32(&indexIsNumber); ASSERT(indexIsNumber && indexAsNumber < m_size); m_map[indexAsNumber] = exec->propertyNames().nullIdentifier; }
void IndexToNameMap::unMap(const Identifier &index) { bool indexIsNumber; int indexAsNumber = index.toStrictUInt32(&indexIsNumber); assert(indexIsNumber && indexAsNumber < _size); _map[indexAsNumber] = CommonIdentifiers::shared()->nullIdentifier;; }
bool StringObject::deleteProperty(ExecState* exec, const Identifier& propertyName) { if (propertyName == exec->propertyNames().length) return false; bool isStrictUInt32; unsigned i = propertyName.toStrictUInt32(&isStrictUInt32); if (isStrictUInt32 && internalValue()->canGetIndex(i)) return false; return JSObject::deleteProperty(exec, propertyName); }
void ObjectPrototype::put(TiExcState* exec, const Identifier& propertyName, TiValue value, PutPropertySlot& slot) { TiObject::put(exec, propertyName, value, slot); if (m_hasNoPropertiesWithUInt32Names) { bool isUInt32; propertyName.toStrictUInt32(&isUInt32); m_hasNoPropertiesWithUInt32Names = !isUInt32; } }
bool JSString::getStringPropertyAttributes(ExecState* exec, const Identifier& propertyName, unsigned& attributes) const { if (propertyName == exec->propertyNames().length) { attributes = DontEnum | DontDelete | ReadOnly; return true; } bool isStrictUInt32; unsigned i = propertyName.toStrictUInt32(&isStrictUInt32); if (isStrictUInt32 && i < static_cast<unsigned>(m_value.size())) { attributes = DontDelete | ReadOnly; return true; } return false; }
bool JSString::getStringPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { if (propertyName == exec->propertyNames().length) { descriptor.setDescriptor(jsNumber(exec, m_value.size()), DontEnum | DontDelete | ReadOnly); return true; } bool isStrictUInt32; unsigned i = propertyName.toStrictUInt32(&isStrictUInt32); if (isStrictUInt32 && i < static_cast<unsigned>(m_value.size())) { descriptor.setDescriptor(jsSingleCharacterSubstring(exec, m_value, i), DontDelete | ReadOnly); return true; } return false; }
bool IndexToNameMap::isMapped(const Identifier& index) const { bool indexIsNumber; unsigned indexAsNumber = index.toStrictUInt32(&indexIsNumber); if (!indexIsNumber) return false; if (indexAsNumber >= m_size) return false; if (m_map[indexAsNumber].isNull()) return false; return true; }
bool JSString::getStringPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { if (propertyName == exec->propertyNames().length) { descriptor.setDescriptor(jsNumber(exec, m_length), DontEnum | DontDelete | ReadOnly); return true; } bool isStrictUInt32; unsigned i = propertyName.toStrictUInt32(&isStrictUInt32); if (isStrictUInt32 && i < m_length) { descriptor.setDescriptor(getIndex(exec, i), DontDelete | ReadOnly); return true; } return false; }