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

Unified Diff: src/elements.cc

Issue 467013003: Add interceptor support for symbols (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Updated to filter out non-symbol keys from for-in enumeration Created 6 years, 4 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 | « src/elements.h ('k') | src/ic/ic.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/elements.cc
diff --git a/src/elements.cc b/src/elements.cc
index 76b9b03bf62d51a0ff4a59127f809f8f441fef84..c28a34173d81cbd7304fe5041f418d4aa960263a 100644
--- a/src/elements.cc
+++ b/src/elements.cc
@@ -751,7 +751,8 @@ class ElementsAccessorBase : public ElementsAccessor {
Handle<Object> receiver,
Handle<JSObject> holder,
Handle<FixedArray> to,
- Handle<FixedArrayBase> from) V8_FINAL V8_OVERRIDE {
+ Handle<FixedArrayBase> from,
+ FixedArray::KeyFilter filter) V8_FINAL V8_OVERRIDE {
int len0 = to->length();
#ifdef ENABLE_SLOW_DCHECKS
if (FLAG_enable_slow_asserts) {
@@ -781,6 +782,11 @@ class ElementsAccessorBase : public ElementsAccessor {
FixedArray);
DCHECK(!value->IsTheHole());
+
+ if (filter == FixedArray::NON_SYMBOL_KEYS && value->IsSymbol()) {
+ continue;
+ }
+
if (!HasKey(to, value)) {
extra++;
}
@@ -814,6 +820,9 @@ class ElementsAccessorBase : public ElementsAccessor {
isolate, value,
ElementsAccessorSubclass::GetImpl(receiver, holder, key, from),
FixedArray);
+ if (filter == FixedArray::NON_SYMBOL_KEYS && value->IsSymbol()) {
+ continue;
+ }
if (!value->IsTheHole() && !HasKey(to, value)) {
result->set(len0 + index, *value);
index++;
« no previous file with comments | « src/elements.h ('k') | src/ic/ic.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698