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

Side by Side Diff: src/property.h

Issue 11554019: Object.observe: Make array length and other magic data properties work correctly. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years 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
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 bool IsFound() { return lookup_type_ != NOT_FOUND; } 303 bool IsFound() { return lookup_type_ != NOT_FOUND; }
304 bool IsTransition() { return lookup_type_ == TRANSITION_TYPE; } 304 bool IsTransition() { return lookup_type_ == TRANSITION_TYPE; }
305 bool IsHandler() { return lookup_type_ == HANDLER_TYPE; } 305 bool IsHandler() { return lookup_type_ == HANDLER_TYPE; }
306 bool IsInterceptor() { return lookup_type_ == INTERCEPTOR_TYPE; } 306 bool IsInterceptor() { return lookup_type_ == INTERCEPTOR_TYPE; }
307 307
308 // Is the result is a property excluding transitions and the null descriptor? 308 // Is the result is a property excluding transitions and the null descriptor?
309 bool IsProperty() { 309 bool IsProperty() {
310 return IsFound() && !IsTransition(); 310 return IsFound() && !IsTransition();
311 } 311 }
312 312
313 bool IsDataProperty() {
314 switch (type()) {
315 case FIELD:
316 case NORMAL:
317 case CONSTANT_FUNCTION:
318 return true;
319 case CALLBACKS:
320 return GetCallbackObject()->IsForeign();
Michael Starzinger 2012/12/12 15:34:05 I think AccessorInfo callbacks should also return
rossberg 2012/12/12 15:41:10 Done.
321 default:
Michael Starzinger 2012/12/12 15:34:05 I think Sven has to say something about this defau
rossberg 2012/12/12 15:41:10 Unfolded default (also in GetLazyValue below).
322 return false;
323 }
324 }
325
313 bool IsCacheable() { return cacheable_; } 326 bool IsCacheable() { return cacheable_; }
314 void DisallowCaching() { cacheable_ = false; } 327 void DisallowCaching() { cacheable_ = false; }
315 328
316 Object* GetLazyValue() { 329 Object* GetLazyValue() {
317 switch (type()) { 330 switch (type()) {
318 case FIELD: 331 case FIELD:
319 return holder()->FastPropertyAt(GetFieldIndex().field_index()); 332 return holder()->FastPropertyAt(GetFieldIndex().field_index());
320 case NORMAL: { 333 case NORMAL: {
321 Object* value; 334 Object* value;
322 value = holder()->property_dictionary()->ValueAt(GetDictionaryEntry()); 335 value = holder()->property_dictionary()->ValueAt(GetDictionaryEntry());
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
447 JSReceiver* holder_; 460 JSReceiver* holder_;
448 int number_; 461 int number_;
449 bool cacheable_; 462 bool cacheable_;
450 PropertyDetails details_; 463 PropertyDetails details_;
451 }; 464 };
452 465
453 466
454 } } // namespace v8::internal 467 } } // namespace v8::internal
455 468
456 #endif // V8_PROPERTY_H_ 469 #endif // V8_PROPERTY_H_
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | src/v8natives.js » ('j') | src/v8natives.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698