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

Issue 8229028: Don't allow a #source directive in a library unit include itself (Closed)

Created:
9 years, 2 months ago by jbrosenberg
Modified:
9 years, 2 months ago
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Don't allow a #source directive in a library unit include itself Committed: https://code.google.com/p/dart/source/detail?r=383

Patch Set 1 #

Total comments: 7

Patch Set 2 : Overhauled directive validation for better error reporting #

Patch Set 3 : Minor cleanup from previous, removed some debugging code #

Unified diffs Side-by-side diffs Delta from patch set Stats (+106 lines, -42 lines) Patch
M compiler/java/com/google/dart/compiler/DartCompiler.java View 1 2 7 chunks +82 lines, -37 lines 0 comments Download
M compiler/java/com/google/dart/compiler/DartCompilerErrorCode.java View 1 2 chunks +2 lines, -2 lines 0 comments Download
M compiler/java/com/google/dart/compiler/PrettyErrorFormatter.java View 1 1 chunk +2 lines, -2 lines 0 comments Download
M compiler/java/com/google/dart/compiler/ast/DartUnit.java View 1 1 chunk +4 lines, -1 line 0 comments Download
M compiler/java/com/google/dart/compiler/parser/DartParser.java View 1 1 chunk +4 lines, -0 lines 0 comments Download
A tests/language/src/SourceSelfNegativeTest.dart View 1 chunk +12 lines, -0 lines 0 comments Download

Messages

Total messages: 11 (0 generated)
jbrosenberg
This is a simple change, to handle the special case where a source that is ...
9 years, 2 months ago (2011-10-11 21:32:31 UTC) #1
jbrosenberg
http://codereview.chromium.org/8229028/diff/1/tests/language/src/SourceSelfNegativeTest.dart File tests/language/src/SourceSelfNegativeTest.dart (right): http://codereview.chromium.org/8229028/diff/1/tests/language/src/SourceSelfNegativeTest.dart#newcode5 tests/language/src/SourceSelfNegativeTest.dart:5: // Dart test program importing the core library explicitly. ...
9 years, 2 months ago (2011-10-11 22:05:12 UTC) #2
danrubel
LGTM with 1 suggestion. http://codereview.chromium.org/8229028/diff/1/compiler/java/com/google/dart/compiler/DartCompiler.java File compiler/java/com/google/dart/compiler/DartCompiler.java (right): http://codereview.chromium.org/8229028/diff/1/compiler/java/com/google/dart/compiler/DartCompiler.java#newcode545 compiler/java/com/google/dart/compiler/DartCompiler.java:545: DartCompilerErrorCode.MISSING_LIBRARY_DIRECTIVE, unit.getSourceName())); From the user's ...
9 years, 2 months ago (2011-10-11 22:13:21 UTC) #3
codefu
9 years, 2 months ago (2011-10-11 22:13:53 UTC) #4
codefu
On 2011/10/11 22:13:53, codefu wrote: LGTM
9 years, 2 months ago (2011-10-11 22:14:00 UTC) #5
Brian Wilkerson
http://codereview.chromium.org/8229028/diff/1/compiler/java/com/google/dart/compiler/DartCompiler.java File compiler/java/com/google/dart/compiler/DartCompiler.java (right): http://codereview.chromium.org/8229028/diff/1/compiler/java/com/google/dart/compiler/DartCompiler.java#newcode544 compiler/java/com/google/dart/compiler/DartCompiler.java:544: context.compilationError(new DartCompilationError(Location.NONE, Please, please, please! Always pass in a ...
9 years, 2 months ago (2011-10-11 22:29:15 UTC) #6
jbrosenberg
http://codereview.chromium.org/8229028/diff/1/compiler/java/com/google/dart/compiler/DartCompiler.java File compiler/java/com/google/dart/compiler/DartCompiler.java (right): http://codereview.chromium.org/8229028/diff/1/compiler/java/com/google/dart/compiler/DartCompiler.java#newcode545 compiler/java/com/google/dart/compiler/DartCompiler.java:545: DartCompilerErrorCode.MISSING_LIBRARY_DIRECTIVE, unit.getSourceName())); No disagreement from me. Perhaps we have ...
9 years, 2 months ago (2011-10-12 14:52:51 UTC) #7
Brian Wilkerson
Thanks. I created an issue so that it won't be forgotten (http://code.google.com/p/dart/issues/detail?id=82).
9 years, 2 months ago (2011-10-12 15:03:01 UTC) #8
mmendez
On 2011/10/12 15:03:01, Brian Wilkerson wrote: > Thanks. I created an issue so that it ...
9 years, 2 months ago (2011-10-12 18:29:17 UTC) #9
jbrosenberg
PTAL, I think I've made the error reporting, for the directive validation case, cleaner and ...
9 years, 2 months ago (2011-10-12 20:50:18 UTC) #10
codefu
9 years, 2 months ago (2011-10-12 22:21:33 UTC) #11
On 2011/10/12 20:50:18, jbrosenberg wrote:
> PTAL, I think I've made the error reporting, for the directive validation
case,
> cleaner and it reports the error at the point the directive is declared, and
not
> in reference to the included file.

Still LGTM.  
The verification logic could be refactored later to the unit level, in case our
directives change.

Powered by Google App Engine
This is Rietveld 408576698