| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 } | 123 } |
| 124 } | 124 } |
| 125 this.defineProperty(name, { | 125 this.defineProperty(name, { |
| 126 value: val, | 126 value: val, |
| 127 writable: true, | 127 writable: true, |
| 128 enumerable: true, | 128 enumerable: true, |
| 129 configurable: true}); | 129 configurable: true}); |
| 130 return true; | 130 return true; |
| 131 } | 131 } |
| 132 | 132 |
| 133 function DerivedHasTrap(name) { | |
| 134 return !!this.getPropertyDescriptor(name) | |
| 135 } | |
| 136 | |
| 137 function DerivedHasOwnTrap(name) { | 133 function DerivedHasOwnTrap(name) { |
| 138 return !!this.getOwnPropertyDescriptor(name) | 134 return !!this.getOwnPropertyDescriptor(name) |
| 139 } | 135 } |
| 140 | 136 |
| 141 function DerivedKeysTrap() { | 137 function DerivedKeysTrap() { |
| 142 var names = this.getOwnPropertyNames() | 138 var names = this.getOwnPropertyNames() |
| 143 var enumerableNames = [] | 139 var enumerableNames = [] |
| 144 for (var i = 0, count = 0; i < names.length; ++i) { | 140 for (var i = 0, count = 0; i < names.length; ++i) { |
| 145 var name = names[i] | 141 var name = names[i] |
| 146 if (IS_SYMBOL(name)) continue | 142 if (IS_SYMBOL(name)) continue |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 // Exports | 186 // Exports |
| 191 | 187 |
| 192 utils.Export(function(to) { | 188 utils.Export(function(to) { |
| 193 to.ProxyDelegateCallAndConstruct = DelegateCallAndConstruct; | 189 to.ProxyDelegateCallAndConstruct = DelegateCallAndConstruct; |
| 194 to.ProxyDerivedHasOwnTrap = DerivedHasOwnTrap; | 190 to.ProxyDerivedHasOwnTrap = DerivedHasOwnTrap; |
| 195 to.ProxyDerivedKeysTrap = DerivedKeysTrap; | 191 to.ProxyDerivedKeysTrap = DerivedKeysTrap; |
| 196 }); | 192 }); |
| 197 | 193 |
| 198 %InstallToContext([ | 194 %InstallToContext([ |
| 199 "derived_get_trap", DerivedGetTrap, | 195 "derived_get_trap", DerivedGetTrap, |
| 200 "derived_has_trap", DerivedHasTrap, | |
| 201 "derived_set_trap", DerivedSetTrap, | 196 "derived_set_trap", DerivedSetTrap, |
| 202 "proxy_enumerate", ProxyEnumerate, | 197 "proxy_enumerate", ProxyEnumerate, |
| 203 ]); | 198 ]); |
| 204 | 199 |
| 205 }) | 200 }) |
| OLD | NEW |