| 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 /** | 5 /** |
| 6 * Top level generator object for writing code and keeping track of | 6 * Top level generator object for writing code and keeping track of |
| 7 * dependencies. | 7 * dependencies. |
| 8 * | 8 * |
| 9 * Should have two compilation models, but only one implemented so far. | 9 * Should have two compilation models, but only one implemented so far. |
| 10 * | 10 * |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 writeTypes(main.declaringType.library); | 115 writeTypes(main.declaringType.library); |
| 116 | 116 |
| 117 // Write out any inherited concrete members. | 117 // Write out any inherited concrete members. |
| 118 // TODO(jmesserly): this won't need to come last once we are sorting types | 118 // TODO(jmesserly): this won't need to come last once we are sorting types |
| 119 // correctly. | 119 // correctly. |
| 120 if (_mixins != null) writer.write(_mixins.text); | 120 if (_mixins != null) writer.write(_mixins.text); |
| 121 | 121 |
| 122 writeDynamicDispatchMetadata(); | 122 writeDynamicDispatchMetadata(); |
| 123 | 123 |
| 124 writeGlobals(); | 124 writeGlobals(); |
| 125 writer.writeln("if (typeof window != 'undefined' && window.addEventListener)
{"); | 125 writer.writeln("if (typeof window != 'undefined' && typeof document != 'unde
fined' &&"); |
| 126 writer.writeln(" window.addEventListener && document.readyState == 'loadi
ng') {"); |
| 126 writer.writeln(" window.addEventListener('DOMContentLoaded', function(e) {"
); | 127 writer.writeln(" window.addEventListener('DOMContentLoaded', function(e) {"
); |
| 127 writer.writeln(" ${mainCall.code};"); | 128 writer.writeln(" ${mainCall.code};"); |
| 128 writer.writeln(" });"); | 129 writer.writeln(" });"); |
| 129 writer.writeln("} else {"); | 130 writer.writeln("} else {"); |
| 130 writer.writeln(" ${mainCall.code};"); | 131 writer.writeln(" ${mainCall.code};"); |
| 131 writer.writeln("}"); | 132 writer.writeln("}"); |
| 132 } | 133 } |
| 133 | 134 |
| 134 void markLibrariesUsed(List<Library> libs) => | 135 void markLibrariesUsed(List<Library> libs) => |
| 135 getAllTypes(libs).forEach(markTypeUsed); | 136 getAllTypes(libs).forEach(markTypeUsed); |
| (...skipping 2391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2527 return true; | 2528 return true; |
| 2528 } | 2529 } |
| 2529 | 2530 |
| 2530 } | 2531 } |
| 2531 | 2532 |
| 2532 class ReturnKind { | 2533 class ReturnKind { |
| 2533 static final int IGNORE = 1; | 2534 static final int IGNORE = 1; |
| 2534 static final int POST = 2; | 2535 static final int POST = 2; |
| 2535 static final int PRE = 3; | 2536 static final int PRE = 3; |
| 2536 } | 2537 } |
| OLD | NEW |