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

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

Issue 2908153003: It's alive! (Closed)
Patch Set: Updated cf. comments Created 3 years, 7 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
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 0edf49ffcc62184d2b1f386dfec538aef98c3455..df9ca34f5fac07bee740cd29d125e8da9b03fb59 100644
--- a/pkg/compiler/lib/src/js_emitter/parameter_stub_generator.dart
+++ b/pkg/compiler/lib/src/js_emitter/parameter_stub_generator.dart
@@ -15,6 +15,8 @@ import '../elements/elements.dart'
FunctionSignature,
MethodElement,
ParameterElement;
+import '../elements/entities.dart';
+import '../elements/names.dart';
import '../js/js.dart' as jsAst;
import '../js/js.dart' show js;
import '../js_backend/constant_handler_javascript.dart'
@@ -223,10 +225,10 @@ class ParameterStubGenerator {
// (1) foo$2(a, b) => MyClass.foo$4$c$d.call(this, a, b, null, null)
// (2) foo$3$c(a, b, c) => MyClass.foo$4$c$d(this, a, b, c, null);
// (3) foo$3$d(a, b, d) => MyClass.foo$4$c$d(this, a, b, null, d);
- List<ParameterStubMethod> generateParameterStubs(MethodElement member,
+ List<ParameterStubMethod> generateParameterStubs(FunctionEntity member,
{bool canTearOff: true}) {
- if (member.enclosingElement.isClosure) {
- ClosureClassElement cls = member.enclosingElement;
+ if (member.enclosingClass != null && member.enclosingClass.isClosure) {
+ ClosureClassElement cls = member.enclosingClass;
if (cls.supertype.element == _commonElements.boundClosureClass) {
throw new SpannableAssertionFailure(
cls.methodElement, 'Bound closure1.');
@@ -283,8 +285,8 @@ class ParameterStubGenerator {
// Start with the callSelectors since they imply the generation of the
// non-call version.
for (Selector selector in callSelectors.keys) {
- Selector renamedSelector =
- new Selector.call(member.memberName, selector.callStructure);
+ Selector renamedSelector = new Selector.call(
+ new Name(member.name, member.library), selector.callStructure);
renamedCallSelectors.add(renamedSelector);
if (!renamedSelector.appliesUnnamed(member)) {

Powered by Google App Engine
This is Rietveld 408576698