Changeset 47288 in webkit
- Timestamp:
- Aug 14, 2009 11:12:49 AM (15 years ago)
- Location:
- trunk
- Files:
-
- 26 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r47284 r47288 1 2009-08-14 Darin Adler <darin@apple.com> 2 3 Reviewed by Sam Weinig. 4 5 Rename the confusing isObject(<class>) to inherits(<class>). 6 It still works on non-objects, returning false. 7 8 * runtime/ArrayConstructor.cpp: 9 (JSC::arrayConstructorIsArray): Removed unneeded isObject call 10 and updated remaining isObject call to new name, inherits. 11 12 * runtime/JSCell.h: Renamed isObject(<class>) to inherits(<class>) 13 but more importantly, made it non-virtual (it was already inline) 14 so it is now as fast as JSObject::inherits was. 15 16 * runtime/JSObject.h: Removed inherits function since the one 17 in the base class is fine as-is. Also made various JSCell functions 18 that should not be called on JSObject uncallable by making them 19 both private and not implemented. 20 (JSC::JSCell::inherits): Updated name. 21 (JSC::JSValue::inherits): Ditto. 22 23 * debugger/Debugger.cpp: 24 (JSC::Debugger::recompileAllJSFunctions): 25 * interpreter/Interpreter.cpp: 26 (JSC::Interpreter::unwindCallFrame): 27 * runtime/ArrayPrototype.cpp: 28 (JSC::arrayProtoFuncToString): 29 (JSC::arrayProtoFuncToLocaleString): 30 (JSC::arrayProtoFuncConcat): 31 * runtime/BooleanPrototype.cpp: 32 (JSC::booleanProtoFuncToString): 33 (JSC::booleanProtoFuncValueOf): 34 * runtime/DateConstructor.cpp: 35 (JSC::constructDate): 36 * runtime/DatePrototype.cpp: 37 (JSC::dateProtoFuncToString): 38 (JSC::dateProtoFuncToUTCString): 39 (JSC::dateProtoFuncToISOString): 40 (JSC::dateProtoFuncToDateString): 41 (JSC::dateProtoFuncToTimeString): 42 (JSC::dateProtoFuncToLocaleString): 43 (JSC::dateProtoFuncToLocaleDateString): 44 (JSC::dateProtoFuncToLocaleTimeString): 45 (JSC::dateProtoFuncGetTime): 46 (JSC::dateProtoFuncGetFullYear): 47 (JSC::dateProtoFuncGetUTCFullYear): 48 (JSC::dateProtoFuncToGMTString): 49 (JSC::dateProtoFuncGetMonth): 50 (JSC::dateProtoFuncGetUTCMonth): 51 (JSC::dateProtoFuncGetDate): 52 (JSC::dateProtoFuncGetUTCDate): 53 (JSC::dateProtoFuncGetDay): 54 (JSC::dateProtoFuncGetUTCDay): 55 (JSC::dateProtoFuncGetHours): 56 (JSC::dateProtoFuncGetUTCHours): 57 (JSC::dateProtoFuncGetMinutes): 58 (JSC::dateProtoFuncGetUTCMinutes): 59 (JSC::dateProtoFuncGetSeconds): 60 (JSC::dateProtoFuncGetUTCSeconds): 61 (JSC::dateProtoFuncGetMilliSeconds): 62 (JSC::dateProtoFuncGetUTCMilliseconds): 63 (JSC::dateProtoFuncGetTimezoneOffset): 64 (JSC::dateProtoFuncSetTime): 65 (JSC::setNewValueFromTimeArgs): 66 (JSC::setNewValueFromDateArgs): 67 (JSC::dateProtoFuncSetYear): 68 (JSC::dateProtoFuncGetYear): 69 * runtime/FunctionPrototype.cpp: 70 (JSC::functionProtoFuncToString): 71 * runtime/JSActivation.cpp: 72 (JSC::JSActivation::argumentsGetter): 73 * runtime/JSValue.h: 74 * runtime/RegExpConstructor.cpp: 75 (JSC::constructRegExp): 76 * runtime/RegExpPrototype.cpp: 77 (JSC::regExpProtoFuncTest): 78 (JSC::regExpProtoFuncExec): 79 (JSC::regExpProtoFuncCompile): 80 (JSC::regExpProtoFuncToString): 81 * runtime/ScopeChain.cpp: 82 (JSC::ScopeChain::localDepth): 83 * runtime/StringPrototype.cpp: 84 (JSC::stringProtoFuncReplace): 85 (JSC::stringProtoFuncToString): 86 (JSC::stringProtoFuncMatch): 87 (JSC::stringProtoFuncSearch): 88 (JSC::stringProtoFuncSplit): 89 Updated to new name, inherits, from old name, isObject. 90 1 91 2009-07-31 Harald Fernengel <harald.fernengel@nokia.com> 2 92 -
trunk/JavaScriptCore/debugger/Debugger.cpp
r47239 r47288 65 65 Heap::iterator heapEnd = globalData->heap.primaryHeapEnd(); 66 66 for (Heap::iterator it = globalData->heap.primaryHeapBegin(); it != heapEnd; ++it) { 67 if ((*it)->i sObject(&JSFunction::info)) {67 if ((*it)->inherits(&JSFunction::info)) { 68 68 JSFunction* function = asFunction(*it); 69 69 if (!function->body()->isHostFunction()) -
trunk/JavaScriptCore/interpreter/Interpreter.cpp
r47183 r47288 505 505 // If this call frame created an activation or an 'arguments' object, tear it off. 506 506 if (oldCodeBlock->codeType() == FunctionCode && oldCodeBlock->needsFullScopeChain()) { 507 while (!scopeChain->object->i sObject(&JSActivation::info))507 while (!scopeChain->object->inherits(&JSActivation::info)) 508 508 scopeChain = scopeChain->pop(); 509 509 static_cast<JSActivation*>(scopeChain->object)->copyRegisters(callFrame->optionalCalleeArguments()); -
trunk/JavaScriptCore/runtime/ArrayConstructor.cpp
r47276 r47288 92 92 JSValue JSC_HOST_CALL arrayConstructorIsArray(ExecState*, JSObject*, JSValue, const ArgList& args) 93 93 { 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)); 97 95 } 98 96 -
trunk/JavaScriptCore/runtime/ArrayPrototype.cpp
r44286 r47288 145 145 JSValue JSC_HOST_CALL arrayProtoFuncToString(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&) 146 146 { 147 if (!thisValue.i sObject(&JSArray::info))147 if (!thisValue.inherits(&JSArray::info)) 148 148 return throwError(exec, TypeError); 149 149 JSObject* thisObj = asArray(thisValue); … … 191 191 JSValue JSC_HOST_CALL arrayProtoFuncToLocaleString(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&) 192 192 { 193 if (!thisValue.i sObject(&JSArray::info))193 if (!thisValue.inherits(&JSArray::info)) 194 194 return throwError(exec, TypeError); 195 195 JSObject* thisObj = asArray(thisValue); … … 299 299 ArgList::const_iterator end = args.end(); 300 300 while (1) { 301 if (curArg.i sObject(&JSArray::info)) {301 if (curArg.inherits(&JSArray::info)) { 302 302 unsigned length = curArg.get(exec, exec->propertyNames().length).toUInt32(exec); 303 303 JSObject* curObject = curArg.toObject(exec); -
trunk/JavaScriptCore/runtime/BooleanPrototype.cpp
r43372 r47288 60 60 return jsNontrivialString(exec, "true"); 61 61 62 if (!thisValue.i sObject(&BooleanObject::info))62 if (!thisValue.inherits(&BooleanObject::info)) 63 63 return throwError(exec, TypeError); 64 64 … … 75 75 return thisValue; 76 76 77 if (!thisValue.i sObject(&BooleanObject::info))77 if (!thisValue.inherits(&BooleanObject::info)) 78 78 return throwError(exec, TypeError); 79 79 -
trunk/JavaScriptCore/runtime/DateConstructor.cpp
r46992 r47288 80 80 value = getCurrentUTCTime(); 81 81 else if (numArgs == 1) { 82 if (args.at(0).i sObject(&DateInstance::info))82 if (args.at(0).inherits(&DateInstance::info)) 83 83 value = asDateInstance(args.at(0))->internalNumber(); 84 84 else { -
trunk/JavaScriptCore/runtime/DatePrototype.cpp
r44931 r47288 412 412 JSValue JSC_HOST_CALL dateProtoFuncToString(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&) 413 413 { 414 if (!thisValue.i sObject(&DateInstance::info))414 if (!thisValue.inherits(&DateInstance::info)) 415 415 return throwError(exec, TypeError); 416 416 … … 429 429 JSValue JSC_HOST_CALL dateProtoFuncToUTCString(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&) 430 430 { 431 if (!thisValue.i sObject(&DateInstance::info))431 if (!thisValue.inherits(&DateInstance::info)) 432 432 return throwError(exec, TypeError); 433 433 … … 446 446 JSValue JSC_HOST_CALL dateProtoFuncToISOString(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&) 447 447 { 448 if (!thisValue.i sObject(&DateInstance::info))448 if (!thisValue.inherits(&DateInstance::info)) 449 449 return throwError(exec, TypeError); 450 450 … … 468 468 JSValue JSC_HOST_CALL dateProtoFuncToDateString(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&) 469 469 { 470 if (!thisValue.i sObject(&DateInstance::info))470 if (!thisValue.inherits(&DateInstance::info)) 471 471 return throwError(exec, TypeError); 472 472 … … 485 485 JSValue JSC_HOST_CALL dateProtoFuncToTimeString(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&) 486 486 { 487 if (!thisValue.i sObject(&DateInstance::info))487 if (!thisValue.inherits(&DateInstance::info)) 488 488 return throwError(exec, TypeError); 489 489 … … 502 502 JSValue JSC_HOST_CALL dateProtoFuncToLocaleString(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args) 503 503 { 504 if (!thisValue.i sObject(&DateInstance::info))504 if (!thisValue.inherits(&DateInstance::info)) 505 505 return throwError(exec, TypeError); 506 506 … … 515 515 JSValue JSC_HOST_CALL dateProtoFuncToLocaleDateString(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args) 516 516 { 517 if (!thisValue.i sObject(&DateInstance::info))517 if (!thisValue.inherits(&DateInstance::info)) 518 518 return throwError(exec, TypeError); 519 519 … … 528 528 JSValue JSC_HOST_CALL dateProtoFuncToLocaleTimeString(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args) 529 529 { 530 if (!thisValue.i sObject(&DateInstance::info))530 if (!thisValue.inherits(&DateInstance::info)) 531 531 return throwError(exec, TypeError); 532 532 … … 541 541 JSValue JSC_HOST_CALL dateProtoFuncGetTime(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&) 542 542 { 543 if (!thisValue.i sObject(&DateInstance::info))543 if (!thisValue.inherits(&DateInstance::info)) 544 544 return throwError(exec, TypeError); 545 545 … … 554 554 JSValue JSC_HOST_CALL dateProtoFuncGetFullYear(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&) 555 555 { 556 if (!thisValue.i sObject(&DateInstance::info))556 if (!thisValue.inherits(&DateInstance::info)) 557 557 return throwError(exec, TypeError); 558 558 … … 571 571 JSValue JSC_HOST_CALL dateProtoFuncGetUTCFullYear(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&) 572 572 { 573 if (!thisValue.i sObject(&DateInstance::info))573 if (!thisValue.inherits(&DateInstance::info)) 574 574 return throwError(exec, TypeError); 575 575 … … 588 588 JSValue JSC_HOST_CALL dateProtoFuncToGMTString(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&) 589 589 { 590 if (!thisValue.i sObject(&DateInstance::info))590 if (!thisValue.inherits(&DateInstance::info)) 591 591 return throwError(exec, TypeError); 592 592 … … 605 605 JSValue JSC_HOST_CALL dateProtoFuncGetMonth(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&) 606 606 { 607 if (!thisValue.i sObject(&DateInstance::info))607 if (!thisValue.inherits(&DateInstance::info)) 608 608 return throwError(exec, TypeError); 609 609 … … 622 622 JSValue JSC_HOST_CALL dateProtoFuncGetUTCMonth(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&) 623 623 { 624 if (!thisValue.i sObject(&DateInstance::info))624 if (!thisValue.inherits(&DateInstance::info)) 625 625 return throwError(exec, TypeError); 626 626 … … 639 639 JSValue JSC_HOST_CALL dateProtoFuncGetDate(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&) 640 640 { 641 if (!thisValue.i sObject(&DateInstance::info))641 if (!thisValue.inherits(&DateInstance::info)) 642 642 return throwError(exec, TypeError); 643 643 … … 656 656 JSValue JSC_HOST_CALL dateProtoFuncGetUTCDate(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&) 657 657 { 658 if (!thisValue.i sObject(&DateInstance::info))658 if (!thisValue.inherits(&DateInstance::info)) 659 659 return throwError(exec, TypeError); 660 660 … … 673 673 JSValue JSC_HOST_CALL dateProtoFuncGetDay(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&) 674 674 { 675 if (!thisValue.i sObject(&DateInstance::info))675 if (!thisValue.inherits(&DateInstance::info)) 676 676 return throwError(exec, TypeError); 677 677 … … 690 690 JSValue JSC_HOST_CALL dateProtoFuncGetUTCDay(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&) 691 691 { 692 if (!thisValue.i sObject(&DateInstance::info))692 if (!thisValue.inherits(&DateInstance::info)) 693 693 return throwError(exec, TypeError); 694 694 … … 707 707 JSValue JSC_HOST_CALL dateProtoFuncGetHours(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&) 708 708 { 709 if (!thisValue.i sObject(&DateInstance::info))709 if (!thisValue.inherits(&DateInstance::info)) 710 710 return throwError(exec, TypeError); 711 711 … … 724 724 JSValue JSC_HOST_CALL dateProtoFuncGetUTCHours(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&) 725 725 { 726 if (!thisValue.i sObject(&DateInstance::info))726 if (!thisValue.inherits(&DateInstance::info)) 727 727 return throwError(exec, TypeError); 728 728 … … 741 741 JSValue JSC_HOST_CALL dateProtoFuncGetMinutes(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&) 742 742 { 743 if (!thisValue.i sObject(&DateInstance::info))743 if (!thisValue.inherits(&DateInstance::info)) 744 744 return throwError(exec, TypeError); 745 745 … … 758 758 JSValue JSC_HOST_CALL dateProtoFuncGetUTCMinutes(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&) 759 759 { 760 if (!thisValue.i sObject(&DateInstance::info))760 if (!thisValue.inherits(&DateInstance::info)) 761 761 return throwError(exec, TypeError); 762 762 … … 775 775 JSValue JSC_HOST_CALL dateProtoFuncGetSeconds(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&) 776 776 { 777 if (!thisValue.i sObject(&DateInstance::info))777 if (!thisValue.inherits(&DateInstance::info)) 778 778 return throwError(exec, TypeError); 779 779 … … 792 792 JSValue JSC_HOST_CALL dateProtoFuncGetUTCSeconds(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&) 793 793 { 794 if (!thisValue.i sObject(&DateInstance::info))794 if (!thisValue.inherits(&DateInstance::info)) 795 795 return throwError(exec, TypeError); 796 796 … … 809 809 JSValue JSC_HOST_CALL dateProtoFuncGetMilliSeconds(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&) 810 810 { 811 if (!thisValue.i sObject(&DateInstance::info))811 if (!thisValue.inherits(&DateInstance::info)) 812 812 return throwError(exec, TypeError); 813 813 … … 824 824 JSValue JSC_HOST_CALL dateProtoFuncGetUTCMilliseconds(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&) 825 825 { 826 if (!thisValue.i sObject(&DateInstance::info))826 if (!thisValue.inherits(&DateInstance::info)) 827 827 return throwError(exec, TypeError); 828 828 … … 839 839 JSValue JSC_HOST_CALL dateProtoFuncGetTimezoneOffset(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&) 840 840 { 841 if (!thisValue.i sObject(&DateInstance::info))841 if (!thisValue.inherits(&DateInstance::info)) 842 842 return throwError(exec, TypeError); 843 843 … … 856 856 JSValue JSC_HOST_CALL dateProtoFuncSetTime(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args) 857 857 { 858 if (!thisValue.i sObject(&DateInstance::info))858 if (!thisValue.inherits(&DateInstance::info)) 859 859 return throwError(exec, TypeError); 860 860 … … 869 869 static JSValue setNewValueFromTimeArgs(ExecState* exec, JSValue thisValue, const ArgList& args, int numArgsToUse, bool inputIsUTC) 870 870 { 871 if (!thisValue.i sObject(&DateInstance::info))871 if (!thisValue.inherits(&DateInstance::info)) 872 872 return throwError(exec, TypeError); 873 873 … … 900 900 static JSValue setNewValueFromDateArgs(ExecState* exec, JSValue thisValue, const ArgList& args, int numArgsToUse, bool inputIsUTC) 901 901 { 902 if (!thisValue.i sObject(&DateInstance::info))902 if (!thisValue.inherits(&DateInstance::info)) 903 903 return throwError(exec, TypeError); 904 904 … … 1021 1021 JSValue JSC_HOST_CALL dateProtoFuncSetYear(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args) 1022 1022 { 1023 if (!thisValue.i sObject(&DateInstance::info))1023 if (!thisValue.inherits(&DateInstance::info)) 1024 1024 return throwError(exec, TypeError); 1025 1025 … … 1063 1063 JSValue JSC_HOST_CALL dateProtoFuncGetYear(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&) 1064 1064 { 1065 if (!thisValue.i sObject(&DateInstance::info))1065 if (!thisValue.inherits(&DateInstance::info)) 1066 1066 return throwError(exec, TypeError); 1067 1067 -
trunk/JavaScriptCore/runtime/FunctionPrototype.cpp
r47236 r47288 85 85 JSValue JSC_HOST_CALL functionProtoFuncToString(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&) 86 86 { 87 if (thisValue.i sObject(&JSFunction::info)) {87 if (thisValue.inherits(&JSFunction::info)) { 88 88 JSFunction* function = asFunction(thisValue); 89 89 FunctionBodyNode* body = function->body(); … … 95 95 } 96 96 97 if (thisValue.i sObject(&InternalFunction::info)) {97 if (thisValue.inherits(&InternalFunction::info)) { 98 98 InternalFunction* function = asInternalFunction(thisValue); 99 99 return jsString(exec, "function " + function->name(&exec->globalData()) + "() {\n [native code]\n}"); -
trunk/JavaScriptCore/runtime/JSActivation.cpp
r47022 r47288 157 157 callFrame->setCalleeArguments(arguments); 158 158 } 159 ASSERT(arguments->i sObject(&Arguments::info));159 ASSERT(arguments->inherits(&Arguments::info)); 160 160 161 161 return arguments; -
trunk/JavaScriptCore/runtime/JSCell.h
r47267 r47288 56 56 bool isObject() const; 57 57 virtual bool isGetterSetter() const; 58 virtual bool isObject(const ClassInfo*) const;58 bool inherits(const ClassInfo*) const; 59 59 virtual bool isAPIValueWrapper() const { return false; } 60 60 -
trunk/JavaScriptCore/runtime/JSObject.h
r47267 r47288 83 83 virtual ~JSObject(); 84 84 85 bool inherits(const ClassInfo* classInfo) const { return JSCell::isObject(classInfo); }86 87 85 JSValue prototype() const; 88 86 void setPrototype(JSValue prototype); … … 209 207 210 208 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 211 221 ConstPropertyStorage propertyStorage() const { return (isUsingInlineStorage() ? m_inlineStorage : m_externalStorage); } 212 222 PropertyStorage propertyStorage() { return (isUsingInlineStorage() ? m_inlineStorage : m_externalStorage); } … … 297 307 } 298 308 299 inline bool JSCell::i sObject(const ClassInfo* info) const309 inline bool JSCell::inherits(const ClassInfo* info) const 300 310 { 301 311 for (const ClassInfo* ci = classInfo(); ci; ci = ci->parentClass) { … … 306 316 } 307 317 308 // this method is here to be after the inline declaration of JSCell::i sObject309 inline bool JSValue::i sObject(const ClassInfo* classInfo) const310 { 311 return isCell() && asCell()->i sObject(classInfo);318 // this method is here to be after the inline declaration of JSCell::inherits 319 inline bool JSValue::inherits(const ClassInfo* classInfo) const 320 { 321 return isCell() && asCell()->inherits(classInfo); 312 322 } 313 323 -
trunk/JavaScriptCore/runtime/JSValue.h
r47022 r47288 131 131 bool isGetterSetter() const; 132 132 bool isObject() const; 133 bool i sObject(const ClassInfo*) const;133 bool inherits(const ClassInfo*) const; 134 134 135 135 // Extracting the value. -
trunk/JavaScriptCore/runtime/RegExpConstructor.cpp
r47239 r47288 331 331 JSValue arg1 = args.at(1); 332 332 333 if (arg0.i sObject(&RegExpObject::info)) {333 if (arg0.inherits(&RegExpObject::info)) { 334 334 if (!arg1.isUndefined()) 335 335 return throwError(exec, TypeError, "Cannot supply flags when constructing one RegExp from another."); -
trunk/JavaScriptCore/runtime/RegExpPrototype.cpp
r47239 r47288 60 60 JSValue JSC_HOST_CALL regExpProtoFuncTest(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args) 61 61 { 62 if (!thisValue.i sObject(&RegExpObject::info))62 if (!thisValue.inherits(&RegExpObject::info)) 63 63 return throwError(exec, TypeError); 64 64 return asRegExpObject(thisValue)->test(exec, args); … … 67 67 JSValue JSC_HOST_CALL regExpProtoFuncExec(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args) 68 68 { 69 if (!thisValue.i sObject(&RegExpObject::info))69 if (!thisValue.inherits(&RegExpObject::info)) 70 70 return throwError(exec, TypeError); 71 71 return asRegExpObject(thisValue)->exec(exec, args); … … 74 74 JSValue JSC_HOST_CALL regExpProtoFuncCompile(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args) 75 75 { 76 if (!thisValue.i sObject(&RegExpObject::info))76 if (!thisValue.inherits(&RegExpObject::info)) 77 77 return throwError(exec, TypeError); 78 78 … … 81 81 JSValue arg1 = args.at(1); 82 82 83 if (arg0.i sObject(&RegExpObject::info)) {83 if (arg0.inherits(&RegExpObject::info)) { 84 84 if (!arg1.isUndefined()) 85 85 return throwError(exec, TypeError, "Cannot supply flags when constructing one RegExp from another."); … … 101 101 JSValue JSC_HOST_CALL regExpProtoFuncToString(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&) 102 102 { 103 if (!thisValue.i sObject(&RegExpObject::info)) {104 if (thisValue.i sObject(&RegExpPrototype::info))103 if (!thisValue.inherits(&RegExpObject::info)) { 104 if (thisValue.inherits(&RegExpPrototype::info)) 105 105 return jsNontrivialString(exec, "//"); 106 106 return throwError(exec, TypeError); -
trunk/JavaScriptCore/runtime/ScopeChain.cpp
r44224 r47288 57 57 ScopeChainIterator iter = this->begin(); 58 58 ScopeChainIterator end = this->end(); 59 while (!(*iter)->i sObject(&JSActivation::info)) {59 while (!(*iter)->inherits(&JSActivation::info)) { 60 60 ++iter; 61 61 if (iter == end) -
trunk/JavaScriptCore/runtime/StringPrototype.cpp
r47239 r47288 222 222 replacementString = replacement.toString(exec); 223 223 224 if (pattern.i sObject(&RegExpObject::info)) {224 if (pattern.inherits(&RegExpObject::info)) { 225 225 RegExp* reg = asRegExpObject(pattern)->regExp(); 226 226 bool global = reg->global(); … … 367 367 return thisValue; 368 368 369 if (thisValue.i sObject(&StringObject::info))369 if (thisValue.inherits(&StringObject::info)) 370 370 return asStringObject(thisValue)->internalValue(); 371 371 … … 468 468 RefPtr<RegExp> reg; 469 469 RegExpObject* imp = 0; 470 if (a0.i sObject(&RegExpObject::info))470 if (a0.inherits(&RegExpObject::info)) 471 471 reg = asRegExpObject(a0)->regExp(); 472 472 else { … … 518 518 UString u = s; 519 519 RefPtr<RegExp> reg; 520 if (a0.i sObject(&RegExpObject::info))520 if (a0.inherits(&RegExpObject::info)) 521 521 reg = asRegExpObject(a0)->regExp(); 522 522 else { … … 570 570 int p0 = 0; 571 571 unsigned limit = a1.isUndefined() ? 0xFFFFFFFFU : a1.toUInt32(exec); 572 if (a0.i sObject(&RegExpObject::info)) {572 if (a0.inherits(&RegExpObject::info)) { 573 573 RegExp* reg = asRegExpObject(a0)->regExp(); 574 574 if (s.isEmpty() && reg->match(s, 0) >= 0) { -
trunk/WebCore/ChangeLog
r47282 r47288 1 2009-08-14 Darin Adler <darin@apple.com> 2 3 Reviewed by Sam Weinig. 4 5 Rename the confusing isObject(<class>) to inherits(<class>). 6 It still works on non-objects, returning false. 7 8 * bindings/js/JSEventTarget.cpp: 9 (WebCore::toEventTarget): 10 * bindings/js/JSGeolocationCustom.cpp: 11 (WebCore::createPositionCallback): 12 (WebCore::createPositionErrorCallback): 13 * bindings/js/JSNodeFilterCustom.cpp: 14 (WebCore::toNodeFilter): 15 * bindings/js/JSXMLHttpRequestCustom.cpp: 16 (WebCore::JSXMLHttpRequest::send): 17 * bindings/js/JSXSLTProcessorCustom.cpp: 18 (WebCore::JSXSLTProcessor::importStylesheet): 19 (WebCore::JSXSLTProcessor::transformToFragment): 20 (WebCore::JSXSLTProcessor::transformToDocument): 21 * bindings/scripts/CodeGeneratorJS.pm: 22 * bridge/objc/objc_runtime.mm: 23 (JSC::Bindings::callObjCFallbackObject): 24 * bridge/runtime_method.cpp: 25 (JSC::callRuntimeMethod): 26 Updated to new name, inherits, from old name, isObject. 27 1 28 2009-08-14 Yael Aharon <yael.aharon@nokia.com> 2 29 -
trunk/WebCore/bindings/js/JSEventTarget.cpp
r47056 r47288 129 129 { 130 130 #define CONVERT_TO_EVENT_TARGET(type) \ 131 if (value.i sObject(&JS##type::s_info)) \131 if (value.inherits(&JS##type::s_info)) \ 132 132 return static_cast<JS##type*>(asObject(value))->impl(); 133 133 … … 137 137 CONVERT_TO_EVENT_TARGET(MessagePort) 138 138 139 if (value.i sObject(&JSDOMWindowShell::s_info))139 if (value.inherits(&JSDOMWindowShell::s_info)) 140 140 return static_cast<JSDOMWindowShell*>(asObject(value))->impl(); 141 141 -
trunk/WebCore/bindings/js/JSGeolocationCustom.cpp
r47252 r47288 45 45 { 46 46 // The spec specifies 'FunctionOnly' for this object. 47 if (!value.i sObject(&InternalFunction::info)) {47 if (!value.inherits(&InternalFunction::info)) { 48 48 setDOMException(exec, TYPE_MISMATCH_ERR); 49 49 return 0; … … 62 62 63 63 // The spec specifies 'FunctionOnly' for this object. 64 if (!value.i sObject(&InternalFunction::info)) {64 if (!value.inherits(&InternalFunction::info)) { 65 65 setDOMException(exec, TYPE_MISMATCH_ERR); 66 66 return 0; -
trunk/WebCore/bindings/js/JSNodeFilterCustom.cpp
r47022 r47288 49 49 PassRefPtr<NodeFilter> toNodeFilter(JSValue value) 50 50 { 51 if (value.i sObject(&JSNodeFilter::s_info))51 if (value.inherits(&JSNodeFilter::s_info)) 52 52 return static_cast<JSNodeFilter*>(asObject(value))->impl(); 53 53 -
trunk/WebCore/bindings/js/JSXMLHttpRequestCustom.cpp
r47022 r47288 124 124 if (val.isUndefinedOrNull()) 125 125 impl()->send(ec); 126 else if (val.i sObject(&JSDocument::s_info))126 else if (val.inherits(&JSDocument::s_info)) 127 127 impl()->send(toDocument(val), ec); 128 else if (val.i sObject(&JSFile::s_info))128 else if (val.inherits(&JSFile::s_info)) 129 129 impl()->send(toFile(val), ec); 130 130 else -
trunk/WebCore/bindings/js/JSXSLTProcessorCustom.cpp
r43122 r47288 50 50 { 51 51 JSValue nodeVal = args.at(0); 52 if (nodeVal.i sObject(&JSNode::s_info)) {52 if (nodeVal.inherits(&JSNode::s_info)) { 53 53 JSNode* node = static_cast<JSNode*>(asObject(nodeVal)); 54 54 impl()->importStylesheet(node->impl()); … … 63 63 JSValue nodeVal = args.at(0); 64 64 JSValue docVal = args.at(1); 65 if (nodeVal.i sObject(&JSNode::s_info) && docVal.isObject(&JSDocument::s_info)) {65 if (nodeVal.inherits(&JSNode::s_info) && docVal.inherits(&JSDocument::s_info)) { 66 66 WebCore::Node* node = static_cast<JSNode*>(asObject(nodeVal))->impl(); 67 67 Document* doc = static_cast<Document*>(static_cast<JSDocument*>(asObject(docVal))->impl()); … … 75 75 { 76 76 JSValue nodeVal = args.at(0); 77 if (nodeVal.i sObject(&JSNode::s_info)) {77 if (nodeVal.inherits(&JSNode::s_info)) { 78 78 JSNode* node = static_cast<JSNode*>(asObject(nodeVal)); 79 79 RefPtr<Document> resultDocument = impl()->transformToDocument(node->impl()); -
trunk/WebCore/bindings/scripts/CodeGeneratorJS.pm
r47267 r47288 1380 1380 push(@implContent, " return throwError(exec, TypeError);\n"); 1381 1381 } else { 1382 push(@implContent, " if (!thisValue.i sObject(&${className}::s_info))\n");1382 push(@implContent, " if (!thisValue.inherits(&${className}::s_info))\n"); 1383 1383 push(@implContent, " return throwError(exec, TypeError);\n"); 1384 1384 push(@implContent, " $className* castedThisObj = static_cast<$className*>(asObject(thisValue));\n"); … … 1544 1544 push(@implContent, "{\n"); 1545 1545 1546 push(@implContent, " return value.i sObject(&${className}::s_info) ? " . ($podType ? "($podType) *" : "") . "static_cast<$className*>(asObject(value))->impl() : ");1546 push(@implContent, " return value.inherits(&${className}::s_info) ? " . ($podType ? "($podType) *" : "") . "static_cast<$className*>(asObject(value))->impl() : "); 1547 1547 if ($podType and $podType ne "float") { 1548 1548 push(@implContent, "$podType();\n}\n"); -
trunk/WebCore/bridge/objc/objc_runtime.mm
r46431 r47288 210 210 static JSValue JSC_HOST_CALL callObjCFallbackObject(ExecState* exec, JSObject* function, JSValue thisValue, const ArgList& args) 211 211 { 212 if (!thisValue.i sObject(&RuntimeObjectImp::s_info))212 if (!thisValue.inherits(&RuntimeObjectImp::s_info)) 213 213 return throwError(exec, TypeError); 214 214 -
trunk/WebCore/bridge/runtime_method.cpp
r45724 r47288 83 83 RuntimeObjectImp* imp; 84 84 85 if (thisValue.i sObject(&RuntimeObjectImp::s_info)) {85 if (thisValue.inherits(&RuntimeObjectImp::s_info)) { 86 86 imp = static_cast<RuntimeObjectImp*>(asObject(thisValue)); 87 87 } else { … … 89 89 // runtime object from the DOM object. 90 90 JSValue value = thisValue.get(exec, Identifier(exec, "__apple_runtime_object")); 91 if (value.i sObject(&RuntimeObjectImp::s_info))91 if (value.inherits(&RuntimeObjectImp::s_info)) 92 92 imp = static_cast<RuntimeObjectImp*>(asObject(value)); 93 93 else
Note: See TracChangeset
for help on using the changeset viewer.