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

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: Extract function that finds static field targets. 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; 100 if (element.isLibrary()) {
101 bool isLibrary = false;
102 if (element.isClass()) {
103 isClass = true;
104 } else if (element.isLibrary()) {
105 isLibrary = false;
106 assert(invariant(element, emitStatics)); 101 assert(invariant(element, emitStatics));
107 } else { 102 } else if (!element.isClass()) {
108 throw new SpannableAssertionFailure( 103 throw new SpannableAssertionFailure(
109 element, 'Must be a ClassElement or a LibraryElement'); 104 element, 'Must be a ClassElement or a LibraryElement');
110 } 105 }
111 if (emitStatics) { 106 if (emitStatics) {
112 assert(invariant(element, superName == null, message: superName)); 107 assert(invariant(element, superName == null, message: superName));
113 } else { 108 } else {
114 assert(invariant(element, superName != null)); 109 assert(invariant(element, superName != null));
115 String nativeName = 110 String nativeName =
116 namer.getPrimitiveInterceptorRuntimeName(element); 111 namer.getPrimitiveInterceptorRuntimeName(element);
117 if (nativeName != null) { 112 if (nativeName != null) {
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after
600 computeTypeVariable = 595 computeTypeVariable =
601 js(r'this.$builtinTypeInfo && this.$builtinTypeInfo[#]', index); 596 js(r'this.$builtinTypeInfo && this.$builtinTypeInfo[#]', index);
602 } 597 }
603 jsAst.Expression convertRtiToRuntimeType = 598 jsAst.Expression convertRtiToRuntimeType =
604 namer.elementAccess(compiler.findHelper('convertRtiToRuntimeType')); 599 namer.elementAccess(compiler.findHelper('convertRtiToRuntimeType'));
605 builder.addProperty( 600 builder.addProperty(
606 name, js.fun( 601 name, js.fun(
607 [], [js.return_(convertRtiToRuntimeType(computeTypeVariable))])); 602 [], [js.return_(convertRtiToRuntimeType(computeTypeVariable))]));
608 } 603 }
609 } 604 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698