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

Side by Side Diff: packages/smoke/lib/codegen/recorder.dart

Issue 1521693002: Roll Observatory deps (charted -> ^0.3.0) (Closed) Base URL: https://chromium.googlesource.com/external/github.com/dart-lang/observatory_pub_packages.git@master
Patch Set: Created 5 years 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
« no previous file with comments | « packages/smoke/CHANGELOG.md ('k') | packages/smoke/lib/mirrors.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 /// Records accesses to Dart program declarations and generates code that will 5 /// Records accesses to Dart program declarations and generates code that will
6 /// allow to do the same accesses at runtime using `package:smoke/static.dart`. 6 /// allow to do the same accesses at runtime using `package:smoke/static.dart`.
7 /// Internally, this library relies on the `analyzer` to extract data from the 7 /// Internally, this library relies on the `analyzer` to extract data from the
8 /// program, and then uses [SmokeCodeGenerator] to produce the code needed by 8 /// program, and then uses [SmokeCodeGenerator] to produce the code needed by
9 /// the smoke system. 9 /// the smoke system.
10 /// 10 ///
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 246
247 /// Adds [name] as a symbol, a getter, and optionally a setter in [generator]. 247 /// Adds [name] as a symbol, a getter, and optionally a setter in [generator].
248 _addAccessors(String name, bool includeSetter) { 248 _addAccessors(String name, bool includeSetter) {
249 generator.addSymbol(name); 249 generator.addSymbol(name);
250 generator.addGetter(name); 250 generator.addGetter(name);
251 if (includeSetter) generator.addSetter(name); 251 if (includeSetter) generator.addSetter(name);
252 } 252 }
253 253
254 /// Copy metadata associated with the declaration of [target]. 254 /// Copy metadata associated with the declaration of [target].
255 List<ConstExpression> _copyAnnotations(Element target) { 255 List<ConstExpression> _copyAnnotations(Element target) {
256 var node = target.node; 256 var node = target.computeNode();
257 // [node] is the initialization expression, we walk up to get to the actual 257 // [node] is the initialization expression, we walk up to get to the actual
258 // member declaration where the metadata is attached to. 258 // member declaration where the metadata is attached to.
259 while (node is! ClassMember) node = node.parent; 259 while (node is! ClassMember) node = node.parent;
260 return node.metadata.map(_convertAnnotation).toList(); 260 return node.metadata.map(_convertAnnotation).toList();
261 } 261 }
262 262
263 /// Converts annotations into [ConstExpression]s supported by the codegen 263 /// Converts annotations into [ConstExpression]s supported by the codegen
264 /// library. 264 /// library.
265 ConstExpression _convertAnnotation(Annotation annotation) { 265 ConstExpression _convertAnnotation(Annotation annotation) {
266 var element = annotation.element; 266 var element = annotation.element;
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 final NameMatcher matches; 396 final NameMatcher matches;
397 397
398 const QueryOptions({this.includeFields: true, this.includeProperties: true, 398 const QueryOptions({this.includeFields: true, this.includeProperties: true,
399 this.includeInherited: true, this.includeUpTo: null, 399 this.includeInherited: true, this.includeUpTo: null,
400 this.excludeFinal: false, this.includeMethods: false, 400 this.excludeFinal: false, this.includeMethods: false,
401 this.withAnnotations: null, this.matches: null}); 401 this.withAnnotations: null, this.matches: null});
402 } 402 }
403 403
404 /// Predicate that tells whether [name] should be included in query results. 404 /// Predicate that tells whether [name] should be included in query results.
405 typedef bool NameMatcher(String name); 405 typedef bool NameMatcher(String name);
OLDNEW
« no previous file with comments | « packages/smoke/CHANGELOG.md ('k') | packages/smoke/lib/mirrors.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698