Skip to content

Conversation

@natebosch
Copy link
Member

This makes annotation.dart forward compatible with implementations of the Resolvers and LibraryElement using analyzer summary files.

Going through computeNode() and AST types is not guaranteed to work for
all Element sources. Instead go through only statically available
Element types.

- Avoid computeNode() on the ConstructorElement by reading parameters
  and names directly
- Avoid computedNode() on the PropertyAccessorElement.variable by
  checking if it is a ConstVariableElement with an available
  InstanceCreationExpression
- Update imports for Element classes to a non-deprecated library
@sigmundch
Copy link
Member

nice! lgtm

} else {
ctorName = new Symbol(ctorDeclaration.name.name);
}
Symbol ctorName = new Symbol(ctor.name ?? '');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use var ctorName =

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call. Done

@natebosch natebosch merged commit fd2fc3a into dart-lang:master Sep 13, 2016
@natebosch natebosch deleted the skip-compute-node branch September 13, 2016 20:09
mosuem pushed a commit to dart-lang/build that referenced this pull request Dec 10, 2024
* avoid computeNode calls in annotation.dart

Going through computeNode() and AST types is not guaranteed to work for
all Element sources. Instead go through only statically available
Element types.

- Avoid computeNode() on the ConstructorElement by reading parameters
  and names directly
- Avoid computedNode() on the PropertyAccessorElement.variable by
  checking if it is a ConstVariableElement with an available
  InstanceCreationExpression
- Update imports for Element classes to a non-deprecated library

* Bump version and update changelog

* Fix unnecessarily typed variable
mosuem pushed a commit to dart-lang/build that referenced this pull request Dec 10, 2024
* avoid computeNode calls in annotation.dart

Going through computeNode() and AST types is not guaranteed to work for
all Element sources. Instead go through only statically available
Element types.

- Avoid computeNode() on the ConstructorElement by reading parameters
  and names directly
- Avoid computedNode() on the PropertyAccessorElement.variable by
  checking if it is a ConstVariableElement with an available
  InstanceCreationExpression
- Update imports for Element classes to a non-deprecated library

* Bump version and update changelog

* Fix unnecessarily typed variable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants