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('elements'); | 5 #library('elements'); |
6 | 6 |
7 #import('dart:uri'); | 7 #import('dart:uri'); |
8 | 8 |
9 #import('../tree/tree.dart'); | 9 #import('../tree/tree.dart'); |
10 #import('../scanner/scannerlib.dart'); | 10 #import('../scanner/scannerlib.dart'); |
(...skipping 1293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1304 | 1304 |
1305 static bool isInstanceField(Element element) { | 1305 static bool isInstanceField(Element element) { |
1306 return (element !== null) | 1306 return (element !== null) |
1307 && element.isInstanceMember() | 1307 && element.isInstanceMember() |
1308 && (element.kind === ElementKind.FIELD | 1308 && (element.kind === ElementKind.FIELD |
1309 || element.kind === ElementKind.GETTER | 1309 || element.kind === ElementKind.GETTER |
1310 || element.kind === ElementKind.SETTER); | 1310 || element.kind === ElementKind.SETTER); |
1311 } | 1311 } |
1312 | 1312 |
1313 static bool isStaticOrTopLevel(Element element) { | 1313 static bool isStaticOrTopLevel(Element element) { |
| 1314 // TODO(ager): This should not be necessary when patch support has |
| 1315 // been reworked. |
| 1316 if (element != null |
| 1317 && element.modifiers != null |
| 1318 && element.modifiers.isStatic()) { |
| 1319 return true; |
| 1320 } |
1314 return (element != null) | 1321 return (element != null) |
1315 && !element.isInstanceMember() | 1322 && !element.isInstanceMember() |
1316 && !element.isPrefix() | 1323 && !element.isPrefix() |
1317 && element.enclosingElement !== null | 1324 && element.enclosingElement !== null |
1318 && (element.enclosingElement.kind == ElementKind.CLASS || | 1325 && (element.enclosingElement.kind == ElementKind.CLASS || |
1319 element.enclosingElement.kind == ElementKind.COMPILATION_UNIT || | 1326 element.enclosingElement.kind == ElementKind.COMPILATION_UNIT || |
1320 element.enclosingElement.kind == ElementKind.LIBRARY); | 1327 element.enclosingElement.kind == ElementKind.LIBRARY); |
1321 } | 1328 } |
1322 | 1329 |
1323 static bool isStaticOrTopLevelField(Element element) { | 1330 static bool isStaticOrTopLevelField(Element element) { |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1479 Node parseNode(compiler) => cachedNode; | 1486 Node parseNode(compiler) => cachedNode; |
1480 | 1487 |
1481 String toString() => "${enclosingElement.toString()}.${name.slowToString()}"; | 1488 String toString() => "${enclosingElement.toString()}.${name.slowToString()}"; |
1482 | 1489 |
1483 TypeVariableElement cloneTo(Element enclosing, DiagnosticListener listener) { | 1490 TypeVariableElement cloneTo(Element enclosing, DiagnosticListener listener) { |
1484 TypeVariableElement result = | 1491 TypeVariableElement result = |
1485 new TypeVariableElement(name, enclosing, node, type, bound); | 1492 new TypeVariableElement(name, enclosing, node, type, bound); |
1486 return result; | 1493 return result; |
1487 } | 1494 } |
1488 } | 1495 } |
OLD | NEW |