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

Issue 9143001: Fixes 2 tests and a crash (Closed)

Created:
8 years, 11 months ago by jimhug
Modified:
8 years, 11 months ago
Reviewers:
Jennifer Messerly
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Fixes 2 tests and a crash - while cleaning up EvaluatedValue Another step towards cleaning up the use of Value. Greatly reduced use of .dynamic and slowly increasing modularity of code for handling consts by moving it into the constant Values themselves. Apologies for the ugliness of added parens around ALL numeric constants - but this did simplify several parts of the code while fixing a couple of broken tests. I'm confident this step back in readability won't last out the weekend (though I'm not telling you which one <smile>). Committed: https://code.google.com/p/dart/source/detail?r=3076

Patch Set 1 #

Total comments: 27
Unified diffs Side-by-side diffs Delta from patch set Stats (+2175 lines, -1899 lines) Patch
M frog/gen.dart View 8 chunks +72 lines, -132 lines 12 comments Download
M frog/member.dart View 12 chunks +29 lines, -17 lines 7 comments Download
M frog/minfrog View 294 chunks +1738 lines, -1609 lines 1 comment Download
M frog/parser.dart View 5 chunks +27 lines, -27 lines 0 comments Download
M frog/scripts/tree_gen.py View 1 chunk +3 lines, -2 lines 0 comments Download
M frog/tree.g.dart View 2 chunks +8 lines, -6 lines 0 comments Download
M frog/value.dart View 9 chunks +298 lines, -99 lines 7 comments Download
M tests/isolate/isolate.status View 1 chunk +0 lines, -5 lines 0 comments Download
M tests/language/language.status View 2 chunks +0 lines, -2 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
jimhug
tbr
8 years, 11 months ago (2012-01-08 00:03:57 UTC) #1
Jennifer Messerly
lgtm http://codereview.chromium.org/9143001/diff/1/frog/gen.dart File frog/gen.dart (right): http://codereview.chromium.org/9143001/diff/1/frog/gen.dart#newcode1981 frog/gen.dart:1981: return x.binop(kind, y, this, node); so nice! http://codereview.chromium.org/9143001/diff/1/frog/gen.dart#newcode2331 ...
8 years, 11 months ago (2012-01-09 19:06:54 UTC) #2
jimhug
8 years, 11 months ago (2012-01-09 21:34:23 UTC) #3
http://codereview.chromium.org/9143001/diff/1/frog/gen.dart
File frog/gen.dart (right):

http://codereview.chromium.org/9143001/diff/1/frog/gen.dart#newcode2331
frog/gen.dart:2331: //var listType = node.isConst ? world.immutableListType :
world.listType;
On 2012/01/09 19:06:54, John Messerly wrote:
> remove?

Done.

http://codereview.chromium.org/9143001/diff/1/frog/gen.dart#newcode2364
frog/gen.dart:2364: var values = new List<Value>();
On 2012/01/09 19:06:54, John Messerly wrote:
> perhaps:
>     var values = <Value>[];
> ?

Done.

http://codereview.chromium.org/9143001/diff/1/frog/gen.dart#newcode2376
frog/gen.dart:2376: if (node.isConst && (keyType is ParameterType ||
keyType.hasTypeParams)) {
On 2012/01/09 19:06:54, John Messerly wrote:
> long line

Done.

http://codereview.chromium.org/9143001/diff/1/frog/gen.dart#newcode2376
frog/gen.dart:2376: if (node.isConst && (keyType is ParameterType ||
keyType.hasTypeParams)) {
Good idea - for longer-term cleanup.
On 2012/01/09 19:06:54, John Messerly wrote:
> keyType.isUnboundType, or something like that? Where it's defined like:
> class Type { ...; bool get isUnboundType() => hasTypeParameters; ... }
> class ParameterType { ...; bool get isUnboundType() => true; ... }
> 
> or maybe hasTypeParameters should return "true" from ParameterType

http://codereview.chromium.org/9143001/diff/1/frog/gen.dart#newcode2396
frog/gen.dart:2396: var value = visitTypedValue(node.items[i+1], valueType);
On 2012/01/09 19:06:54, John Messerly wrote:
> nit: spacing on i + 1

Done.

http://codereview.chromium.org/9143001/diff/1/frog/member.dart
File frog/member.dart (right):

http://codereview.chromium.org/9143001/diff/1/frog/member.dart#newcode425
frog/member.dart:425: /*else if (target.isConst && isFinal) {
Was a todo - but then I decided on something different and forgot to remove... 
Done.
On 2012/01/09 19:06:54, John Messerly wrote:
> remove? or is this a todo

http://codereview.chromium.org/9143001/diff/1/frog/member.dart#newcode1027
frog/member.dart:1027: // ????
On 2012/01/09 19:06:54, John Messerly wrote:
> is this a TODO?

Done.

http://codereview.chromium.org/9143001/diff/1/frog/member.dart#newcode1045
frog/member.dart:1045: // TODO(jmesserly): factor this better
I'm not sure I understand the ramifications of removing this - please remove it
in a future checkin when convenient.
On 2012/01/09 19:06:54, John Messerly wrote:
> Not your change, but I noticed that this block of code here is obsolete (logic
> is now in corejs.dart). =)

http://codereview.chromium.org/9143001/diff/1/frog/value.dart
File frog/value.dart (right):

http://codereview.chromium.org/9143001/diff/1/frog/value.dart#newcode555
frog/value.dart:555: String get code() => '@@@';
Really, this should just throw - the point is to ensure an error if one of these
is written.  I'll switch to creating an error.

On 2012/01/09 19:06:54, John Messerly wrote:
> Maybe this should include the type name? e.g. '@@@EvaluatedValue@@@'
> Slightly worried that someone will copy this class, and not realize they need
to
> change the "code" too so == isn't broken. But this is possibly too paranoid :)

http://codereview.chromium.org/9143001/diff/1/frog/value.dart#newcode749
frog/value.dart:749: for (var i=0; i < values.length; i++) {
On 2012/01/09 19:06:54, John Messerly wrote:
> nit: spacing on i=0;

Done.

http://codereview.chromium.org/9143001/diff/1/frog/value.dart#newcode859
frog/value.dart:859: /*
On 2012/01/09 19:06:54, John Messerly wrote:
> remove?

Done.

Powered by Google App Engine
This is Rietveld 408576698