Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index 29ccacf42138c66421b81bd8c3fa2c489e8fe040..58a34634a7ffc4842ac7a6fa6114002cacdca85b 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -3751,13 +3751,11 @@ MaybeObject* JSObject::GetHiddenPropertiesDictionary(bool create_if_absent) { |
MaybeObject* dict_alloc = StringDictionary::Allocate(kInitialSize); |
StringDictionary* dictionary; |
if (!dict_alloc->To<StringDictionary>(&dictionary)) return dict_alloc; |
- MaybeObject* store_result = |
- SetPropertyPostInterceptor(GetHeap()->hidden_symbol(), |
- dictionary, |
- DONT_ENUM, |
- kNonStrictMode); |
- if (store_result->IsFailure()) return store_result; |
- return dictionary; |
+ // Using AddProperty or SetPropertyPostInterceptor here could fail, because |
+ // object might be non-extensible. |
+ return HasFastProperties() |
+ ? AddFastProperty(GetHeap()->hidden_symbol(), dictionary, DONT_ENUM) |
+ : AddSlowProperty(GetHeap()->hidden_symbol(), dictionary, DONT_ENUM); |
} |