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

Side by Side Diff: src/proxy.js

Issue 12455002: ES6 symbols: filter symbols form for-in loops and Object.keys (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 9 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 | « src/property-details.h ('k') | src/runtime.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 156
157 function DerivedHasOwnTrap(name) { 157 function DerivedHasOwnTrap(name) {
158 return !!this.getOwnPropertyDescriptor(name) 158 return !!this.getOwnPropertyDescriptor(name)
159 } 159 }
160 160
161 function DerivedKeysTrap() { 161 function DerivedKeysTrap() {
162 var names = this.getOwnPropertyNames() 162 var names = this.getOwnPropertyNames()
163 var enumerableNames = [] 163 var enumerableNames = []
164 for (var i = 0, count = 0; i < names.length; ++i) { 164 for (var i = 0, count = 0; i < names.length; ++i) {
165 var name = names[i] 165 var name = names[i]
166 if (IS_SYMBOL(name)) continue
166 var desc = this.getOwnPropertyDescriptor(TO_STRING_INLINE(name)) 167 var desc = this.getOwnPropertyDescriptor(TO_STRING_INLINE(name))
167 if (!IS_UNDEFINED(desc) && desc.enumerable) { 168 if (!IS_UNDEFINED(desc) && desc.enumerable) {
168 enumerableNames[count++] = names[i] 169 enumerableNames[count++] = names[i]
169 } 170 }
170 } 171 }
171 return enumerableNames 172 return enumerableNames
172 } 173 }
173 174
174 function DerivedEnumerateTrap() { 175 function DerivedEnumerateTrap() {
175 var names = this.getPropertyNames() 176 var names = this.getPropertyNames()
176 var enumerableNames = [] 177 var enumerableNames = []
177 for (var i = 0, count = 0; i < names.length; ++i) { 178 for (var i = 0, count = 0; i < names.length; ++i) {
178 var name = names[i] 179 var name = names[i]
180 if (IS_SYMBOL(name)) continue
179 var desc = this.getPropertyDescriptor(TO_STRING_INLINE(name)) 181 var desc = this.getPropertyDescriptor(TO_STRING_INLINE(name))
180 if (!IS_UNDEFINED(desc) && desc.enumerable) { 182 if (!IS_UNDEFINED(desc) && desc.enumerable) {
181 enumerableNames[count++] = names[i] 183 enumerableNames[count++] = names[i]
182 } 184 }
183 } 185 }
184 return enumerableNames 186 return enumerableNames
185 } 187 }
186 188
187 function ProxyEnumerate(proxy) { 189 function ProxyEnumerate(proxy) {
188 var handler = %GetHandler(proxy) 190 var handler = %GetHandler(proxy)
189 if (IS_UNDEFINED(handler.enumerate)) { 191 if (IS_UNDEFINED(handler.enumerate)) {
190 return %Apply(DerivedEnumerateTrap, handler, [], 0, 0) 192 return %Apply(DerivedEnumerateTrap, handler, [], 0, 0)
191 } else { 193 } else {
192 return ToNameArray(handler.enumerate(), "enumerate") 194 return ToNameArray(handler.enumerate(), "enumerate", false)
193 } 195 }
194 } 196 }
OLDNEW
« no previous file with comments | « src/property-details.h ('k') | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698