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

Issue 8487003: unary operators (Closed)

Created:
9 years, 1 month ago by jimhug
Modified:
9 years, 1 month ago
Reviewers:
Jennifer Messerly
CC:
reviews_dartlang.org
Visibility:
Public.

Description

unary operators +4 tests passing, -5 lines in frogsh Committed: https://code.google.com/p/dart/source/detail?r=1237

Patch Set 1 #

Total comments: 5
Unified diffs Side-by-side diffs Delta from patch set Stats (+249 lines, -262 lines) Patch
M frog/frogsh View 158 chunks +210 lines, -215 lines 0 comments Download
M frog/gen.dart View 4 chunks +21 lines, -29 lines 3 comments Download
M frog/member.dart View 5 chunks +16 lines, -12 lines 2 comments Download
M tests/language/language.status View 3 chunks +2 lines, -6 lines 0 comments Download

Messages

Total messages: 2 (0 generated)
jimhug
TBR
9 years, 1 month ago (2011-11-06 18:29:26 UTC) #1
Jennifer Messerly
9 years, 1 month ago (2011-11-07 21:29:53 UTC) #2
lgtm

http://codereview.chromium.org/8487003/diff/1/frog/gen.dart
File frog/gen.dart (right):

http://codereview.chromium.org/8487003/diff/1/frog/gen.dart#newcode1670
frog/gen.dart:1670: index = assignTemp(tmpindex, index);
for consistency, I'd remove this line, and change the invoke of "\$setindex"
below to be:

var ret = assignTemp(tmptarget, target).invoke(this, '\$setindex',
    position, new Arguments(null, [assignTemp(tmpindex, index), y]));

using assignTemp inline prevents someone from accidentally assigning twice. The
code is correct as it is though.

http://codereview.chromium.org/8487003/diff/1/frog/gen.dart#newcode1729
frog/gen.dart:1729: var newVal = value.convertToNonNullBool(this, node);
Ah. I was wondering why we had the extra non-null bool converts in the generated
code.

FWIW, I could not find anything in the spec that says this should use a "boolean
conversion" here. Although it does say we should be using them for && and ||,
which I don't think we are currently (unless you fixed that in another CR). So
this seems consistent & I agree the right fix.

http://codereview.chromium.org/8487003/diff/1/frog/gen.dart#newcode1739
frog/gen.dart:1739: if (node.op.kind == TokenKind.BIT_NOT) {
this is so much nicer.

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

http://codereview.chromium.org/8487003/diff/1/frog/member.dart#newcode863
frog/member.dart:863: // TODO(jimhug): target really shouldn't ever be null...
It's null for constructors, factories, and static (including top-level) methods.
Basically anything that's resolved statically.

I wonder if we should always have a target, but use a Value that represents the
type?

http://codereview.chromium.org/8487003/diff/1/frog/member.dart#newcode1197
frog/member.dart:1197: // TODO(jimhug): need a better annotation for being an
operator method
+1 :)

Powered by Google App Engine
This is Rietveld 408576698