| 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 6247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6258 | 6258 |
| 6259 | 6259 |
| 6260 JSObject::LocalElementType JSObject::HasLocalElement(uint32_t index) { | 6260 JSObject::LocalElementType JSObject::HasLocalElement(uint32_t index) { |
| 6261 // Check access rights if needed. | 6261 // Check access rights if needed. |
| 6262 if (IsAccessCheckNeeded() && | 6262 if (IsAccessCheckNeeded() && |
| 6263 !Top::MayIndexedAccess(this, index, v8::ACCESS_HAS)) { | 6263 !Top::MayIndexedAccess(this, index, v8::ACCESS_HAS)) { |
| 6264 Top::ReportFailedAccessCheck(this, v8::ACCESS_HAS); | 6264 Top::ReportFailedAccessCheck(this, v8::ACCESS_HAS); |
| 6265 return UNDEFINED_ELEMENT; | 6265 return UNDEFINED_ELEMENT; |
| 6266 } | 6266 } |
| 6267 | 6267 |
| 6268 if (IsJSGlobalProxy()) { |
| 6269 Object* proto = GetPrototype(); |
| 6270 if (proto->IsNull()) return UNDEFINED_ELEMENT; |
| 6271 ASSERT(proto->IsJSGlobalObject()); |
| 6272 return JSObject::cast(proto)->HasLocalElement(index); |
| 6273 } |
| 6274 |
| 6268 // Check for lookup interceptor | 6275 // Check for lookup interceptor |
| 6269 if (HasIndexedInterceptor()) { | 6276 if (HasIndexedInterceptor()) { |
| 6270 return HasElementWithInterceptor(this, index) ? INTERCEPTED_ELEMENT | 6277 return HasElementWithInterceptor(this, index) ? INTERCEPTED_ELEMENT |
| 6271 : UNDEFINED_ELEMENT; | 6278 : UNDEFINED_ELEMENT; |
| 6272 } | 6279 } |
| 6273 | 6280 |
| 6274 // Handle [] on String objects. | 6281 // Handle [] on String objects. |
| 6275 if (this->IsStringObjectWithCharacterAt(index)) { | 6282 if (this->IsStringObjectWithCharacterAt(index)) { |
| 6276 return STRING_CHARACTER_ELEMENT; | 6283 return STRING_CHARACTER_ELEMENT; |
| 6277 } | 6284 } |
| (...skipping 3066 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9344 if (break_point_objects()->IsUndefined()) return 0; | 9351 if (break_point_objects()->IsUndefined()) return 0; |
| 9345 // Single beak point. | 9352 // Single beak point. |
| 9346 if (!break_point_objects()->IsFixedArray()) return 1; | 9353 if (!break_point_objects()->IsFixedArray()) return 1; |
| 9347 // Multiple break points. | 9354 // Multiple break points. |
| 9348 return FixedArray::cast(break_point_objects())->length(); | 9355 return FixedArray::cast(break_point_objects())->length(); |
| 9349 } | 9356 } |
| 9350 #endif | 9357 #endif |
| 9351 | 9358 |
| 9352 | 9359 |
| 9353 } } // namespace v8::internal | 9360 } } // namespace v8::internal |
| OLD | NEW |