| 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 // Flags: --harmony-proxies | |
| 6 | |
| 7 var target = { | 5 var target = { |
| 8 "target_one": 1 | 6 "target_one": 1 |
| 9 }; | 7 }; |
| 10 target.__proto__ = { | 8 target.__proto__ = { |
| 11 "target_two": 2 | 9 "target_two": 2 |
| 12 }; | 10 }; |
| 13 var handler = { | 11 var handler = { |
| 14 has: function(target, name) { | 12 has: function(target, name) { |
| 15 return name == "present"; | 13 return name == "present"; |
| 16 } | 14 } |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 assertThrows("'target_one' in proxy", TypeError); | 52 assertThrows("'target_one' in proxy", TypeError); |
| 55 assertFalse("target_two" in proxy); | 53 assertFalse("target_two" in proxy); |
| 56 assertFalse("in_your_dreams" in proxy); | 54 assertFalse("in_your_dreams" in proxy); |
| 57 | 55 |
| 58 // Regression test for crbug.com/570120 (stray JSObject::cast). | 56 // Regression test for crbug.com/570120 (stray JSObject::cast). |
| 59 (function TestHasPropertyFastPath() { | 57 (function TestHasPropertyFastPath() { |
| 60 var proxy = new Proxy({}, {}); | 58 var proxy = new Proxy({}, {}); |
| 61 var object = Object.create(proxy); | 59 var object = Object.create(proxy); |
| 62 object.hasOwnProperty(0); | 60 object.hasOwnProperty(0); |
| 63 })(); | 61 })(); |
| OLD | NEW |