Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(880)

Unified Diff: src/objects.cc

Issue 9844025: Fix hidden properties to ignore [[Extensible]]. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add comment. Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-2034.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-2034.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698