Changeset 15482 in webkit for trunk/JavaScriptCore/kjs/internal.cpp
- Timestamp:
- Jul 17, 2006, 1:20:28 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/internal.cpp
r14834 r15482 217 217 } 218 218 219 bool InternalFunctionImp::hasInstance(ExecState *exec, JSValue *value)220 {221 if (!value->isObject())222 return false;223 224 JSValue *prot = get(exec,prototypePropertyName);225 if (!prot->isObject() && !prot->isNull()) {226 throwError(exec, TypeError, "Invalid prototype encountered in instanceof operation.");227 return false;228 }229 230 JSObject *v = static_cast<JSObject *>(value);231 while ((v = v->prototype()->getObject())) {232 if (v == prot)233 return true;234 }235 return false;236 }237 238 219 // ------------------------------ global functions ----------------------------- 239 220
Note:
See TracChangeset
for help on using the changeset viewer.