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 1995 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2006 AssertNoContextChange ncc; | 2006 AssertNoContextChange ncc; |
2007 | 2007 |
2008 HandleScope scope; | 2008 HandleScope scope; |
2009 Handle<InterceptorInfo> interceptor(GetNamedInterceptor()); | 2009 Handle<InterceptorInfo> interceptor(GetNamedInterceptor()); |
2010 Handle<JSObject> receiver_handle(receiver); | 2010 Handle<JSObject> receiver_handle(receiver); |
2011 Handle<JSObject> holder_handle(this); | 2011 Handle<JSObject> holder_handle(this); |
2012 Handle<String> name_handle(name); | 2012 Handle<String> name_handle(name); |
2013 CustomArguments args(interceptor->data(), receiver, this); | 2013 CustomArguments args(interceptor->data(), receiver, this); |
2014 v8::AccessorInfo info(args.end()); | 2014 v8::AccessorInfo info(args.end()); |
2015 if (!interceptor->query()->IsUndefined()) { | 2015 if (!interceptor->query()->IsUndefined()) { |
2016 v8::NamedPropertyQueryImpl query = | 2016 v8::NamedPropertyQuery query = |
2017 v8::ToCData<v8::NamedPropertyQueryImpl>(interceptor->query()); | 2017 v8::ToCData<v8::NamedPropertyQuery>(interceptor->query()); |
2018 LOG(ApiNamedPropertyAccess("interceptor-named-has", *holder_handle, name)); | 2018 LOG(ApiNamedPropertyAccess("interceptor-named-has", *holder_handle, name)); |
2019 v8::Handle<v8::Value> result; | 2019 v8::Handle<v8::Integer> result; |
2020 { | 2020 { |
2021 // Leaving JavaScript. | 2021 // Leaving JavaScript. |
2022 VMState state(EXTERNAL); | 2022 VMState state(EXTERNAL); |
2023 result = query(v8::Utils::ToLocal(name_handle), info); | 2023 result = query(v8::Utils::ToLocal(name_handle), info); |
2024 } | 2024 } |
2025 if (!result.IsEmpty()) { | 2025 if (!result.IsEmpty()) { |
2026 // Temporary complicated logic, would be removed soon. | 2026 ASSERT(result->IsInt32()); |
2027 if (result->IsBoolean()) { | 2027 return static_cast<PropertyAttributes>(result->Int32Value()); |
2028 // Convert the boolean result to a property attribute | |
2029 // specification. | |
2030 return result->IsTrue() ? NONE : ABSENT; | |
2031 } else { | |
2032 ASSERT(result->IsInt32()); | |
2033 return static_cast<PropertyAttributes>(result->Int32Value()); | |
2034 } | |
2035 } | 2028 } |
2036 } else if (!interceptor->getter()->IsUndefined()) { | 2029 } else if (!interceptor->getter()->IsUndefined()) { |
2037 v8::NamedPropertyGetter getter = | 2030 v8::NamedPropertyGetter getter = |
2038 v8::ToCData<v8::NamedPropertyGetter>(interceptor->getter()); | 2031 v8::ToCData<v8::NamedPropertyGetter>(interceptor->getter()); |
2039 LOG(ApiNamedPropertyAccess("interceptor-named-get-has", this, name)); | 2032 LOG(ApiNamedPropertyAccess("interceptor-named-get-has", this, name)); |
2040 v8::Handle<v8::Value> result; | 2033 v8::Handle<v8::Value> result; |
2041 { | 2034 { |
2042 // Leaving JavaScript. | 2035 // Leaving JavaScript. |
2043 VMState state(EXTERNAL); | 2036 VMState state(EXTERNAL); |
2044 result = getter(v8::Utils::ToLocal(name_handle), info); | 2037 result = getter(v8::Utils::ToLocal(name_handle), info); |
(...skipping 6677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8722 if (break_point_objects()->IsUndefined()) return 0; | 8715 if (break_point_objects()->IsUndefined()) return 0; |
8723 // Single beak point. | 8716 // Single beak point. |
8724 if (!break_point_objects()->IsFixedArray()) return 1; | 8717 if (!break_point_objects()->IsFixedArray()) return 1; |
8725 // Multiple break points. | 8718 // Multiple break points. |
8726 return FixedArray::cast(break_point_objects())->length(); | 8719 return FixedArray::cast(break_point_objects())->length(); |
8727 } | 8720 } |
8728 #endif | 8721 #endif |
8729 | 8722 |
8730 | 8723 |
8731 } } // namespace v8::internal | 8724 } } // namespace v8::internal |
OLD | NEW |