Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(808)

Unified Diff: pkg/compiler/lib/src/elements/modelx.dart

Issue 1420013002: Support multiline location messages and use signature for function spans. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments. Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/compiler/lib/src/io/source_file.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/elements/modelx.dart
diff --git a/pkg/compiler/lib/src/elements/modelx.dart b/pkg/compiler/lib/src/elements/modelx.dart
index cae9c9fde3c817b20efb09c85e6043ba581183f2..191867ab319eefed753e72a5becd346e02f99a2a 100644
--- a/pkg/compiler/lib/src/elements/modelx.dart
+++ b/pkg/compiler/lib/src/elements/modelx.dart
@@ -2052,6 +2052,25 @@ abstract class FunctionElementX extends BaseFunctionElementX
MemberElement get memberContext => this;
+ @override
+ SourceSpan get sourcePosition {
+ SourceSpan span = super.sourcePosition;
+ if (span != null && hasNode) {
+ FunctionExpression functionExpression = node.asFunctionExpression();
+ if (functionExpression != null) {
+ Token begin = functionExpression.getBeginToken();
+ Token end;
+ if (functionExpression.parameters != null) {
+ end = functionExpression.parameters.getEndToken();
+ } else {
+ end = functionExpression.name.getEndToken();
+ }
+ span = new SourceSpan.fromTokens(span.uri, begin, end);
+ }
+ }
+ return span;
+ }
+
void reuseElement() {
super.reuseElement();
nestedClosures.clear();
« no previous file with comments | « no previous file | pkg/compiler/lib/src/io/source_file.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698