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

Unified Diff: src/key-accumulator.cc

Issue 1474083003: [proxies] Implement [[Enumerate]] and [[OwnPropertyKeys]] (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: gcmole fix Created 5 years, 1 month 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/key-accumulator.h ('k') | src/messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/key-accumulator.cc
diff --git a/src/key-accumulator.cc b/src/key-accumulator.cc
index 91b014aacd7b688f521ebb7e131d4d0dcd76a2cb..68fe9d8cb70df5d0ab0ae2f7864d272266ec8d77 100644
--- a/src/key-accumulator.cc
+++ b/src/key-accumulator.cc
@@ -217,6 +217,18 @@ void KeyAccumulator::AddKeysFromProxy(Handle<JSObject> array_like) {
}
+void KeyAccumulator::AddKeysFromProxy(Handle<FixedArray> keys) {
+ // Proxies define a complete list of keys with no distinction of
+ // elements and properties, which breaks the normal assumption for the
+ // KeyAccumulator.
+ AddKeys(keys, PROXY_MAGIC);
+ // Invert the current length to indicate a present proxy, so we can ignore
+ // element keys for this level. Otherwise we would not fully respect the order
+ // given by the proxy.
+ level_string_length_ = -level_string_length_;
+}
+
+
void KeyAccumulator::AddElementKeysFromInterceptor(
Handle<JSObject> array_like) {
AddKeys(array_like, CONVERT_TO_ARRAY_INDEX);
« no previous file with comments | « src/key-accumulator.h ('k') | src/messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698