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

Side by Side Diff: pkg/compiler/lib/src/native/resolver.dart

Issue 2859133003: Find native classes with mixins in NativeClassFinder (Closed)
Patch Set: Created 3 years, 7 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
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 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
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
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 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/native/enqueue.dart ('k') | pkg/compiler/lib/src/resolution/resolution_strategy.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698