Changeset 180564 in webkit for trunk/Source/JavaScriptCore/runtime/Arguments.cpp
- Timestamp:
- Feb 24, 2015, 9:08:06 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/runtime/Arguments.cpp
r179887 r180564 82 82 83 83 default: 84 return;84 RELEASE_ASSERT_NOT_REACHED(); 85 85 } 86 86 } … … 296 296 if (i < thisObject->m_numArguments) { 297 297 RELEASE_ASSERT(i < PropertyName::NotAnIndex); 298 // If the property is not yet present on the object, and is not yet marked as deleted, then add it now. 299 PropertySlot slot(thisObject); 300 if (!thisObject->isDeletedArgument(i) && !JSObject::getOwnPropertySlot(thisObject, exec, propertyName, slot)) { 298 299 if (thisObject->isArgument(i)) { 300 if (!descriptor.isAccessorDescriptor()) { 301 // If the property is not deleted and we are using a non-accessor descriptor, then 302 // make sure that the aliased argument sees the value. 303 if (descriptor.value()) 304 thisObject->trySetArgument(exec->vm(), i, descriptor.value()); 305 306 // If the property is not deleted and we are using a non-accessor, writable 307 // descriptor, then we are done. The argument continues to be aliased. Note that we 308 // ignore the request to change enumerability. We appear to have always done so, in 309 // cases where the argument was still aliased. 310 // FIXME: https://bugs.webkit.org/show_bug.cgi?id=141952 311 if (descriptor.writable()) 312 return true; 313 } 314 315 // If the property is a non-deleted argument, then move it into the base object and then 316 // delete it. 301 317 JSValue value = thisObject->tryGetArgument(i); 302 318 ASSERT(value); 303 319 object->putDirectMayBeIndex(exec, propertyName, value); 304 } 305 if (!Base::defineOwnProperty(object, exec, propertyName, descriptor, shouldThrow)) 306 return false; 307 308 // From ES 5.1, 10.6 Arguments Object 309 // 5. If the value of isMapped is not undefined, then 310 if (thisObject->isArgument(i)) { 311 // a. If IsAccessorDescriptor(Desc) is true, then 312 if (descriptor.isAccessorDescriptor()) { 313 // i. Call the [[Delete]] internal method of map passing P, and false as the arguments. 314 thisObject->tryDeleteArgument(exec->vm(), i); 315 } else { // b. Else 316 // i. If Desc.[[Value]] is present, then 317 // 1. Call the [[Put]] internal method of map passing P, Desc.[[Value]], and Throw as the arguments. 318 if (descriptor.value()) 319 thisObject->trySetArgument(exec->vm(), i, descriptor.value()); 320 // ii. If Desc.[[Writable]] is present and its value is false, then 321 // 1. Call the [[Delete]] internal method of map passing P and false as arguments. 322 if (descriptor.writablePresent() && !descriptor.writable()) 323 thisObject->tryDeleteArgument(exec->vm(), i); 324 } 325 } 326 return true; 320 thisObject->tryDeleteArgument(exec->vm(), i); 321 } 322 323 // Now just let the normal object machinery do its thing. 324 return Base::defineOwnProperty(object, exec, propertyName, descriptor, shouldThrow); 327 325 } 328 326
Note:
See TracChangeset
for help on using the changeset viewer.