| 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 import "package:expect/expect.dart"; | 5 import "package:expect/expect.dart"; |
| 6 import "symbol_map_helper.dart"; |
| 6 | 7 |
| 7 apply(Function function, ArgumentDescriptor args) { | 8 apply(Function function, ArgumentDescriptor args) { |
| 8 return Function.apply( | 9 return Function.apply( |
| 9 function, args.positionalArguments, args.namedArguments); | 10 function, args.positionalArguments, |
| 11 symbolMapToStringMap(args.namedArguments)); |
| 10 } | 12 } |
| 11 | 13 |
| 12 class ArgumentDescriptor { | 14 class ArgumentDescriptor { |
| 13 final List positionalArguments; | 15 final List positionalArguments; |
| 14 final Map<String, dynamic> namedArguments; | 16 final Map<String, dynamic> namedArguments; |
| 15 | 17 |
| 16 ArgumentDescriptor(this.positionalArguments, this.namedArguments); | 18 ArgumentDescriptor(this.positionalArguments, this.namedArguments); |
| 17 } | 19 } |
| 18 | 20 |
| 19 void throwsNSME(function) { | 21 void throwsNSME(function) { |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 apply(c6, new ArgumentDescriptor([], {'a': 3, 'b': 4}))); | 81 apply(c6, new ArgumentDescriptor([], {'a': 3, 'b': 4}))); |
| 80 Expect.equals('c6 4 3', | 82 Expect.equals('c6 4 3', |
| 81 apply(c6, new ArgumentDescriptor([], {'b': 3, 'a': 4}))); | 83 apply(c6, new ArgumentDescriptor([], {'b': 3, 'a': 4}))); |
| 82 Expect.equals('c6 2 3', | 84 Expect.equals('c6 2 3', |
| 83 apply(c6, new ArgumentDescriptor([], {'b': 3}))); | 85 apply(c6, new ArgumentDescriptor([], {'b': 3}))); |
| 84 throwsNSME(() => apply(c6, new ArgumentDescriptor([1], {'a': 1}))); | 86 throwsNSME(() => apply(c6, new ArgumentDescriptor([1], {'a': 1}))); |
| 85 throwsNSME(() => apply(c6, new ArgumentDescriptor([1], {}))); | 87 throwsNSME(() => apply(c6, new ArgumentDescriptor([1], {}))); |
| 86 throwsNSME(() => | 88 throwsNSME(() => |
| 87 apply(c6, new ArgumentDescriptor([], {'a': 1, 'b': 2, 'c': 3}))); | 89 apply(c6, new ArgumentDescriptor([], {'a': 1, 'b': 2, 'c': 3}))); |
| 88 } | 90 } |
| OLD | NEW |