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

Issue 8913016: Issue 839: Bad code leading to top level methods being something other than identifier (Closed)

Created:
9 years ago by codefu
Modified:
9 years ago
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Issue 839: Bad code leading to top level methods being something other than identifier Note; borrowed code from http://codereview.chromium.org/8914015/ as the editor had the same issue. Added support for the AST writer to handle Function Expressions and updated the parser to give the AST writer a chance to dump the unit (if requested via the current command line parameters) before bailing on the whole program. BUG= TEST= Committed: https://code.google.com/p/dart/source/detail?r=2515

Patch Set 1 #

Total comments: 5

Patch Set 2 : Review adjustments #

Total comments: 8

Patch Set 3 : Nits #

Messages

Total messages: 6 (0 generated)
codefu
9 years ago (2011-12-14 22:51:18 UTC) #1
Brian Wilkerson
LGTM
9 years ago (2011-12-14 23:41:01 UTC) #2
mmendez
We need to go another round on this. We can reproduce the problem if you ...
9 years ago (2011-12-15 15:02:19 UTC) #3
codefu
http://codereview.chromium.org/8913016/diff/1/compiler/java/com/google/dart/compiler/DartCompiler.java File compiler/java/com/google/dart/compiler/DartCompiler.java (right): http://codereview.chromium.org/8913016/diff/1/compiler/java/com/google/dart/compiler/DartCompiler.java#newcode842 compiler/java/com/google/dart/compiler/DartCompiler.java:842: astWriter.process(unit); On 2011/12/15 15:02:20, mmendez wrote: > This will ...
9 years ago (2011-12-15 16:23:59 UTC) #4
mmendez
LGTM with nits. I added shauvik so he could weigh in on this as well. ...
9 years ago (2011-12-15 18:26:17 UTC) #5
codefu
9 years ago (2011-12-15 18:49:55 UTC) #6
http://codereview.chromium.org/8913016/diff/6001/compiler/java/com/google/dar...
File compiler/java/com/google/dart/compiler/ast/LibraryUnit.java (right):

http://codereview.chromium.org/8913016/diff/6001/compiler/java/com/google/dar...
compiler/java/com/google/dart/compiler/ast/LibraryUnit.java:311:
topLevelNodes.put(node.getName().toSource(), node);
On 2011/12/15 18:26:18, mmendez wrote:
> Nit: Please double check that this does make compilation speed any worse.


Will change to if(is identifier)-else

http://codereview.chromium.org/8913016/diff/6001/compiler/java/com/google/dar...
File compiler/java/com/google/dart/compiler/parser/DartParser.java (right):

http://codereview.chromium.org/8913016/diff/6001/compiler/java/com/google/dar...
compiler/java/com/google/dart/compiler/parser/DartParser.java:1118:
if(currentlyParsingTopleve()) {
On 2011/12/15 18:26:18, mmendez wrote:
> Do you have a test for this new behavior?

Done.

http://codereview.chromium.org/8913016/diff/6001/compiler/java/com/google/dar...
compiler/java/com/google/dart/compiler/parser/DartParser.java:3754: private
boolean currentlyParsingTopleve() {
On 2011/12/15 18:26:18, mmendez wrote:
> Nit: currentlyParsingTopleve -> currentlyParsingToplevel

Done.

http://codereview.chromium.org/8913016/diff/6001/compiler/java/com/google/dar...
File
compiler/java/com/google/dart/compiler/resolver/MethodElementImplementation.java
(right):

http://codereview.chromium.org/8913016/diff/6001/compiler/java/com/google/dar...
compiler/java/com/google/dart/compiler/resolver/MethodElementImplementation.java:140:
targetName = node.toSource();
On 2011/12/15 18:26:18, mmendez wrote:
> Nit: add a comment here about why you are using node.toSource().  This maybe a
> better pattern to use in the LibraryUnit. 

Done.

Powered by Google App Engine
This is Rietveld 408576698