return m_privateProperties->getPrivateProperty(propertyName);
}
- void setPrivateProperty(JSGlobalData& globalData, JSCell* owner, const Identifier& propertyName, JSValue value)
+ void setPrivateProperty(VM& vm, JSCell* owner, const Identifier& propertyName, JSValue value)
{
if (!m_privateProperties)
m_privateProperties = adoptPtr(new JSPrivatePropertyMap);
- m_privateProperties->setPrivateProperty(globalData, owner, propertyName, value);
+ m_privateProperties->setPrivateProperty(vm, owner, propertyName, value);
}
void deletePrivateProperty(const Identifier& propertyName)
PrivatePropertyMap::const_iterator location = m_propertyMap.find(propertyName.impl());
if (location == m_propertyMap.end())
return JSValue();
- return location->second.get();
+ return location->value.get();
}
- void setPrivateProperty(JSGlobalData& globalData, JSCell* owner, const Identifier& propertyName, JSValue value)
+ void setPrivateProperty(VM& vm, JSCell* owner, const Identifier& propertyName, JSValue value)
{
WriteBarrier<Unknown> empty;
- m_propertyMap.add(propertyName.impl(), empty).iterator->second.set(globalData, owner, value);
+ m_propertyMap.add(propertyName.impl(), empty).iterator->value.set(vm, owner, value);
}
void deletePrivateProperty(const Identifier& propertyName)
void visitChildren(SlotVisitor& visitor)
{
for (PrivatePropertyMap::iterator ptr = m_propertyMap.begin(); ptr != m_propertyMap.end(); ++ptr) {
- if (ptr->second)
- visitor.append(&ptr->second);
+ if (ptr->value)
+ visitor.append(&ptr->value);
}
}
class JSCallbackObject : public Parent {
protected:
JSCallbackObject(ExecState*, Structure*, JSClassRef, void* data);
- JSCallbackObject(JSGlobalData&, JSClassRef, Structure*);
+ JSCallbackObject(VM&, JSClassRef, Structure*);
void finishCreation(ExecState*);
- void finishCreation(JSGlobalData&);
+ void finishCreation(VM&);
public:
typedef Parent Base;
callbackObject->finishCreation(exec);
return callbackObject;
}
- static JSCallbackObject* create(JSGlobalData& globalData, JSClassRef classRef, Structure* structure)
+ static JSCallbackObject<Parent>* create(VM&, JSClassRef, Structure*);
+
+ static const bool needsDestruction;
+ static void destroy(JSCell* cell)
{
- JSCallbackObject* callbackObject = new (NotNull, allocateCell<JSCallbackObject>(globalData.heap)) JSCallbackObject(globalData, classRef, structure);
- callbackObject->finishCreation(globalData);
- return callbackObject;
+ static_cast<JSCallbackObject*>(cell)->JSCallbackObject::~JSCallbackObject();
}
void setPrivate(void* data);
JSClassRef classRef() const { return m_callbackObjectData->jsClass; }
bool inherits(JSClassRef) const;
- static Structure* createStructure(JSGlobalData&, JSGlobalObject*, JSValue);
+ static Structure* createStructure(VM&, JSGlobalObject*, JSValue);
JSValue getPrivateProperty(const Identifier& propertyName) const
{
return m_callbackObjectData->getPrivateProperty(propertyName);
}
- void setPrivateProperty(JSGlobalData& globalData, const Identifier& propertyName, JSValue value)
+ void setPrivateProperty(VM& vm, const Identifier& propertyName, JSValue value)
{
- m_callbackObjectData->setPrivateProperty(globalData, this, propertyName, value);
+ m_callbackObjectData->setPrivateProperty(vm, this, propertyName, value);
}
void deletePrivateProperty(const Identifier& propertyName)
using Parent::methodTable;
protected:
- static const unsigned StructureFlags = ProhibitsPropertyCaching | OverridesGetOwnPropertySlot | ImplementsHasInstance | OverridesHasInstance | OverridesVisitChildren | OverridesGetPropertyNames | Parent::StructureFlags;
+ static const unsigned StructureFlags = ProhibitsPropertyCaching | OverridesGetOwnPropertySlot | InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | ImplementsHasInstance | OverridesHasInstance | OverridesVisitChildren | OverridesGetPropertyNames | Parent::StructureFlags;
private:
- static UString className(const JSObject*);
-
- static void destroy(JSCell*);
+ static String className(const JSObject*);
static JSValue defaultValue(const JSObject*, ExecState*, PreferredPrimitiveType);
- static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&);
- static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&);
+ static bool getOwnPropertySlot(JSCell*, ExecState*, PropertyName, PropertySlot&);
+ static bool getOwnPropertySlotByIndex(JSCell*, ExecState*, unsigned propertyName, PropertySlot&);
+ static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&);
- static void put(JSCell*, ExecState*, const Identifier&, JSValue, PutPropertySlot&);
+ static void put(JSCell*, ExecState*, PropertyName, JSValue, PutPropertySlot&);
+ static void putByIndex(JSCell*, ExecState*, unsigned, JSValue, bool shouldThrow);
- static bool deleteProperty(JSCell*, ExecState*, const Identifier&);
+ static bool deleteProperty(JSCell*, ExecState*, PropertyName);
static bool deletePropertyByIndex(JSCell*, ExecState*, unsigned);
- static bool hasInstance(JSObject*, ExecState*, JSValue, JSValue proto);
+ static bool customHasInstance(JSObject*, ExecState*, JSValue);
- static void getOwnPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode);
+ static void getOwnNonIndexPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode);
static ConstructType getConstructData(JSCell*, ConstructData&);
static CallType getCallData(JSCell*, CallData&);
static EncodedJSValue JSC_HOST_CALL call(ExecState*);
static EncodedJSValue JSC_HOST_CALL construct(ExecState*);
- JSValue getStaticValue(ExecState*, const Identifier&);
- static JSValue staticFunctionGetter(ExecState*, JSValue, const Identifier&);
- static JSValue callbackGetter(ExecState*, JSValue, const Identifier&);
+ JSValue getStaticValue(ExecState*, PropertyName);
+ static JSValue staticFunctionGetter(ExecState*, JSValue, PropertyName);
+ static JSValue callbackGetter(ExecState*, JSValue, PropertyName);
OwnPtr<JSCallbackObjectData> m_callbackObjectData;
};