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

Unified Diff: sdk/lib/_internal/compiler/implementation/mirrors/dart2js_mirrors.dart

Issue 296463003: Handle metadata on nested function parameters. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comment. Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sdk/lib/_internal/compiler/implementation/mirrors/dart2js_mirrors.dart
diff --git a/sdk/lib/_internal/compiler/implementation/mirrors/dart2js_mirrors.dart b/sdk/lib/_internal/compiler/implementation/mirrors/dart2js_mirrors.dart
index 7530c86766c4a9cb4122edbbe49d97c086be3699..1d21994c44c25eed564750bad89e1fa57f4a0def 100644
--- a/sdk/lib/_internal/compiler/implementation/mirrors/dart2js_mirrors.dart
+++ b/sdk/lib/_internal/compiler/implementation/mirrors/dart2js_mirrors.dart
@@ -476,13 +476,9 @@ class BackDoor {
Compiler compiler = declaration.mirrorSystem.compiler;
return declaration._element.metadata.toList().map((metadata) {
var node = metadata.parseNode(compiler);
- Element annotatedElement = metadata.annotatedElement;
- var context = annotatedElement.enclosingElement;
- if (context == null) {
- context = annotatedElement;
- }
+ var treeElements = metadata.annotatedElement.treeElements;
return new ResolvedNode(
- node, context.treeElements, declaration.mirrorSystem);
+ node, treeElements, declaration.mirrorSystem);
});
}
@@ -496,8 +492,7 @@ class BackDoor {
static ResolvedNode defaultValueSyntaxOf(Dart2JsParameterMirror parameter) {
if (!parameter.hasDefaultValue) return null;
var node = parameter._element.initializer;
- return new ResolvedNode(node,
- (parameter.owner as Dart2JsElementMirror)._element.treeElements,
- parameter.mirrorSystem);
+ var treeElements = parameter._element.treeElements;
+ return new ResolvedNode(node, treeElements, parameter.mirrorSystem);
}
}

Powered by Google App Engine
This is Rietveld 408576698