Changeset 120897 in webkit for trunk/Source/JavaScriptCore/runtime/JSObject.cpp
- Timestamp:
- Jun 20, 2012, 6:38:49 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/runtime/JSObject.cpp
r120244 r120897 44 44 namespace JSC { 45 45 46 JSCell* getCallableObjectSlow(JSCell* cell) 47 { 48 Structure* structure = cell->structure(); 49 if (structure->typeInfo().type() == JSFunctionType) 50 return cell; 51 if (structure->classInfo()->isSubClassOf(&InternalFunction::s_info)) 52 return cell; 53 return 0; 54 } 55 46 56 ASSERT_CLASS_FITS_IN_CELL(JSObject); 47 57 ASSERT_CLASS_FITS_IN_CELL(JSNonFinalObject); … … 134 144 prototype = obj->prototype(); 135 145 if (prototype.isNull()) { 136 if (!thisObject->putDirectInternal<PutModePut>(globalData, propertyName, value, 0, slot, get JSFunction(value)) && slot.isStrictMode())146 if (!thisObject->putDirectInternal<PutModePut>(globalData, propertyName, value, 0, slot, getCallableObject(value)) && slot.isStrictMode()) 137 147 throwTypeError(exec, StrictModeReadonlyPropertyWriteError); 138 148 return; … … 181 191 } 182 192 183 if (!thisObject->putDirectInternal<PutModePut>(globalData, propertyName, value, 0, slot, get JSFunction(value)) && slot.isStrictMode())193 if (!thisObject->putDirectInternal<PutModePut>(globalData, propertyName, value, 0, slot, getCallableObject(value)) && slot.isStrictMode()) 184 194 throwTypeError(exec, StrictModeReadonlyPropertyWriteError); 185 195 return; … … 197 207 ASSERT(!value.isGetterSetter() && !(attributes & Accessor)); 198 208 PutPropertySlot slot; 199 object->putDirectInternal<PutModeDefineOwnProperty>(exec->globalData(), propertyName, value, attributes, slot, get JSFunction(value));209 object->putDirectInternal<PutModeDefineOwnProperty>(exec->globalData(), propertyName, value, attributes, slot, getCallableObject(value)); 200 210 } 201 211 … … 227 237 228 238 PutPropertySlot slot; 229 putDirectInternal<PutModeDefineOwnProperty>(globalData, propertyName, value, attributes, slot, get JSFunction(value));239 putDirectInternal<PutModeDefineOwnProperty>(globalData, propertyName, value, attributes, slot, getCallableObject(value)); 230 240 231 241 // putDirect will change our Structure if we add a new property. For
Note:
See TracChangeset
for help on using the changeset viewer.