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 library dart2js.js_model.elements; | 5 library dart2js.js_model.elements; |
6 | 6 |
7 import '../common/names.dart' show Names; | 7 import '../common/names.dart' show Names; |
8 import '../elements/entities.dart'; | 8 import '../elements/entities.dart'; |
9 import '../elements/names.dart'; | 9 import '../elements/names.dart'; |
10 import '../elements/types.dart'; | 10 import '../elements/types.dart'; |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 final JLibrary library; | 312 final JLibrary library; |
313 | 313 |
314 /// Class index used for fast lookup in [JsToFrontendMapImpl]. | 314 /// Class index used for fast lookup in [JsToFrontendMapImpl]. |
315 final int classIndex; | 315 final int classIndex; |
316 | 316 |
317 final String name; | 317 final String name; |
318 final bool isAbstract; | 318 final bool isAbstract; |
319 | 319 |
320 JClass(this.library, this.classIndex, this.name, {this.isAbstract}); | 320 JClass(this.library, this.classIndex, this.name, {this.isAbstract}); |
321 | 321 |
322 @override | 322 /// True if this class is a class created to represent the semantics of a Dart |
| 323 /// closure. |
323 bool get isClosure => false; | 324 bool get isClosure => false; |
324 | 325 |
325 String toString() => '${jsElementPrefix}class($name)'; | 326 String toString() => '${jsElementPrefix}class($name)'; |
326 } | 327 } |
327 | 328 |
328 class JTypedef implements TypedefEntity, IndexedTypedef { | 329 class JTypedef implements TypedefEntity, IndexedTypedef { |
329 final JLibrary library; | 330 final JLibrary library; |
330 | 331 |
331 /// Typedef index used for fast lookup in [JsToFrontendMapImpl]. | 332 /// Typedef index used for fast lookup in [JsToFrontendMapImpl]. |
332 final int typedefIndex; | 333 final int typedefIndex; |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
540 | 541 |
541 @override | 542 @override |
542 bool get isField => true; | 543 bool get isField => true; |
543 | 544 |
544 String get _kind => 'field'; | 545 String get _kind => 'field'; |
545 } | 546 } |
546 | 547 |
547 class JClosureCallMethod extends JMethod { | 548 class JClosureCallMethod extends JMethod { |
548 JClosureCallMethod(int memberIndex, KernelClosureClass containingClass, | 549 JClosureCallMethod(int memberIndex, KernelClosureClass containingClass, |
549 ParameterStructure parameterStructure, AsyncMarker asyncMarker) | 550 ParameterStructure parameterStructure, AsyncMarker asyncMarker) |
550 : super(memberIndex, containingClass.library, containingClass, Names.call, | 551 : super( |
551 parameterStructure, asyncMarker, | 552 memberIndex, |
552 isStatic: false, isExternal: false, isAbstract: false); | 553 containingClass.closureClassEntity.library, |
| 554 containingClass.closureClassEntity, |
| 555 Names.call, |
| 556 parameterStructure, |
| 557 asyncMarker, |
| 558 isStatic: false, |
| 559 isExternal: false, |
| 560 isAbstract: false); |
553 | 561 |
554 String get _kind => 'closure_call'; | 562 String get _kind => 'closure_call'; |
555 } | 563 } |
556 | 564 |
557 class JTypeVariable implements TypeVariableEntity, IndexedTypeVariable { | 565 class JTypeVariable implements TypeVariableEntity, IndexedTypeVariable { |
558 final int typeVariableIndex; | 566 final int typeVariableIndex; |
559 final Entity typeDeclaration; | 567 final Entity typeDeclaration; |
560 final String name; | 568 final String name; |
561 final int index; | 569 final int index; |
562 | 570 |
563 JTypeVariable( | 571 JTypeVariable( |
564 this.typeVariableIndex, this.typeDeclaration, this.name, this.index); | 572 this.typeVariableIndex, this.typeDeclaration, this.name, this.index); |
565 | 573 |
566 String toString() => | 574 String toString() => |
567 '${jsElementPrefix}type_variable(${typeDeclaration.name}.$name)'; | 575 '${jsElementPrefix}type_variable(${typeDeclaration.name}.$name)'; |
568 } | 576 } |
OLD | NEW |