Changeset 210457 in webkit for trunk/Source/JavaScriptCore/runtime/SparseArrayValueMap.cpp
- Timestamp:
- Jan 6, 2017, 3:30:57 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/runtime/SparseArrayValueMap.cpp
r209897 r210457 138 138 SparseArrayEntry& entry = result.iterator->value; 139 139 140 if (mode != PutDirectIndexLikePutDirect && !array->isStructureExtensible()) {141 // To save a separate find & add, we first always add to the sparse map.142 // In the uncommon case that this is a new property, and the array is not143 // extensible, this is not the right thing to have done - so remove again.144 if (result.isNewEntry) {145 remove(result.iterator);146 return typeError(exec, scope, shouldThrow, ASCIILiteral(NonExtensibleObjectPropertyDefineError));147 } 148 149 150 } 140 // To save a separate find & add, we first always add to the sparse map. 141 // In the uncommon case that this is a new property, and the array is not 142 // extensible, this is not the right thing to have done - so remove again. 143 if (mode != PutDirectIndexLikePutDirect && result.isNewEntry && !array->isStructureExtensible()) { 144 remove(result.iterator); 145 return typeError(exec, scope, shouldThrow, ASCIILiteral(NonExtensibleObjectPropertyDefineError)); 146 } 147 148 if (entry.attributes & ReadOnly) 149 return typeError(exec, scope, shouldThrow, ASCIILiteral(ReadonlyPropertyWriteError)); 150 151 151 entry.attributes = attributes; 152 152 entry.set(vm, this, value);
Note:
See TracChangeset
for help on using the changeset viewer.