#ifndef KJS_RUNTIME_OBJECT_H
#define KJS_RUNTIME_OBJECT_H
#include "runtime.h"
#include "object.h"
#include <wtf/Noncopyable.h>
namespace KJS {
class RuntimeObjectImp : public JSObject {
public:
virtual ~RuntimeObjectImp();
const ClassInfo *classInfo() const { return &info; }
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
virtual bool canPut(ExecState *exec, const Identifier &propertyName) const;
virtual void put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr = None);
virtual bool deleteProperty(ExecState *exec, const Identifier &propertyName);
virtual JSValue *defaultValue(ExecState *exec, JSType hint) const;
virtual bool implementsCall() const;
virtual JSValue *callAsFunction(ExecState *exec, JSObject *thisObj, const List &args);
virtual void getPropertyNames(ExecState*, PropertyNameArray&);
virtual void invalidate();
Bindings::Instance *getInternalInstance() const { return instance.get(); }
static JSObject* throwInvalidAccessError(ExecState*);
static const ClassInfo info;
protected:
friend class Bindings::Instance;
RuntimeObjectImp(Bindings::Instance*);
private:
RuntimeObjectImp();
static JSValue *fallbackObjectGetter(ExecState *, JSObject *, const Identifier&, const PropertySlot&);
static JSValue *fieldGetter(ExecState *, JSObject *, const Identifier&, const PropertySlot&);
static JSValue *methodGetter(ExecState *, JSObject *, const Identifier&, const PropertySlot&);
RefPtr<Bindings::Instance> instance;
};
}
#endif