OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 %CheckIsBootstrapping(); | 7 %CheckIsBootstrapping(); |
8 | 8 |
9 // ---------------------------------------------------------------------------- | 9 // ---------------------------------------------------------------------------- |
10 // Imports | 10 // Imports |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 return this.toString(); | 176 return this.toString(); |
177 } | 177 } |
178 | 178 |
179 | 179 |
180 // ECMA-262 - 15.2.4.4 | 180 // ECMA-262 - 15.2.4.4 |
181 function ObjectValueOf() { | 181 function ObjectValueOf() { |
182 return TO_OBJECT(this); | 182 return TO_OBJECT(this); |
183 } | 183 } |
184 | 184 |
185 | 185 |
186 // ECMA-262 - 15.2.4.5 | 186 // ES6 7.3.11 |
187 function ObjectHasOwnProperty(value) { | 187 function ObjectHasOwnProperty(value) { |
188 var name = TO_NAME(value); | 188 var name = TO_NAME(value); |
189 var object = TO_OBJECT(this); | 189 var object = TO_OBJECT(this); |
190 | |
191 if (%_IsJSProxy(object)) { | |
192 // TODO(rossberg): adjust once there is a story for symbols vs proxies. | |
193 if (IS_SYMBOL(value)) return false; | |
194 | |
195 var handler = %GetHandler(object); | |
196 return CallTrap1(handler, "hasOwn", ProxyDerivedHasOwnTrap, name); | |
197 } | |
198 return %HasOwnProperty(object, name); | 190 return %HasOwnProperty(object, name); |
199 } | 191 } |
200 | 192 |
201 | 193 |
202 // ECMA-262 - 15.2.4.6 | 194 // ECMA-262 - 15.2.4.6 |
203 function ObjectIsPrototypeOf(V) { | 195 function ObjectIsPrototypeOf(V) { |
204 if (!IS_SPEC_OBJECT(V)) return false; | 196 if (!IS_SPEC_OBJECT(V)) return false; |
205 var O = TO_OBJECT(this); | 197 var O = TO_OBJECT(this); |
206 return %_HasInPrototypeChain(V, O); | 198 return %_HasInPrototypeChain(V, O); |
207 } | 199 } |
(...skipping 1554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1762 | 1754 |
1763 %InstallToContext([ | 1755 %InstallToContext([ |
1764 "global_eval_fun", GlobalEval, | 1756 "global_eval_fun", GlobalEval, |
1765 "object_value_of", ObjectValueOf, | 1757 "object_value_of", ObjectValueOf, |
1766 "object_to_string", ObjectToString, | 1758 "object_to_string", ObjectToString, |
1767 "object_get_own_property_descriptor", ObjectGetOwnPropertyDescriptor, | 1759 "object_get_own_property_descriptor", ObjectGetOwnPropertyDescriptor, |
1768 "to_complete_property_descriptor", ToCompletePropertyDescriptor, | 1760 "to_complete_property_descriptor", ToCompletePropertyDescriptor, |
1769 ]); | 1761 ]); |
1770 | 1762 |
1771 }) | 1763 }) |
OLD | NEW |