OLD | NEW |
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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:async'; | 5 import 'dart:async'; |
6 import 'dart:convert'; | 6 import 'dart:convert'; |
7 import 'dart:io'; | 7 import 'dart:io'; |
8 | 8 |
9 import 'package:analyzer/dart/ast/ast.dart'; | 9 import 'package:analyzer/dart/ast/ast.dart'; |
| 10 import 'package:analyzer/dart/ast/token.dart'; |
10 import 'package:analyzer/dart/ast/visitor.dart'; | 11 import 'package:analyzer/dart/ast/visitor.dart'; |
11 import 'package:analyzer/dart/element/element.dart'; | 12 import 'package:analyzer/dart/element/element.dart'; |
12 import 'package:analyzer/dart/element/type.dart'; | 13 import 'package:analyzer/dart/element/type.dart'; |
13 import 'package:analyzer/src/dart/analysis/driver.dart'; | 14 import 'package:analyzer/src/dart/analysis/driver.dart'; |
14 import 'package:analyzer/src/generated/source.dart'; | 15 import 'package:analyzer/src/generated/source.dart'; |
15 import 'package:analyzer/src/generated/utilities_dart.dart'; | 16 import 'package:analyzer/src/generated/utilities_dart.dart'; |
16 import 'package:front_end/src/base/instrumentation.dart' as fasta; | 17 import 'package:front_end/src/base/instrumentation.dart' as fasta; |
17 import 'package:front_end/src/fasta/compiler_context.dart' as fasta; | 18 import 'package:front_end/src/fasta/compiler_context.dart' as fasta; |
18 import 'package:front_end/src/fasta/testing/validating_instrumentation.dart' | 19 import 'package:front_end/src/fasta/testing/validating_instrumentation.dart' |
19 as fasta; | 20 as fasta; |
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 node.prefix.staticElement is! ClassElement) { | 444 node.prefix.staticElement is! ClassElement) { |
444 if (node.identifier.inGetterContext() || | 445 if (node.identifier.inGetterContext() || |
445 node.identifier.inSetterContext()) { | 446 node.identifier.inSetterContext()) { |
446 _recordTarget(node.identifier.offset, node.identifier.staticElement); | 447 _recordTarget(node.identifier.offset, node.identifier.staticElement); |
447 } | 448 } |
448 } | 449 } |
449 } | 450 } |
450 | 451 |
451 visitPrefixExpression(PrefixExpression node) { | 452 visitPrefixExpression(PrefixExpression node) { |
452 super.visitPrefixExpression(node); | 453 super.visitPrefixExpression(node); |
453 _recordTarget(node.operator.charOffset, node.staticElement); | 454 if (node.operator.type != TokenType.PLUS_PLUS && |
| 455 node.operator.type != TokenType.MINUS_MINUS) { |
| 456 _recordTarget(node.operator.charOffset, node.staticElement); |
| 457 } |
454 } | 458 } |
455 | 459 |
456 @override | 460 @override |
457 visitPropertyAccess(PropertyAccess node) { | 461 visitPropertyAccess(PropertyAccess node) { |
458 super.visitPropertyAccess(node); | 462 super.visitPropertyAccess(node); |
459 if (node.propertyName.inGetterContext() || | 463 if (node.propertyName.inGetterContext() || |
460 node.propertyName.inSetterContext()) { | 464 node.propertyName.inSetterContext()) { |
461 _recordTarget(node.propertyName.offset, node.propertyName.staticElement); | 465 _recordTarget(node.propertyName.offset, node.propertyName.staticElement); |
462 } | 466 } |
463 } | 467 } |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
545 | 549 |
546 /// Based on DDC code generator's `_recoverTypeArguments` | 550 /// Based on DDC code generator's `_recoverTypeArguments` |
547 Iterable<DartType> _recoverTypeArguments(FunctionType g, FunctionType f) { | 551 Iterable<DartType> _recoverTypeArguments(FunctionType g, FunctionType f) { |
548 assert(identical(g.element, f.element)); | 552 assert(identical(g.element, f.element)); |
549 assert(g.typeFormals.isNotEmpty && f.typeFormals.isEmpty); | 553 assert(g.typeFormals.isNotEmpty && f.typeFormals.isEmpty); |
550 assert(g.typeFormals.length + g.typeArguments.length == | 554 assert(g.typeFormals.length + g.typeArguments.length == |
551 f.typeArguments.length); | 555 f.typeArguments.length); |
552 return f.typeArguments.skip(g.typeArguments.length); | 556 return f.typeArguments.skip(g.typeArguments.length); |
553 } | 557 } |
554 } | 558 } |
OLD | NEW |