Changeset 39320 in webkit for trunk/JavaScriptCore/runtime/JSObject.cpp
- Timestamp:
- Dec 15, 2008, 4:22:14 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/runtime/JSObject.cpp
r38440 r39320 105 105 106 106 if (propertyName == exec->propertyNames().underscoreProto) { 107 JSObject* proto = value->getObject();108 109 107 // Setting __proto__ to a non-object, non-null value is silently ignored to match Mozilla. 110 if (! proto&& !value->isNull())108 if (!value->isObject() && !value->isNull()) 111 109 return; 112 113 while (proto) { 114 if (proto == this) { 110 111 JSValue* nextPrototypeValue = value; 112 while (nextPrototypeValue && nextPrototypeValue->isObject()) { 113 JSObject* nextPrototype = asObject(nextPrototypeValue)->unwrappedObject(); 114 if (nextPrototype == this) { 115 115 throwError(exec, GeneralError, "cyclic __proto__ value"); 116 116 return; 117 117 } 118 proto = proto->prototype() ? proto->prototype()->getObject() : 0;119 } 120 118 nextPrototypeValue = nextPrototype->prototype(); 119 } 120 121 121 setPrototype(value); 122 122 return; 123 123 } 124 124 125 125 // Check if there are any setters or getters in the prototype chain 126 126 JSValue* prototype; … … 459 459 } 460 460 461 JS GlobalObject* JSObject::toGlobalObject(ExecState*) const462 { 463 return 0;461 JSObject* JSObject::unwrappedObject() 462 { 463 return this; 464 464 } 465 465
Note:
See TracChangeset
for help on using the changeset viewer.