| 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 #library('universe'); | 5 #library('universe'); |
| 6 | 6 |
| 7 #import('../closure.dart'); | 7 #import('../closure.dart'); |
| 8 #import('../elements/elements.dart'); | 8 #import('../elements/elements.dart'); |
| 9 #import('../leg.dart'); | 9 #import('../leg.dart'); |
| 10 #import('../scanner/scannerlib.dart'); | 10 #import('../scanner/scannerlib.dart'); |
| (...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 396 } else { | 396 } else { |
| 397 // Visit named arguments and add them into a temporary list. | 397 // Visit named arguments and add them into a temporary list. |
| 398 List compiledNamedArguments = []; | 398 List compiledNamedArguments = []; |
| 399 for (; !arguments.isEmpty(); arguments = arguments.tail) { | 399 for (; !arguments.isEmpty(); arguments = arguments.tail) { |
| 400 NamedArgument namedArgument = arguments.head; | 400 NamedArgument namedArgument = arguments.head; |
| 401 compiledNamedArguments.add(compileArgument(namedArgument.expression)); | 401 compiledNamedArguments.add(compileArgument(namedArgument.expression)); |
| 402 } | 402 } |
| 403 // Iterate over the optional parameters of the signature, and try to | 403 // Iterate over the optional parameters of the signature, and try to |
| 404 // find them in [compiledNamedArguments]. If found, we use the | 404 // find them in [compiledNamedArguments]. If found, we use the |
| 405 // value in the temporary list, otherwise the default value. | 405 // value in the temporary list, otherwise the default value. |
| 406 parameters.forEachOptionalParameter((element) { | 406 parameters.orderedOptionalParameters.forEach((element) { |
| 407 int foundIndex = namedArguments.indexOf(element.name); | 407 int foundIndex = namedArguments.indexOf(element.name); |
| 408 if (foundIndex != -1) { | 408 if (foundIndex != -1) { |
| 409 list.add(compiledNamedArguments[foundIndex]); | 409 list.add(compiledNamedArguments[foundIndex]); |
| 410 } else { | 410 } else { |
| 411 list.add(compileConstant(element)); | 411 list.add(compileConstant(element)); |
| 412 } | 412 } |
| 413 }); | 413 }); |
| 414 } | 414 } |
| 415 return true; | 415 return true; |
| 416 } | 416 } |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 525 | 525 |
| 526 if (!self.isInterface() && self.isSubclassOf(other)) { | 526 if (!self.isInterface() && self.isSubclassOf(other)) { |
| 527 // Resolve an invocation of [element.name] on [self]. If it | 527 // Resolve an invocation of [element.name] on [self]. If it |
| 528 // is found, this selector is a candidate. | 528 // is found, this selector is a candidate. |
| 529 return hasElementIn(self, element) && appliesUntyped(element, compiler); | 529 return hasElementIn(self, element) && appliesUntyped(element, compiler); |
| 530 } | 530 } |
| 531 | 531 |
| 532 return false; | 532 return false; |
| 533 } | 533 } |
| 534 } | 534 } |
| OLD | NEW |