Changeset 35228 in webkit for trunk/JavaScriptCore


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.
Location:
trunk/JavaScriptCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r35227 r35228  
    22
    33        Roll out r35199 as it is causing failures on the PPC build.
     4
     52008-07-17  Geoffrey Garen  <[email protected]>
     6
     7        Reviewed by David Kilzer.
     8       
     9        Fixed https://bugs.webkit.org/show_bug.cgi?id=20067
     10        Support function.name (Firefox extension)
     11       
     12        Pretty straight-forward.
    413
    5142008-07-17  Geoffrey Garen  <[email protected]>
  • trunk/JavaScriptCore/JavaScriptCore.exp

    r35162 r35228  
    128128__ZN3KJS14constructArrayEPNS_9ExecStateERKNS_7ArgListE
    129129__ZN3KJS15JSWrapperObject4markEv
     130__ZN3KJS16InternalFunction14deletePropertyEPNS_9ExecStateERKNS_10IdentifierE
     131__ZN3KJS16InternalFunction18getOwnPropertySlotEPNS_9ExecStateERKNS_10IdentifierERNS_12PropertySlotE
     132__ZN3KJS16InternalFunction3putEPNS_9ExecStateERKNS_10IdentifierEPNS_7JSValueE
    130133__ZN3KJS16InternalFunction4infoE
    131134__ZN3KJS16InternalFunctionC2EPNS_17FunctionPrototypeERKNS_10IdentifierE
  • 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
  • trunk/JavaScriptCore/kjs/InternalFunction.h

    r35022 r35228  
    3737        static const ClassInfo info;
    3838
     39        virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
     40        virtual void put(ExecState*, const Identifier& propertyName, JSValue*);
     41        virtual bool deleteProperty(ExecState*, const Identifier& propertyName);
     42
    3943        const Identifier& functionName() const { return m_name; }
    4044
     
    4448
    4549    private:
     50        static JSValue* nameGetter(ExecState*, const Identifier&, const PropertySlot&);
    4651        virtual CallType getCallData(CallData&) = 0;
    4752        virtual bool implementsHasInstance() const;
Note: See TracChangeset for help on using the changeset viewer.