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

Side by Side Diff: pkg/analyzer/lib/src/summary/public_namespace_computer.dart

Issue 1589573003: Include the export namespace in the prelinked summary. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library analyzer.src.summary.public_namespace_visitor; 5 library analyzer.src.summary.public_namespace_visitor;
6 6
7 import 'package:analyzer/analyzer.dart'; 7 import 'package:analyzer/analyzer.dart';
8 import 'package:analyzer/src/summary/format.dart'; 8 import 'package:analyzer/src/summary/format.dart';
9 9
10 /** 10 /**
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 .map((Combinator c) => c.accept(new _CombinatorEncoder())) 78 .map((Combinator c) => c.accept(new _CombinatorEncoder()))
79 .toList())); 79 .toList()));
80 } 80 }
81 81
82 @override 82 @override
83 visitFunctionDeclaration(FunctionDeclaration node) { 83 visitFunctionDeclaration(FunctionDeclaration node) {
84 String name = node.name.name; 84 String name = node.name.name;
85 if (node.isSetter) { 85 if (node.isSetter) {
86 name += '='; 86 name += '=';
87 } 87 }
88 addNameIfPublic(name, PrelinkedReferenceKind.other, 88 addNameIfPublic(
89 name,
90 node.isGetter || node.isSetter
91 ? PrelinkedReferenceKind.topLevelPropertyAccessor
92 : PrelinkedReferenceKind.topLevelFunction,
89 node.functionExpression.typeParameters?.typeParameters?.length ?? 0); 93 node.functionExpression.typeParameters?.typeParameters?.length ?? 0);
90 } 94 }
91 95
92 @override 96 @override
93 visitFunctionTypeAlias(FunctionTypeAlias node) { 97 visitFunctionTypeAlias(FunctionTypeAlias node) {
94 addNameIfPublic(node.name.name, PrelinkedReferenceKind.typedef, 98 addNameIfPublic(node.name.name, PrelinkedReferenceKind.typedef,
95 node.typeParameters?.typeParameters?.length ?? 0); 99 node.typeParameters?.typeParameters?.length ?? 0);
96 } 100 }
97 101
98 @override 102 @override
99 visitPartDirective(PartDirective node) { 103 visitPartDirective(PartDirective node) {
100 parts.add(node.uri.stringValue); 104 parts.add(node.uri.stringValue);
101 } 105 }
102 106
103 @override 107 @override
104 visitVariableDeclaration(VariableDeclaration node) { 108 visitVariableDeclaration(VariableDeclaration node) {
105 String name = node.name.name; 109 String name = node.name.name;
106 addNameIfPublic(name, PrelinkedReferenceKind.other, 0); 110 addNameIfPublic(name, PrelinkedReferenceKind.topLevelPropertyAccessor, 0);
107 if (!node.isFinal && !node.isConst) { 111 if (!node.isFinal && !node.isConst) {
108 addNameIfPublic('$name=', PrelinkedReferenceKind.other, 0); 112 addNameIfPublic(
113 '$name=', PrelinkedReferenceKind.topLevelPropertyAccessor, 0);
109 } 114 }
110 } 115 }
111 } 116 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698