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

Issue 9117033: Setup getter and setter elements. (Closed)

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

Description

Setup getter and setter elements. Committed: https://code.google.com/p/dart/source/detail?r=3593

Patch Set 1 #

Total comments: 1

Patch Set 2 : Use recursion #

Total comments: 6

Patch Set 3 : Address review comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+64 lines, -24 lines) Patch
M dart/frog/leg/compiler.dart View 1 chunk +4 lines, -3 lines 0 comments Download
M dart/frog/leg/elements/elements.dart View 1 2 7 chunks +19 lines, -0 lines 0 comments Download
M dart/frog/leg/emitter.dart View 2 chunks +4 lines, -2 lines 0 comments Download
M dart/frog/leg/frog_leg.dart View 1 2 chunks +4 lines, -1 line 0 comments Download
M dart/frog/leg/scanner/class_element_parser.dart View 3 chunks +14 lines, -5 lines 0 comments Download
M dart/frog/leg/scanner/listener.dart View 4 chunks +6 lines, -2 lines 0 comments Download
M dart/frog/leg/scanner/parser.dart View 2 chunks +4 lines, -1 line 0 comments Download
M dart/tests/language/language-leg.status View 8 chunks +9 lines, -10 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
ahe
8 years, 11 months ago (2012-01-24 15:54:16 UTC) #1
ahe
https://chromiumcodereview.appspot.com/9117033/diff/1/dart/frog/leg/frog_leg.dart File dart/frog/leg/frog_leg.dart (right): https://chromiumcodereview.appspot.com/9117033/diff/1/dart/frog/leg/frog_leg.dart#newcode99 dart/frog/leg/frog_leg.dart:99: if (token === null && element !== null) { ...
8 years, 11 months ago (2012-01-24 16:01:34 UTC) #2
ngeoffray
LGTM! https://chromiumcodereview.appspot.com/9117033/diff/4001/dart/frog/leg/elements/elements.dart File dart/frog/leg/elements/elements.dart (right): https://chromiumcodereview.appspot.com/9117033/diff/4001/dart/frog/leg/elements/elements.dart#newcode142 dart/frog/leg/elements/elements.dart:142: ? cachedNode.getBeginToken() : variables.position(); This will return different ...
8 years, 11 months ago (2012-01-25 08:36:05 UTC) #3
ahe
Thank you, Nicolas. https://chromiumcodereview.appspot.com/9117033/diff/4001/dart/frog/leg/elements/elements.dart File dart/frog/leg/elements/elements.dart (right): https://chromiumcodereview.appspot.com/9117033/diff/4001/dart/frog/leg/elements/elements.dart#newcode142 dart/frog/leg/elements/elements.dart:142: ? cachedNode.getBeginToken() : variables.position(); On 2012/01/25 ...
8 years, 11 months ago (2012-01-25 08:56:24 UTC) #4
ngeoffray
https://chromiumcodereview.appspot.com/9117033/diff/4001/dart/frog/leg/emitter.dart File dart/frog/leg/emitter.dart (right): https://chromiumcodereview.appspot.com/9117033/diff/4001/dart/frog/leg/emitter.dart#newcode70 dart/frog/leg/emitter.dart:70: element: member); On 2012/01/25 08:56:24, ahe wrote: > On ...
8 years, 11 months ago (2012-01-25 09:03:59 UTC) #5
ahe
8 years, 11 months ago (2012-01-25 09:07:14 UTC) #6
https://chromiumcodereview.appspot.com/9117033/diff/4001/dart/frog/leg/emitte...
File dart/frog/leg/emitter.dart (right):

https://chromiumcodereview.appspot.com/9117033/diff/4001/dart/frog/leg/emitte...
dart/frog/leg/emitter.dart:70: element: member);
On 2012/01/25 09:03:59, ngeoffray wrote:
> On 2012/01/25 08:56:24, ahe wrote:
> > On 2012/01/25 08:36:05, ngeoffray wrote:
> > > Because that's the only place it's needed, and because we know that if
we're
> > > here, the node is available, I would prefer doing:
> > > node: element.parseNode(compiler, compiler).
> > > 
> > > I am not convinced about the robustness of the 'position' method in
Element
> > > (what if someone starts cancelling on the element before it got parsed, or
> > > resolved?). Therefore I would not provide the possibility of passing it an
> > > element in the API.
> > 
> > I tried calling parseNode here, but noticed that I got a different error
> > message. This is what happened: parseFunction doesn't handle "get" or "set",
> > yet.
> > 
> > Moving forward, it would seem that we don't actually know that the node is
> > available at this point.
> 
> Yeah, and I guess that's a bug: we're not putting in the work queue the
> getter/setter.
> 
> > 
> > Regardless, it is a sound principle to keep error handling as simple as
> > possible. Invoking the parser just to report an error message does not seem
> like
> > a great idea to me anyways (but it was the first thing I thought of doing
:-).
> 
> I agree. Then we have to realize we must give up on giving a location if
> cachedNode is null (which you do not check against in the 'position' methods).
> You're just lucky that this is backed by a PartialElement that knows its
initial
> location :)

I'm not sure what situation you have in mind here. But let's talk more about
this when I arrive at the office.

Powered by Google App Engine
This is Rietveld 408576698