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

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

Issue 1124613002: Revert "dart2js: add type arguments to constructor in case the class needs rti." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 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 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 // TODO(ahe): Share these with js_helper.dart. 7 // TODO(ahe): Share these with js_helper.dart.
8 const FUNCTION_INDEX = 0; 8 const FUNCTION_INDEX = 0;
9 const NAME_INDEX = 1; 9 const NAME_INDEX = 1;
10 const CALL_NAME_INDEX = 2; 10 const CALL_NAME_INDEX = 2;
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 228
229 for (var i = 0; i < fields.length; i++) { 229 for (var i = 0; i < fields.length; i++) {
230 if(i != 0) str += ", "; 230 if(i != 0) str += ", ";
231 231
232 var field = generateAccessor(fields[i], accessors, name); 232 var field = generateAccessor(fields[i], accessors, name);
233 if (#hasIsolateSupport) { fieldNames += "'" + field + "',"; } 233 if (#hasIsolateSupport) { fieldNames += "'" + field + "',"; }
234 var parameter = "p_" + field; 234 var parameter = "p_" + field;
235 str += parameter; 235 str += parameter;
236 body += ("this." + field + " = " + parameter + ";\\n"); 236 body += ("this." + field + " = " + parameter + ";\\n");
237 } 237 }
238 // TODO(zarah): Check whether there is any gain in always having this
239 // property and if so, add it unconditionally.
240 body += "if (typeInfo) this.\$builtinTypeInfo = typeInfo;\\n";
241 if (supportsDirectProtoAccess) { 238 if (supportsDirectProtoAccess) {
242 body += "this." + #deferredActionString + "();"; 239 body += "this." + #deferredActionString + "();";
243 } 240 }
244 241 str += ") {\\n" + body + "}\\n";
245 if (fields.length > 0) str += ",";
246 str += "typeInfo) {\\n" + body + "}\\n";
247 str += name + ".$typeNameProperty=\\"" + name + "\\";\\n"; 242 str += name + ".$typeNameProperty=\\"" + name + "\\";\\n";
248 str += "\$desc=\$collectedClasses." + name + "[1];\\n"; 243 str += "\$desc=\$collectedClasses." + name + "[1];\\n";
249 str += name + ".prototype = \$desc;\\n"; 244 str += name + ".prototype = \$desc;\\n";
250 if (typeof defineClass.name != "string") { 245 if (typeof defineClass.name != "string") {
251 str += name + ".name=\\"" + name + "\\";\\n"; 246 str += name + ".name=\\"" + name + "\\";\\n";
252 } 247 }
253 if (#hasIsolateSupport) { 248 if (#hasIsolateSupport) {
254 str += name + "." + #fieldNamesProperty + "=[" + fieldNames 249 str += name + "." + #fieldNamesProperty + "=[" + fieldNames
255 + "];\\n"; 250 + "];\\n";
256 } 251 }
(...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after
850 (function() { 845 (function() {
851 var result = $array[$index]; 846 var result = $array[$index];
852 if ($check) { 847 if ($check) {
853 throw new Error( 848 throw new Error(
854 name + ": expected value of type \'$type\' at index " + ($index) + 849 name + ": expected value of type \'$type\' at index " + ($index) +
855 " but got " + (typeof result)); 850 " but got " + (typeof result));
856 } 851 }
857 return result; 852 return result;
858 })()'''; 853 })()''';
859 } 854 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_emitter/class_stub_generator.dart ('k') | pkg/compiler/lib/src/js_emitter/type_test_registry.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698