OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 // Test the use of general expression as keys in map literals. | 5 // Test the use of general expression as keys in map literals. |
6 | 6 |
7 library map_literal5_test; | 7 library map_literal5_test; |
8 | 8 |
9 import "package:expect/expect.dart"; | 9 import "package:expect/expect.dart"; |
10 | 10 |
(...skipping 23 matching lines...) Expand all Loading... |
34 | 34 |
35 create(bool b) { | 35 create(bool b) { |
36 return { | 36 return { |
37 b: 0, | 37 b: 0, |
38 m(b): n(b), | 38 m(b): n(b), |
39 b ? 1 : "foo": 2, | 39 b ? 1 : "foo": 2, |
40 }; | 40 }; |
41 } | 41 } |
42 | 42 |
43 m(bool b) => b ? 2 : "bar"; | 43 m(bool b) => b ? 2 : "bar"; |
44 n(bool b) => b ? 3 : "baz"; | 44 n(bool b) => b ? 3 : "baz"; |
OLD | NEW |