Index: dart/sdk/lib/_internal/compiler/implementation/js_emitter/code_emitter_task.dart |
=================================================================== |
--- dart/sdk/lib/_internal/compiler/implementation/js_emitter/code_emitter_task.dart (revision 36645) |
+++ dart/sdk/lib/_internal/compiler/implementation/js_emitter/code_emitter_task.dart (working copy) |
@@ -135,8 +135,6 @@ |
String get lazyInitializerName |
=> '${namer.isolateName}.\$lazy'; |
String get initName => 'init'; |
- String get makeConstListProperty |
- => namer.getMappedInstanceName('makeConstantList'); |
jsAst.FunctionDeclaration get generateAccessorFunction { |
const RANGE1_SIZE = RANGE1_LAST - RANGE1_FIRST + 1; |
@@ -540,7 +538,7 @@ |
if (#) |
Isolate.$finishClassesProperty = oldIsolate.$finishClassesProperty; |
if (#) |
- Isolate.$makeConstListProperty = oldIsolate.$makeConstListProperty; |
+ Isolate.makeConstantList = oldIsolate.makeConstantList; |
return Isolate; |
}''', |
[ needsDefineClass, hasMakeConstantList ]); |
@@ -958,16 +956,14 @@ |
void emitMakeConstantListIfNotEmitted(CodeBuffer buffer) { |
if (hasMakeConstantList) return; |
hasMakeConstantList = true; |
- jsAst.Statement value = new jsAst.ExpressionStatement(new jsAst.Assignment( |
- new jsAst.PropertyAccess.field( |
- new jsAst.VariableUse(namer.isolateName), |
- makeConstListProperty), |
- js('''function(list) { |
- list.immutable\$list = $initName; |
- list.fixed\$length = $initName; |
- return list; |
- }'''))); |
- buffer.write(jsAst.prettyPrint(value, compiler)); |
+ buffer |
+ ..write(namer.isolateName) |
+ ..write('''.makeConstantList = function(list) { |
+ list.immutable\$list = $initName; |
+ list.fixed\$length = $initName; |
+ return list; |
+}; |
+'''); |
} |
/// Returns the code equivalent to: |