Index: dart/sdk/lib/_internal/compiler/implementation/js_emitter/code_emitter_task.dart |
diff --git a/dart/sdk/lib/_internal/compiler/implementation/js_emitter/code_emitter_task.dart b/dart/sdk/lib/_internal/compiler/implementation/js_emitter/code_emitter_task.dart |
index 377ab8961c87638cd1c225882c8bb312e33b82b5..0e0c6676ea82c52749104183da3f9aa4a5cb2f16 100644 |
--- a/dart/sdk/lib/_internal/compiler/implementation/js_emitter/code_emitter_task.dart |
+++ b/dart/sdk/lib/_internal/compiler/implementation/js_emitter/code_emitter_task.dart |
@@ -352,6 +352,16 @@ class CodeEmitterTask extends CompilerTask { |
js('var s = fields.split(";")'), |
js('fields = s[1] == "" ? [] : s[1].split(",")'), |
js('supr = s[0]'), |
+ js('split = supr.split(":")'), |
+ js.if_('split.length == 2', [ |
+ js('supr = split[0]'), |
+ js('var functionSignature = split[1]'), |
+ js.if_('functionSignature', |
+ js('desc.\$signature = #', |
+ js.fun('s', |
+ js.return_(js.fun([], js.return_('init.metadata[s]'))))( |
+ js('functionSignature')))) |
+ ]), |
optional(needsMixinSupport, js.if_('supr && supr.indexOf("+") > 0', [ |
js('s = supr.split("+")'), |
@@ -1203,6 +1213,7 @@ mainBuffer.add(r''' |
mainBuffer.add('(function(${namer.CURRENT_ISOLATE})$_{$n'); |
} |
+ mainBuffer.add('function dart() {}'); |
kasperl
2013/11/29 10:10:55
Add a comment that explains what this is good for.
ahe
2013/12/06 15:57:53
This gives slightly better names in stack traces.
|
for (String globalObject in Namer.reservedGlobalObjectNames) { |
// The global objects start as so-called "slow objects". For V8, this |
// means that it won't try to make map transitions as we add properties |
@@ -1210,7 +1221,7 @@ mainBuffer.add(r''' |
// fast objects by calling "convertToFastObject" (see |
// [emitConvertToFastObjectFunction]). |
mainBuffer |
- ..write('var ${globalObject}$_=$_{}$N') |
+ ..write('var ${globalObject}$_=${_}new dart$N') |
..write('delete ${globalObject}.x$N'); |
} |
@@ -1266,16 +1277,16 @@ mainBuffer.add(r''' |
containerBuilder.emitStaticFunctionClosures(); |
- addComment('Method closures', mainBuffer); |
+ // addComment('Method closures', mainBuffer); |
kasperl
2013/11/29 10:10:55
This is just throw away code, right?
ahe
2013/12/06 15:57:53
Done.
|
// Now that we have emitted all classes, we know all the method |
// closures that will be needed. |
- containerBuilder.methodClosures.forEach((String code, Element closure) { |
- // TODO(ahe): Some of these can be deferred. |
- String mangledName = namer.getNameOfClass(closure); |
- mainBuffer.add('$classesCollector.$mangledName$_=$_' |
- '[${namer.globalObjectFor(closure)},$_$code]'); |
- mainBuffer.add("$N$n"); |
- }); |
+ // containerBuilder.methodClosures.forEach((String code, Element closure) { |
+ // // TODO(ahe): Some of these can be deferred. |
+ // String mangledName = namer.getNameOfClass(closure); |
+ // mainBuffer.add('$classesCollector.$mangledName$_=$_' |
+ // '[${namer.globalObjectFor(closure)},$_$code]'); |
+ // mainBuffer.add("$N$n"); |
+ // }); |
// After this assignment we will produce invalid JavaScript code if we use |
// the classesCollector variable. |
@@ -1297,7 +1308,7 @@ mainBuffer.add(r''' |
if (classEmitter.emitFields( |
library, builder, null, emitStatics: true)) { |
getElementDescriptorForOutputUnit(library, "main") |
- .properties.addAll(builder.properties); |
+ .properties.addAll(builder.toObjectInitializer().properties); |
} |
} |
} |
@@ -1336,7 +1347,7 @@ mainBuffer.add(r''' |
} |
} |
mainBuffer |
- ..write(getReflectionDataParser(classesCollector, namer)) |
+ ..write(getReflectionDataParser(classesCollector, backend)) |
..write('([$n'); |
List<Element> sortedElements = |
@@ -1542,7 +1553,7 @@ if (typeof $printHelperName === "function") { |
'$_${namer.isolateName}.prototype$N$n' |
// The classesCollector object ($$). |
'$classesCollector$_=$_{};$n') |
- ..write(getReflectionDataParser(classesCollector, namer)) |
+ ..write(getReflectionDataParser(classesCollector, backend)) |
..write('([$n') |
..addBuffer(deferredLibrariesBuffer) |
..write('])$N'); |