| Index: pkg/compiler/lib/src/js_emitter/model.dart
|
| diff --git a/pkg/compiler/lib/src/js_emitter/model.dart b/pkg/compiler/lib/src/js_emitter/model.dart
|
| index ea1e4769ed5c17d114a6a289cb64e3d8958e6dd9..e4a57fd8c5c1e3758d3dcce51e408319d5b8e62d 100644
|
| --- a/pkg/compiler/lib/src/js_emitter/model.dart
|
| +++ b/pkg/compiler/lib/src/js_emitter/model.dart
|
| @@ -333,21 +333,20 @@ abstract class Method {
|
| class DartMethod extends Method {
|
| final bool needsTearOff;
|
| final String tearOffName;
|
| - // TODO(herhut): Directly store stubs instead/
|
| - final bool needsStubs;
|
| + final List<ParameterStubMethod> parameterStubs;
|
| // TODO(herhut): Directly store aliases instead.
|
| final bool canBeApplied;
|
| final bool canBeReflected;
|
|
|
| DartMethod(Element element, String name, js.Expression code,
|
| - {this.needsTearOff, this.tearOffName, this.needsStubs, this.canBeApplied,
|
| - this.canBeReflected})
|
| + {this.needsTearOff, this.tearOffName, this.parameterStubs,
|
| + this.canBeApplied, this.canBeReflected})
|
| : super(element, name, code) {
|
| assert(needsTearOff != null);
|
| assert(!needsTearOff || tearOffName != null);
|
| assert(canBeApplied != null);
|
| + assert(parameterStubs != null);
|
| assert(canBeReflected != null);
|
| - assert(needsStubs != null);
|
| }
|
| }
|
|
|
| @@ -363,13 +362,13 @@ class InstanceMethod extends DartMethod {
|
| bool canBeApplied,
|
| bool canBeReflected,
|
| this.isClosure,
|
| - bool needsStubs})
|
| + List<ParameterStubMethod> parameterStubs})
|
| : super(element, name, code,
|
| needsTearOff: needsTearOff,
|
| tearOffName: tearOffName,
|
| canBeApplied: canBeApplied,
|
| canBeReflected: canBeReflected,
|
| - needsStubs: needsStubs) {
|
| + parameterStubs: parameterStubs) {
|
| assert(hasSuperAlias != null);
|
| assert(isClosure != null);
|
| }
|
| @@ -386,23 +385,36 @@ class StubMethod extends Method {
|
| : super(element, name, code);
|
| }
|
|
|
| +/**
|
| + * A method that is generated for the different versions of method calls of
|
| + * methods with named parameters,
|
| + *
|
| + * For example for a method foo(a, b, {c, d}) that is called as foo(1, 2, c: 3)
|
| + * we have the stub foo$3$c(a, b, c) => foo$4$c$d(a, b, c, null);
|
| + */
|
| +class ParameterStubMethod extends StubMethod {
|
| + final Selector selector;
|
| + ParameterStubMethod(String name, js.Expression code, this.selector,
|
| + {Element element})
|
| + : super(name, code, element: element);
|
| +}
|
| +
|
| abstract class StaticMethod implements Method {
|
| Holder get holder;
|
| }
|
|
|
| class StaticDartMethod extends DartMethod implements StaticMethod {
|
| final Holder holder;
|
| -
|
| StaticDartMethod(Element element, String name, this.holder,
|
| js.Expression code,
|
| {bool needsTearOff, String tearOffName, bool canBeApplied,
|
| - bool canBeReflected, bool needsStubs})
|
| + bool canBeReflected, List<StubMethod> parameterStubs})
|
| : super(element, name, code,
|
| needsTearOff: needsTearOff,
|
| tearOffName : tearOffName,
|
| canBeApplied : canBeApplied,
|
| canBeReflected : canBeReflected,
|
| - needsStubs : needsStubs);
|
| + parameterStubs : parameterStubs);
|
| }
|
|
|
| class StaticStubMethod extends StubMethod implements StaticMethod {
|
|
|