OLD | NEW |
---|---|
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 Loading... | |
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 proto; | |
Mads Ager (chromium)
2011/02/08 12:25:35
I don't think you should return the null prototype
Rico
2011/02/08 12:39:04
Done.
| |
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 Loading... | |
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 |
OLD | NEW |