| 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-object-literals --allow-natives-syntax | 5 // Flags: --allow-natives-syntax |
| 6 | 6 |
| 7 | 7 |
| 8 (function TestBasics() { | 8 (function TestBasics() { |
| 9 var object = { | 9 var object = { |
| 10 method() { | 10 method() { |
| 11 return 42; | 11 return 42; |
| 12 } | 12 } |
| 13 }; | 13 }; |
| 14 assertEquals(42, object.method()); | 14 assertEquals(42, object.method()); |
| 15 })(); | 15 })(); |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 var p = {}; | 305 var p = {}; |
| 306 var object = { | 306 var object = { |
| 307 __proto__() { | 307 __proto__() { |
| 308 return 1; | 308 return 1; |
| 309 }, | 309 }, |
| 310 __proto__: p | 310 __proto__: p |
| 311 }; | 311 }; |
| 312 assertEquals(p, Object.getPrototypeOf(object)); | 312 assertEquals(p, Object.getPrototypeOf(object)); |
| 313 assertEquals(1, object.__proto__()); | 313 assertEquals(1, object.__proto__()); |
| 314 })(); | 314 })(); |
| OLD | NEW |