Show
Ignore:
Timestamp:
08/18/08 11:14:49 (5 months ago)
Author:
odole
Message:

merge with webkit revision 35814

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/JavaScriptCore/kjs/InternalFunction.cpp

    r402 r440  
    2929namespace KJS { 
    3030 
     31ASSERT_CLASS_FITS_IN_CELL(InternalFunction); 
     32 
    3133const ClassInfo InternalFunction::info = { "Function", 0, 0, 0 }; 
    3234 
    33 InternalFunction::InternalFunction(
     35InternalFunction::InternalFunction(ExecState* exec
    3436{ 
     37    putDirect(exec->propertyNames().name, jsString(exec, exec->propertyNames().nullIdentifier.ustring()), DontDelete | ReadOnly | DontEnum); 
    3538} 
    3639 
    37 InternalFunction::InternalFunction(FunctionPrototype* prototype, const Identifier& name) 
     40InternalFunction::InternalFunction(ExecState* exec, FunctionPrototype* prototype, const Identifier& name) 
    3841    : JSObject(prototype) 
    39     , m_name(name) 
    4042{ 
     43    putDirect(exec->propertyNames().name, jsString(exec, name.ustring()), DontDelete | ReadOnly | DontEnum); 
     44} 
     45 
     46const UString& InternalFunction::name(ExecState* exec) 
     47{ 
     48    JSValue* v = getDirect(exec->propertyNames().name); 
     49    ASSERT(v->isString()); 
     50    return static_cast<JSString*>(v)->value(); 
    4151} 
    4252 
     
    4656} 
    4757 
    48 bool InternalFunction::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) 
    49 { 
    50     if (propertyName == exec->propertyNames().name) { 
    51         slot.setCustom(this, nameGetter); 
    52         return true; 
    53     } 
    54  
    55     return JSObject::getOwnPropertySlot(exec, propertyName, slot); 
    56 } 
    57  
    58 void InternalFunction::put(ExecState* exec, const Identifier& propertyName, JSValue* value) 
    59 { 
    60     if (propertyName == exec->propertyNames().name) 
    61         return; 
    62     JSObject::put(exec, propertyName, value); 
    63 } 
    64  
    65 bool InternalFunction::deleteProperty(ExecState* exec, const Identifier& propertyName) 
    66 { 
    67     if (propertyName == exec->propertyNames().name) 
    68         return false; 
    69     return JSObject::deleteProperty(exec, propertyName); 
    70 } 
    71  
    72 JSValue* InternalFunction::nameGetter(ExecState* exec, const Identifier&, const PropertySlot& slot) 
    73 { 
    74     InternalFunction* thisObj = static_cast<InternalFunction*>(slot.slotBase()); 
    75     return jsString(exec, thisObj->functionName().ustring()); 
    76 } 
    77  
    7858} // namespace KJS