Changeset 127349 in webkit for trunk/Source/JavaScriptCore/runtime/JSArray.h
- Timestamp:
- Aug 31, 2012, 6:50:13 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/runtime/JSArray.h
r127210 r127349 31 31 class LLIntOffsetsExtractor; 32 32 33 enum PutDirectIndexMode { PutDirectIndexLikePutDirect, PutDirectIndexShouldNotThrow, PutDirectIndexShouldThrow }; 34 33 35 struct SparseArrayEntry : public WriteBarrier<Unknown> { 34 36 typedef WriteBarrier<Unknown> Base; … … 88 90 // These methods may mutate the contents of the map 89 91 void put(ExecState*, JSArray*, unsigned, JSValue, bool shouldThrow); 90 bool putDirect(ExecState*, JSArray*, unsigned, JSValue, bool shouldThrow);92 bool putDirect(ExecState*, JSArray*, unsigned, JSValue, PutDirectIndexMode); 91 93 AddResult add(JSArray*, unsigned); 92 94 iterator find(unsigned i) { return m_map.find(i); } … … 174 176 // - the prototype chain is not consulted 175 177 // - accessors are not called. 178 // - it will ignore extensibility and read-only properties if PutDirectIndexLikePutDirect is passed as the mode (the default). 176 179 // This method creates a property with attributes writable, enumerable and configurable all set to true. 177 bool putDirectIndex(ExecState* exec, unsigned propertyName, JSValue value, bool shouldThrow = true)180 bool putDirectIndex(ExecState* exec, unsigned propertyName, JSValue value, PutDirectIndexMode mode = PutDirectIndexLikePutDirect) 178 181 { 179 182 if (canSetIndex(propertyName)) { … … 181 184 return true; 182 185 } 183 return putDirectIndexBeyondVectorLength(exec, propertyName, value, shouldThrow);186 return putDirectIndexBeyondVectorLength(exec, propertyName, value, mode); 184 187 } 185 188 … … 303 306 304 307 void putByIndexBeyondVectorLength(ExecState*, unsigned propertyName, JSValue, bool shouldThrow); 305 JS_EXPORT_PRIVATE bool putDirectIndexBeyondVectorLength(ExecState*, unsigned propertyName, JSValue, bool shouldThrow);308 JS_EXPORT_PRIVATE bool putDirectIndexBeyondVectorLength(ExecState*, unsigned propertyName, JSValue, PutDirectIndexMode); 306 309 307 310 unsigned getNewVectorLength(unsigned desiredLength);
Note:
See TracChangeset
for help on using the changeset viewer.