/*
    This file is part of the WebKit open source project.
    This file has been generated by generate-bindings.pl. DO NOT MODIFY!

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
    License as published by the Free Software Foundation; either
    version 2 of the License, or (at your option) any later version.

    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Library General Public License for more details.

    You should have received a copy of the GNU Library General Public License
    along with this library; see the file COPYING.LIB.  If not, write to
    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
    Boston, MA 02110-1301, USA.
*/

#include "config.h"
#include "JSEntityReference.h"

#include "EntityReference.h"
#include <wtf/GetPtr.h>

using namespace JSC;

namespace WebCore {

/* Hash table */

static const HashTableValue JSEntityReferenceTableValues[] =
{
    { "constructor", DontEnum | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsEntityReferenceConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) },
    { 0, 0, NoIntrinsic, 0, 0 }
};

static const HashTable JSEntityReferenceTable = { 2, 1, true, JSEntityReferenceTableValues, 0 };
/* Hash table for constructor */

static const HashTableValue JSEntityReferenceConstructorTableValues[] =
{
    { 0, 0, NoIntrinsic, 0, 0 }
};

static const HashTable JSEntityReferenceConstructorTable = { 1, 0, false, JSEntityReferenceConstructorTableValues, 0 };
const ClassInfo JSEntityReferenceConstructor::s_info = { "EntityReferenceConstructor", &Base::s_info, &JSEntityReferenceConstructorTable, 0, CREATE_METHOD_TABLE(JSEntityReferenceConstructor) };

JSEntityReferenceConstructor::JSEntityReferenceConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
    : DOMConstructorObject(structure, globalObject)
{
}

void JSEntityReferenceConstructor::finishCreation(VM& vm, JSDOMGlobalObject* globalObject)
{
    Base::finishCreation(vm);
    ASSERT(inherits(info()));
    putDirect(vm, vm.propertyNames->prototype, JSEntityReferencePrototype::self(vm, globalObject), DontDelete | ReadOnly);
    putDirect(vm, vm.propertyNames->length, jsNumber(0), ReadOnly | DontDelete | DontEnum);
}

bool JSEntityReferenceConstructor::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
{
    return getStaticValueSlot<JSEntityReferenceConstructor, JSDOMWrapper>(exec, JSEntityReferenceConstructorTable, jsCast<JSEntityReferenceConstructor*>(object), propertyName, slot);
}

/* Hash table for prototype */

static const HashTableValue JSEntityReferencePrototypeTableValues[] =
{
    { 0, 0, NoIntrinsic, 0, 0 }
};

static const HashTable JSEntityReferencePrototypeTable = { 1, 0, false, JSEntityReferencePrototypeTableValues, 0 };
const ClassInfo JSEntityReferencePrototype::s_info = { "EntityReferencePrototype", &Base::s_info, &JSEntityReferencePrototypeTable, 0, CREATE_METHOD_TABLE(JSEntityReferencePrototype) };

JSObject* JSEntityReferencePrototype::self(VM& vm, JSGlobalObject* globalObject)
{
    return getDOMPrototype<JSEntityReference>(vm, globalObject);
}

const ClassInfo JSEntityReference::s_info = { "EntityReference", &Base::s_info, &JSEntityReferenceTable, 0 , CREATE_METHOD_TABLE(JSEntityReference) };

JSEntityReference::JSEntityReference(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<EntityReference> impl)
    : JSNode(structure, globalObject, impl)
{
}

void JSEntityReference::finishCreation(VM& vm)
{
    Base::finishCreation(vm);
    ASSERT(inherits(info()));
}

JSObject* JSEntityReference::createPrototype(VM& vm, JSGlobalObject* globalObject)
{
    return JSEntityReferencePrototype::create(vm, globalObject, JSEntityReferencePrototype::createStructure(vm, globalObject, JSNodePrototype::self(vm, globalObject)));
}

bool JSEntityReference::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
{
    JSEntityReference* thisObject = jsCast<JSEntityReference*>(object);
    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
    return getStaticValueSlot<JSEntityReference, Base>(exec, JSEntityReferenceTable, thisObject, propertyName, slot);
}

EncodedJSValue jsEntityReferenceConstructor(ExecState* exec, EncodedJSValue thisValue, EncodedJSValue, PropertyName)
{
    JSEntityReference* domObject = jsDynamicCast<JSEntityReference*>(JSValue::decode(thisValue));
    if (!domObject)
        return throwVMTypeError(exec);
    if (!domObject)
        return throwVMTypeError(exec);
    return JSValue::encode(JSEntityReference::getConstructor(exec->vm(), domObject->globalObject()));
}

JSValue JSEntityReference::getConstructor(VM& vm, JSGlobalObject* globalObject)
{
    return getDOMConstructor<JSEntityReferenceConstructor>(vm, jsCast<JSDOMGlobalObject*>(globalObject));
}


}
