1
1
// -*- c-basic-offset: 4 -*-
3
* This file is part of the KDE libraries
4
* Copyright (C) 2005 Apple Computer, Inc.
3
* Copyright (C) 2005, 2008 Apple Inc. All rights reserved.
6
5
* This library is free software; you can redistribute it and/or
7
6
* modify it under the terms of the GNU Library General Public
24
23
#include "config.h"
25
24
#include "property_slot.h"
26
#include "JSGlobalObject.h"
26
27
#include "object.h"
28
#include "RegisterFileStack.h"
30
JSValue *PropertySlot::undefinedGetter(ExecState*, JSObject*, const Identifier&, const PropertySlot&)
32
JSValue* PropertySlot::undefinedGetter(ExecState*, const Identifier&, const PropertySlot&)
32
34
return jsUndefined();
35
JSValue *PropertySlot::functionGetter(ExecState* exec, JSObject* originalObject, const Identifier&, const PropertySlot& slot)
37
JSValue* PropertySlot::functionGetter(ExecState* exec, const Identifier&, const PropertySlot& slot)
37
return slot.m_data.getterFunc->call(exec, originalObject, List::empty());
40
CallType callType = slot.m_data.getterFunc->getCallData(data);
41
if (callType == CallTypeNative)
42
return slot.m_data.getterFunc->callAsFunction(exec, static_cast<JSObject*>(slot.slotBase()), exec->emptyList());
43
ASSERT(callType == CallTypeJS);
44
RegisterFileStack* stack = &exec->dynamicGlobalObject()->registerFileStack();
45
stack->pushFunctionRegisterFile();
46
JSValue* result = slot.m_data.getterFunc->callAsFunction(exec, static_cast<JSObject*>(slot.slotBase()), exec->emptyList());
47
stack->popFunctionRegisterFile();