| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 * Generates the code for all used classes in the program. Static fields (even | 8 * Generates the code for all used classes in the program. Static fields (even |
| 9 * in classes) are ignored, since they can be treated as non-class elements. | 9 * in classes) are ignored, since they can be treated as non-class elements. |
| 10 * | 10 * |
| (...skipping 1862 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1873 if (uri.scheme == 'file' && compiler.sourceMapUri != null) { | 1873 if (uri.scheme == 'file' && compiler.sourceMapUri != null) { |
| 1874 // TODO(ahe): It is a hack to use compiler.sourceMapUri | 1874 // TODO(ahe): It is a hack to use compiler.sourceMapUri |
| 1875 // here. It should be relative to the main JavaScript | 1875 // here. It should be relative to the main JavaScript |
| 1876 // output file. | 1876 // output file. |
| 1877 uri = relativize( | 1877 uri = relativize( |
| 1878 compiler.sourceMapUri, library.canonicalUri, false); | 1878 compiler.sourceMapUri, library.canonicalUri, false); |
| 1879 } | 1879 } |
| 1880 if (buffer != null) { | 1880 if (buffer != null) { |
| 1881 var metadata = buildMetadataFunction(library); | 1881 var metadata = buildMetadataFunction(library); |
| 1882 mainBuffer | 1882 mainBuffer |
| 1883 ..write('["${library.getLibraryOrScriptName()}",$_') | 1883 ..write('["${library.getLibraryName()}",$_') |
| 1884 ..write('"${uri}",$_') | 1884 ..write('"${uri}",$_') |
| 1885 ..write(metadata == null | 1885 ..write(metadata == null |
| 1886 ? "" : jsAst.prettyPrint(metadata, compiler)) | 1886 ? "" : jsAst.prettyPrint(metadata, compiler)) |
| 1887 ..write(',$_') | 1887 ..write(',$_') |
| 1888 ..write(namer.globalObjectFor(library)) | 1888 ..write(namer.globalObjectFor(library)) |
| 1889 ..write(',$_') | 1889 ..write(',$_') |
| 1890 ..write('{$n') | 1890 ..write('{$n') |
| 1891 ..addBuffer(buffer) | 1891 ..addBuffer(buffer) |
| 1892 ..write('}'); | 1892 ..write('}'); |
| 1893 if (library == compiler.mainApp) { | 1893 if (library == compiler.mainApp) { |
| 1894 mainBuffer.write(',${n}1'); | 1894 mainBuffer.write(',${n}1'); |
| 1895 } | 1895 } |
| 1896 mainBuffer.write('],$n'); | 1896 mainBuffer.write('],$n'); |
| 1897 } | 1897 } |
| 1898 buffer = buffers[1]; | 1898 buffer = buffers[1]; |
| 1899 if (buffer != null) { | 1899 if (buffer != null) { |
| 1900 deferredLibraries | 1900 deferredLibraries |
| 1901 ..write('["${library.getLibraryOrScriptName()}",$_') | 1901 ..write('["${library.getLibraryName()}",$_') |
| 1902 ..write('"${uri}",$_') | 1902 ..write('"${uri}",$_') |
| 1903 ..write('[],$_') | 1903 ..write('[],$_') |
| 1904 ..write(namer.globalObjectFor(library)) | 1904 ..write(namer.globalObjectFor(library)) |
| 1905 ..write(',$_') | 1905 ..write(',$_') |
| 1906 ..write('{$n') | 1906 ..write('{$n') |
| 1907 ..addBuffer(buffer) | 1907 ..addBuffer(buffer) |
| 1908 ..write('}],$n'); | 1908 ..write('}],$n'); |
| 1909 } | 1909 } |
| 1910 elementBuffers[library] = const []; | 1910 elementBuffers[library] = const []; |
| 1911 } | 1911 } |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2146 return compiler.deferredLoadTask.isDeferred(element); | 2146 return compiler.deferredLoadTask.isDeferred(element); |
| 2147 } | 2147 } |
| 2148 | 2148 |
| 2149 bool get areAnyElementsDeferred { | 2149 bool get areAnyElementsDeferred { |
| 2150 return compiler.deferredLoadTask.areAnyElementsDeferred; | 2150 return compiler.deferredLoadTask.areAnyElementsDeferred; |
| 2151 } | 2151 } |
| 2152 } | 2152 } |
| 2153 | 2153 |
| 2154 // TODO(ahe): Move code for interceptors to own file. | 2154 // TODO(ahe): Move code for interceptors to own file. |
| 2155 // TODO(ahe): Move code for reifying metadata/types to own file. | 2155 // TODO(ahe): Move code for reifying metadata/types to own file. |
| OLD | NEW |