| 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 2986 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2997 scripts[i].removeEventListener('load', onLoad, false); | 2997 scripts[i].removeEventListener('load', onLoad, false); |
| 2998 } | 2998 } |
| 2999 callback(event.target); | 2999 callback(event.target); |
| 3000 } | 3000 } |
| 3001 for (var i = 0; i < scripts.length; ++i) { | 3001 for (var i = 0; i < scripts.length; ++i) { |
| 3002 scripts[i].addEventListener('load', onLoad, false); | 3002 scripts[i].addEventListener('load', onLoad, false); |
| 3003 } | 3003 } |
| 3004 })(function(currentScript) { | 3004 })(function(currentScript) { |
| 3005 ${namer.isolateName}.${namer.isolatePropertiesName}.\$currentScript = | 3005 ${namer.isolateName}.${namer.isolatePropertiesName}.\$currentScript = |
| 3006 currentScript; | 3006 currentScript; |
| 3007 ${namer.CURRENT_ISOLATE}.\$currentScript = currentScript; |
| 3007 | 3008 |
| 3008 if (typeof console !== 'undefined' && typeof document !== 'undefined' && | 3009 if (typeof console !== 'undefined' && typeof document !== 'undefined' && |
| 3009 document.readyState == "loading") { | 3010 document.readyState == "loading") { |
| 3010 console.warn("Dart script executed synchronously, use <script src='" + | 3011 console.warn("Dart script executed synchronously, use <script src='" + |
| 3011 currentScript.src + "' defer></scr" + "ipt> to execute after parsing " + | 3012 currentScript.src + "' defer></scr" + "ipt> to execute after parsing " + |
| 3012 "has completed. See also http://dartbug.com/12281."); | 3013 "has completed. See also http://dartbug.com/12281."); |
| 3013 } | 3014 } |
| 3014 if (typeof dartMainRunner === "function") { | 3015 if (typeof dartMainRunner === "function") { |
| 3015 dartMainRunner(function() { ${mainCall}; }); | 3016 dartMainRunner(function() { ${mainCall}; }); |
| 3016 } else { | 3017 } else { |
| (...skipping 1135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4152 | 4153 |
| 4153 const String HOOKS_API_USAGE = """ | 4154 const String HOOKS_API_USAGE = """ |
| 4154 // The code supports the following hooks: | 4155 // The code supports the following hooks: |
| 4155 // dartPrint(message) - if this function is defined it is called | 4156 // dartPrint(message) - if this function is defined it is called |
| 4156 // instead of the Dart [print] method. | 4157 // instead of the Dart [print] method. |
| 4157 // dartMainRunner(main) - if this function is defined, the Dart [main] | 4158 // dartMainRunner(main) - if this function is defined, the Dart [main] |
| 4158 // method will not be invoked directly. | 4159 // method will not be invoked directly. |
| 4159 // Instead, a closure that will invoke [main] is | 4160 // Instead, a closure that will invoke [main] is |
| 4160 // passed to [dartMainRunner]. | 4161 // passed to [dartMainRunner]. |
| 4161 """; | 4162 """; |
| OLD | NEW |