| 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 js_backend; | 5 part of js_backend; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * A function element that represents a closure call. The signature is copied | 8 * A function element that represents a closure call. The signature is copied |
| 9 * from the given element. | 9 * from the given element. |
| 10 */ | 10 */ |
| (...skipping 1876 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1887 } | 1887 } |
| 1888 $mainEnsureGetter | 1888 $mainEnsureGetter |
| 1889 """); | 1889 """); |
| 1890 return "${namer.isolateAccess(isolateMain)}($mainAccess)"; | 1890 return "${namer.isolateAccess(isolateMain)}($mainAccess)"; |
| 1891 } | 1891 } |
| 1892 | 1892 |
| 1893 emitMain(CodeBuffer buffer) { | 1893 emitMain(CodeBuffer buffer) { |
| 1894 if (compiler.isMockCompilation) return; | 1894 if (compiler.isMockCompilation) return; |
| 1895 Element main = compiler.mainApp.find(Compiler.MAIN); | 1895 Element main = compiler.mainApp.find(Compiler.MAIN); |
| 1896 String mainCall = null; | 1896 String mainCall = null; |
| 1897 if (compiler.isolateHelperLibrary != null) { | 1897 if (compiler.isolateLibrary != null) { |
| 1898 Element isolateMain = | 1898 Element isolateMain = |
| 1899 compiler.isolateHelperLibrary.find(Compiler.START_ROOT_ISOLATE); | 1899 compiler.isolateLibrary.find(Compiler.START_ROOT_ISOLATE); |
| 1900 mainCall = buildIsolateSetup(buffer, main, isolateMain); | 1900 mainCall = buildIsolateSetup(buffer, main, isolateMain); |
| 1901 } else { | 1901 } else { |
| 1902 mainCall = '${namer.isolateAccess(main)}()'; | 1902 mainCall = '${namer.isolateAccess(main)}()'; |
| 1903 } | 1903 } |
| 1904 if (!compiler.enableMinification) { | 1904 if (!compiler.enableMinification) { |
| 1905 buffer.add(""" | 1905 buffer.add(""" |
| 1906 | 1906 |
| 1907 // | 1907 // |
| 1908 // BEGIN invoke [main]. | 1908 // BEGIN invoke [main]. |
| 1909 // | 1909 // |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2084 """; | 2084 """; |
| 2085 const String HOOKS_API_USAGE = """ | 2085 const String HOOKS_API_USAGE = """ |
| 2086 // The code supports the following hooks: | 2086 // The code supports the following hooks: |
| 2087 // dartPrint(message) - if this function is defined it is called | 2087 // dartPrint(message) - if this function is defined it is called |
| 2088 // instead of the Dart [print] method. | 2088 // instead of the Dart [print] method. |
| 2089 // dartMainRunner(main) - if this function is defined, the Dart [main] | 2089 // dartMainRunner(main) - if this function is defined, the Dart [main] |
| 2090 // method will not be invoked directly. | 2090 // method will not be invoked directly. |
| 2091 // Instead, a closure that will invoke [main] is | 2091 // Instead, a closure that will invoke [main] is |
| 2092 // passed to [dartMainRunner]. | 2092 // passed to [dartMainRunner]. |
| 2093 """; | 2093 """; |
| OLD | NEW |