Changeset 207178 in webkit for trunk/Source/JavaScriptCore/runtime/SparseArrayValueMap.cpp
- Timestamp:
- Oct 11, 2016, 4:25:38 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/runtime/SparseArrayValueMap.cpp
r207023 r207178 118 118 SparseArrayEntry& entry = result.iterator->value; 119 119 120 // To save a separate find & add, we first always add to the sparse map. 121 // In the uncommon case that this is a new property, and the array is not 122 // extensible, this is not the right thing to have done - so remove again. 123 if (mode != PutDirectIndexLikePutDirect && result.isNewEntry && !array->isStructureExtensible()) { 124 remove(result.iterator); 125 return reject(exec, mode == PutDirectIndexShouldThrow, "Attempting to define property on object that is not extensible."); 120 if (mode != PutDirectIndexLikePutDirect && !array->isStructureExtensible()) { 121 // To save a separate find & add, we first always add to the sparse map. 122 // In the uncommon case that this is a new property, and the array is not 123 // extensible, this is not the right thing to have done - so remove again. 124 if (result.isNewEntry) { 125 remove(result.iterator); 126 return reject(exec, mode == PutDirectIndexShouldThrow, "Attempting to define property on object that is not extensible."); 127 } 128 if (entry.attributes & ReadOnly) 129 return reject(exec, mode == PutDirectIndexShouldThrow, ReadonlyPropertyWriteError); 126 130 } 127 128 131 entry.attributes = attributes; 129 132 entry.set(exec->vm(), this, value);
Note:
See TracChangeset
for help on using the changeset viewer.