Changeset 180173 in webkit for trunk/Source/JavaScriptCore/runtime/JSObject.cpp
- Timestamp:
- Feb 16, 2015, 2:10:12 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/runtime/JSObject.cpp
r178928 r180173 256 256 ASSERT(info); 257 257 return info->className; 258 } 259 260 String JSObject::calculatedClassName(JSObject* object) 261 { 262 String prototypeFunctionName; 263 ExecState* exec = object->globalObject()->globalExec(); 264 PropertySlot slot(object->structure()->storedPrototype()); 265 PropertyName constructor(exec->propertyNames().constructor); 266 if (object->getPropertySlot(exec, constructor, slot)) { 267 if (slot.isValue()) { 268 JSValue constructorValue = slot.getValue(exec, constructor); 269 if (constructorValue.isCell()) { 270 if (JSCell* constructorCell = constructorValue.asCell()) { 271 if (JSObject* ctorObject = constructorCell->getObject()) { 272 if (JSFunction* constructorFunction = jsDynamicCast<JSFunction*>(ctorObject)) 273 prototypeFunctionName = constructorFunction->calculatedDisplayName(exec); 274 else if (InternalFunction* constructorFunction = jsDynamicCast<InternalFunction*>(ctorObject)) 275 prototypeFunctionName = constructorFunction->calculatedDisplayName(exec); 276 } 277 } 278 } 279 } 280 } 281 282 if (prototypeFunctionName.isNull() || prototypeFunctionName == "Object") { 283 String tableClassName = object->methodTable()->className(object); 284 if (!tableClassName.isNull() && tableClassName != "Object") 285 return tableClassName; 286 287 String classInfoName = object->classInfo()->className; 288 if (!classInfoName.isNull()) 289 return classInfoName; 290 291 if (prototypeFunctionName.isNull()) 292 return ASCIILiteral("Object"); 293 } 294 295 return prototypeFunctionName; 258 296 } 259 297
Note:
See TracChangeset
for help on using the changeset viewer.