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

Issue 2498133002: Connect analyzer's AnalysisError object to front_end's CompilationError. (Closed)

Created:
4 years, 1 month ago by Paul Berry
Modified:
4 years, 1 month ago
CC:
reviews_dartlang.org
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Connect analyzer's AnalysisError object to front_end's CompilationError. AnalysisError implements CompilationError but provides additional services, such as extensibility via the `getProperty` method. Note: CompilationError.location has been renamed to CompilationError.span to avoid confusion (since its type is `SourceSpan`, not `SourceLocation`). R=scheglov@google.com Committed: https://github.com/dart-lang/sdk/commit/fc5270df72d47daf68e16b8985591d40f3ee264a

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+100 lines, -2 lines) Patch
M pkg/analyzer/lib/error/error.dart View 3 chunks +6 lines, -1 line 0 comments Download
M pkg/analyzer/lib/src/generated/source.dart View 3 chunks +7 lines, -0 lines 0 comments Download
M pkg/analyzer/lib/src/generated/source_io.dart View 3 chunks +7 lines, -0 lines 1 comment Download
M pkg/analyzer/lib/src/source/source_resource.dart View 3 chunks +7 lines, -0 lines 0 comments Download
M pkg/analyzer/lib/src/string_source.dart View 3 chunks +7 lines, -0 lines 0 comments Download
M pkg/analyzer/lib/src/summary/package_bundle_reader.dart View 2 chunks +5 lines, -0 lines 0 comments Download
M pkg/analyzer/lib/src/task/html.dart View 1 chunk +3 lines, -0 lines 0 comments Download
A pkg/analyzer/test/generated/error_test.dart View 1 chunk +44 lines, -0 lines 0 comments Download
M pkg/analyzer/test/generated/test_support.dart View 3 chunks +7 lines, -0 lines 0 comments Download
M pkg/front_end/lib/compilation_error.dart View 1 chunk +1 line, -1 line 1 comment Download
M pkg/front_end/lib/src/base/source.dart View 2 chunks +6 lines, -0 lines 0 comments Download

Messages

Total messages: 7 (2 generated)
Paul Berry
4 years, 1 month ago (2016-11-14 23:02:45 UTC) #2
scheglov
LGTM
4 years, 1 month ago (2016-11-14 23:16:15 UTC) #3
Paul Berry
Committed patchset #1 (id:1) manually as fc5270df72d47daf68e16b8985591d40f3ee264a (presubmit successful).
4 years, 1 month ago (2016-11-14 23:30:15 UTC) #5
Brian Wilkerson
https://codereview.chromium.org/2498133002/diff/1/pkg/analyzer/lib/src/generated/source_io.dart File pkg/analyzer/lib/src/generated/source_io.dart (right): https://codereview.chromium.org/2498133002/diff/1/pkg/analyzer/lib/src/generated/source_io.dart#newcode242 pkg/analyzer/lib/src/generated/source_io.dart:242: new source_span.SourceFile(file.readAsStringSync(), url: uri); I haven't thought this through ...
4 years, 1 month ago (2016-11-14 23:34:41 UTC) #6
Paul Berry
4 years, 1 month ago (2016-11-15 16:54:05 UTC) #7
Message was sent while issue was closed.
On 2016/11/14 23:34:41, Brian Wilkerson wrote:
>
https://codereview.chromium.org/2498133002/diff/1/pkg/analyzer/lib/src/genera...
> File pkg/analyzer/lib/src/generated/source_io.dart (right):
> 
>
https://codereview.chromium.org/2498133002/diff/1/pkg/analyzer/lib/src/genera...
> pkg/analyzer/lib/src/generated/source_io.dart:242: new
> source_span.SourceFile(file.readAsStringSync(), url: uri);
> I haven't thought this through completely, but this (and similar code in
> FileSource) is somewhat concerning.
> (1) If the content has been overlaid, then this could return a SourceFile with
> the wrong content.
> (2) Because sources are light-weight objects, we might end up reading the file
> multiple times, even though it's cached in one source object.
> (3) Because it's cached, it won't be recreated if the content changes (either
on
> disk or as an overlay).
> 
>
https://codereview.chromium.org/2498133002/diff/1/pkg/front_end/lib/compilati...
> File pkg/front_end/lib/compilation_error.dart (right):
> 
>
https://codereview.chromium.org/2498133002/diff/1/pkg/front_end/lib/compilati...
> pkg/front_end/lib/compilation_error.dart:21: /// The source location where the
> error occurred.
> "location" --> "span"?

Good points.  I will re-think this and do a follow-up CL.

Powered by Google App Engine
This is Rietveld 408576698