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

Issue 10832203: Refactor Library/CompilationUnit and how we define local Scope. (Closed)

Created:
8 years, 4 months ago by Anders Johnsen
Modified:
8 years, 4 months ago
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Refactor Library/CompilationUnit and how we define local Scope. This also collapses members and constructors of a class into the same map. BUG= Committed: https://code.google.com/p/dart/source/detail?r=10549

Patch Set 1 #

Total comments: 25

Patch Set 2 : Rebase #

Patch Set 3 : Rebase #

Patch Set 4 : Removed previous failing tests from co19-leg. #

Patch Set 5 : Fix a regression where we allowed sourcing in from already sourced in files. #

Patch Set 6 : Last test fixes, passes co19. #

Total comments: 3

Patch Set 7 : Rebase and refactor ClassElement.constructors. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+165 lines, -177 lines) Patch
M lib/compiler/implementation/compiler.dart View 1 2 3 4 5 6 6 chunks +18 lines, -22 lines 0 comments Download
M lib/compiler/implementation/elements/elements.dart View 1 2 3 4 5 6 12 chunks +100 lines, -83 lines 0 comments Download
M lib/compiler/implementation/enqueue.dart View 1 2 3 4 5 6 2 chunks +2 lines, -2 lines 0 comments Download
M lib/compiler/implementation/js_backend/native_emitter.dart View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M lib/compiler/implementation/native_handler.dart View 1 2 3 4 5 6 2 chunks +5 lines, -4 lines 0 comments Download
M lib/compiler/implementation/patch_parser.dart View 1 chunk +4 lines, -2 lines 0 comments Download
M lib/compiler/implementation/resolver.dart View 1 2 3 4 5 6 1 chunk +2 lines, -2 lines 0 comments Download
M lib/compiler/implementation/scanner/class_element_parser.dart View 1 chunk +1 line, -1 line 0 comments Download
M lib/compiler/implementation/scanner/listener.dart View 1 2 3 4 1 chunk +8 lines, -4 lines 0 comments Download
M lib/compiler/implementation/scanner/scanner_task.dart View 1 2 3 4 6 chunks +16 lines, -13 lines 0 comments Download
M lib/dartdoc/mirrors/dart2js_mirror.dart View 1 2 3 4 5 6 2 chunks +2 lines, -7 lines 0 comments Download
M tests/co19/co19-leg.status View 1 2 3 4 5 6 6 chunks +0 lines, -29 lines 0 comments Download
M tests/compiler/dart2js/find_my_name_test.dart View 1 chunk +1 line, -1 line 0 comments Download
M tests/compiler/dart2js/mock_compiler.dart View 1 2 3 4 5 6 1 chunk +4 lines, -5 lines 0 comments Download
M tests/compiler/dart2js/parser_helper.dart View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 6 (0 generated)
Anders Johnsen
8 years, 4 months ago (2012-08-08 12:06:14 UTC) #1
Lasse Reichstein Nielsen
STV! https://chromiumcodereview.appspot.com/10832203/diff/1/lib/compiler/implementation/compiler.dart File lib/compiler/implementation/compiler.dart (right): https://chromiumcodereview.appspot.com/10832203/diff/1/lib/compiler/implementation/compiler.dart#newcode528 lib/compiler/implementation/compiler.dart:528: applyContainerPatch(original, patches, original.findLocal); If both ClassElement and LibraryElement ...
8 years, 4 months ago (2012-08-08 14:22:12 UTC) #2
Anders Johnsen
PTAL https://chromiumcodereview.appspot.com/10832203/diff/1/lib/compiler/implementation/compiler.dart File lib/compiler/implementation/compiler.dart (right): https://chromiumcodereview.appspot.com/10832203/diff/1/lib/compiler/implementation/compiler.dart#newcode528 lib/compiler/implementation/compiler.dart:528: applyContainerPatch(original, patches, original.findLocal); On 2012/08/08 14:22:12, Lasse Reichstein ...
8 years, 4 months ago (2012-08-08 17:30:37 UTC) #3
ahe
Very good. Unfortunately, you hit one of my idiosyncrasies :-) I'm concerned about the implementation ...
8 years, 4 months ago (2012-08-08 17:39:05 UTC) #4
Lasse Reichstein Nielsen
Still LGTM. https://chromiumcodereview.appspot.com/10832203/diff/6002/lib/compiler/implementation/elements/elements.dart File lib/compiler/implementation/elements/elements.dart (right): https://chromiumcodereview.appspot.com/10832203/diff/6002/lib/compiler/implementation/elements/elements.dart#newcode1017 lib/compiler/implementation/elements/elements.dart:1017: return localScope.getValues().filter((element) => element.isConstructor()); I personally don't ...
8 years, 4 months ago (2012-08-10 11:32:17 UTC) #5
Anders Johnsen
8 years, 4 months ago (2012-08-13 06:22:41 UTC) #6
Committing.

https://chromiumcodereview.appspot.com/10832203/diff/6002/lib/compiler/implem...
File lib/compiler/implementation/elements/elements.dart (right):

https://chromiumcodereview.appspot.com/10832203/diff/6002/lib/compiler/implem...
lib/compiler/implementation/elements/elements.dart:1017: return
localScope.getValues().filter((element) => element.isConstructor());
On 2012/08/10 11:32:17, Lasse Reichstein Nielsen wrote:
> I personally don't like the filter function.
> In this case, I think it's ok. You run through all the local members,
including
> the synthetic constructor, and create a new collection of those of them that
are
> constructors.
> 
> To be more imperative, perhaps do:
> 
> List<Element> result = <Element>[];
> localScope.forEach((_, Element value) => {
>   if (value.isConstructor()) result.add(value);
> });
> return result;

I have no preference here, changing.

Powered by Google App Engine
This is Rietveld 408576698