diff options
Diffstat (limited to 'deps/v8/src/objects/dictionary.h')
-rw-r--r-- | deps/v8/src/objects/dictionary.h | 41 |
1 files changed, 23 insertions, 18 deletions
diff --git a/deps/v8/src/objects/dictionary.h b/deps/v8/src/objects/dictionary.h index 7cc0e5f5b3..4aca71d563 100644 --- a/deps/v8/src/objects/dictionary.h +++ b/deps/v8/src/objects/dictionary.h @@ -48,11 +48,11 @@ class Dictionary : public HashTable<Derived, Shape> { } // Delete a property from the dictionary. - MUST_USE_RESULT static Handle<Derived> DeleteEntry(Handle<Derived> dictionary, - int entry); + V8_WARN_UNUSED_RESULT static Handle<Derived> DeleteEntry( + Handle<Derived> dictionary, int entry); // Attempt to shrink the dictionary after deletion of key. - MUST_USE_RESULT static inline Handle<Derived> Shrink( + V8_WARN_UNUSED_RESULT static inline Handle<Derived> Shrink( Handle<Derived> dictionary) { return DerivedHashTable::Shrink(dictionary); } @@ -73,16 +73,18 @@ class Dictionary : public HashTable<Derived, Shape> { inline void SetEntry(int entry, Object* key, Object* value, PropertyDetails details); - MUST_USE_RESULT static Handle<Derived> Add(Handle<Derived> dictionary, - Key key, Handle<Object> value, - PropertyDetails details, - int* entry_out = nullptr); + V8_WARN_UNUSED_RESULT static Handle<Derived> Add(Handle<Derived> dictionary, + Key key, + Handle<Object> value, + PropertyDetails details, + int* entry_out = nullptr); protected: // Generic at put operation. - MUST_USE_RESULT static Handle<Derived> AtPut(Handle<Derived> dictionary, - Key key, Handle<Object> value, - PropertyDetails details); + V8_WARN_UNUSED_RESULT static Handle<Derived> AtPut(Handle<Derived> dictionary, + Key key, + Handle<Object> value, + PropertyDetails details); }; template <typename Key> @@ -152,7 +154,7 @@ class BaseNameDictionary : public Dictionary<Derived, Shape> { } // Creates a new dictionary. - MUST_USE_RESULT static Handle<Derived> New( + V8_WARN_UNUSED_RESULT static Handle<Derived> New( Isolate* isolate, int at_least_space_for, PretenureFlag pretenure = NOT_TENURED, MinimumCapacity capacity_option = USE_DEFAULT_MINIMUM_CAPACITY); @@ -165,6 +167,8 @@ class BaseNameDictionary : public Dictionary<Derived, Shape> { static Handle<FixedArray> IterationIndices(Handle<Derived> dictionary); // Copies enumerable keys to preallocated fixed array. + // Does not throw for uninitialized exports in module namespace objects, so + // this has to be checked separately. static void CopyEnumKeysTo(Handle<Derived> dictionary, Handle<FixedArray> storage, KeyCollectionMode mode, KeyAccumulator* accumulator); @@ -172,14 +176,15 @@ class BaseNameDictionary : public Dictionary<Derived, Shape> { // Ensure enough space for n additional elements. static Handle<Derived> EnsureCapacity(Handle<Derived> dictionary, int n); - MUST_USE_RESULT static Handle<Derived> AddNoUpdateNextEnumerationIndex( + V8_WARN_UNUSED_RESULT static Handle<Derived> AddNoUpdateNextEnumerationIndex( Handle<Derived> dictionary, Key key, Handle<Object> value, PropertyDetails details, int* entry_out = nullptr); - MUST_USE_RESULT static Handle<Derived> Add(Handle<Derived> dictionary, - Key key, Handle<Object> value, - PropertyDetails details, - int* entry_out = nullptr); + V8_WARN_UNUSED_RESULT static Handle<Derived> Add(Handle<Derived> dictionary, + Key key, + Handle<Object> value, + PropertyDetails details, + int* entry_out = nullptr); }; class NameDictionary @@ -277,7 +282,7 @@ class SimpleNumberDictionary public: DECL_CAST(SimpleNumberDictionary) // Type specific at put (default NONE attributes is used when adding). - MUST_USE_RESULT static Handle<SimpleNumberDictionary> Set( + V8_WARN_UNUSED_RESULT static Handle<SimpleNumberDictionary> Set( Handle<SimpleNumberDictionary> dictionary, uint32_t key, Handle<Object> value); @@ -298,7 +303,7 @@ class NumberDictionary DECL_CAST(NumberDictionary) // Type specific at put (default NONE attributes is used when adding). - MUST_USE_RESULT static Handle<NumberDictionary> Set( + V8_WARN_UNUSED_RESULT static Handle<NumberDictionary> Set( Handle<NumberDictionary> dictionary, uint32_t key, Handle<Object> value, Handle<JSObject> dictionary_holder = Handle<JSObject>::null(), PropertyDetails details = PropertyDetails::Empty()); |