| 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 '../elements/entities.dart'; | 7 import '../elements/entities.dart'; |
| 8 import '../elements/names.dart'; | 8 import '../elements/names.dart'; |
| 9 import '../elements/types.dart'; | 9 import '../elements/types.dart'; |
| 10 import '../kernel/elements.dart'; | 10 import '../kernel/elements.dart'; |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 JClass(this.library, this.classIndex, this.name, {this.isAbstract}); | 307 JClass(this.library, this.classIndex, this.name, {this.isAbstract}); |
| 308 | 308 |
| 309 @override | 309 @override |
| 310 bool get isClosure => false; | 310 bool get isClosure => false; |
| 311 | 311 |
| 312 String toString() => '${jsElementPrefix}class($name)'; | 312 String toString() => '${jsElementPrefix}class($name)'; |
| 313 } | 313 } |
| 314 | 314 |
| 315 abstract class JMember implements MemberEntity, IndexedMember { | 315 abstract class JMember implements MemberEntity, IndexedMember { |
| 316 /// Member index used for fast lookup in [JsToFrontendMapImpl]. | 316 /// Member index used for fast lookup in [JsToFrontendMapImpl]. |
| 317 int _memberIndex; | 317 final int memberIndex; |
| 318 final JLibrary library; | 318 final JLibrary library; |
| 319 final JClass enclosingClass; | 319 final JClass enclosingClass; |
| 320 final Name _name; | 320 final Name _name; |
| 321 final bool _isStatic; | 321 final bool _isStatic; |
| 322 | 322 |
| 323 JMember(this._memberIndex, this.library, this.enclosingClass, this._name, | 323 JMember(this.memberIndex, this.library, this.enclosingClass, this._name, |
| 324 {bool isStatic: false}) | 324 {bool isStatic: false}) |
| 325 : _isStatic = isStatic; | 325 : _isStatic = isStatic; |
| 326 | 326 |
| 327 int get memberIndex => _memberIndex; | |
| 328 | |
| 329 /// Should only be called by closure methods. All others should set | |
| 330 /// memberIndex at initialization time. | |
| 331 void set setClosureMemberIndex(int newIndex) { | |
| 332 _memberIndex = newIndex; | |
| 333 } | |
| 334 | |
| 335 String get name => _name.text; | 327 String get name => _name.text; |
| 336 | 328 |
| 337 Name get memberName => _name; | 329 Name get memberName => _name; |
| 338 | 330 |
| 339 @override | 331 @override |
| 340 bool get isAssignable => false; | 332 bool get isAssignable => false; |
| 341 | 333 |
| 342 @override | 334 @override |
| 343 bool get isConst => false; | 335 bool get isConst => false; |
| 344 | 336 |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 531 final Entity typeDeclaration; | 523 final Entity typeDeclaration; |
| 532 final String name; | 524 final String name; |
| 533 final int index; | 525 final int index; |
| 534 | 526 |
| 535 JTypeVariable( | 527 JTypeVariable( |
| 536 this.typeVariableIndex, this.typeDeclaration, this.name, this.index); | 528 this.typeVariableIndex, this.typeDeclaration, this.name, this.index); |
| 537 | 529 |
| 538 String toString() => | 530 String toString() => |
| 539 '${jsElementPrefix}type_variable(${typeDeclaration.name}.$name)'; | 531 '${jsElementPrefix}type_variable(${typeDeclaration.name}.$name)'; |
| 540 } | 532 } |
| OLD | NEW |