#include "config.h"
#include "NamePrototype.h"
#include "Error.h"
#include "Operations.h"
namespace JSC {
static EncodedJSValue JSC_HOST_CALL privateNameProtoFuncToString(ExecState*);
}
#include "NamePrototype.lut.h"
namespace JSC {
const ClassInfo NamePrototype::s_info = { "Name", &Base::s_info, 0, ExecState::privateNamePrototypeTable, CREATE_METHOD_TABLE(NamePrototype) };
NamePrototype::NamePrototype(ExecState* exec, Structure* structure)
: Base(exec->vm(), structure, jsEmptyString(exec))
{
}
void NamePrototype::finishCreation(ExecState* exec)
{
Base::finishCreation(exec->vm());
ASSERT(inherits(&s_info));
}
bool NamePrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, PropertyName propertyName, PropertySlot &slot)
{
return getStaticFunctionSlot<Base>(exec, ExecState::privateNamePrototypeTable(exec), jsCast<NamePrototype*>(cell), propertyName, slot);
}
bool NamePrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, PropertyName propertyName, PropertyDescriptor& descriptor)
{
return getStaticFunctionDescriptor<Base>(exec, ExecState::privateNamePrototypeTable(exec), jsCast<NamePrototype*>(object), propertyName, descriptor);
}
EncodedJSValue JSC_HOST_CALL privateNameProtoFuncToString(ExecState* exec)
{
JSValue thisValue = exec->hostThisValue();
if (!thisValue.isObject())
return throwVMTypeError(exec);
JSObject* thisObject = asObject(thisValue);
if (!thisObject->inherits(&NameInstance::s_info))
return throwVMTypeError(exec);
return JSValue::encode(jsCast<NameInstance*>(thisObject)->nameString());
}
}