Index: pkg/compiler/lib/src/js_emitter/program_builder/program_builder.dart |
diff --git a/pkg/compiler/lib/src/js_emitter/program_builder/program_builder.dart b/pkg/compiler/lib/src/js_emitter/program_builder/program_builder.dart |
index a0ce8a667ba03e5720d586fbf10a706dc5b5ab2b..0a5716193d4974495d1835147727be0d0fabf096 100644 |
--- a/pkg/compiler/lib/src/js_emitter/program_builder/program_builder.dart |
+++ b/pkg/compiler/lib/src/js_emitter/program_builder/program_builder.dart |
@@ -502,6 +502,7 @@ class ProgramBuilder { |
// if it does not we can suppress it completely. |
onlyForRti = true; |
} |
+ bool isClosureBaseClass = element == _compiler.commonElements.closureClass; |
List<Method> methods = []; |
List<StubMethod> callStubs = <StubMethod>[]; |
@@ -551,9 +552,8 @@ class ProgramBuilder { |
}); |
} |
- if (element == _compiler.commonElements.closureClass) { |
- // We add a special getter here to allow for tearing off a closure from |
- // itself. |
+ if (isClosureBaseClass) { |
+ // We add a special getter to allow for tearing off a closure from itself. |
js.Name name = namer.getterForMember(Names.call); |
js.Fun function = js.js('function() { return this; }'); |
callStubs.add(_buildStubMethod(name, function)); |
@@ -617,6 +617,7 @@ class ProgramBuilder { |
if (element.isMixinApplication && !onlyForRti) { |
assert(!backend.nativeData.isNativeClass(element)); |
assert(methods.isEmpty); |
+ assert(!isClosureBaseClass); |
result = new MixinApplication( |
element, |
@@ -647,7 +648,8 @@ class ProgramBuilder { |
isDirectlyInstantiated: isInstantiated, |
hasRtiField: hasRtiField, |
onlyForRti: onlyForRti, |
- isNative: backend.nativeData.isNativeClass(element)); |
+ isNative: backend.nativeData.isNativeClass(element), |
+ isClosureBaseClass: isClosureBaseClass); |
} |
_classes[element] = result; |
return result; |