Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(494)

Side by Side Diff: frog/gen.dart

Issue 9918014: Fix issue http://dartbug.com/2342 by checking document.readyState (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | frog/minfrog » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | frog/minfrog » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698