| 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 1825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1836 } | 1836 } |
| 1837 $mainEnsureGetter | 1837 $mainEnsureGetter |
| 1838 """); | 1838 """); |
| 1839 return "${namer.isolateAccess(isolateMain)}($mainAccess)"; | 1839 return "${namer.isolateAccess(isolateMain)}($mainAccess)"; |
| 1840 } | 1840 } |
| 1841 | 1841 |
| 1842 emitMain(CodeBuffer buffer) { | 1842 emitMain(CodeBuffer buffer) { |
| 1843 if (compiler.isMockCompilation) return; | 1843 if (compiler.isMockCompilation) return; |
| 1844 Element main = compiler.mainApp.find(Compiler.MAIN); | 1844 Element main = compiler.mainApp.find(Compiler.MAIN); |
| 1845 String mainCall = null; | 1845 String mainCall = null; |
| 1846 if (compiler.isolateHelperLibrary != null) { | 1846 if (compiler.isolateLibrary != null) { |
| 1847 Element isolateMain = | 1847 Element isolateMain = |
| 1848 compiler.isolateHelperLibrary.find(Compiler.START_ROOT_ISOLATE); | 1848 compiler.isolateLibrary.find(Compiler.START_ROOT_ISOLATE); |
| 1849 mainCall = buildIsolateSetup(buffer, main, isolateMain); | 1849 mainCall = buildIsolateSetup(buffer, main, isolateMain); |
| 1850 } else { | 1850 } else { |
| 1851 mainCall = '${namer.isolateAccess(main)}()'; | 1851 mainCall = '${namer.isolateAccess(main)}()'; |
| 1852 } | 1852 } |
| 1853 if (!compiler.enableMinification) { | 1853 if (!compiler.enableMinification) { |
| 1854 buffer.add(""" | 1854 buffer.add(""" |
| 1855 | 1855 |
| 1856 // | 1856 // |
| 1857 // BEGIN invoke [main]. | 1857 // BEGIN invoke [main]. |
| 1858 // | 1858 // |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2016 """; | 2016 """; |
| 2017 const String HOOKS_API_USAGE = """ | 2017 const String HOOKS_API_USAGE = """ |
| 2018 // The code supports the following hooks: | 2018 // The code supports the following hooks: |
| 2019 // dartPrint(message) - if this function is defined it is called | 2019 // dartPrint(message) - if this function is defined it is called |
| 2020 // instead of the Dart [print] method. | 2020 // instead of the Dart [print] method. |
| 2021 // dartMainRunner(main) - if this function is defined, the Dart [main] | 2021 // dartMainRunner(main) - if this function is defined, the Dart [main] |
| 2022 // method will not be invoked directly. | 2022 // method will not be invoked directly. |
| 2023 // Instead, a closure that will invoke [main] is | 2023 // Instead, a closure that will invoke [main] is |
| 2024 // passed to [dartMainRunner]. | 2024 // passed to [dartMainRunner]. |
| 2025 """; | 2025 """; |
| OLD | NEW |