| 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 | 5 // Flags: --harmony-proxies |
| 6 | 6 |
| 7 var target = { | 7 var target = { |
| 8 "target_one": 1 | 8 "target_one": 1 |
| 9 }; | 9 }; |
| 10 target.__proto__ = { | 10 target.__proto__ = { |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 result = false; | 47 result = false; |
| 48 assertThrows("'nonconf' in proxy", TypeError); | 48 assertThrows("'nonconf' in proxy", TypeError); |
| 49 | 49 |
| 50 // Step 9b iii. Trap result must confirm presence of all own properties of | 50 // Step 9b iii. Trap result must confirm presence of all own properties of |
| 51 // non-extensible targets. | 51 // non-extensible targets. |
| 52 Object.preventExtensions(target); | 52 Object.preventExtensions(target); |
| 53 assertThrows("'nonconf' in proxy", TypeError); | 53 assertThrows("'nonconf' in proxy", TypeError); |
| 54 assertThrows("'target_one' in proxy", TypeError); | 54 assertThrows("'target_one' in proxy", TypeError); |
| 55 assertFalse("target_two" in proxy); | 55 assertFalse("target_two" in proxy); |
| 56 assertFalse("in_your_dreams" in proxy); | 56 assertFalse("in_your_dreams" in proxy); |
| 57 |
| 58 // Regression test for crbug.com/570120 (stray JSObject::cast). |
| 59 (function TestHasPropertyFastPath() { |
| 60 var proxy = new Proxy({}, {}); |
| 61 var object = Object.create(proxy); |
| 62 object.hasOwnProperty(0); |
| 63 })(); |
| OLD | NEW |