Changeset 15482 in webkit for trunk/JavaScriptCore/kjs/object.cpp
- Timestamp:
- Jul 17, 2006, 1:20:28 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/object.cpp
r15468 r15482 445 445 } 446 446 447 bool JSObject::hasInstance(ExecState *, JSValue *) 448 { 449 assert(false); 450 return false; 447 bool JSObject::hasInstance(ExecState* exec, JSValue* value) 448 { 449 JSValue* proto = get(exec, prototypePropertyName); 450 if (!proto->isObject()) { 451 throwError(exec, TypeError, "intanceof called on an object with an invalid prototype property."); 452 return false; 453 } 454 455 if (!value->isObject()) 456 return false; 457 458 JSObject* o = static_cast<JSObject*>(value); 459 while ((o = o->prototype()->getObject())) { 460 if (o == proto) 461 return true; 462 } 463 return false; 451 464 } 452 465
Note:
See TracChangeset
for help on using the changeset viewer.