| 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
|
|
|