| 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:convert'; | 7 import 'dart:convert'; |
| 8 import 'dart:collection' show HashMap; | 8 import 'dart:collection' show HashMap; |
| 9 | 9 |
| 10 import 'package:js_runtime/shared/embedded_names.dart' as embeddedNames; | 10 import 'package:js_runtime/shared/embedded_names.dart' as embeddedNames; |
| 11 import 'package:js_runtime/shared/embedded_names.dart' show | 11 import 'package:js_runtime/shared/embedded_names.dart' show |
| 12 JsBuiltin, | 12 JsBuiltin, |
| 13 JsGetName; | 13 JsGetName; |
| 14 | 14 |
| 15 import '../headers.dart'; |
| 16 |
| 15 import '../js_emitter.dart' hide Emitter; | 17 import '../js_emitter.dart' hide Emitter; |
| 16 import '../js_emitter.dart' as js_emitter show Emitter; | 18 import '../js_emitter.dart' as js_emitter show Emitter; |
| 17 | 19 |
| 18 import '../model.dart'; | 20 import '../model.dart'; |
| 19 import '../program_builder/program_builder.dart'; | 21 import '../program_builder/program_builder.dart'; |
| 20 | 22 |
| 21 import '../../common.dart'; | 23 import '../../common.dart'; |
| 22 | 24 |
| 23 import '../../constants/values.dart'; | 25 import '../../constants/values.dart'; |
| 24 | 26 |
| (...skipping 2040 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2065 } else { | 2067 } else { |
| 2066 output.close(); | 2068 output.close(); |
| 2067 } | 2069 } |
| 2068 | 2070 |
| 2069 hunkHashes[outputUnit] = hash; | 2071 hunkHashes[outputUnit] = hash; |
| 2070 } | 2072 } |
| 2071 return hunkHashes; | 2073 return hunkHashes; |
| 2072 } | 2074 } |
| 2073 | 2075 |
| 2074 jsAst.Comment buildGeneratedBy() { | 2076 jsAst.Comment buildGeneratedBy() { |
| 2075 String suffix = ''; | 2077 List<String> options = []; |
| 2076 if (compiler.hasBuildId) suffix = ' version: ${compiler.buildId}'; | 2078 if (compiler.mirrorsLibrary != null) options.add('mirrors'); |
| 2077 String msg = '// Generated by dart2js, the Dart to JavaScript ' | 2079 if (compiler.useContentSecurityPolicy) options.add("CSP"); |
| 2078 'compiler$suffix.'; | 2080 return new jsAst.Comment(generatedBy(compiler, flavor: options.join(", "))); |
| 2079 return new jsAst.Comment(msg); | |
| 2080 } | 2081 } |
| 2081 | 2082 |
| 2082 void outputSourceMap(CodeOutput output, | 2083 void outputSourceMap(CodeOutput output, |
| 2083 LineColumnProvider lineColumnProvider, | 2084 LineColumnProvider lineColumnProvider, |
| 2084 String name, | 2085 String name, |
| 2085 [Uri sourceMapUri, | 2086 [Uri sourceMapUri, |
| 2086 Uri fileUri]) { | 2087 Uri fileUri]) { |
| 2087 if (!generateSourceMap) return; | 2088 if (!generateSourceMap) return; |
| 2088 // Create a source file for the compilation output. This allows using | 2089 // Create a source file for the compilation output. This allows using |
| 2089 // [:getLine:] to transform offsets to line numbers in [SourceMapBuilder]. | 2090 // [:getLine:] to transform offsets to line numbers in [SourceMapBuilder]. |
| (...skipping 24 matching lines...) Expand all Loading... |
| 2114 for (Element element in compiler.enqueuer.codegen.newlyEnqueuedElements) { | 2115 for (Element element in compiler.enqueuer.codegen.newlyEnqueuedElements) { |
| 2115 if (element.isInstanceMember) { | 2116 if (element.isInstanceMember) { |
| 2116 cachedClassBuilders.remove(element.enclosingClass); | 2117 cachedClassBuilders.remove(element.enclosingClass); |
| 2117 | 2118 |
| 2118 nativeEmitter.cachedBuilders.remove(element.enclosingClass); | 2119 nativeEmitter.cachedBuilders.remove(element.enclosingClass); |
| 2119 | 2120 |
| 2120 } | 2121 } |
| 2121 } | 2122 } |
| 2122 } | 2123 } |
| 2123 } | 2124 } |
| OLD | NEW |