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/names.dart' show Identifiers; | 8 import '../common/names.dart' show Identifiers; |
9 import '../common/resolution.dart' show Resolution, ParsingContext; | 9 import '../common/resolution.dart' show Resolution, ParsingContext; |
10 import '../compiler.dart' show Compiler; | 10 import '../compiler.dart' show Compiler; |
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
491 | 491 |
492 /// The element whose usage cause a warning. | 492 /// The element whose usage cause a warning. |
493 final Element wrappedElement; | 493 final Element wrappedElement; |
494 | 494 |
495 WarnOnUseElementX( | 495 WarnOnUseElementX( |
496 this.warning, this.info, Element enclosingElement, Element wrappedElement) | 496 this.warning, this.info, Element enclosingElement, Element wrappedElement) |
497 : this.wrappedElement = wrappedElement, | 497 : this.wrappedElement = wrappedElement, |
498 super(wrappedElement.name, ElementKind.WARN_ON_USE, enclosingElement); | 498 super(wrappedElement.name, ElementKind.WARN_ON_USE, enclosingElement); |
499 | 499 |
500 Element unwrap(DiagnosticReporter reporter, Spannable usageSpannable) { | 500 Element unwrap(DiagnosticReporter reporter, Spannable usageSpannable) { |
501 var unwrapped = wrappedElement; | 501 dynamic unwrapped = wrappedElement; |
502 if (warning != null) { | 502 if (warning != null) { |
503 Spannable spannable = warning.sourceSpan; | 503 Spannable spannable = warning.sourceSpan; |
504 if (spannable == null) spannable = usageSpannable; | 504 if (spannable == null) spannable = usageSpannable; |
505 DiagnosticMessage warningMessage = reporter.createMessage( | 505 DiagnosticMessage warningMessage = reporter.createMessage( |
506 spannable, warning.messageKind, warning.messageArguments); | 506 spannable, warning.messageKind, warning.messageArguments); |
507 List<DiagnosticMessage> infos = <DiagnosticMessage>[]; | 507 List<DiagnosticMessage> infos = <DiagnosticMessage>[]; |
508 if (info != null) { | 508 if (info != null) { |
509 Spannable spannable = info.sourceSpan; | 509 Spannable spannable = info.sourceSpan; |
510 if (spannable == null) spannable = usageSpannable; | 510 if (spannable == null) spannable = usageSpannable; |
511 infos.add(reporter.createMessage( | 511 infos.add(reporter.createMessage( |
(...skipping 3003 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3515 body = node.asFunctionExpression().body; | 3515 body = node.asFunctionExpression().body; |
3516 } | 3516 } |
3517 return new ParsedResolvedAst( | 3517 return new ParsedResolvedAst( |
3518 declaration, | 3518 declaration, |
3519 node, | 3519 node, |
3520 body, | 3520 body, |
3521 definingElement.treeElements, | 3521 definingElement.treeElements, |
3522 definingElement.compilationUnit.script.resourceUri); | 3522 definingElement.compilationUnit.script.resourceUri); |
3523 } | 3523 } |
3524 } | 3524 } |
OLD | NEW |