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

Issue 192303002: Support for @DartName and @DartOptional annotations. (Closed)

Created:
6 years, 9 months ago by scheglov
Modified:
6 years, 9 months ago
Reviewers:
Brian Wilkerson
CC:
reviews_dartlang.org, ricow1
Visibility:
Public.

Description

Support for @DartName and @DartOptional annotations. R=brianwilkerson@google.com BUG= Committed: https://code.google.com/p/dart/source/detail?r=33472

Patch Set 1 #

Total comments: 11
Unified diffs Side-by-side diffs Delta from patch set Stats (+642 lines, -410 lines) Patch
M editor/tools/plugins/com.google.dart.engine/META-INF/MANIFEST.MF View 1 chunk +2 lines, -1 line 0 comments Download
M editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/ast/IndexExpression.java View 3 chunks +3 lines, -0 lines 0 comments Download
M editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/ast/NodeList.java View 2 chunks +2 lines, -0 lines 0 comments Download
M editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/html/ast/XmlTagNode.java View 2 chunks +2 lines, -0 lines 2 comments Download
M editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/element/ElementImpl.java View 2 chunks +2 lines, -0 lines 0 comments Download
M editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/sdk/DirectoryBasedDartSdk.java View 3 chunks +5 lines, -1 line 0 comments Download
M editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/type/Type.java View 2 chunks +2 lines, -0 lines 2 comments Download
M editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/utilities/translation/DartOmit.java View 1 chunk +1 line, -1 line 0 comments Download
M editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/ast/AstFactory.java View 3 chunks +10 lines, -16 lines 0 comments Download
M editor/util/plugins/com.google.dart.java2dart/src/com/google/dart/java2dart/Context.java View 6 chunks +26 lines, -68 lines 0 comments Download
M editor/util/plugins/com.google.dart.java2dart/src/com/google/dart/java2dart/SyntaxTranslator.java View 3 chunks +5 lines, -0 lines 0 comments Download
M editor/util/plugins/com.google.dart.java2dart/src/com/google/dart/java2dart/engine/EngineAnnotationProcessor.java View 3 chunks +80 lines, -3 lines 4 comments Download
M editor/util/plugins/com.google.dart.java2dart/src/com/google/dart/java2dart/engine/EngineSemanticProcessor.java View 3 chunks +0 lines, -19 lines 0 comments Download
M editor/util/plugins/com.google.dart.java2dart/src/com/google/dart/java2dart/engine/MainEngine.java View 6 chunks +6 lines, -21 lines 0 comments Download
M editor/util/plugins/com.google.dart.java2dart/src/com/google/dart/java2dart/processor/LocalVariablesSemanticProcessor.java View 1 chunk +0 lines, -15 lines 0 comments Download
A editor/util/plugins/com.google.dart.java2dart/src/com/google/dart/java2dart/processor/RenameConstructorsSemanticProcessor.java View 1 chunk +112 lines, -0 lines 0 comments Download
A + editor/util/plugins/com.google.dart.java2dart/src/com/google/dart/java2dart/processor/UniqueMemberNamesSemanticProcessor.java View 1 chunk +11 lines, -14 lines 0 comments Download
M editor/util/plugins/com.google.dart.java2dart/src/com/google/dart/java2dart/util/ToFormattedSourceVisitor.java View 2 chunks +10 lines, -1 line 0 comments Download
M editor/util/plugins/com.google.dart.java2dart_test/src/com/google/dart/java2dart/SemanticTest.java View 67 chunks +76 lines, -182 lines 0 comments Download
M editor/util/plugins/com.google.dart.java2dart_test/src/com/google/dart/java2dart/processor/EngineAnnotationProcessorTest.java View 6 chunks +250 lines, -24 lines 2 comments Download
M editor/util/plugins/com.google.dart.java2dart_test/src/com/google/dart/java2dart/processor/PropertySemanticProcessorTest.java View 2 chunks +2 lines, -2 lines 0 comments Download
M editor/util/plugins/com.google.dart.java2dart_test/src/com/google/dart/java2dart/processor/SemanticProcessorTest.java View 1 chunk +1 line, -0 lines 0 comments Download
M pkg/analyzer/lib/src/generated/element.dart View 19 chunks +19 lines, -19 lines 0 comments Download
M pkg/analyzer/lib/src/generated/index.dart View 2 chunks +2 lines, -2 lines 0 comments Download
M pkg/analyzer/lib/src/generated/sdk_io.dart View 1 chunk +1 line, -8 lines 1 comment Download
M pkg/analyzer/test/generated/ast_test.dart View 5 chunks +9 lines, -10 lines 0 comments Download
M pkg/analyzer/test/generated/resolver_test.dart View 3 chunks +3 lines, -3 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
scheglov
6 years, 9 months ago (2014-03-09 20:56:57 UTC) #1
Brian Wilkerson
LGTM! https://codereview.chromium.org/192303002/diff/1/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/html/ast/XmlTagNode.java File editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/html/ast/XmlTagNode.java (right): https://codereview.chromium.org/192303002/diff/1/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/html/ast/XmlTagNode.java#newcode349 editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/html/ast/XmlTagNode.java:349: @DartName("becomeParentOfEmpty") I would have made becomeParentOfAll take an ...
6 years, 9 months ago (2014-03-09 23:43:15 UTC) #2
scheglov
Committed patchset #1 manually as r33472 (presubmit successful).
6 years, 9 months ago (2014-03-10 01:13:00 UTC) #3
scheglov
6 years, 9 months ago (2014-03-10 01:13:42 UTC) #4
Message was sent while issue was closed.
https://codereview.chromium.org/192303002/diff/1/editor/tools/plugins/com.goo...
File
editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/html/ast/XmlTagNode.java
(right):

https://codereview.chromium.org/192303002/diff/1/editor/tools/plugins/com.goo...
editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/html/ast/XmlTagNode.java:349:
@DartName("becomeParentOfEmpty")
On 2014/03/09 23:43:15, Brian Wilkerson wrote:
> I would have made becomeParentOfAll take an optional "ifEmpty" parameter
> (probably a named parameter, but I'm not sure of that).

Done.

https://codereview.chromium.org/192303002/diff/1/editor/tools/plugins/com.goo...
File
editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/type/Type.java
(right):

https://codereview.chromium.org/192303002/diff/1/editor/tools/plugins/com.goo...
editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/type/Type.java:25:
@DartName("Type2")
On 2014/03/09 23:43:15, Brian Wilkerson wrote:
> I'm not too fond of this name. How about 'DartType'?

Done.

https://codereview.chromium.org/192303002/diff/1/editor/util/plugins/com.goog...
File
editor/util/plugins/com.google.dart.java2dart/src/com/google/dart/java2dart/engine/EngineAnnotationProcessor.java
(right):

https://codereview.chromium.org/192303002/diff/1/editor/util/plugins/com.goog...
editor/util/plugins/com.google.dart.java2dart/src/com/google/dart/java2dart/engine/EngineAnnotationProcessor.java:87:
"@DartNode is supported only field declarations with a single field.");
On 2014/03/09 23:43:15, Brian Wilkerson wrote:
> nit: "DartNode" --> "DartName"

Done.

https://codereview.chromium.org/192303002/diff/1/editor/util/plugins/com.goog...
editor/util/plugins/com.google.dart.java2dart/src/com/google/dart/java2dart/engine/EngineAnnotationProcessor.java:96:
throw new IllegalArgumentException("@DartNode is not supported for: " +
node.getClass());
On 2014/03/09 23:43:15, Brian Wilkerson wrote:
> nit: "DartNode" --> "DartName"

Done.

https://codereview.chromium.org/192303002/diff/1/editor/util/plugins/com.goog...
File
editor/util/plugins/com.google.dart.java2dart_test/src/com/google/dart/java2dart/processor/EngineAnnotationProcessorTest.java
(right):

https://codereview.chromium.org/192303002/diff/1/editor/util/plugins/com.goog...
editor/util/plugins/com.google.dart.java2dart_test/src/com/google/dart/java2dart/processor/EngineAnnotationProcessorTest.java:125:
"  @DartName()",
On 2014/03/09 23:43:15, Brian Wilkerson wrote:
> Do we need to include an annotation to get an unnamed constructor when there
are
> multiple constructors? (It's fine if we do, just curious.)

No, we don't.
It was a test artefact.
In MainEngine we apply first annotations and only then rename constructors.
So, if there is only one constructor without @DartName left, it'll become
unnamed.
See ElementImpl.

Powered by Google App Engine
This is Rietveld 408576698