OLD | NEW |
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 5805 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5816 // Make sure that the top context does not change when doing | 5816 // Make sure that the top context does not change when doing |
5817 // callbacks or interceptor calls. | 5817 // callbacks or interceptor calls. |
5818 AssertNoContextChange ncc; | 5818 AssertNoContextChange ncc; |
5819 HandleScope scope; | 5819 HandleScope scope; |
5820 Handle<InterceptorInfo> interceptor(GetIndexedInterceptor()); | 5820 Handle<InterceptorInfo> interceptor(GetIndexedInterceptor()); |
5821 Handle<JSObject> receiver_handle(receiver); | 5821 Handle<JSObject> receiver_handle(receiver); |
5822 Handle<JSObject> holder_handle(this); | 5822 Handle<JSObject> holder_handle(this); |
5823 CustomArguments args(interceptor->data(), receiver, this); | 5823 CustomArguments args(interceptor->data(), receiver, this); |
5824 v8::AccessorInfo info(args.end()); | 5824 v8::AccessorInfo info(args.end()); |
5825 if (!interceptor->query()->IsUndefined()) { | 5825 if (!interceptor->query()->IsUndefined()) { |
5826 v8::IndexedPropertyQuery query = | 5826 v8::IndexedPropertyQueryImpl query = |
5827 v8::ToCData<v8::IndexedPropertyQuery>(interceptor->query()); | 5827 v8::ToCData<v8::IndexedPropertyQueryImpl>(interceptor->query()); |
5828 LOG(ApiIndexedPropertyAccess("interceptor-indexed-has", this, index)); | 5828 LOG(ApiIndexedPropertyAccess("interceptor-indexed-has", this, index)); |
5829 v8::Handle<v8::Boolean> result; | 5829 v8::Handle<v8::Value> result; |
5830 { | 5830 { |
5831 // Leaving JavaScript. | 5831 // Leaving JavaScript. |
5832 VMState state(EXTERNAL); | 5832 VMState state(EXTERNAL); |
5833 result = query(index, info); | 5833 result = query(index, info); |
5834 } | 5834 } |
5835 if (!result.IsEmpty()) return result->IsTrue(); | 5835 if (!result.IsEmpty()) { |
| 5836 // IsBoolean check would be removed when transition to new API is over. |
| 5837 if (result->IsBoolean()) { |
| 5838 return result->IsTrue() ? true : false; |
| 5839 } else { |
| 5840 ASSERT(result->IsInt32()); |
| 5841 return true; // absence of property is signaled by empty handle. |
| 5842 } |
| 5843 } |
5836 } else if (!interceptor->getter()->IsUndefined()) { | 5844 } else if (!interceptor->getter()->IsUndefined()) { |
5837 v8::IndexedPropertyGetter getter = | 5845 v8::IndexedPropertyGetter getter = |
5838 v8::ToCData<v8::IndexedPropertyGetter>(interceptor->getter()); | 5846 v8::ToCData<v8::IndexedPropertyGetter>(interceptor->getter()); |
5839 LOG(ApiIndexedPropertyAccess("interceptor-indexed-has-get", this, index)); | 5847 LOG(ApiIndexedPropertyAccess("interceptor-indexed-has-get", this, index)); |
5840 v8::Handle<v8::Value> result; | 5848 v8::Handle<v8::Value> result; |
5841 { | 5849 { |
5842 // Leaving JavaScript. | 5850 // Leaving JavaScript. |
5843 VMState state(EXTERNAL); | 5851 VMState state(EXTERNAL); |
5844 result = getter(index, info); | 5852 result = getter(index, info); |
5845 } | 5853 } |
(...skipping 2965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8811 if (break_point_objects()->IsUndefined()) return 0; | 8819 if (break_point_objects()->IsUndefined()) return 0; |
8812 // Single beak point. | 8820 // Single beak point. |
8813 if (!break_point_objects()->IsFixedArray()) return 1; | 8821 if (!break_point_objects()->IsFixedArray()) return 1; |
8814 // Multiple break points. | 8822 // Multiple break points. |
8815 return FixedArray::cast(break_point_objects())->length(); | 8823 return FixedArray::cast(break_point_objects())->length(); |
8816 } | 8824 } |
8817 #endif | 8825 #endif |
8818 | 8826 |
8819 | 8827 |
8820 } } // namespace v8::internal | 8828 } } // namespace v8::internal |
OLD | NEW |