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

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

Issue 142193005: Fix JS-backend when MirrorsUsed target a static field, but there is no mirrors usage. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update copyright year. Created 6 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 class ClassEmitter extends CodeEmitterHelper { 7 class ClassEmitter extends CodeEmitterHelper {
8 /** 8 /**
9 * Documentation wanted -- johnniwinther 9 * Documentation wanted -- johnniwinther
10 * 10 *
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 } 90 }
91 91
92 /// Returns `true` if fields added. 92 /// Returns `true` if fields added.
93 bool emitFields(Element element, 93 bool emitFields(Element element,
94 ClassBuilder builder, 94 ClassBuilder builder,
95 String superName, 95 String superName,
96 { bool classIsNative: false, 96 { bool classIsNative: false,
97 bool emitStatics: false, 97 bool emitStatics: false,
98 bool onlyForRti: false }) { 98 bool onlyForRti: false }) {
99 assert(!emitStatics || !onlyForRti); 99 assert(!emitStatics || !onlyForRti);
100 bool isClass = false;
101 bool isLibrary = false;
102 if (element.isClass()) { 100 if (element.isClass()) {
kasperl 2014/01/30 13:37:15 The code looks pretty weird now.
floitsch 2014/01/30 14:10:24 Done.
103 isClass = true;
104 } else if (element.isLibrary()) { 101 } else if (element.isLibrary()) {
105 isLibrary = false;
106 assert(invariant(element, emitStatics)); 102 assert(invariant(element, emitStatics));
107 } else { 103 } else {
108 throw new SpannableAssertionFailure( 104 throw new SpannableAssertionFailure(
109 element, 'Must be a ClassElement or a LibraryElement'); 105 element, 'Must be a ClassElement or a LibraryElement');
110 } 106 }
111 if (emitStatics) { 107 if (emitStatics) {
112 assert(invariant(element, superName == null, message: superName)); 108 assert(invariant(element, superName == null, message: superName));
113 } else { 109 } else {
114 assert(invariant(element, superName != null)); 110 assert(invariant(element, superName != null));
115 String nativeName = 111 String nativeName =
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after
600 computeTypeVariable = 596 computeTypeVariable =
601 js(r'this.$builtinTypeInfo && this.$builtinTypeInfo[#]', index); 597 js(r'this.$builtinTypeInfo && this.$builtinTypeInfo[#]', index);
602 } 598 }
603 jsAst.Expression convertRtiToRuntimeType = 599 jsAst.Expression convertRtiToRuntimeType =
604 namer.elementAccess(compiler.findHelper('convertRtiToRuntimeType')); 600 namer.elementAccess(compiler.findHelper('convertRtiToRuntimeType'));
605 builder.addProperty( 601 builder.addProperty(
606 name, js.fun( 602 name, js.fun(
607 [], [js.return_(convertRtiToRuntimeType(computeTypeVariable))])); 603 [], [js.return_(convertRtiToRuntimeType(computeTypeVariable))]));
608 } 604 }
609 } 605 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698