Ejemplo n.º 1
0
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;
}
Ejemplo n.º 2
0
void IndexToNameMap::unMap(const Identifier &index)
{
  bool indexIsNumber;
  int indexAsNumber = index.toStrictUInt32(&indexIsNumber);

  assert(indexIsNumber && indexAsNumber < _size);

  _map[indexAsNumber] = CommonIdentifiers::shared()->nullIdentifier;;
}
Ejemplo n.º 3
0
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);
}
Ejemplo n.º 4
0
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;
    }
}
Ejemplo n.º 5
0
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;
}
Ejemplo n.º 6
0
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;
}
Ejemplo n.º 7
0
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;
}
Ejemplo n.º 8
0
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;
}