| 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 library dart2js.new_js_emitter.model; | 5 library dart2js.new_js_emitter.model; |
| 6 | 6 |
| 7 import '../js/js.dart' as js show Expression, Statement, Name, Literal, | 7 import '../js/js.dart' as js show Expression, Statement, Name, Literal, |
| 8 TokenFinalizer; | 8 TokenFinalizer; |
| 9 import '../constants/values.dart' show ConstantValue; | 9 import '../constants/values.dart' show ConstantValue; |
| 10 | 10 |
| (...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 426 | 426 |
| 427 bool get isStatic; | 427 bool get isStatic; |
| 428 } | 428 } |
| 429 | 429 |
| 430 class InstanceMethod extends DartMethod { | 430 class InstanceMethod extends DartMethod { |
| 431 /// An alternative name for this method. This is used to model calls to | 431 /// An alternative name for this method. This is used to model calls to |
| 432 /// a method via `super`. If [aliasName] is non-null, the emitter has to | 432 /// a method via `super`. If [aliasName] is non-null, the emitter has to |
| 433 /// ensure that this method is registered on the prototype under both [name] | 433 /// ensure that this method is registered on the prototype under both [name] |
| 434 /// and [aliasName]. | 434 /// and [aliasName]. |
| 435 final js.Name aliasName; | 435 final js.Name aliasName; |
| 436 final bool isClosure; | 436 |
| 437 /// True if this is the implicit `call` instance method of an anonymous |
| 438 /// closure. This predicate is false for explicit `call` methods and for |
| 439 /// functions that can be torn off. |
| 440 final bool isClosureCallMethod; |
| 437 | 441 |
| 438 | 442 |
| 439 InstanceMethod(Element element, js.Name name, js.Expression code, | 443 InstanceMethod(Element element, js.Name name, js.Expression code, |
| 440 List<ParameterStubMethod> parameterStubs, | 444 List<ParameterStubMethod> parameterStubs, |
| 441 js.Name callName, | 445 js.Name callName, |
| 442 {bool needsTearOff, | 446 {bool needsTearOff, |
| 443 js.Name tearOffName, | 447 js.Name tearOffName, |
| 444 this.aliasName, | 448 this.aliasName, |
| 445 bool canBeApplied, | 449 bool canBeApplied, |
| 446 bool canBeReflected, | 450 bool canBeReflected, |
| 447 int requiredParameterCount, | 451 int requiredParameterCount, |
| 448 /* List | Map */ optionalParameterDefaultValues, | 452 /* List | Map */ optionalParameterDefaultValues, |
| 449 this.isClosure, | 453 this.isClosureCallMethod, |
| 450 js.Expression functionType}) | 454 js.Expression functionType}) |
| 451 : super(element, name, code, parameterStubs, callName, | 455 : super(element, name, code, parameterStubs, callName, |
| 452 needsTearOff: needsTearOff, | 456 needsTearOff: needsTearOff, |
| 453 tearOffName: tearOffName, | 457 tearOffName: tearOffName, |
| 454 canBeApplied: canBeApplied, | 458 canBeApplied: canBeApplied, |
| 455 canBeReflected: canBeReflected, | 459 canBeReflected: canBeReflected, |
| 456 requiredParameterCount: requiredParameterCount, | 460 requiredParameterCount: requiredParameterCount, |
| 457 optionalParameterDefaultValues: optionalParameterDefaultValues, | 461 optionalParameterDefaultValues: optionalParameterDefaultValues, |
| 458 functionType: functionType) { | 462 functionType: functionType) { |
| 459 assert(isClosure != null); | 463 assert(isClosureCallMethod != null); |
| 460 } | 464 } |
| 461 | 465 |
| 462 bool get isStatic => false; | 466 bool get isStatic => false; |
| 463 } | 467 } |
| 464 | 468 |
| 465 /// A method that is generated by the backend and has not direct correspondence | 469 /// A method that is generated by the backend and has not direct correspondence |
| 466 /// to a method in the original Dart program. Examples are getter and setter | 470 /// to a method in the original Dart program. Examples are getter and setter |
| 467 /// stubs and stubs to dispatch calls to methods with optional parameters. | 471 /// stubs and stubs to dispatch calls to methods with optional parameters. |
| 468 class StubMethod extends Method { | 472 class StubMethod extends Method { |
| 469 StubMethod(js.Name name, js.Expression code, | 473 StubMethod(js.Name name, js.Expression code, |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 517 functionType: functionType); | 521 functionType: functionType); |
| 518 | 522 |
| 519 bool get isStatic => true; | 523 bool get isStatic => true; |
| 520 } | 524 } |
| 521 | 525 |
| 522 class StaticStubMethod extends StubMethod implements StaticMethod { | 526 class StaticStubMethod extends StubMethod implements StaticMethod { |
| 523 Holder holder; | 527 Holder holder; |
| 524 StaticStubMethod(js.Name name, this.holder, js.Expression code) | 528 StaticStubMethod(js.Name name, this.holder, js.Expression code) |
| 525 : super(name, code); | 529 : super(name, code); |
| 526 } | 530 } |
| OLD | NEW |