OLD | NEW |
---|---|
(Empty) | |
1 /* | |
Dmitry Stefantsov
2017/08/24 09:41:13
Please, use line comments for the preamble here an
Dmitry Stefantsov
2017/08/24 09:41:13
I think this file belongs to `pkg/kernel/testcases
sjindel
2017/08/24 11:11:43
I think I just copied it from another file (maybe
| |
2 * Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | |
3 * for details. All rights reserved. Use of this source code is governed by a | |
4 * BSD-style license that can be found in the LICENSE file. | |
5 */ | |
6 main() { | |
7 var closures = [ | |
8 (x, y, [z]) {}, | |
9 (x, y, z) {}, | |
10 (x, y, {z}) {}, | |
11 (x, y, z, w, v) {} | |
12 ]; | |
13 for (var c in closures) { | |
14 bool ok = false; | |
15 try { | |
16 c(1, 2, 3, 4); | |
17 } on NoSuchMethodError catch (_) { | |
18 ok = true; | |
19 } | |
20 if (!ok) { | |
21 throw new Exception("Expected an error!"); | |
22 } | |
23 } | |
24 } | |
OLD | NEW |