| 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 | 7 |
| 8 /** | 8 /** |
| 9 * Kinds of elements. Use kinds instead of instanceof for maximum flexibility | 9 * Kinds of elements. Use kinds instead of instanceof for maximum flexibility |
| 10 * and sharing of similar implementation classes. | 10 * and sharing of similar implementation classes. |
| 11 */ | 11 */ |
| 12 public enum ElementKind { | 12 public enum ElementKind { |
| 13 CLASS, | 13 CLASS, |
| 14 CONSTRUCTOR, | 14 CONSTRUCTOR, |
| 15 FIELD, | 15 FIELD, |
| 16 FUNCTION_OBJECT, | 16 FUNCTION_OBJECT, |
| 17 LABEL, | 17 LABEL, |
| 18 METHOD, | 18 METHOD, |
| 19 PARAMETER, | 19 PARAMETER, |
| 20 TYPE_VARIABLE, | 20 TYPE_VARIABLE, |
| 21 VARIABLE, | 21 VARIABLE, |
| 22 FUNCTION_TYPE_ALIAS, | 22 FUNCTION_TYPE_ALIAS, |
| 23 DYNAMIC, | 23 DYNAMIC, |
| 24 LIBRARY, | 24 LIBRARY, |
| 25 LIBRARY_PREFIX, |
| 25 SUPER, | 26 SUPER, |
| 26 NONE, | 27 NONE, |
| 27 VOID; | 28 VOID; |
| 28 | 29 |
| 29 public static ElementKind of(Element element) { | 30 public static ElementKind of(Element element) { |
| 30 if (element != null) { | 31 if (element != null) { |
| 31 return element.getKind(); | 32 return element.getKind(); |
| 32 } else { | 33 } else { |
| 33 return NONE; | 34 return NONE; |
| 34 } | 35 } |
| 35 } | 36 } |
| 36 } | 37 } |
| OLD | NEW |