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

Side by Side Diff: pkg/compiler/lib/src/js_emitter/old_emitter/container_builder.dart

Issue 895063002: Add member type to model. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 dart2js.js_emitter; 5 part of dart2js.js_emitter;
6 6
7 /// This class should morph into something that makes it easy to build 7 /// This class should morph into something that makes it easy to build
8 /// JavaScript representations of libraries, class-sides, and instance-sides. 8 /// JavaScript representations of libraries, class-sides, and instance-sides.
9 /// Initially, it is just a placeholder for code that is moved from 9 /// Initially, it is just a placeholder for code that is moved from
10 /// [CodeEmitterTask]. 10 /// [CodeEmitterTask].
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 // instance data, we can eliminate this element. 121 // instance data, we can eliminate this element.
122 expressions.add(js('null')); 122 expressions.add(js('null'));
123 } 123 }
124 String callName = stub.callName; 124 String callName = stub.callName;
125 String callSelectorString = (callName == null) ? 'null' : '"$callName"'; 125 String callSelectorString = (callName == null) ? 'null' : '"$callName"';
126 tearOffInfo.add(new jsAst.LiteralString(callSelectorString)); 126 tearOffInfo.add(new jsAst.LiteralString(callSelectorString));
127 } 127 }
128 128
129 jsAst.Expression memberTypeExpression; 129 jsAst.Expression memberTypeExpression;
130 if (canTearOff || canBeReflected) { 130 if (canTearOff || canBeReflected) {
131 DartType memberType; 131 DartType memberType = method.type;
132 if (member.isGenerativeConstructorBody) {
133 var body = member;
134 memberType = body.constructor.type;
135 } else {
136 memberType = member.type;
137 }
138 if (memberType.containsTypeVariables) { 132 if (memberType.containsTypeVariables) {
139 jsAst.Expression thisAccess = js(r'this.$receiver'); 133 jsAst.Expression thisAccess = js(r'this.$receiver');
140 memberTypeExpression = 134 memberTypeExpression =
141 backend.rti.getSignatureEncoding(memberType, thisAccess); 135 backend.rti.getSignatureEncoding(memberType, thisAccess);
142 } else { 136 } else {
143 memberTypeExpression = 137 memberTypeExpression =
144 js.number(task.metadataCollector.reifyType(memberType)); 138 js.number(task.metadataCollector.reifyType(memberType));
145 } 139 }
146 } else { 140 } else {
147 memberTypeExpression = js('null'); 141 memberTypeExpression = js('null');
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 jsAst.ArrayInitializer arrayInit = 191 jsAst.ArrayInitializer arrayInit =
198 new jsAst.ArrayInitializer(expressions.toList()); 192 new jsAst.ArrayInitializer(expressions.toList());
199 compiler.dumpInfoTask.registerElementAst(member, 193 compiler.dumpInfoTask.registerElementAst(member,
200 builder.addProperty(name, arrayInit)); 194 builder.addProperty(name, arrayInit));
201 } 195 }
202 196
203 void addMemberField(Field field, ClassBuilder builder) { 197 void addMemberField(Field field, ClassBuilder builder) {
204 // For now, do nothing. 198 // For now, do nothing.
205 } 199 }
206 } 200 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698