| 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 6038 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6049 | 6049 |
| 6050 | 6050 |
| 6051 JSObject::LocalElementType JSObject::HasLocalElement(uint32_t index) { | 6051 JSObject::LocalElementType JSObject::HasLocalElement(uint32_t index) { |
| 6052 // Check access rights if needed. | 6052 // Check access rights if needed. |
| 6053 if (IsAccessCheckNeeded() && | 6053 if (IsAccessCheckNeeded() && |
| 6054 !Top::MayIndexedAccess(this, index, v8::ACCESS_HAS)) { | 6054 !Top::MayIndexedAccess(this, index, v8::ACCESS_HAS)) { |
| 6055 Top::ReportFailedAccessCheck(this, v8::ACCESS_HAS); | 6055 Top::ReportFailedAccessCheck(this, v8::ACCESS_HAS); |
| 6056 return UNDEFINED_ELEMENT; | 6056 return UNDEFINED_ELEMENT; |
| 6057 } | 6057 } |
| 6058 | 6058 |
| 6059 if (IsJSGlobalProxy()) { |
| 6060 Object* proto = GetPrototype(); |
| 6061 if (proto->IsNull()) return UNDEFINED_ELEMENT; |
| 6062 ASSERT(proto->IsJSGlobalObject()); |
| 6063 return JSObject::cast(proto)->HasLocalElement(index); |
| 6064 } |
| 6065 |
| 6059 // Check for lookup interceptor | 6066 // Check for lookup interceptor |
| 6060 if (HasIndexedInterceptor()) { | 6067 if (HasIndexedInterceptor()) { |
| 6061 return HasElementWithInterceptor(this, index) ? INTERCEPTED_ELEMENT | 6068 return HasElementWithInterceptor(this, index) ? INTERCEPTED_ELEMENT |
| 6062 : UNDEFINED_ELEMENT; | 6069 : UNDEFINED_ELEMENT; |
| 6063 } | 6070 } |
| 6064 | 6071 |
| 6065 // Handle [] on String objects. | 6072 // Handle [] on String objects. |
| 6066 if (this->IsStringObjectWithCharacterAt(index)) { | 6073 if (this->IsStringObjectWithCharacterAt(index)) { |
| 6067 return STRING_CHARACTER_ELEMENT; | 6074 return STRING_CHARACTER_ELEMENT; |
| 6068 } | 6075 } |
| (...skipping 2967 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9036 if (break_point_objects()->IsUndefined()) return 0; | 9043 if (break_point_objects()->IsUndefined()) return 0; |
| 9037 // Single beak point. | 9044 // Single beak point. |
| 9038 if (!break_point_objects()->IsFixedArray()) return 1; | 9045 if (!break_point_objects()->IsFixedArray()) return 1; |
| 9039 // Multiple break points. | 9046 // Multiple break points. |
| 9040 return FixedArray::cast(break_point_objects())->length(); | 9047 return FixedArray::cast(break_point_objects())->length(); |
| 9041 } | 9048 } |
| 9042 #endif | 9049 #endif |
| 9043 | 9050 |
| 9044 | 9051 |
| 9045 } } // namespace v8::internal | 9052 } } // namespace v8::internal |
| OLD | NEW |