OLD | NEW |
---|---|
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 1673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1684 } | 1684 } |
1685 return holder_handle->GetPropertyAttributePostInterceptor(*receiver_handle, | 1685 return holder_handle->GetPropertyAttributePostInterceptor(*receiver_handle, |
1686 *name_handle, | 1686 *name_handle, |
1687 continue_search); | 1687 continue_search); |
1688 } | 1688 } |
1689 | 1689 |
1690 | 1690 |
1691 PropertyAttributes JSObject::GetPropertyAttributeWithReceiver( | 1691 PropertyAttributes JSObject::GetPropertyAttributeWithReceiver( |
1692 JSObject* receiver, | 1692 JSObject* receiver, |
1693 String* key) { | 1693 String* key) { |
1694 uint32_t index; | 1694 uint32_t index = 0; |
bak
2008/09/26 12:21:59
Please add a comment why this assignment is necess
| |
1695 if (key->AsArrayIndex(&index)) { | 1695 if (key->AsArrayIndex(&index)) { |
1696 if (HasElementWithReceiver(receiver, index)) return NONE; | 1696 if (HasElementWithReceiver(receiver, index)) return NONE; |
1697 return ABSENT; | 1697 return ABSENT; |
1698 } | 1698 } |
1699 // Named property. | 1699 // Named property. |
1700 LookupResult result; | 1700 LookupResult result; |
1701 Lookup(key, &result); | 1701 Lookup(key, &result); |
1702 return GetPropertyAttribute(receiver, &result, key, true); | 1702 return GetPropertyAttribute(receiver, &result, key, true); |
1703 } | 1703 } |
1704 | 1704 |
(...skipping 26 matching lines...) Expand all Loading... | |
1731 UNREACHABLE(); | 1731 UNREACHABLE(); |
1732 break; | 1732 break; |
1733 } | 1733 } |
1734 } | 1734 } |
1735 return ABSENT; | 1735 return ABSENT; |
1736 } | 1736 } |
1737 | 1737 |
1738 | 1738 |
1739 PropertyAttributes JSObject::GetLocalPropertyAttribute(String* name) { | 1739 PropertyAttributes JSObject::GetLocalPropertyAttribute(String* name) { |
1740 // Check whether the name is an array index. | 1740 // Check whether the name is an array index. |
1741 uint32_t index; | 1741 uint32_t index = 0; |
bak
2008/09/26 12:21:59
Please move the assignment into AsArrayIndex in ob
| |
1742 if (name->AsArrayIndex(&index)) { | 1742 if (name->AsArrayIndex(&index)) { |
1743 if (HasLocalElement(index)) return NONE; | 1743 if (HasLocalElement(index)) return NONE; |
1744 return ABSENT; | 1744 return ABSENT; |
1745 } | 1745 } |
1746 // Named property. | 1746 // Named property. |
1747 LookupResult result; | 1747 LookupResult result; |
1748 LocalLookup(name, &result); | 1748 LocalLookup(name, &result); |
1749 return GetPropertyAttribute(this, &result, name, false); | 1749 return GetPropertyAttribute(this, &result, name, false); |
1750 } | 1750 } |
1751 | 1751 |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2003 // Check access rights if needed. | 2003 // Check access rights if needed. |
2004 if (IsAccessCheckNeeded() && | 2004 if (IsAccessCheckNeeded() && |
2005 !Top::MayNamedAccess(this, name, v8::ACCESS_DELETE)) { | 2005 !Top::MayNamedAccess(this, name, v8::ACCESS_DELETE)) { |
2006 Top::ReportFailedAccessCheck(this, v8::ACCESS_DELETE); | 2006 Top::ReportFailedAccessCheck(this, v8::ACCESS_DELETE); |
2007 return Heap::false_value(); | 2007 return Heap::false_value(); |
2008 } | 2008 } |
2009 | 2009 |
2010 // ECMA-262, 3rd, 8.6.2.5 | 2010 // ECMA-262, 3rd, 8.6.2.5 |
2011 ASSERT(name->IsString()); | 2011 ASSERT(name->IsString()); |
2012 | 2012 |
2013 uint32_t index; | 2013 uint32_t index = 0; |
2014 if (name->AsArrayIndex(&index)) { | 2014 if (name->AsArrayIndex(&index)) { |
2015 return DeleteElement(index); | 2015 return DeleteElement(index); |
2016 } else { | 2016 } else { |
2017 LookupResult result; | 2017 LookupResult result; |
2018 LocalLookup(name, &result); | 2018 LocalLookup(name, &result); |
2019 if (!result.IsValid()) return Heap::true_value(); | 2019 if (!result.IsValid()) return Heap::true_value(); |
2020 if (result.IsDontDelete()) return Heap::false_value(); | 2020 if (result.IsDontDelete()) return Heap::false_value(); |
2021 // Check for interceptor. | 2021 // Check for interceptor. |
2022 if (result.type() == INTERCEPTOR) { | 2022 if (result.type() == INTERCEPTOR) { |
2023 return DeletePropertyWithInterceptor(name); | 2023 return DeletePropertyWithInterceptor(name); |
(...skipping 4360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6384 // No break point. | 6384 // No break point. |
6385 if (break_point_objects()->IsUndefined()) return 0; | 6385 if (break_point_objects()->IsUndefined()) return 0; |
6386 // Single beak point. | 6386 // Single beak point. |
6387 if (!break_point_objects()->IsFixedArray()) return 1; | 6387 if (!break_point_objects()->IsFixedArray()) return 1; |
6388 // Multiple break points. | 6388 // Multiple break points. |
6389 return FixedArray::cast(break_point_objects())->length(); | 6389 return FixedArray::cast(break_point_objects())->length(); |
6390 } | 6390 } |
6391 | 6391 |
6392 | 6392 |
6393 } } // namespace v8::internal | 6393 } } // namespace v8::internal |
OLD | NEW |