OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 that Object.dynamic returns the identical object. | 5 // Test that Object.dynamic returns the identical object. |
6 | 6 |
7 main() { | 7 main() { |
8 // Primitives | 8 // Primitives |
9 var anInt = 5; | 9 var anInt = 5; |
10 var aString = 'Hello'; | 10 var aString = 'Hello'; |
(...skipping 13 matching lines...) Expand all Loading... |
24 Expect.isTrue(eq(anInt, anInt.dynamic), 'anInt.dynamic'); | 24 Expect.isTrue(eq(anInt, anInt.dynamic), 'anInt.dynamic'); |
25 Expect.isTrue(eq(aString, aString.dynamic), 'aString.dynamic'); | 25 Expect.isTrue(eq(aString, aString.dynamic), 'aString.dynamic'); |
26 Expect.isTrue(eq(aBool, aBool.dynamic), 'aBool.dynamic'); | 26 Expect.isTrue(eq(aBool, aBool.dynamic), 'aBool.dynamic'); |
27 Expect.isTrue(eq(aDouble, aDouble.dynamic), 'aDouble.dynamic'); | 27 Expect.isTrue(eq(aDouble, aDouble.dynamic), 'aDouble.dynamic'); |
28 Expect.isTrue(eq(aMap, aMap.dynamic), 'aMap.dynamic'); | 28 Expect.isTrue(eq(aMap, aMap.dynamic), 'aMap.dynamic'); |
29 } | 29 } |
30 | 30 |
31 dyn(x) => x.dynamic; | 31 dyn(x) => x.dynamic; |
32 | 32 |
33 eq(a, b) => a === b; | 33 eq(a, b) => a === b; |
OLD | NEW |