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

Side by Side Diff: pkg/analyzer/lib/src/dart/element/element.dart

Issue 2982463002: Deprecate UnlinkedVariable.visibleOffset/Length. (Closed)
Patch Set: Created 3 years, 5 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
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/summary/format.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 library analyzer.src.dart.element.element; 5 library analyzer.src.dart.element.element;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 import 'dart:math' show min; 8 import 'dart:math' show min;
9 9
10 import 'package:analyzer/dart/ast/ast.dart'; 10 import 'package:analyzer/dart/ast/ast.dart';
(...skipping 6288 matching lines...) Expand 10 before | Expand all | Expand 10 after
6299 bool get isPotentiallyMutatedInClosure => true; 6299 bool get isPotentiallyMutatedInClosure => true;
6300 6300
6301 @override 6301 @override
6302 bool get isPotentiallyMutatedInScope => true; 6302 bool get isPotentiallyMutatedInScope => true;
6303 6303
6304 @override 6304 @override
6305 ElementKind get kind => ElementKind.LOCAL_VARIABLE; 6305 ElementKind get kind => ElementKind.LOCAL_VARIABLE;
6306 6306
6307 @override 6307 @override
6308 SourceRange get visibleRange { 6308 SourceRange get visibleRange {
6309 if (_unlinkedVariable != null) {
6310 if (_unlinkedVariable.visibleLength == 0) {
6311 return null;
6312 }
6313 return new SourceRange(
6314 _unlinkedVariable.visibleOffset, _unlinkedVariable.visibleLength);
6315 }
6316 if (_visibleRangeLength < 0) { 6309 if (_visibleRangeLength < 0) {
6317 return null; 6310 return null;
6318 } 6311 }
6319 return new SourceRange(_visibleRangeOffset, _visibleRangeLength); 6312 return new SourceRange(_visibleRangeOffset, _visibleRangeLength);
6320 } 6313 }
6321 6314
6322 @override 6315 @override
6323 T accept<T>(ElementVisitor<T> visitor) => 6316 T accept<T>(ElementVisitor<T> visitor) =>
6324 visitor.visitLocalVariableElement(this); 6317 visitor.visitLocalVariableElement(this);
6325 6318
6326 @override 6319 @override
6327 void appendTo(StringBuffer buffer) { 6320 void appendTo(StringBuffer buffer) {
6328 buffer.write(type); 6321 buffer.write(type);
6329 buffer.write(" "); 6322 buffer.write(" ");
6330 buffer.write(displayName); 6323 buffer.write(displayName);
6331 } 6324 }
6332 6325
6333 @override 6326 @override
6334 Declaration computeNode() => getNodeMatching( 6327 Declaration computeNode() => getNodeMatching(
6335 (node) => node is DeclaredIdentifier || node is VariableDeclaration); 6328 (node) => node is DeclaredIdentifier || node is VariableDeclaration);
6336 6329
6337 /** 6330 /**
6338 * Set the visible range for this element to the range starting at the given 6331 * Set the visible range for this element to the range starting at the given
6339 * [offset] with the given [length]. 6332 * [offset] with the given [length].
6340 */ 6333 */
6341 void setVisibleRange(int offset, int length) { 6334 void setVisibleRange(int offset, int length) {
6342 _assertNotResynthesized(_unlinkedVariable);
6343 _visibleRangeOffset = offset; 6335 _visibleRangeOffset = offset;
6344 _visibleRangeLength = length; 6336 _visibleRangeLength = length;
6345 } 6337 }
6346 } 6338 }
6347 6339
6348 /** 6340 /**
6349 * A concrete implementation of a [MethodElement]. 6341 * A concrete implementation of a [MethodElement].
6350 */ 6342 */
6351 class MethodElementImpl extends ExecutableElementImpl implements MethodElement { 6343 class MethodElementImpl extends ExecutableElementImpl implements MethodElement {
6352 /** 6344 /**
(...skipping 2519 matching lines...) Expand 10 before | Expand all | Expand 10 after
8872 8864
8873 @override 8865 @override
8874 DartObject computeConstantValue() => null; 8866 DartObject computeConstantValue() => null;
8875 8867
8876 @override 8868 @override
8877 void visitChildren(ElementVisitor visitor) { 8869 void visitChildren(ElementVisitor visitor) {
8878 super.visitChildren(visitor); 8870 super.visitChildren(visitor);
8879 _initializer?.accept(visitor); 8871 _initializer?.accept(visitor);
8880 } 8872 }
8881 } 8873 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/summary/format.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698