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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/js_emitter/class_emitter.dart

Issue 100413007: Revert "Support type argument substitution on unnamed mixin applications." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years 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
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/js_emitter/reflection_data_parser.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 class ClassEmitter extends CodeEmitterHelper { 7 class ClassEmitter extends CodeEmitterHelper {
8 /** 8 /**
9 * Documentation wanted -- johnniwinther 9 * Documentation wanted -- johnniwinther
10 * 10 *
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 329
330 if (!statics.isEmpty) { 330 if (!statics.isEmpty) {
331 classBuilder.addProperty('static', new jsAst.ObjectInitializer(statics)); 331 classBuilder.addProperty('static', new jsAst.ObjectInitializer(statics));
332 } 332 }
333 333
334 // TODO(ahe): This method (generateClass) should return a jsAst.Expression. 334 // TODO(ahe): This method (generateClass) should return a jsAst.Expression.
335 enclosingBuilder.addProperty(className, classBuilder.toObjectInitializer()); 335 enclosingBuilder.addProperty(className, classBuilder.toObjectInitializer());
336 336
337 String reflectionName = task.getReflectionName(classElement, className); 337 String reflectionName = task.getReflectionName(classElement, className);
338 if (reflectionName != null) { 338 if (reflectionName != null) {
339 reflectionName = '+$reflectionName';
340 } else if (classElement.isUnnamedMixinApplication &&
341 backend.isNeededForReflection(classElement)) {
342 reflectionName = '-$className';
343 }
344 if (reflectionName != null) {
345 if (!backend.isNeededForReflection(classElement)) { 339 if (!backend.isNeededForReflection(classElement)) {
346 enclosingBuilder.addProperty("$reflectionName", js.number(0)); 340 enclosingBuilder.addProperty("+$reflectionName", js.number(0));
347 } else { 341 } else {
348 List<int> types = new List<int>(); 342 List<int> types = new List<int>();
349 if (classElement.supertype != null) { 343 if (classElement.supertype != null) {
350 types.add(task.metadataEmitter.reifyType(classElement.supertype)); 344 types.add(task.metadataEmitter.reifyType(classElement.supertype));
351 } 345 }
352 for (DartType interface in classElement.interfaces) { 346 for (DartType interface in classElement.interfaces) {
353 types.add(task.metadataEmitter.reifyType(interface)); 347 types.add(task.metadataEmitter.reifyType(interface));
354 } 348 }
355 enclosingBuilder.addProperty("$reflectionName", 349 enclosingBuilder.addProperty("+$reflectionName",
356 new jsAst.ArrayInitializer.from(types.map((typeNumber) => 350 new jsAst.ArrayInitializer.from(types.map((typeNumber) =>
357 js.number(typeNumber)))); 351 js.number(typeNumber))));
358 } 352 }
359 } 353 }
360 } 354 }
361 355
362 /** 356 /**
363 * Calls [addField] for each of the fields of [element]. 357 * Calls [addField] for each of the fields of [element].
364 * 358 *
365 * [element] must be a [ClassElement] or a [LibraryElement]. 359 * [element] must be a [ClassElement] or a [LibraryElement].
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
598 computeTypeVariable = 592 computeTypeVariable =
599 js(r'this.$builtinTypeInfo && this.$builtinTypeInfo[#]', index); 593 js(r'this.$builtinTypeInfo && this.$builtinTypeInfo[#]', index);
600 } 594 }
601 jsAst.Expression convertRtiToRuntimeType = 595 jsAst.Expression convertRtiToRuntimeType =
602 namer.elementAccess(compiler.findHelper('convertRtiToRuntimeType')); 596 namer.elementAccess(compiler.findHelper('convertRtiToRuntimeType'));
603 builder.addProperty( 597 builder.addProperty(
604 name, js.fun( 598 name, js.fun(
605 [], [js.return_(convertRtiToRuntimeType(computeTypeVariable))])); 599 [], [js.return_(convertRtiToRuntimeType(computeTypeVariable))]));
606 } 600 }
607 } 601 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/js_emitter/reflection_data_parser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698