#ifndef JSArrayBuffer_h
#define JSArrayBuffer_h
#include "ArrayBuffer.h"
#include "JSObject.h"
namespace JSC {
class JSArrayBuffer : public JSNonFinalObject {
public:
typedef JSNonFinalObject Base;
static const unsigned StructureFlags = Base::StructureFlags | OverridesGetPropertyNames | OverridesGetOwnPropertySlot;
protected:
JSArrayBuffer(VM&, Structure*, PassRefPtr<ArrayBuffer>);
void finishCreation(VM&);
public:
JS_EXPORT_PRIVATE static JSArrayBuffer* create(VM&, Structure*, PassRefPtr<ArrayBuffer>);
ArrayBuffer* impl() const { return m_impl; }
static Structure* createStructure(VM&, JSGlobalObject*, JSValue prototype);
DECLARE_EXPORT_INFO;
protected:
static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);
static void put(JSCell*, ExecState*, PropertyName, JSValue, PutPropertySlot&);
static bool defineOwnProperty(JSObject*, ExecState*, PropertyName, const PropertyDescriptor&, bool shouldThrow);
static bool deleteProperty(JSCell*, ExecState*, PropertyName);
static void getOwnNonIndexPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode);
private:
ArrayBuffer* m_impl;
};
inline ArrayBuffer* toArrayBuffer(JSValue value)
{
JSArrayBuffer* wrapper = jsDynamicCast<JSArrayBuffer*>(value);
if (!wrapper)
return 0;
return wrapper->impl();
}
}
#endif // JSArrayBuffer_h