| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 (function(global, utils) { | 5 (function(global, utils) { |
| 6 | 6 |
| 7 "use strict"; | 7 "use strict"; |
| 8 | 8 |
| 9 %CheckIsBootstrapping(); | 9 %CheckIsBootstrapping(); |
| 10 | 10 |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 function DerivedHasOwnTrap(name) { | 138 function DerivedHasOwnTrap(name) { |
| 139 return !!this.getOwnPropertyDescriptor(name) | 139 return !!this.getOwnPropertyDescriptor(name) |
| 140 } | 140 } |
| 141 | 141 |
| 142 function DerivedKeysTrap() { | 142 function DerivedKeysTrap() { |
| 143 var names = this.getOwnPropertyNames() | 143 var names = this.getOwnPropertyNames() |
| 144 var enumerableNames = [] | 144 var enumerableNames = [] |
| 145 for (var i = 0, count = 0; i < names.length; ++i) { | 145 for (var i = 0, count = 0; i < names.length; ++i) { |
| 146 var name = names[i] | 146 var name = names[i] |
| 147 if (IS_SYMBOL(name)) continue | 147 if (IS_SYMBOL(name)) continue |
| 148 var desc = this.getOwnPropertyDescriptor(TO_STRING_INLINE(name)) | 148 var desc = this.getOwnPropertyDescriptor(TO_STRING(name)) |
| 149 if (!IS_UNDEFINED(desc) && desc.enumerable) { | 149 if (!IS_UNDEFINED(desc) && desc.enumerable) { |
| 150 enumerableNames[count++] = names[i] | 150 enumerableNames[count++] = names[i] |
| 151 } | 151 } |
| 152 } | 152 } |
| 153 return enumerableNames | 153 return enumerableNames |
| 154 } | 154 } |
| 155 | 155 |
| 156 function DerivedEnumerateTrap() { | 156 function DerivedEnumerateTrap() { |
| 157 var names = this.getPropertyNames() | 157 var names = this.getPropertyNames() |
| 158 var enumerableNames = [] | 158 var enumerableNames = [] |
| 159 for (var i = 0, count = 0; i < names.length; ++i) { | 159 for (var i = 0, count = 0; i < names.length; ++i) { |
| 160 var name = names[i] | 160 var name = names[i] |
| 161 if (IS_SYMBOL(name)) continue | 161 if (IS_SYMBOL(name)) continue |
| 162 var desc = this.getPropertyDescriptor(TO_STRING_INLINE(name)) | 162 var desc = this.getPropertyDescriptor(TO_STRING(name)) |
| 163 if (!IS_UNDEFINED(desc)) { | 163 if (!IS_UNDEFINED(desc)) { |
| 164 if (!desc.configurable) { | 164 if (!desc.configurable) { |
| 165 throw MakeTypeError(kProxyPropNotConfigurable, | 165 throw MakeTypeError(kProxyPropNotConfigurable, |
| 166 this, name, "getPropertyDescriptor") | 166 this, name, "getPropertyDescriptor") |
| 167 } | 167 } |
| 168 if (desc.enumerable) enumerableNames[count++] = names[i] | 168 if (desc.enumerable) enumerableNames[count++] = names[i] |
| 169 } | 169 } |
| 170 } | 170 } |
| 171 return enumerableNames | 171 return enumerableNames |
| 172 } | 172 } |
| (...skipping 28 matching lines...) Expand all Loading... |
| 201 }); | 201 }); |
| 202 | 202 |
| 203 %InstallToContext([ | 203 %InstallToContext([ |
| 204 "derived_get_trap", DerivedGetTrap, | 204 "derived_get_trap", DerivedGetTrap, |
| 205 "derived_has_trap", DerivedHasTrap, | 205 "derived_has_trap", DerivedHasTrap, |
| 206 "derived_set_trap", DerivedSetTrap, | 206 "derived_set_trap", DerivedSetTrap, |
| 207 "proxy_enumerate", ProxyEnumerate, | 207 "proxy_enumerate", ProxyEnumerate, |
| 208 ]); | 208 ]); |
| 209 | 209 |
| 210 }) | 210 }) |
| OLD | NEW |