| 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 | |
| 6 | |
| 7 | 5 |
| 8 function ID(x) { | 6 function ID(x) { |
| 9 return x; | 7 return x; |
| 10 } | 8 } |
| 11 | 9 |
| 12 | 10 |
| 13 (function TestMethodComputedNameString() { | 11 (function TestMethodComputedNameString() { |
| 14 var object = { | 12 var object = { |
| 15 a() { return 'A'}, | 13 a() { return 'A'}, |
| 16 ['b']() { return 'B'; }, | 14 ['b']() { return 'B'; }, |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 'use strict'; | 110 'use strict'; |
| 113 // ES5 does not allow duplicate keys. | 111 // ES5 does not allow duplicate keys. |
| 114 // ES6 does but we haven't changed our code yet. | 112 // ES6 does but we haven't changed our code yet. |
| 115 | 113 |
| 116 var object = { | 114 var object = { |
| 117 a() { return 1; }, | 115 a() { return 1; }, |
| 118 ['a']() { return 2; }, | 116 ['a']() { return 2; }, |
| 119 }; | 117 }; |
| 120 assertEquals(2, object.a()); | 118 assertEquals(2, object.a()); |
| 121 })(); | 119 })(); |
| OLD | NEW |