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

Unified Diff: dart/frog/leg/emitter.dart

Issue 9355031: Improve List implementation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased and resolved conflicts 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 | « dart/frog/frog.py ('k') | dart/frog/leg/lib/core.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/frog/leg/emitter.dart
diff --git a/dart/frog/leg/emitter.dart b/dart/frog/leg/emitter.dart
index 33ac93a4964b93c2d988782113b5f98635729ee5..aa9f45ff595ed3dbab9c7042c9867cfaca6216da 100644
--- a/dart/frog/leg/emitter.dart
+++ b/dart/frog/leg/emitter.dart
@@ -500,7 +500,19 @@ if (typeof $dynamicMetadataName == 'undefined') $dynamicMetadataName = [];
CompilationUnitElement compilationUnit = member.getCompilationUnit();
ClassElement closureClassElement = new ClassElement(name, compilationUnit);
String isolateAccess = namer.isolatePropertyAccess(closureClassElement);
- buffer.add("$isolateAccess = function(self) { this.self = self; };\n");
+
+ // Define the constructor with a name so that Object.toString can
+ // find the class name of the closure class.
+ buffer.add("$isolateAccess = function $name(self) ");
+ buffer.add("{ this.self = self; };\n");
+
+ // Make the closure class extend Object.
+ addInheritFunctionIfNecessary(buffer);
+ ClassElement objectClass =
+ compiler.coreLibrary.find(const SourceString('Object'));
+ String superName = namer.isolatePropertyAccess(objectClass);
+ buffer.add('${inheritsName}($isolateAccess, $superName);\n');
+
String prototype = "$isolateAccess.prototype";
// Now add the methods on the closure class. The instance method does not
« no previous file with comments | « dart/frog/frog.py ('k') | dart/frog/leg/lib/core.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698