| OLD | NEW |
| 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 import 'package:front_end/src/fasta/scanner.dart' | 5 import 'package:front_end/src/fasta/scanner.dart' |
| 6 show BeginGroupToken, StringToken, Token; | 6 show BeginGroupToken, StringToken, Token; |
| 7 import 'package:front_end/src/fasta/scanner.dart' as Tokens show EOF_TOKEN; | 7 import 'package:front_end/src/fasta/scanner.dart' as Tokens show EOF_TOKEN; |
| 8 | 8 |
| 9 import '../common.dart'; | 9 import '../common.dart'; |
| 10 import '../common_elements.dart' show CommonElements, ElementEnvironment; | 10 import '../common_elements.dart' show CommonElements, ElementEnvironment; |
| (...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 399 } | 399 } |
| 400 } else { | 400 } else { |
| 401 _tagOwner[tag] = cls; | 401 _tagOwner[tag] = cls; |
| 402 } | 402 } |
| 403 } | 403 } |
| 404 } | 404 } |
| 405 | 405 |
| 406 /// Returns the name of the super class of [cls] or `null` of [cls] has | 406 /// Returns the name of the super class of [cls] or `null` of [cls] has |
| 407 /// no explicit superclass. | 407 /// no explicit superclass. |
| 408 String _findExtendsNameOfClass(ClassEntity cls) { | 408 String _findExtendsNameOfClass(ClassEntity cls) { |
| 409 return _elementEnvironment.getSuperClass(cls)?.name; | 409 return _elementEnvironment |
| 410 .getSuperClass(cls, skipUnnamedMixinApplications: true) |
| 411 ?.name; |
| 410 } | 412 } |
| 411 | 413 |
| 412 /// Adds all subclasses of [nativeClasses] found in [libraries] to | 414 /// Adds all subclasses of [nativeClasses] found in [libraries] to |
| 413 /// [nativeClasses]. | 415 /// [nativeClasses]. |
| 414 void _processSubclassesOfNativeClasses( | 416 void _processSubclassesOfNativeClasses( |
| 415 Iterable<LibraryEntity> libraries, Set<ClassEntity> nativeClasses) { | 417 Iterable<LibraryEntity> libraries, Set<ClassEntity> nativeClasses) { |
| 416 Set<ClassEntity> nativeClassesAndSubclasses = new Set<ClassEntity>(); | 418 Set<ClassEntity> nativeClassesAndSubclasses = new Set<ClassEntity>(); |
| 417 // Collect potential subclasses, e.g. | 419 // Collect potential subclasses, e.g. |
| 418 // | 420 // |
| 419 // class B extends foo.A {} | 421 // class B extends foo.A {} |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 564 | 566 |
| 565 Iterable<ConstantValue> fields = constructedObject.fields.values; | 567 Iterable<ConstantValue> fields = constructedObject.fields.values; |
| 566 // TODO(sra): Better validation of the constant. | 568 // TODO(sra): Better validation of the constant. |
| 567 if (fields.length != 1 || fields.single is! StringConstantValue) { | 569 if (fields.length != 1 || fields.single is! StringConstantValue) { |
| 568 throw new SpannableAssertionFailure( | 570 throw new SpannableAssertionFailure( |
| 569 spannable, 'Annotations needs one string: ${value.toStructuredText()}'); | 571 spannable, 'Annotations needs one string: ${value.toStructuredText()}'); |
| 570 } | 572 } |
| 571 StringConstantValue specStringConstant = fields.single; | 573 StringConstantValue specStringConstant = fields.single; |
| 572 return specStringConstant.toDartString().slowToString(); | 574 return specStringConstant.toDartString().slowToString(); |
| 573 } | 575 } |
| OLD | NEW |