Changeset 47288 in webkit for trunk/JavaScriptCore/runtime


Ignore:
Timestamp:
Aug 14, 2009, 11:12:49 AM (16 years ago)
Author:
Darin Adler
Message:

JavaScriptCore: Rename the confusing isObject(<class>) to inherits(<class>).
It still works on non-objects, returning false.

Patch by Darin Adler <Darin Adler> on 2009-08-14
Reviewed by Sam Weinig.

  • runtime/ArrayConstructor.cpp:

(JSC::arrayConstructorIsArray): Removed unneeded isObject call
and updated remaining isObject call to new name, inherits.

  • runtime/JSCell.h: Renamed isObject(<class>) to inherits(<class>)

but more importantly, made it non-virtual (it was already inline)
so it is now as fast as JSObject::inherits was.

  • runtime/JSObject.h: Removed inherits function since the one

in the base class is fine as-is. Also made various JSCell functions
that should not be called on JSObject uncallable by making them
both private and not implemented.
(JSC::JSCell::inherits): Updated name.
(JSC::JSValue::inherits): Ditto.

  • debugger/Debugger.cpp:

(JSC::Debugger::recompileAllJSFunctions):

  • interpreter/Interpreter.cpp:

(JSC::Interpreter::unwindCallFrame):

  • runtime/ArrayPrototype.cpp:

(JSC::arrayProtoFuncToString):
(JSC::arrayProtoFuncToLocaleString):
(JSC::arrayProtoFuncConcat):

  • runtime/BooleanPrototype.cpp:

(JSC::booleanProtoFuncToString):
(JSC::booleanProtoFuncValueOf):

  • runtime/DateConstructor.cpp:

(JSC::constructDate):

  • runtime/DatePrototype.cpp:

(JSC::dateProtoFuncToString):
(JSC::dateProtoFuncToUTCString):
(JSC::dateProtoFuncToISOString):
(JSC::dateProtoFuncToDateString):
(JSC::dateProtoFuncToTimeString):
(JSC::dateProtoFuncToLocaleString):
(JSC::dateProtoFuncToLocaleDateString):
(JSC::dateProtoFuncToLocaleTimeString):
(JSC::dateProtoFuncGetTime):
(JSC::dateProtoFuncGetFullYear):
(JSC::dateProtoFuncGetUTCFullYear):
(JSC::dateProtoFuncToGMTString):
(JSC::dateProtoFuncGetMonth):
(JSC::dateProtoFuncGetUTCMonth):
(JSC::dateProtoFuncGetDate):
(JSC::dateProtoFuncGetUTCDate):
(JSC::dateProtoFuncGetDay):
(JSC::dateProtoFuncGetUTCDay):
(JSC::dateProtoFuncGetHours):
(JSC::dateProtoFuncGetUTCHours):
(JSC::dateProtoFuncGetMinutes):
(JSC::dateProtoFuncGetUTCMinutes):
(JSC::dateProtoFuncGetSeconds):
(JSC::dateProtoFuncGetUTCSeconds):
(JSC::dateProtoFuncGetMilliSeconds):
(JSC::dateProtoFuncGetUTCMilliseconds):
(JSC::dateProtoFuncGetTimezoneOffset):
(JSC::dateProtoFuncSetTime):
(JSC::setNewValueFromTimeArgs):
(JSC::setNewValueFromDateArgs):
(JSC::dateProtoFuncSetYear):
(JSC::dateProtoFuncGetYear):

  • runtime/FunctionPrototype.cpp:

(JSC::functionProtoFuncToString):

  • runtime/JSActivation.cpp:

(JSC::JSActivation::argumentsGetter):

  • runtime/JSValue.h:
  • runtime/RegExpConstructor.cpp:

(JSC::constructRegExp):

  • runtime/RegExpPrototype.cpp:

(JSC::regExpProtoFuncTest):
(JSC::regExpProtoFuncExec):
(JSC::regExpProtoFuncCompile):
(JSC::regExpProtoFuncToString):

  • runtime/ScopeChain.cpp:

(JSC::ScopeChain::localDepth):

  • runtime/StringPrototype.cpp:

(JSC::stringProtoFuncReplace):
(JSC::stringProtoFuncToString):
(JSC::stringProtoFuncMatch):
(JSC::stringProtoFuncSearch):
(JSC::stringProtoFuncSplit):
Updated to new name, inherits, from old name, isObject.

WebCore: Rename the confusing isObject(<class>) to inherits(<class>).
It still works on non-objects, returning false.

Patch by Darin Adler <Darin Adler> on 2009-08-14
Reviewed by Sam Weinig.

  • bindings/js/JSEventTarget.cpp:

(WebCore::toEventTarget):

  • bindings/js/JSGeolocationCustom.cpp:

(WebCore::createPositionCallback):
(WebCore::createPositionErrorCallback):

  • bindings/js/JSNodeFilterCustom.cpp:

(WebCore::toNodeFilter):

  • bindings/js/JSXMLHttpRequestCustom.cpp:

(WebCore::JSXMLHttpRequest::send):

  • bindings/js/JSXSLTProcessorCustom.cpp:

(WebCore::JSXSLTProcessor::importStylesheet):
(WebCore::JSXSLTProcessor::transformToFragment):
(WebCore::JSXSLTProcessor::transformToDocument):

  • bindings/scripts/CodeGeneratorJS.pm:
  • bridge/objc/objc_runtime.mm:

(JSC::Bindings::callObjCFallbackObject):

  • bridge/runtime_method.cpp:

(JSC::callRuntimeMethod):
Updated to new name, inherits, from old name, isObject.

Location:
trunk/JavaScriptCore/runtime
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/runtime/ArrayConstructor.cpp

    r47276 r47288  
    9292JSValue JSC_HOST_CALL arrayConstructorIsArray(ExecState*, JSObject*, JSValue, const ArgList& args)
    9393{
    94     if (!args.at(0).isObject())
    95         return jsBoolean(false);
    96     return jsBoolean(asObject(args.at(0))->isObject(&JSArray::info));
     94    return jsBoolean(args.at(0).inherits(&JSArray::info));
    9795}
    9896
  • trunk/JavaScriptCore/runtime/ArrayPrototype.cpp

    r44286 r47288  
    145145JSValue JSC_HOST_CALL arrayProtoFuncToString(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&)
    146146{
    147     if (!thisValue.isObject(&JSArray::info))
     147    if (!thisValue.inherits(&JSArray::info))
    148148        return throwError(exec, TypeError);
    149149    JSObject* thisObj = asArray(thisValue);
     
    191191JSValue JSC_HOST_CALL arrayProtoFuncToLocaleString(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&)
    192192{
    193     if (!thisValue.isObject(&JSArray::info))
     193    if (!thisValue.inherits(&JSArray::info))
    194194        return throwError(exec, TypeError);
    195195    JSObject* thisObj = asArray(thisValue);
     
    299299    ArgList::const_iterator end = args.end();
    300300    while (1) {
    301         if (curArg.isObject(&JSArray::info)) {
     301        if (curArg.inherits(&JSArray::info)) {
    302302            unsigned length = curArg.get(exec, exec->propertyNames().length).toUInt32(exec);
    303303            JSObject* curObject = curArg.toObject(exec);
  • trunk/JavaScriptCore/runtime/BooleanPrototype.cpp

    r43372 r47288  
    6060        return jsNontrivialString(exec, "true");
    6161
    62     if (!thisValue.isObject(&BooleanObject::info))
     62    if (!thisValue.inherits(&BooleanObject::info))
    6363        return throwError(exec, TypeError);
    6464
     
    7575        return thisValue;
    7676
    77     if (!thisValue.isObject(&BooleanObject::info))
     77    if (!thisValue.inherits(&BooleanObject::info))
    7878        return throwError(exec, TypeError);
    7979
  • trunk/JavaScriptCore/runtime/DateConstructor.cpp

    r46992 r47288  
    8080        value = getCurrentUTCTime();
    8181    else if (numArgs == 1) {
    82         if (args.at(0).isObject(&DateInstance::info))
     82        if (args.at(0).inherits(&DateInstance::info))
    8383            value = asDateInstance(args.at(0))->internalNumber();
    8484        else {
  • trunk/JavaScriptCore/runtime/DatePrototype.cpp

    r44931 r47288  
    412412JSValue JSC_HOST_CALL dateProtoFuncToString(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&)
    413413{
    414     if (!thisValue.isObject(&DateInstance::info))
     414    if (!thisValue.inherits(&DateInstance::info))
    415415        return throwError(exec, TypeError);
    416416
     
    429429JSValue JSC_HOST_CALL dateProtoFuncToUTCString(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&)
    430430{
    431     if (!thisValue.isObject(&DateInstance::info))
     431    if (!thisValue.inherits(&DateInstance::info))
    432432        return throwError(exec, TypeError);
    433433
     
    446446JSValue JSC_HOST_CALL dateProtoFuncToISOString(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&)
    447447{
    448     if (!thisValue.isObject(&DateInstance::info))
     448    if (!thisValue.inherits(&DateInstance::info))
    449449        return throwError(exec, TypeError);
    450450   
     
    468468JSValue JSC_HOST_CALL dateProtoFuncToDateString(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&)
    469469{
    470     if (!thisValue.isObject(&DateInstance::info))
     470    if (!thisValue.inherits(&DateInstance::info))
    471471        return throwError(exec, TypeError);
    472472
     
    485485JSValue JSC_HOST_CALL dateProtoFuncToTimeString(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&)
    486486{
    487     if (!thisValue.isObject(&DateInstance::info))
     487    if (!thisValue.inherits(&DateInstance::info))
    488488        return throwError(exec, TypeError);
    489489
     
    502502JSValue JSC_HOST_CALL dateProtoFuncToLocaleString(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
    503503{
    504     if (!thisValue.isObject(&DateInstance::info))
     504    if (!thisValue.inherits(&DateInstance::info))
    505505        return throwError(exec, TypeError);
    506506
     
    515515JSValue JSC_HOST_CALL dateProtoFuncToLocaleDateString(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
    516516{
    517     if (!thisValue.isObject(&DateInstance::info))
     517    if (!thisValue.inherits(&DateInstance::info))
    518518        return throwError(exec, TypeError);
    519519
     
    528528JSValue JSC_HOST_CALL dateProtoFuncToLocaleTimeString(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
    529529{
    530     if (!thisValue.isObject(&DateInstance::info))
     530    if (!thisValue.inherits(&DateInstance::info))
    531531        return throwError(exec, TypeError);
    532532
     
    541541JSValue JSC_HOST_CALL dateProtoFuncGetTime(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&)
    542542{
    543     if (!thisValue.isObject(&DateInstance::info))
     543    if (!thisValue.inherits(&DateInstance::info))
    544544        return throwError(exec, TypeError);
    545545
     
    554554JSValue JSC_HOST_CALL dateProtoFuncGetFullYear(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&)
    555555{
    556     if (!thisValue.isObject(&DateInstance::info))
     556    if (!thisValue.inherits(&DateInstance::info))
    557557        return throwError(exec, TypeError);
    558558
     
    571571JSValue JSC_HOST_CALL dateProtoFuncGetUTCFullYear(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&)
    572572{
    573     if (!thisValue.isObject(&DateInstance::info))
     573    if (!thisValue.inherits(&DateInstance::info))
    574574        return throwError(exec, TypeError);
    575575
     
    588588JSValue JSC_HOST_CALL dateProtoFuncToGMTString(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&)
    589589{
    590     if (!thisValue.isObject(&DateInstance::info))
     590    if (!thisValue.inherits(&DateInstance::info))
    591591        return throwError(exec, TypeError);
    592592
     
    605605JSValue JSC_HOST_CALL dateProtoFuncGetMonth(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&)
    606606{
    607     if (!thisValue.isObject(&DateInstance::info))
     607    if (!thisValue.inherits(&DateInstance::info))
    608608        return throwError(exec, TypeError);
    609609
     
    622622JSValue JSC_HOST_CALL dateProtoFuncGetUTCMonth(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&)
    623623{
    624     if (!thisValue.isObject(&DateInstance::info))
     624    if (!thisValue.inherits(&DateInstance::info))
    625625        return throwError(exec, TypeError);
    626626
     
    639639JSValue JSC_HOST_CALL dateProtoFuncGetDate(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&)
    640640{
    641     if (!thisValue.isObject(&DateInstance::info))
     641    if (!thisValue.inherits(&DateInstance::info))
    642642        return throwError(exec, TypeError);
    643643
     
    656656JSValue JSC_HOST_CALL dateProtoFuncGetUTCDate(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&)
    657657{
    658     if (!thisValue.isObject(&DateInstance::info))
     658    if (!thisValue.inherits(&DateInstance::info))
    659659        return throwError(exec, TypeError);
    660660
     
    673673JSValue JSC_HOST_CALL dateProtoFuncGetDay(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&)
    674674{
    675     if (!thisValue.isObject(&DateInstance::info))
     675    if (!thisValue.inherits(&DateInstance::info))
    676676        return throwError(exec, TypeError);
    677677
     
    690690JSValue JSC_HOST_CALL dateProtoFuncGetUTCDay(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&)
    691691{
    692     if (!thisValue.isObject(&DateInstance::info))
     692    if (!thisValue.inherits(&DateInstance::info))
    693693        return throwError(exec, TypeError);
    694694
     
    707707JSValue JSC_HOST_CALL dateProtoFuncGetHours(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&)
    708708{
    709     if (!thisValue.isObject(&DateInstance::info))
     709    if (!thisValue.inherits(&DateInstance::info))
    710710        return throwError(exec, TypeError);
    711711
     
    724724JSValue JSC_HOST_CALL dateProtoFuncGetUTCHours(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&)
    725725{
    726     if (!thisValue.isObject(&DateInstance::info))
     726    if (!thisValue.inherits(&DateInstance::info))
    727727        return throwError(exec, TypeError);
    728728
     
    741741JSValue JSC_HOST_CALL dateProtoFuncGetMinutes(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&)
    742742{
    743     if (!thisValue.isObject(&DateInstance::info))
     743    if (!thisValue.inherits(&DateInstance::info))
    744744        return throwError(exec, TypeError);
    745745
     
    758758JSValue JSC_HOST_CALL dateProtoFuncGetUTCMinutes(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&)
    759759{
    760     if (!thisValue.isObject(&DateInstance::info))
     760    if (!thisValue.inherits(&DateInstance::info))
    761761        return throwError(exec, TypeError);
    762762
     
    775775JSValue JSC_HOST_CALL dateProtoFuncGetSeconds(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&)
    776776{
    777     if (!thisValue.isObject(&DateInstance::info))
     777    if (!thisValue.inherits(&DateInstance::info))
    778778        return throwError(exec, TypeError);
    779779
     
    792792JSValue JSC_HOST_CALL dateProtoFuncGetUTCSeconds(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&)
    793793{
    794     if (!thisValue.isObject(&DateInstance::info))
     794    if (!thisValue.inherits(&DateInstance::info))
    795795        return throwError(exec, TypeError);
    796796
     
    809809JSValue JSC_HOST_CALL dateProtoFuncGetMilliSeconds(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&)
    810810{
    811     if (!thisValue.isObject(&DateInstance::info))
     811    if (!thisValue.inherits(&DateInstance::info))
    812812        return throwError(exec, TypeError);
    813813
     
    824824JSValue JSC_HOST_CALL dateProtoFuncGetUTCMilliseconds(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&)
    825825{
    826     if (!thisValue.isObject(&DateInstance::info))
     826    if (!thisValue.inherits(&DateInstance::info))
    827827        return throwError(exec, TypeError);
    828828
     
    839839JSValue JSC_HOST_CALL dateProtoFuncGetTimezoneOffset(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&)
    840840{
    841     if (!thisValue.isObject(&DateInstance::info))
     841    if (!thisValue.inherits(&DateInstance::info))
    842842        return throwError(exec, TypeError);
    843843
     
    856856JSValue JSC_HOST_CALL dateProtoFuncSetTime(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
    857857{
    858     if (!thisValue.isObject(&DateInstance::info))
     858    if (!thisValue.inherits(&DateInstance::info))
    859859        return throwError(exec, TypeError);
    860860
     
    869869static JSValue setNewValueFromTimeArgs(ExecState* exec, JSValue thisValue, const ArgList& args, int numArgsToUse, bool inputIsUTC)
    870870{
    871     if (!thisValue.isObject(&DateInstance::info))
     871    if (!thisValue.inherits(&DateInstance::info))
    872872        return throwError(exec, TypeError);
    873873
     
    900900static JSValue setNewValueFromDateArgs(ExecState* exec, JSValue thisValue, const ArgList& args, int numArgsToUse, bool inputIsUTC)
    901901{
    902     if (!thisValue.isObject(&DateInstance::info))
     902    if (!thisValue.inherits(&DateInstance::info))
    903903        return throwError(exec, TypeError);
    904904
     
    10211021JSValue JSC_HOST_CALL dateProtoFuncSetYear(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
    10221022{
    1023     if (!thisValue.isObject(&DateInstance::info))
     1023    if (!thisValue.inherits(&DateInstance::info))
    10241024        return throwError(exec, TypeError);
    10251025
     
    10631063JSValue JSC_HOST_CALL dateProtoFuncGetYear(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&)
    10641064{
    1065     if (!thisValue.isObject(&DateInstance::info))
     1065    if (!thisValue.inherits(&DateInstance::info))
    10661066        return throwError(exec, TypeError);
    10671067
  • trunk/JavaScriptCore/runtime/FunctionPrototype.cpp

    r47236 r47288  
    8585JSValue JSC_HOST_CALL functionProtoFuncToString(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&)
    8686{
    87     if (thisValue.isObject(&JSFunction::info)) {
     87    if (thisValue.inherits(&JSFunction::info)) {
    8888        JSFunction* function = asFunction(thisValue);
    8989        FunctionBodyNode* body = function->body();
     
    9595    }
    9696
    97     if (thisValue.isObject(&InternalFunction::info)) {
     97    if (thisValue.inherits(&InternalFunction::info)) {
    9898        InternalFunction* function = asInternalFunction(thisValue);
    9999        return jsString(exec, "function " + function->name(&exec->globalData()) + "() {\n    [native code]\n}");
  • trunk/JavaScriptCore/runtime/JSActivation.cpp

    r47022 r47288  
    157157        callFrame->setCalleeArguments(arguments);
    158158    }
    159     ASSERT(arguments->isObject(&Arguments::info));
     159    ASSERT(arguments->inherits(&Arguments::info));
    160160
    161161    return arguments;
  • trunk/JavaScriptCore/runtime/JSCell.h

    r47267 r47288  
    5656        bool isObject() const;
    5757        virtual bool isGetterSetter() const;
    58         virtual bool isObject(const ClassInfo*) const;
     58        bool inherits(const ClassInfo*) const;
    5959        virtual bool isAPIValueWrapper() const { return false; }
    6060
  • trunk/JavaScriptCore/runtime/JSObject.h

    r47267 r47288  
    8383        virtual ~JSObject();
    8484
    85         bool inherits(const ClassInfo* classInfo) const { return JSCell::isObject(classInfo); }
    86 
    8785        JSValue prototype() const;
    8886        void setPrototype(JSValue prototype);
     
    209207
    210208    private:
     209        // Nobody should ever ask any of these questions on something already known to be a JSObject.
     210        using JSCell::isAPIValueWrapper;
     211        using JSCell::isGetterSetter;
     212        using JSCell::toObject;
     213        void getObject();
     214        void getString();
     215        void isObject();
     216        void isString();
     217#if USE(JSVALUE32)
     218        void isNumber();
     219#endif
     220
    211221        ConstPropertyStorage propertyStorage() const { return (isUsingInlineStorage() ? m_inlineStorage : m_externalStorage); }
    212222        PropertyStorage propertyStorage() { return (isUsingInlineStorage() ? m_inlineStorage : m_externalStorage); }
     
    297307}
    298308
    299 inline bool JSCell::isObject(const ClassInfo* info) const
     309inline bool JSCell::inherits(const ClassInfo* info) const
    300310{
    301311    for (const ClassInfo* ci = classInfo(); ci; ci = ci->parentClass) {
     
    306316}
    307317
    308 // this method is here to be after the inline declaration of JSCell::isObject
    309 inline bool JSValue::isObject(const ClassInfo* classInfo) const
    310 {
    311     return isCell() && asCell()->isObject(classInfo);
     318// this method is here to be after the inline declaration of JSCell::inherits
     319inline bool JSValue::inherits(const ClassInfo* classInfo) const
     320{
     321    return isCell() && asCell()->inherits(classInfo);
    312322}
    313323
  • trunk/JavaScriptCore/runtime/JSValue.h

    r47022 r47288  
    131131        bool isGetterSetter() const;
    132132        bool isObject() const;
    133         bool isObject(const ClassInfo*) const;
     133        bool inherits(const ClassInfo*) const;
    134134       
    135135        // Extracting the value.
  • trunk/JavaScriptCore/runtime/RegExpConstructor.cpp

    r47239 r47288  
    331331    JSValue arg1 = args.at(1);
    332332
    333     if (arg0.isObject(&RegExpObject::info)) {
     333    if (arg0.inherits(&RegExpObject::info)) {
    334334        if (!arg1.isUndefined())
    335335            return throwError(exec, TypeError, "Cannot supply flags when constructing one RegExp from another.");
  • trunk/JavaScriptCore/runtime/RegExpPrototype.cpp

    r47239 r47288  
    6060JSValue JSC_HOST_CALL regExpProtoFuncTest(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
    6161{
    62     if (!thisValue.isObject(&RegExpObject::info))
     62    if (!thisValue.inherits(&RegExpObject::info))
    6363        return throwError(exec, TypeError);
    6464    return asRegExpObject(thisValue)->test(exec, args);
     
    6767JSValue JSC_HOST_CALL regExpProtoFuncExec(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
    6868{
    69     if (!thisValue.isObject(&RegExpObject::info))
     69    if (!thisValue.inherits(&RegExpObject::info))
    7070        return throwError(exec, TypeError);
    7171    return asRegExpObject(thisValue)->exec(exec, args);
     
    7474JSValue JSC_HOST_CALL regExpProtoFuncCompile(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
    7575{
    76     if (!thisValue.isObject(&RegExpObject::info))
     76    if (!thisValue.inherits(&RegExpObject::info))
    7777        return throwError(exec, TypeError);
    7878
     
    8181    JSValue arg1 = args.at(1);
    8282   
    83     if (arg0.isObject(&RegExpObject::info)) {
     83    if (arg0.inherits(&RegExpObject::info)) {
    8484        if (!arg1.isUndefined())
    8585            return throwError(exec, TypeError, "Cannot supply flags when constructing one RegExp from another.");
     
    101101JSValue JSC_HOST_CALL regExpProtoFuncToString(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&)
    102102{
    103     if (!thisValue.isObject(&RegExpObject::info)) {
    104         if (thisValue.isObject(&RegExpPrototype::info))
     103    if (!thisValue.inherits(&RegExpObject::info)) {
     104        if (thisValue.inherits(&RegExpPrototype::info))
    105105            return jsNontrivialString(exec, "//");
    106106        return throwError(exec, TypeError);
  • trunk/JavaScriptCore/runtime/ScopeChain.cpp

    r44224 r47288  
    5757    ScopeChainIterator iter = this->begin();
    5858    ScopeChainIterator end = this->end();
    59     while (!(*iter)->isObject(&JSActivation::info)) {
     59    while (!(*iter)->inherits(&JSActivation::info)) {
    6060        ++iter;
    6161        if (iter == end)
  • trunk/JavaScriptCore/runtime/StringPrototype.cpp

    r47239 r47288  
    222222        replacementString = replacement.toString(exec);
    223223
    224     if (pattern.isObject(&RegExpObject::info)) {
     224    if (pattern.inherits(&RegExpObject::info)) {
    225225        RegExp* reg = asRegExpObject(pattern)->regExp();
    226226        bool global = reg->global();
     
    367367        return thisValue;
    368368
    369     if (thisValue.isObject(&StringObject::info))
     369    if (thisValue.inherits(&StringObject::info))
    370370        return asStringObject(thisValue)->internalValue();
    371371
     
    468468    RefPtr<RegExp> reg;
    469469    RegExpObject* imp = 0;
    470     if (a0.isObject(&RegExpObject::info))
     470    if (a0.inherits(&RegExpObject::info))
    471471        reg = asRegExpObject(a0)->regExp();
    472472    else {
     
    518518    UString u = s;
    519519    RefPtr<RegExp> reg;
    520     if (a0.isObject(&RegExpObject::info))
     520    if (a0.inherits(&RegExpObject::info))
    521521        reg = asRegExpObject(a0)->regExp();
    522522    else {
     
    570570    int p0 = 0;
    571571    unsigned limit = a1.isUndefined() ? 0xFFFFFFFFU : a1.toUInt32(exec);
    572     if (a0.isObject(&RegExpObject::info)) {
     572    if (a0.inherits(&RegExpObject::info)) {
    573573        RegExp* reg = asRegExpObject(a0)->regExp();
    574574        if (s.isEmpty() && reg->match(s, 0) >= 0) {
Note: See TracChangeset for help on using the changeset viewer.