| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 package com.google.dart.compiler.resolver; | 5 package com.google.dart.compiler.resolver; |
| 6 | 6 |
| 7 import com.google.common.annotations.VisibleForTesting; | 7 import com.google.common.annotations.VisibleForTesting; |
| 8 import com.google.dart.compiler.ast.DartClass; | 8 import com.google.dart.compiler.ast.DartClass; |
| 9 import com.google.dart.compiler.ast.DartField; | 9 import com.google.dart.compiler.ast.DartField; |
| 10 import com.google.dart.compiler.ast.DartFunctionExpression; | 10 import com.google.dart.compiler.ast.DartFunctionExpression; |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 } | 117 } |
| 118 return null; | 118 return null; |
| 119 } | 119 } |
| 120 | 120 |
| 121 public static MethodElement methodFromFunctionExpression(DartFunctionExpressio
n node, | 121 public static MethodElement methodFromFunctionExpression(DartFunctionExpressio
n node, |
| 122 Modifiers modifiers)
{ | 122 Modifiers modifiers)
{ |
| 123 return MethodElementImplementation.fromFunctionExpression(node, modifiers); | 123 return MethodElementImplementation.fromFunctionExpression(node, modifiers); |
| 124 } | 124 } |
| 125 | 125 |
| 126 @VisibleForTesting | 126 @VisibleForTesting |
| 127 public static MethodElement methodFromMethodNode(DartMethodDefinition node, | 127 public static MethodElement methodFromMethodNode(DartMethodDefinition node, |
| 128 EnclosingElement holder) { | 128 EnclosingElement holder) { |
| 129 return MethodElementImplementation.fromMethodNode(node, holder); | 129 return MethodElementImplementation.fromMethodNode(node, holder); |
| 130 } | 130 } |
| 131 | 131 |
| 132 static ConstructorElement constructorFromMethodNode(DartMethodDefinition node, | 132 static ConstructorElement constructorFromMethodNode(DartMethodDefinition node, |
| 133 String name, | 133 String name, |
| 134 ClassElement declaringClas
s, | 134 ClassElement declaringClas
s, |
| 135 ClassElement constructorTy
pe) { | 135 ClassElement constructorTy
pe) { |
| 136 return ConstructorElementImplementation.fromMethodNode(node, name, declaring
Class, | 136 return ConstructorElementImplementation.fromMethodNode(node, name, declaring
Class, |
| 137 constructorType); | 137 constructorType); |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 return VoidElement.getInstance(); | 220 return VoidElement.getInstance(); |
| 221 } | 221 } |
| 222 | 222 |
| 223 /** | 223 /** |
| 224 * Returns true if the class needs an implicit default constructor. | 224 * Returns true if the class needs an implicit default constructor. |
| 225 */ | 225 */ |
| 226 public static boolean needsImplicitDefaultConstructor(ClassElement classElemen
t) { | 226 public static boolean needsImplicitDefaultConstructor(ClassElement classElemen
t) { |
| 227 return !classElement.isObject() && classElement.getConstructors().isEmpty(); | 227 return !classElement.isObject() && classElement.getConstructors().isEmpty(); |
| 228 } | 228 } |
| 229 } | 229 } |
| OLD | NEW |