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