OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 part of js_backend; | 5 part of js_backend; |
6 | 6 |
7 class CodeEmitterNoEvalTask extends CodeEmitterTask { | 7 class CodeEmitterNoEvalTask extends CodeEmitterTask { |
8 CodeEmitterNoEvalTask(Compiler compiler, | 8 CodeEmitterNoEvalTask(Compiler compiler, |
9 Namer namer, | 9 Namer namer, |
10 bool generateSourceMap) | 10 bool generateSourceMap) |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 js.block1( | 73 js.block1( |
74 js.return_( | 74 js.return_( |
75 js.fieldAccess(js.use(isolate), namer.getName(element))))); | 75 js.fieldAccess(js.use(isolate), namer.getName(element))))); |
76 } | 76 } |
77 | 77 |
78 js.Expression buildConstructor(String mangledName, List<String> fieldNames) { | 78 js.Expression buildConstructor(String mangledName, List<String> fieldNames) { |
79 return new js.NamedFunction( | 79 return new js.NamedFunction( |
80 new js.VariableDeclaration(mangledName), | 80 new js.VariableDeclaration(mangledName), |
81 new js.Fun( | 81 new js.Fun( |
82 fieldNames | 82 fieldNames |
83 .mappedBy((fieldName) => new js.Parameter(fieldName)) | 83 .map((fieldName) => new js.Parameter(fieldName)) |
84 .toList(), | 84 .toList(), |
85 new js.Block( | 85 new js.Block( |
86 fieldNames.mappedBy((fieldName) => | 86 fieldNames.map((fieldName) => |
87 new js.ExpressionStatement( | 87 new js.ExpressionStatement( |
88 new js.Assignment( | 88 new js.Assignment( |
89 new js.This().dot(fieldName), | 89 new js.This().dot(fieldName), |
90 new js.VariableUse(fieldName)))) | 90 new js.VariableUse(fieldName)))) |
91 .toList()))); | 91 .toList()))); |
92 } | 92 } |
93 | 93 |
94 void emitBoundClosureClassHeader(String mangledName, | 94 void emitBoundClosureClassHeader(String mangledName, |
95 String superName, | 95 String superName, |
96 List<String> fieldNames, | 96 List<String> fieldNames, |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 } | 129 } |
130 | 130 |
131 void emitClassFields(ClassElement classElement, | 131 void emitClassFields(ClassElement classElement, |
132 ClassBuilder builder, | 132 ClassBuilder builder, |
133 { String superClass: "", | 133 { String superClass: "", |
134 bool classIsNative: false}) { | 134 bool classIsNative: false}) { |
135 } | 135 } |
136 | 136 |
137 bool get getterAndSetterCanBeImplementedByFieldSpec => false; | 137 bool get getterAndSetterCanBeImplementedByFieldSpec => false; |
138 } | 138 } |
OLD | NEW |