OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 | 7 |
8 class OldEmitter implements Emitter { | 8 class OldEmitter implements Emitter { |
9 final Compiler compiler; | 9 final Compiler compiler; |
10 final CodeEmitterTask task; | 10 final CodeEmitterTask task; |
(...skipping 1191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1202 #; | 1202 #; |
1203 return properties; | 1203 return properties; |
1204 }''', [debugCode]); | 1204 }''', [debugCode]); |
1205 | 1205 |
1206 mainBuffer.add(jsAst.prettyPrint(convertToFastObject, compiler)); | 1206 mainBuffer.add(jsAst.prettyPrint(convertToFastObject, compiler)); |
1207 mainBuffer.add(N); | 1207 mainBuffer.add(N); |
1208 } | 1208 } |
1209 | 1209 |
1210 void writeLibraryDescriptors(CodeBuffer buffer, LibraryElement library) { | 1210 void writeLibraryDescriptors(CodeBuffer buffer, LibraryElement library) { |
1211 var uri = ""; | 1211 var uri = ""; |
1212 if (!compiler.enableMinification || backend.mustPreserveUris) { | 1212 if (!compiler.enableMinification || backend.mustRetainUris) { |
1213 uri = library.canonicalUri; | 1213 uri = library.canonicalUri; |
1214 if (uri.scheme == 'file' && compiler.outputUri != null) { | 1214 if (uri.scheme == 'file' && compiler.outputUri != null) { |
1215 uri = relativize(compiler.outputUri, library.canonicalUri, false); | 1215 uri = relativize(compiler.outputUri, library.canonicalUri, false); |
1216 } | 1216 } |
1217 } | 1217 } |
1218 ClassBuilder descriptor = elementDescriptors[library]; | 1218 ClassBuilder descriptor = elementDescriptors[library]; |
1219 if (descriptor == null) { | 1219 if (descriptor == null) { |
1220 // Nothing of the library was emitted. | 1220 // Nothing of the library was emitted. |
1221 // TODO(floitsch): this should not happen. We currently have an example | 1221 // TODO(floitsch): this should not happen. We currently have an example |
1222 // with language/prefix6_negative_test.dart where we have an instance | 1222 // with language/prefix6_negative_test.dart where we have an instance |
(...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1987 for (Element element in compiler.enqueuer.codegen.newlyEnqueuedElements) { | 1987 for (Element element in compiler.enqueuer.codegen.newlyEnqueuedElements) { |
1988 if (element.isInstanceMember) { | 1988 if (element.isInstanceMember) { |
1989 cachedClassBuilders.remove(element.enclosingClass); | 1989 cachedClassBuilders.remove(element.enclosingClass); |
1990 | 1990 |
1991 nativeEmitter.cachedBuilders.remove(element.enclosingClass); | 1991 nativeEmitter.cachedBuilders.remove(element.enclosingClass); |
1992 | 1992 |
1993 } | 1993 } |
1994 } | 1994 } |
1995 } | 1995 } |
1996 } | 1996 } |
OLD | NEW |