| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 elements.modelx; | 5 library elements.modelx; |
| 6 | 6 |
| 7 import '../common.dart'; | 7 import '../common.dart'; |
| 8 import '../common/resolution.dart' show | 8 import '../common/resolution.dart' show |
| 9 Resolution, | 9 Resolution, |
| 10 Parsing; | 10 Parsing; |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 } | 93 } |
| 94 | 94 |
| 95 bool get isClosure => false; | 95 bool get isClosure => false; |
| 96 bool get isClassMember { | 96 bool get isClassMember { |
| 97 // Check that this element is defined in the scope of a Class. | 97 // Check that this element is defined in the scope of a Class. |
| 98 return enclosingElement != null && enclosingElement.isClass; | 98 return enclosingElement != null && enclosingElement.isClass; |
| 99 } | 99 } |
| 100 bool get isInstanceMember => false; | 100 bool get isInstanceMember => false; |
| 101 bool get isDeferredLoaderGetter => false; | 101 bool get isDeferredLoaderGetter => false; |
| 102 | 102 |
| 103 bool get isFactoryConstructor => modifiers.isFactory; | |
| 104 bool get isConst => modifiers.isConst; | 103 bool get isConst => modifiers.isConst; |
| 105 bool get isFinal => modifiers.isFinal; | 104 bool get isFinal => modifiers.isFinal; |
| 106 bool get isStatic => modifiers.isStatic; | 105 bool get isStatic => modifiers.isStatic; |
| 107 bool get isOperator => Elements.isOperatorName(name); | 106 bool get isOperator => Elements.isOperatorName(name); |
| 108 | 107 |
| 109 bool get isSynthesized => false; | 108 bool get isSynthesized => false; |
| 110 | 109 |
| 111 bool get isMixinApplication => false; | 110 bool get isMixinApplication => false; |
| 112 | 111 |
| 113 bool get isLocal => false; | 112 bool get isLocal => false; |
| 114 | 113 |
| 115 // TODO(johnniwinther): This breaks for libraries (for which enclosing | 114 // TODO(johnniwinther): This breaks for libraries (for which enclosing |
| 116 // elements are null) and is invalid for top level variable declarations for | 115 // elements are null) and is invalid for top level variable declarations for |
| 117 // which the enclosing element is a VariableDeclarations and not a compilation | 116 // which the enclosing element is a VariableDeclarations and not a compilation |
| 118 // unit. | 117 // unit. |
| 119 bool get isTopLevel { | 118 bool get isTopLevel { |
| 120 return enclosingElement != null && enclosingElement.isCompilationUnit; | 119 return enclosingElement != null && enclosingElement.isCompilationUnit; |
| 121 } | 120 } |
| 122 | 121 |
| 123 bool get isAssignable { | 122 bool get isAssignable { |
| 124 if (isFinal || isConst) return false; | 123 if (isFinal || isConst) return false; |
| 125 if (isFunction || isGenerativeConstructor) return false; | 124 if (isFunction || isConstructor) return false; |
| 126 return true; | 125 return true; |
| 127 } | 126 } |
| 128 | 127 |
| 129 Token get position => null; | 128 Token get position => null; |
| 130 | 129 |
| 131 SourceSpan get sourcePosition { | 130 SourceSpan get sourcePosition { |
| 132 if (position == null) return null; | 131 if (position == null) return null; |
| 133 Uri uri = compilationUnit.script.resourceUri; | 132 Uri uri = compilationUnit.script.resourceUri; |
| 134 return new SourceSpan( | 133 return new SourceSpan( |
| 135 uri, position.charOffset, position.charOffset + position.charCount); | 134 uri, position.charOffset, position.charOffset + position.charCount); |
| (...skipping 3047 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3183 AstElement get definingElement; | 3182 AstElement get definingElement; |
| 3184 | 3183 |
| 3185 bool get hasResolvedAst => definingElement.hasTreeElements; | 3184 bool get hasResolvedAst => definingElement.hasTreeElements; |
| 3186 | 3185 |
| 3187 ResolvedAst get resolvedAst { | 3186 ResolvedAst get resolvedAst { |
| 3188 return new ResolvedAst(declaration, | 3187 return new ResolvedAst(declaration, |
| 3189 definingElement.node, definingElement.treeElements); | 3188 definingElement.node, definingElement.treeElements); |
| 3190 } | 3189 } |
| 3191 | 3190 |
| 3192 } | 3191 } |
| OLD | NEW |