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

Issue 9325029: Fix for issue 1480: analyze a method even if it does not have a body, and do not try to evaluate ... (Closed)

Created:
8 years, 10 months ago by ngeoffray
Modified:
8 years, 10 months ago
Reviewers:
kasperl
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Fix for issue 1480: analyze a method even if it does not have a body, and do not try to evaluate a call if it does not have the right number of arguments. Committed: https://code.google.com/p/dart/source/detail?r=3937

Patch Set 1 #

Total comments: 14

Patch Set 2 : '' #

Patch Set 3 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+121 lines, -16 lines) Patch
M dart/frog/analyze.dart View 1 3 chunks +44 lines, -3 lines 0 comments Download
M dart/frog/gen.dart View 1 1 chunk +4 lines, -0 lines 0 comments Download
M dart/frog/method_data.dart View 1 1 chunk +0 lines, -2 lines 0 comments Download
M dart/frog/minfrog View 1 2 13 chunks +57 lines, -11 lines 0 comments Download
A dart/tests/language/src/BodyLessConstructorWrongArgNegativeTest.dart View 1 1 chunk +16 lines, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
ngeoffray
8 years, 10 months ago (2012-02-03 15:22:27 UTC) #1
kasperl
LGTM. https://chromiumcodereview.appspot.com/9325029/diff/1/dart/frog/analyze.dart File dart/frog/analyze.dart (right): https://chromiumcodereview.appspot.com/9325029/diff/1/dart/frog/analyze.dart#newcode51 dart/frog/analyze.dart:51: final declaredInitializers = method.definition.dynamic.initializers; Add a comment here ...
8 years, 10 months ago (2012-02-03 15:39:20 UTC) #2
ngeoffray
8 years, 10 months ago (2012-02-06 11:50:30 UTC) #3
Thanks Kasper,

https://chromiumcodereview.appspot.com/9325029/diff/1/dart/frog/analyze.dart
File dart/frog/analyze.dart (right):

https://chromiumcodereview.appspot.com/9325029/diff/1/dart/frog/analyze.dart#...
dart/frog/analyze.dart:51: final declaredInitializers =
method.definition.dynamic.initializers;
On 2012/02/03 15:39:20, kasperl wrote:
> Add a comment here that explains how this is dealt with. Explain that your
> changing the behavior of visitCallExpression to realize when you're in the
> middle of visiting an initializer expression (alternatively you could add
> another visitor but that's probably overkill).

Done.

https://chromiumcodereview.appspot.com/9325029/diff/1/dart/frog/analyze.dart#...
dart/frog/analyze.dart:56: if (init is CallExpression) {
On 2012/02/03 15:39:20, kasperl wrote:
> How bad would it be to add an optional parameter to visitCallExpression
> [inInitializer=false] and call that visit function from here with
inInitializer:
> true? That way you wouldn't need to add extra state to this visitor.

Done.

https://chromiumcodereview.appspot.com/9325029/diff/1/dart/frog/analyze.dart#...
dart/frog/analyze.dart:57: init.visit(this);;
On 2012/02/03 15:39:20, kasperl wrote:
> ;; -> ;

Done.

https://chromiumcodereview.appspot.com/9325029/diff/1/dart/frog/analyze.dart#...
dart/frog/analyze.dart:411: analyzeThisOrSuperConstructorCall(CallExpression
node,
On 2012/02/03 15:39:20, kasperl wrote:
> analyzeInitializerConstructorCall instead? In this context, they are both
> constructor calls.

Done.

https://chromiumcodereview.appspot.com/9325029/diff/1/dart/frog/analyze.dart#...
dart/frog/analyze.dart:423: world.warning('cannot find "$name"', node.span);
On 2012/02/03 15:39:20, kasperl wrote:
> How does this look if name is the empty string? Maybe you should pass in null
> for name in that case instead and deal with it?

Done.

https://chromiumcodereview.appspot.com/9325029/diff/1/dart/frog/gen.dart
File dart/frog/gen.dart (right):

https://chromiumcodereview.appspot.com/9325029/diff/1/dart/frog/gen.dart#newc...
dart/frog/gen.dart:1003: // Not enough argument, we'll get an error later.
On 2012/02/03 15:39:20, kasperl wrote:
> argument -> arguments

Done.

https://chromiumcodereview.appspot.com/9325029/diff/1/dart/tests/language/src...
File dart/tests/language/src/BodyLessConstructorWrongArgNegativeTest.dart
(right):

https://chromiumcodereview.appspot.com/9325029/diff/1/dart/tests/language/src...
dart/tests/language/src/BodyLessConstructorWrongArgNegativeTest.dart:15: const
C(var x): super(); // call super construtor with wrong arg count
On 2012/02/03 15:39:20, kasperl wrote:
> construtor -> constructor

Done.

Powered by Google App Engine
This is Rietveld 408576698