OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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-computed-property-names | 5 // Flags: --harmony-computed-property-names |
6 | 6 |
7 | 7 |
8 function ID(x) { | 8 function ID(x) { |
9 return x; | 9 return x; |
10 } | 10 } |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 var object = { | 256 var object = { |
257 __proto__: proto | 257 __proto__: proto |
258 }; | 258 }; |
259 assertEquals(proto, Object.getPrototypeOf(object)); | 259 assertEquals(proto, Object.getPrototypeOf(object)); |
260 | 260 |
261 object = { | 261 object = { |
262 '__proto__': proto | 262 '__proto__': proto |
263 }; | 263 }; |
264 assertEquals(proto, Object.getPrototypeOf(object)); | 264 assertEquals(proto, Object.getPrototypeOf(object)); |
265 | 265 |
266 var object = { | 266 object = { |
267 ['__proto__']: proto | 267 ['__proto__']: proto |
268 }; | 268 }; |
269 assertEquals(Object.prototype, Object.getPrototypeOf(object)); | 269 assertEquals(Object.prototype, Object.getPrototypeOf(object)); |
270 assertEquals(proto, object.__proto__); | 270 assertEquals(proto, object.__proto__); |
271 assertTrue(object.hasOwnProperty('__proto__')); | 271 assertTrue(object.hasOwnProperty('__proto__')); |
| 272 |
| 273 object = { |
| 274 [ID('x')]: 'X', |
| 275 __proto__: proto |
| 276 }; |
| 277 assertEquals('X', object.x); |
| 278 assertEquals(proto, Object.getPrototypeOf(object)); |
272 })(); | 279 })(); |
OLD | NEW |