| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 import 'dart:convert'; | 5 import 'dart:convert'; |
| 6 | 6 |
| 7 import 'package:analyzer/dart/ast/ast.dart'; | 7 import 'package:analyzer/dart/ast/ast.dart'; |
| 8 import 'package:analyzer/dart/element/element.dart'; | 8 import 'package:analyzer/dart/element/element.dart'; |
| 9 import 'package:analyzer/src/summary/format.dart'; | 9 import 'package:analyzer/src/summary/format.dart'; |
| 10 import 'package:analyzer/src/summary/idl.dart'; | 10 import 'package:analyzer/src/summary/idl.dart'; |
| (...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 664 main() { | 664 main() { |
| 665 new A(); // 1 | 665 new A(); // 1 |
| 666 } | 666 } |
| 667 '''); | 667 '''); |
| 668 ClassElement classA = findElement('A'); | 668 ClassElement classA = findElement('A'); |
| 669 ConstructorElement constA = classA.constructors[0]; | 669 ConstructorElement constA = classA.constructors[0]; |
| 670 // A() | 670 // A() |
| 671 assertThat(constA)..isReferencedAt('(); // 1', true, length: 0); | 671 assertThat(constA)..isReferencedAt('(); // 1', true, length: 0); |
| 672 } | 672 } |
| 673 | 673 |
| 674 void test_isReferencedBy_DynamicElement() { |
| 675 _indexTestUnit(''' |
| 676 dynamic f() { |
| 677 }'''); |
| 678 expect(unitIndex.usedElementOffsets, isEmpty); |
| 679 } |
| 680 |
| 674 void test_isReferencedBy_FieldElement() { | 681 void test_isReferencedBy_FieldElement() { |
| 675 _indexTestUnit(''' | 682 _indexTestUnit(''' |
| 676 class A { | 683 class A { |
| 677 var field; | 684 var field; |
| 678 A({this.field}); | 685 A({this.field}); |
| 679 m() { | 686 m() { |
| 680 field = 2; // nq | 687 field = 2; // nq |
| 681 print(field); // nq | 688 print(field); // nq |
| 682 } | 689 } |
| 683 } | 690 } |
| (...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1215 final bool isQualified; | 1222 final bool isQualified; |
| 1216 | 1223 |
| 1217 _Relation(this.kind, this.offset, this.length, this.isQualified); | 1224 _Relation(this.kind, this.offset, this.length, this.isQualified); |
| 1218 | 1225 |
| 1219 @override | 1226 @override |
| 1220 String toString() { | 1227 String toString() { |
| 1221 return '_Relation{kind: $kind, offset: $offset, length: $length, ' | 1228 return '_Relation{kind: $kind, offset: $offset, length: $length, ' |
| 1222 'isQualified: $isQualified}'; | 1229 'isQualified: $isQualified}'; |
| 1223 } | 1230 } |
| 1224 } | 1231 } |
| OLD | NEW |