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

Unified Diff: dart/sdk/lib/_internal/compiler/implementation/js_emitter/code_emitter_task.dart

Issue 298153002: Version 1.4.1 (Closed) Base URL: http://dart.googlecode.com/svn/branches/1.4/
Patch Set: Created 6 years, 7 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
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 36615)
+++ dart/sdk/lib/_internal/compiler/implementation/js_emitter/code_emitter_task.dart (working copy)
@@ -135,6 +135,8 @@
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;
@@ -538,7 +540,7 @@
if (#)
Isolate.$finishClassesProperty = oldIsolate.$finishClassesProperty;
if (#)
- Isolate.makeConstantList = oldIsolate.makeConstantList;
+ Isolate.$makeConstListProperty = oldIsolate.$makeConstListProperty;
return Isolate;
}''',
[ needsDefineClass, hasMakeConstantList ]);
@@ -956,14 +958,16 @@
void emitMakeConstantListIfNotEmitted(CodeBuffer buffer) {
if (hasMakeConstantList) return;
hasMakeConstantList = true;
- buffer
- ..write(namer.isolateName)
- ..write('''.makeConstantList = function(list) {
- list.immutable\$list = $initName;
- list.fixed\$length = $initName;
- return list;
-};
-''');
+ 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));
}
/// Returns the code equivalent to:

Powered by Google App Engine
This is Rietveld 408576698