-bool JSFunction::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
-{
- JSFunction* thisObject = jsCast<JSFunction*>(object);
- if (thisObject->isHostFunction())
- return Base::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor);
-
- if (propertyName == exec->propertyNames().prototype) {
- PropertySlot slot;
- thisObject->methodTable()->getOwnPropertySlot(thisObject, exec, propertyName, slot);
- return Base::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor);
- }
-
- if (propertyName == exec->propertyNames().arguments) {
- if (thisObject->jsExecutable()->isStrictMode()) {
- bool result = Base::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor);
- if (!result) {
- thisObject->putDirectAccessor(exec->globalData(), propertyName, thisObject->globalObject()->throwTypeErrorGetterSetter(exec), DontDelete | DontEnum | Accessor);
- result = Base::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor);
- ASSERT(result);
- }
- return result;
- }
- descriptor.setDescriptor(exec->interpreter()->retrieveArgumentsFromVMCode(exec, thisObject), ReadOnly | DontEnum | DontDelete);
- return true;
- }
-
- if (propertyName == exec->propertyNames().length) {
- descriptor.setDescriptor(jsNumber(thisObject->jsExecutable()->parameterCount()), ReadOnly | DontEnum | DontDelete);
- return true;
- }
-
- if (propertyName == exec->propertyNames().caller) {
- if (thisObject->jsExecutable()->isStrictMode()) {
- bool result = Base::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor);
- if (!result) {
- thisObject->putDirectAccessor(exec->globalData(), propertyName, thisObject->globalObject()->throwTypeErrorGetterSetter(exec), DontDelete | DontEnum | Accessor);
- result = Base::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor);
- ASSERT(result);
- }
- return result;
- }
- descriptor.setDescriptor(exec->interpreter()->retrieveCallerFromVMCode(exec, thisObject), ReadOnly | DontEnum | DontDelete);
- return true;
- }
-
- return Base::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor);
-}
-
-void JSFunction::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)