OLD | NEW |
---|---|
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 main() { | 5 main() { |
6 var a = [0, 1]; | 6 var a = [0, 1]; |
7 a[1.2]; /// 01: runtime error | 7 a[1.2]; |
8 a[1.2] = 4; /// 02: runtime error | 8 |
9 checkIndex(a, 1.4); /// 03: runtime error | 9 /// 01: runtime error |
Siggi Cherem (dart-lang)
2016/09/16 20:55:24
revert
Harry Terkelsen
2016/09/16 21:44:04
Done.
| |
10 checkIndexedAssignment(a, 1.4); /// 04: runtime error | 10 a[1.2] = 4; |
11 | |
12 /// 02: runtime error | |
13 checkIndex(a, 1.4); | |
14 | |
15 /// 03: runtime error | |
16 checkIndexedAssignment(a, 1.4); | |
17 | |
18 /// 04: runtime error | |
11 checkIndex(a, 0); | 19 checkIndex(a, 0); |
12 checkIndexedAssignment(a, 0); | 20 checkIndexedAssignment(a, 0); |
13 } | 21 } |
14 | 22 |
15 checkIndex(a, b) { | 23 checkIndex(a, b) { |
16 a[b]; | 24 a[b]; |
17 } | 25 } |
18 | 26 |
19 checkIndexedAssignment(a, b) { | 27 checkIndexedAssignment(a, b) { |
20 a[b] = 1; | 28 a[b] = 1; |
21 } | 29 } |
OLD | NEW |