Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(131)

Side by Side Diff: src/objects.cc

Issue 629008: Make sure that post-interceptor property getter doesn't assume name lookup is... (Closed) Base URL: http://v8.googlecode.com/svn/trunk/
Patch Set: Created 10 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 6152 matching lines...) Expand 10 before | Expand all | Expand 10 after
6163 return InterceptorInfo::cast(result); 6163 return InterceptorInfo::cast(result);
6164 } 6164 }
6165 6165
6166 6166
6167 Object* JSObject::GetPropertyPostInterceptor(JSObject* receiver, 6167 Object* JSObject::GetPropertyPostInterceptor(JSObject* receiver,
6168 String* name, 6168 String* name,
6169 PropertyAttributes* attributes) { 6169 PropertyAttributes* attributes) {
6170 // Check local property in holder, ignore interceptor. 6170 // Check local property in holder, ignore interceptor.
6171 LookupResult result; 6171 LookupResult result;
6172 LocalLookupRealNamedProperty(name, &result); 6172 LocalLookupRealNamedProperty(name, &result);
6173 if (result.IsValid()) return GetProperty(receiver, &result, name, attributes); 6173 if (result.IsValid()) {
6174 Object* p = GetProperty(receiver, &result, name, attributes);
6175 // Successful name lookup doesn't mean the value is there, because the
Mads Ager (chromium) 2010/02/18 08:29:30 There is something fishy going on here. The resul
6176 // name could've been introduced by the interceptor. Only return property
6177 // if it's not absent.
6178 if (*attributes != ABSENT) return p;
6179 }
6174 // Continue searching via the prototype chain. 6180 // Continue searching via the prototype chain.
6175 Object* pt = GetPrototype(); 6181 Object* pt = GetPrototype();
6176 *attributes = ABSENT; 6182 *attributes = ABSENT;
6177 if (pt == Heap::null_value()) return Heap::undefined_value(); 6183 if (pt == Heap::null_value()) return Heap::undefined_value();
6178 return pt->GetPropertyWithReceiver(receiver, name, attributes); 6184 return pt->GetPropertyWithReceiver(receiver, name, attributes);
6179 } 6185 }
6180 6186
6181 6187
6182 Object* JSObject::GetLocalPropertyPostInterceptor( 6188 Object* JSObject::GetLocalPropertyPostInterceptor(
6183 JSObject* receiver, 6189 JSObject* receiver,
(...skipping 2116 matching lines...) Expand 10 before | Expand all | Expand 10 after
8300 if (break_point_objects()->IsUndefined()) return 0; 8306 if (break_point_objects()->IsUndefined()) return 0;
8301 // Single beak point. 8307 // Single beak point.
8302 if (!break_point_objects()->IsFixedArray()) return 1; 8308 if (!break_point_objects()->IsFixedArray()) return 1;
8303 // Multiple break points. 8309 // Multiple break points.
8304 return FixedArray::cast(break_point_objects())->length(); 8310 return FixedArray::cast(break_point_objects())->length();
8305 } 8311 }
8306 #endif 8312 #endif
8307 8313
8308 8314
8309 } } // namespace v8::internal 8315 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698