Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(639)

Unified Diff: pkg/compiler/lib/src/js_emitter/parameter_stub_generator.dart

Issue 3008753002: Avoid Element-only assertions in generateParameterStubs (Closed)
Patch Set: status Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests/compiler/dart2js_extra/dart2js_extra.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/js_emitter/parameter_stub_generator.dart
diff --git a/pkg/compiler/lib/src/js_emitter/parameter_stub_generator.dart b/pkg/compiler/lib/src/js_emitter/parameter_stub_generator.dart
index c953bd108bf275315db1097cb20b75686b869733..449c45f1e1699d688f6207c4950fba58f57d5ceb 100644
--- a/pkg/compiler/lib/src/js_emitter/parameter_stub_generator.dart
+++ b/pkg/compiler/lib/src/js_emitter/parameter_stub_generator.dart
@@ -217,13 +217,20 @@ class ParameterStubGenerator {
// (3) foo$3$d(a, b, d) => MyClass.foo$4$c$d(this, a, b, null, d);
List<ParameterStubMethod> generateParameterStubs(FunctionEntity member,
{bool canTearOff: true}) {
- if (member.enclosingClass != null && member.enclosingClass.isClosure) {
- ClosureClassElement cls = member.enclosingClass;
- if (cls.supertype.element == _commonElements.boundClosureClass) {
- failedAt(cls.methodElement, 'Bound closure1.');
- }
- if (cls.methodElement.isInstanceMember) {
- failedAt(cls.methodElement, 'Bound closure2.');
+ {
+ var enclosingClass = member.enclosingClass;
+ if (enclosingClass != null && enclosingClass.isClosure) {
+ if (enclosingClass is ClosureClassElement) {
+ // TODO(redemption): What is the equivalent invariant for J-entities?
+ var methodElement = enclosingClass.methodElement;
+ if (enclosingClass.supertype.element ==
+ _commonElements.boundClosureClass) {
+ failedAt(methodElement, 'Bound closure1.');
+ }
+ if (methodElement.isInstanceMember) {
+ failedAt(methodElement, 'Bound closure2.');
+ }
+ }
}
}
« no previous file with comments | « no previous file | tests/compiler/dart2js_extra/dart2js_extra.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698