| 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 'dart:collection'; | 5 import 'dart:collection'; |
| 6 | 6 |
| 7 import 'package:js_runtime/shared/embedded_names.dart'; | 7 import 'package:js_runtime/shared/embedded_names.dart'; |
| 8 | 8 |
| 9 import '../closure.dart'; | 9 import '../closure.dart'; |
| 10 import '../common.dart'; | 10 import '../common.dart'; |
| (...skipping 2941 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2952 if (node.arguments.isEmpty || !node.arguments.tail.isEmpty) { | 2952 if (node.arguments.isEmpty || !node.arguments.tail.isEmpty) { |
| 2953 reporter.internalError( | 2953 reporter.internalError( |
| 2954 node.argumentsNode, '"$name" requires exactly one argument.'); | 2954 node.argumentsNode, '"$name" requires exactly one argument.'); |
| 2955 } | 2955 } |
| 2956 ast.Node closure = node.arguments.head; | 2956 ast.Node closure = node.arguments.head; |
| 2957 Element element = elements[closure]; | 2957 Element element = elements[closure]; |
| 2958 if (!Elements.isStaticOrTopLevelFunction(element)) { | 2958 if (!Elements.isStaticOrTopLevelFunction(element)) { |
| 2959 reporter.internalError( | 2959 reporter.internalError( |
| 2960 closure, '"$name" requires a static or top-level method.'); | 2960 closure, '"$name" requires a static or top-level method.'); |
| 2961 } | 2961 } |
| 2962 FunctionElement function = element; | 2962 MethodElement function = element; |
| 2963 // TODO(johnniwinther): Try to eliminate the need to distinguish declaration | 2963 // TODO(johnniwinther): Try to eliminate the need to distinguish declaration |
| 2964 // and implementation signatures. Currently it is need because the | 2964 // and implementation signatures. Currently it is need because the |
| 2965 // signatures have different elements for parameters. | 2965 // signatures have different elements for parameters. |
| 2966 FunctionElement implementation = function.implementation; | 2966 FunctionElement implementation = function.implementation; |
| 2967 FunctionSignature params = implementation.functionSignature; | 2967 FunctionSignature params = implementation.functionSignature; |
| 2968 if (params.optionalParameterCount != 0) { | 2968 if (params.optionalParameterCount != 0) { |
| 2969 reporter.internalError( | 2969 reporter.internalError( |
| 2970 closure, '"$name" does not handle closure with optional parameters.'); | 2970 closure, '"$name" does not handle closure with optional parameters.'); |
| 2971 } | 2971 } |
| 2972 | 2972 |
| (...skipping 3799 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6772 this.oldReturnLocal, | 6772 this.oldReturnLocal, |
| 6773 this.oldReturnType, | 6773 this.oldReturnType, |
| 6774 this.oldResolvedAst, | 6774 this.oldResolvedAst, |
| 6775 this.oldStack, | 6775 this.oldStack, |
| 6776 this.oldLocalsHandler, | 6776 this.oldLocalsHandler, |
| 6777 this.inTryStatement, | 6777 this.inTryStatement, |
| 6778 this.allFunctionsCalledOnce, | 6778 this.allFunctionsCalledOnce, |
| 6779 this.oldElementInferenceResults) | 6779 this.oldElementInferenceResults) |
| 6780 : super(function); | 6780 : super(function); |
| 6781 } | 6781 } |
| OLD | NEW |