-
Notifications
You must be signed in to change notification settings - Fork 62
New features for 1.0.0-beta #52
Conversation
Partial support towards https://github.com/dart-lang/code_builder/issues/43
natebosch
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests for increment and decrement?
| } | ||
|
|
||
| @override | ||
| ExpressionBuilder increment([bool prefix = false]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nit] how are you choosing between => and return? Why is this one different from decrement above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trying not to use => when it creates a new line, but probably inconsistent.
|
|
||
| @override | ||
| ExpressionBuilder identical(ExpressionBuilder other) { | ||
| return lib$core.identical.call([ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this fixing an analyzer warning? I'd be surprised if this wasn't inferred in strong mode...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it could not infer the type and warned as such.
| HasParameters, | ||
| HasStatements, | ||
| ValidClassMember { | ||
| /// Create a new [ConstructorBuilder], optionally with a [name]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doc comment is no longer complete. This is a case where we can add useful information explaining the 'super' arguments ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Acknowledged.
lib/src/builders/method.dart
Outdated
| List<ExpressionBuilder> invokeSuper, | ||
| }) = _NormalConstructorBuilder; | ||
|
|
||
| /// Adds a constructor initializer. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nit] 'constructor initializer' reads a bit strange to me... how about
/// Adds a field initializer to this constructor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
| /// The `/` token. | ||
| final Token $divide = new Token(TokenType.SLASH, 0); | ||
|
|
||
| /// The `do` keyword. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we consider dropping this lint? The zero-information comments are very noisy throughout
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To make it consistent I'll drop them all in another PR.
test/builders/statement_test.dart
Outdated
| }); | ||
| }); | ||
|
|
||
| group('for statemnets', () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nit] typo in statements
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
natebosch
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding a test for increment/decrement in a followup
* Add for/for-in loop Closes https://github.com/dart-lang/code_builder/issues/49 * Add support for while/do-while * Add constructor initializers Closes https://github.com/dart-lang/code_builder/issues/50 * Update CHANGELOG and pubspec for beta * Add “name” getter for ParameterBuilder Partial support towards https://github.com/dart-lang/code_builder/issues/43 * Update CHANGELOG * Address feedback
I don't expect anyone to get to this before the new year
Closes dart-lang/tools#894
Closes dart-lang/tools#970
Closes dart-lang/tools#968
Partial support on dart-lang/tools#966
1.0.0-beta
async,sync,sync*functionsasAwait,asYield,asYieldStartoExportBuilderandtoImportBuilderto types and referencesreturnstatements and named constructor invocations.whileanddo {} whileloop supportforandfor-insupportnamegetter forParameterBuilder/cc @alorenzen