OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 dart2js.resolution.class_hierarchy; | 5 library dart2js.resolution.class_hierarchy; |
6 | 6 |
7 import '../common.dart'; | 7 import '../common.dart'; |
8 import '../common/resolution.dart' show Feature; | 8 import '../common/resolution.dart' show Feature; |
9 import '../compiler.dart' show Compiler; | 9 import '../compiler.dart' show Compiler; |
10 import '../core_types.dart' show CoreClasses, CoreTypes; | 10 import '../core_types.dart' show CoreClasses, CoreTypes; |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 ConstructorElement target, ClassElement enclosing) { | 348 ConstructorElement target, ClassElement enclosing) { |
349 FunctionElement constructor = | 349 FunctionElement constructor = |
350 new SynthesizedConstructorElementX.notForDefault( | 350 new SynthesizedConstructorElementX.notForDefault( |
351 target.name, target, enclosing); | 351 target.name, target, enclosing); |
352 constructor.computeType(resolution); | 352 constructor.computeType(resolution); |
353 return constructor; | 353 return constructor; |
354 } | 354 } |
355 | 355 |
356 void doApplyMixinTo(MixinApplicationElementX mixinApplication, | 356 void doApplyMixinTo(MixinApplicationElementX mixinApplication, |
357 DartType supertype, DartType mixinType) { | 357 DartType supertype, DartType mixinType) { |
358 Node node = mixinApplication.parseNode(resolution.parsing); | 358 Node node = mixinApplication.parseNode(resolution.parsingContext); |
359 | 359 |
360 if (mixinApplication.supertype != null) { | 360 if (mixinApplication.supertype != null) { |
361 // [supertype] is not null if there was a cycle. | 361 // [supertype] is not null if there was a cycle. |
362 assert(invariant(node, compiler.compilationFailed)); | 362 assert(invariant(node, compiler.compilationFailed)); |
363 supertype = mixinApplication.supertype; | 363 supertype = mixinApplication.supertype; |
364 assert(invariant(node, supertype.isObject)); | 364 assert(invariant(node, supertype.isObject)); |
365 } else { | 365 } else { |
366 mixinApplication.supertype = supertype; | 366 mixinApplication.supertype = supertype; |
367 } | 367 } |
368 | 368 |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
645 Identifier selector = node.selector.asIdentifier(); | 645 Identifier selector = node.selector.asIdentifier(); |
646 var e = prefixElement.lookupLocalMember(selector.source); | 646 var e = prefixElement.lookupLocalMember(selector.source); |
647 if (e == null || !e.impliesType) { | 647 if (e == null || !e.impliesType) { |
648 reporter.reportErrorMessage(node.selector, | 648 reporter.reportErrorMessage(node.selector, |
649 MessageKind.CANNOT_RESOLVE_TYPE, {'typeName': node.selector}); | 649 MessageKind.CANNOT_RESOLVE_TYPE, {'typeName': node.selector}); |
650 return; | 650 return; |
651 } | 651 } |
652 loadSupertype(e, node); | 652 loadSupertype(e, node); |
653 } | 653 } |
654 } | 654 } |
OLD | NEW |