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

Side by Side Diff: src/objects.cc

Issue 6454001: Make sure that we never call prevent extension on the global proxy,... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-1103.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 2761 matching lines...) Expand 10 before | Expand all | Expand 10 after
2772 return context->extension()->ReferencesObject(obj); 2772 return context->extension()->ReferencesObject(obj);
2773 } 2773 }
2774 } 2774 }
2775 2775
2776 // No references to object. 2776 // No references to object.
2777 return false; 2777 return false;
2778 } 2778 }
2779 2779
2780 2780
2781 MaybeObject* JSObject::PreventExtensions() { 2781 MaybeObject* JSObject::PreventExtensions() {
2782 if (IsJSGlobalProxy()) {
2783 Object* proto = GetPrototype();
2784 if (proto->IsNull()) return this;
2785 ASSERT(proto->IsJSGlobalObject());
2786 return JSObject::cast(proto)->PreventExtensions();
2787 }
2788
2782 // If there are fast elements we normalize. 2789 // If there are fast elements we normalize.
2783 if (HasFastElements()) { 2790 if (HasFastElements()) {
2784 Object* ok; 2791 Object* ok;
2785 { MaybeObject* maybe_ok = NormalizeElements(); 2792 { MaybeObject* maybe_ok = NormalizeElements();
2786 if (!maybe_ok->ToObject(&ok)) return maybe_ok; 2793 if (!maybe_ok->ToObject(&ok)) return maybe_ok;
2787 } 2794 }
2788 } 2795 }
2789 // Make sure that we never go back to fast case. 2796 // Make sure that we never go back to fast case.
2790 element_dictionary()->set_requires_slow_elements(); 2797 element_dictionary()->set_requires_slow_elements();
2791 2798
(...skipping 7108 matching lines...) Expand 10 before | Expand all | Expand 10 after
9900 if (break_point_objects()->IsUndefined()) return 0; 9907 if (break_point_objects()->IsUndefined()) return 0;
9901 // Single beak point. 9908 // Single beak point.
9902 if (!break_point_objects()->IsFixedArray()) return 1; 9909 if (!break_point_objects()->IsFixedArray()) return 1;
9903 // Multiple break points. 9910 // Multiple break points.
9904 return FixedArray::cast(break_point_objects())->length(); 9911 return FixedArray::cast(break_point_objects())->length();
9905 } 9912 }
9906 #endif 9913 #endif
9907 9914
9908 9915
9909 } } // namespace v8::internal 9916 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-1103.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698