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

Unified Diff: frog/leg/emitter.dart

Issue 9463046: Fix bug where the closure-invocation method was not mangled correctly. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 10 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/language/language-leg.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: frog/leg/emitter.dart
diff --git a/frog/leg/emitter.dart b/frog/leg/emitter.dart
index 887feb6f535e8347eb6a70e4d7880d493ce5ed9b..737276911653f527288cf9cc967cec0478afa923 100644
--- a/frog/leg/emitter.dart
+++ b/frog/leg/emitter.dart
@@ -3,6 +3,18 @@
// BSD-style license that can be found in the LICENSE file.
/**
+ * A function element that represents a closure call. The signature is copied
+ * from the given element.
+ */
+class ClosureInvocationElement extends FunctionElement {
+ ClosureInvocationElement(SourceString name,
+ FunctionElement other)
+ : super.from(name, other, null);
+
+ isInstanceMember() => true;
+}
+
+/**
* Generates the code for all used classes in the program. Static fields (even
* in classes) are ignored, since they can be treated as non-class elements.
*
@@ -495,12 +507,9 @@ if (typeof $dynamicMetadataName == 'undefined') $dynamicMetadataName = [];
// The static function does not have the correct name. Since
// [addParameterStubs] use the name to create its stubs we simply
// create a fake element with the correct name.
- // Note: the callElement will not have the correct modifiers (in case
- // of static functions) and will not have any enclosingElement.
+ // Note: the callElement will not have any enclosingElement.
FunctionElement callElement =
- new FunctionElement.from(Namer.CLOSURE_INVOCATION_NAME,
- element,
- null);
+ new ClosureInvocationElement(Namer.CLOSURE_INVOCATION_NAME, element);
String staticName = namer.isolatePropertyAccess(element);
int parameterCount = element.parameterCount(compiler);
String invocationName =
@@ -554,10 +563,9 @@ if (typeof $dynamicMetadataName == 'undefined') $dynamicMetadataName = [];
// Now add the methods on the closure class. The instance method does not
// have the correct name. Since [addParameterStubs] use the name to create
// its stubs we simply create a fake element with the correct name.
- // Note: the callElement will not have the correct modifiers (in case
- // of static functions) and will not have any enclosingElement.
+ // Note: the callElement will not have any enclosingElement.
FunctionElement callElement =
- new FunctionElement.from(Namer.CLOSURE_INVOCATION_NAME, member, null);
+ new ClosureInvocationElement(Namer.CLOSURE_INVOCATION_NAME, member);
int parameterCount = member.parameterCount(compiler);
String invocationName =
« no previous file with comments | « no previous file | tests/language/language-leg.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698