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

Issue 9027002: Support factory methods. (Closed)

Created:
9 years ago by ngeoffray
Modified:
9 years ago
Reviewers:
ahe, floitsch, kasperl
CC:
reviews_dartlang.org, floitsch, Lasse Reichstein Nielsen, karlklose
Visibility:
Public.

Description

Support factory methods. Committed: https://code.google.com/p/dart/source/detail?r=2759

Patch Set 1 : '' #

Total comments: 6

Patch Set 2 : '' #

Total comments: 6

Patch Set 3 : '' #

Total comments: 4

Patch Set 4 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+92 lines, -27 lines) Patch
M frog/leg/compiler.dart View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M frog/leg/elements/elements.dart View 1 2 3 7 chunks +15 lines, -10 lines 0 comments Download
M frog/leg/emitter.dart View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M frog/leg/lib/core.dart View 1 2 3 1 chunk +11 lines, -1 line 0 comments Download
M frog/leg/namer.dart View 1 2 3 2 chunks +3 lines, -3 lines 0 comments Download
M frog/leg/resolver.dart View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M frog/leg/scanner/class_element_parser.dart View 1 2 3 2 chunks +18 lines, -1 line 0 comments Download
M frog/leg/scanner/listener.dart View 1 2 3 2 chunks +4 lines, -2 lines 0 comments Download
M frog/leg/scanner/parser.dart View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M frog/leg/ssa/builder.dart View 1 2 3 2 chunks +3 lines, -3 lines 0 comments Download
M frog/tests/leg/src/ResolverTest.dart View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
A frog/tests/leg_only/src/FactoryTest.dart View 1 1 chunk +13 lines, -0 lines 0 comments Download
A frog/tests/leg_only/src/ListFactoryTest.dart View 1 1 chunk +15 lines, -0 lines 0 comments Download
M tests/language/language-leg.status View 1 2 3 3 chunks +4 lines, -1 line 0 comments Download

Messages

Total messages: 10 (0 generated)
ngeoffray
9 years ago (2011-12-22 11:12:21 UTC) #1
kasperl
LGTM. Not sure about the super long GENERATIVE_CONSTRUCTOR name but maybe that's okay. http://codereview.chromium.org/9027002/diff/10/frog/leg/lib/core.dart File ...
9 years ago (2011-12-22 11:34:41 UTC) #2
ngeoffray
PTAL, especially for the isInt check. About GENERATIVE_CONSTRUCTOR, I changed it this way because the ...
9 years ago (2011-12-22 13:07:01 UTC) #3
kasperl
LGTM.
9 years ago (2011-12-22 13:08:52 UTC) #4
ahe
LGTM! I was surprised how simple this change was. Once you filter out the GENERATIVE_CONSTRUCTOR ...
9 years ago (2011-12-22 13:32:39 UTC) #5
ngeoffray
Thanks Peter and Kasper! http://codereview.chromium.org/9027002/diff/3013/frog/leg/lib/core.dart File frog/leg/lib/core.dart (right): http://codereview.chromium.org/9027002/diff/3013/frog/leg/lib/core.dart#newcode256 frog/leg/lib/core.dart:256: if (!isInt(n)) throw "Invalid length"; ...
9 years ago (2011-12-22 13:50:22 UTC) #6
ahe
A minor follow-up question. http://codereview.chromium.org/9027002/diff/5008/frog/leg/lib/core.dart File frog/leg/lib/core.dart (right): http://codereview.chromium.org/9027002/diff/5008/frog/leg/lib/core.dart#newcode246 frog/leg/lib/core.dart:246: return JS(@"($0 | 0) === ...
9 years ago (2011-12-22 14:18:05 UTC) #7
floitsch
http://codereview.chromium.org/9027002/diff/5008/frog/leg/lib/core.dart File frog/leg/lib/core.dart (right): http://codereview.chromium.org/9027002/diff/5008/frog/leg/lib/core.dart#newcode246 frog/leg/lib/core.dart:246: return JS(@"($0 | 0) === $1", v, v); On ...
9 years ago (2011-12-22 14:36:18 UTC) #8
ahe
http://codereview.chromium.org/9027002/diff/5008/frog/leg/lib/core.dart File frog/leg/lib/core.dart (right): http://codereview.chromium.org/9027002/diff/5008/frog/leg/lib/core.dart#newcode246 frog/leg/lib/core.dart:246: return JS(@"($0 | 0) === $1", v, v); On ...
9 years ago (2011-12-22 14:41:21 UTC) #9
floitsch
9 years ago (2011-12-22 15:13:21 UTC) #10
http://codereview.chromium.org/9027002/diff/5008/frog/leg/lib/core.dart
File frog/leg/lib/core.dart (right):

http://codereview.chromium.org/9027002/diff/5008/frog/leg/lib/core.dart#newco...
frog/leg/lib/core.dart:246: return JS(@"($0 | 0) === $1", v, v);
On 2011/12/22 14:41:22, ahe wrote:
> On 2011/12/22 14:36:19, floitsch wrote:
> > On 2011/12/22 14:18:05, ahe wrote:
> > > Why not:
> > > 
> > > JS(@"($0 | 0) === $0", v);
> > 
> > I asked him to do it this way. This way generating v at use-site would still
> be
> > legal for arguments to JS. If 'v' is an expression with side-effects it
would
> > not be marked since there are two uses.
> > We have another guard against this, but I would actually prefer to get rid
of
> > the other guard, since it always disallows generate-at-use-site for JS.
> 
> I'm not sure I understand. Are you saying that you requested this one:
> 
> a: JS(@"($0 | 0) === $0", v);
> 
> or this one:
> 
> b: JS(@"($0 | 0) === $1", v, v);
sorry for the confusion. I asked him to do b. I find it cleaner if the compiler
knows how often the variable is used.

Powered by Google App Engine
This is Rietveld 408576698