Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(682)

Side by Side Diff: tests/language/named_parameter_clash_test.dart

Issue 891673003: dart2js: Refactoring, documentation, and a few bugfixes in Namer class. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tests/language/is_operator_clash_test.dart ('k') | tests/language/private_clash_lib.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
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.
4
5 import 'package:expect/expect.dart';
6
7 class Foo {
8 m({a, b, c}) {
9 try {} catch(e) {} // no inline
10 return 'Foo $a $b $c';
11 }
12 }
13
14 class Bar {
15 m(z, {a$b, c}) {
16 try {} catch(e) {} // no inline
17 var ab = a$b;
18 return 'Bar $z $ab $c';
19 }
20 }
21
22 inscrutable(xs, i) => i == 0 ? xs[0] : inscrutable(xs.sublist(1), i-1);
23
24 main() {
25 var list = [new Foo(), new Bar()];
26 var foo = inscrutable(list, 0);
27 var bar = inscrutable(list, 1);
28
29 Expect.equals(r'Foo a b c', foo.m(a: 'a', b: 'b', c: 'c'));
30 Expect.equals(r'Bar z a$b c', bar.m('z', a$b: r'a$b', c: 'c'));
31
32 Expect.throws(() => foo.m('z', a$b: r'a$b', c: 'c'),
33 (e) => e is NoSuchMethodError);
34 Expect.throws(() => bar.m(a: 'a', b: 'b', c: 'c'),
35 (e) => e is NoSuchMethodError);
36 }
OLDNEW
« no previous file with comments | « tests/language/is_operator_clash_test.dart ('k') | tests/language/private_clash_lib.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698