Changeset 197412 in webkit for trunk/Source/JavaScriptCore/runtime/JSObject.cpp
- Timestamp:
- Mar 1, 2016, 1:45:16 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/runtime/JSObject.cpp
r197391 r197412 1678 1678 bool JSObject::preventExtensions(JSObject* object, ExecState* exec) 1679 1679 { 1680 if (!object->isExtensible()) 1680 if (!object->isStructureExtensible()) { 1681 // We've already set the internal [[PreventExtensions]] field to false. 1682 // We don't call the methodTable isExtensible here because it's not defined 1683 // that way in the specification. We are just doing an optimization here. 1681 1684 return true; 1685 } 1682 1686 1683 1687 VM& vm = exec->vm(); … … 1685 1689 object->setStructure(vm, Structure::preventExtensionsTransition(vm, object->structure(vm))); 1686 1690 return true; 1691 } 1692 1693 bool JSObject::isExtensible(JSObject* obj, ExecState*) 1694 { 1695 return obj->isExtensibleImpl(); 1687 1696 } 1688 1697 … … 1822 1831 // 4. If current is undefined and extensible is true, then 1823 1832 if (result.isNewEntry) { 1824 if (!is Extensible()) {1833 if (!isStructureExtensible()) { 1825 1834 map->remove(result.iterator); 1826 1835 return reject(exec, throwException, "Attempting to define property on object that is not extensible."); … … 2038 2047 if (LIKELY(!map)) { 2039 2048 // If the array is not extensible, we should have entered dictionary mode, and created the sparse map. 2040 ASSERT(is Extensible());2049 ASSERT(isStructureExtensible()); 2041 2050 2042 2051 // Update m_length if necessary. … … 2064 2073 if (i >= length) { 2065 2074 // Prohibit growing the array if length is not writable. 2066 if (map->lengthIsReadOnly() || !is Extensible()) {2075 if (map->lengthIsReadOnly() || !isStructureExtensible()) { 2067 2076 if (shouldThrow) 2068 2077 throwTypeError(exec, StrictModeReadonlyPropertyWriteError); … … 2184 2193 if (LIKELY(!map)) { 2185 2194 // If the array is not extensible, we should have entered dictionary mode, and created the spare map. 2186 ASSERT(is Extensible());2195 ASSERT(isStructureExtensible()); 2187 2196 2188 2197 // Update m_length if necessary. … … 2214 2223 if (map->lengthIsReadOnly()) 2215 2224 return reject(exec, mode == PutDirectIndexShouldThrow, StrictModeReadonlyPropertyWriteError); 2216 if (!is Extensible())2225 if (!isStructureExtensible()) 2217 2226 return reject(exec, mode == PutDirectIndexShouldThrow, "Attempting to define property on object that is not extensible."); 2218 2227 } … … 2849 2858 PropertyDescriptor current; 2850 2859 bool isCurrentDefined = getOwnPropertyDescriptor(exec, propertyName, current); 2851 return validateAndApplyPropertyDescriptor(exec, this, propertyName, isExtensible(), descriptor, isCurrentDefined, current, throwException); 2860 bool isExtensible = isExtensibleInline(exec); 2861 if (UNLIKELY(exec->hadException())) 2862 return false; 2863 return validateAndApplyPropertyDescriptor(exec, this, propertyName, isExtensible, descriptor, isCurrentDefined, current, throwException); 2852 2864 } 2853 2865
Note:
See TracChangeset
for help on using the changeset viewer.