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

Unified Diff: src/lookup.h

Issue 1147863002: Prepare GetProperty(Attributes)WithInterceptor to support elements (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/objects.h » ('j') | src/objects.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/lookup.h
diff --git a/src/lookup.h b/src/lookup.h
index 02501c73bb20668c20932c123e6239a90cc7d947..df9e63ebefb0b779ceb92fa9e5923dc4ecc7545a 100644
--- a/src/lookup.h
+++ b/src/lookup.h
@@ -120,7 +120,17 @@ class LookupIterator final BASE_EMBEDDED {
Isolate* isolate() const { return isolate_; }
State state() const { return state_; }
- Handle<Name> name() const { return name_; }
+ Handle<Name> name() const {
+ DCHECK(!IsElement());
+ return name_;
+ }
+ Handle<String> GetName() {
+ if (name_.is_null()) {
+ DCHECK(IsElement());
+ name_ = isolate_->factory()->Uint32ToString(index_);
+ }
+ return Handle<String>::cast(name_);
+ }
uint32_t index() const { return index_; }
bool IsElement() const { return index_ != kMaxUInt32; }
« no previous file with comments | « no previous file | src/objects.h » ('j') | src/objects.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698