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 library dart2js.js_emitter.full_emitter; | 5 library dart2js.js_emitter.full_emitter; |
6 | 6 |
7 import 'dart:collection' show HashMap; | 7 import 'dart:collection' show HashMap; |
8 import 'dart:convert'; | 8 import 'dart:convert'; |
9 | 9 |
10 import 'package:js_runtime/shared/embedded_names.dart' as embeddedNames; | 10 import 'package:js_runtime/shared/embedded_names.dart' as embeddedNames; |
(...skipping 2094 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2105 output.close(); | 2105 output.close(); |
2106 } | 2106 } |
2107 | 2107 |
2108 hunkHashes[outputUnit] = hash; | 2108 hunkHashes[outputUnit] = hash; |
2109 } | 2109 } |
2110 return hunkHashes; | 2110 return hunkHashes; |
2111 } | 2111 } |
2112 | 2112 |
2113 jsAst.Comment buildGeneratedBy() { | 2113 jsAst.Comment buildGeneratedBy() { |
2114 List<String> options = []; | 2114 List<String> options = []; |
2115 if (compiler.mirrorsLibrary != null) options.add('mirrors'); | 2115 if (compiler.commonElements.mirrorsLibrary != null) options.add('mirrors'); |
2116 if (compiler.options.useContentSecurityPolicy) options.add("CSP"); | 2116 if (compiler.options.useContentSecurityPolicy) options.add("CSP"); |
2117 return new jsAst.Comment(generatedBy(compiler, flavor: options.join(", "))); | 2117 return new jsAst.Comment(generatedBy(compiler, flavor: options.join(", "))); |
2118 } | 2118 } |
2119 | 2119 |
2120 void outputSourceMap( | 2120 void outputSourceMap( |
2121 CodeOutput output, LineColumnProvider lineColumnProvider, String name, | 2121 CodeOutput output, LineColumnProvider lineColumnProvider, String name, |
2122 [Uri sourceMapUri, Uri fileUri]) { | 2122 [Uri sourceMapUri, Uri fileUri]) { |
2123 if (!generateSourceMap) return; | 2123 if (!generateSourceMap) return; |
2124 // Create a source file for the compilation output. This allows using | 2124 // Create a source file for the compilation output. This allows using |
2125 // [:getLine:] to transform offsets to line numbers in [SourceMapBuilder]. | 2125 // [:getLine:] to transform offsets to line numbers in [SourceMapBuilder]. |
(...skipping 24 matching lines...) Expand all Loading... |
2150 if (cachedElements.isEmpty) return; | 2150 if (cachedElements.isEmpty) return; |
2151 for (Element element in compiler.enqueuer.codegen.newlyEnqueuedElements) { | 2151 for (Element element in compiler.enqueuer.codegen.newlyEnqueuedElements) { |
2152 if (element.isInstanceMember) { | 2152 if (element.isInstanceMember) { |
2153 cachedClassBuilders.remove(element.enclosingClass); | 2153 cachedClassBuilders.remove(element.enclosingClass); |
2154 | 2154 |
2155 nativeEmitter.cachedBuilders.remove(element.enclosingClass); | 2155 nativeEmitter.cachedBuilders.remove(element.enclosingClass); |
2156 } | 2156 } |
2157 } | 2157 } |
2158 } | 2158 } |
2159 } | 2159 } |
OLD | NEW |