Ignore:
Timestamp:
Jul 17, 2008, 2:42:24 PM (17 years ago)
Author:
[email protected]
Message:

JavaScriptCore:

2008-07-17 Sam Weinig <[email protected]>

Roll out r35199 as it is causing failures on the PPC build.

LayoutTests:

2008-07-17 Geoffrey Garen <[email protected]>

Reviewed by David Kilzer.


Test for https://bugs.webkit.org/show_bug.cgi?id=20067
Support function.name (Firefox extension)

  • fast/js/function-name-expected.txt: Added.
  • fast/js/function-name.html: Added.
  • fast/js/resources/function-name.js: Added.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/InternalFunction.cpp

    r34893 r35228  
    2222
    2323#include "config.h"
    24 #include "JSFunction.h"
     24#include "InternalFunction.h"
    2525
    2626#include "FunctionPrototype.h"
     
    4545}
    4646
     47bool InternalFunction::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
     48{
     49    if (propertyName == exec->propertyNames().name) {
     50        slot.setCustom(this, nameGetter);
     51        return true;
     52    }
     53
     54    return JSObject::getOwnPropertySlot(exec, propertyName, slot);
     55}
     56
     57void InternalFunction::put(ExecState* exec, const Identifier& propertyName, JSValue* value)
     58{
     59    if (propertyName == exec->propertyNames().name)
     60        return;
     61    JSObject::put(exec, propertyName, value);
     62}
     63
     64bool InternalFunction::deleteProperty(ExecState* exec, const Identifier& propertyName)
     65{
     66    if (propertyName == exec->propertyNames().name)
     67        return false;
     68    return JSObject::deleteProperty(exec, propertyName);
     69}
     70
     71JSValue* InternalFunction::nameGetter(ExecState* exec, const Identifier&, const PropertySlot& slot)
     72{
     73    InternalFunction* thisObj = static_cast<InternalFunction*>(slot.slotBase());
     74    return jsString(exec, thisObj->functionName().ustring());
     75}
     76
    4777} // namespace KJS
Note: See TracChangeset for help on using the changeset viewer.