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

Unified Diff: frog/gen.dart

Issue 9877008: Move the DOMContentLoaded logic into the generated JavaScript (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: frog/gen.dart
===================================================================
--- frog/gen.dart (revision 5935)
+++ frog/gen.dart (working copy)
@@ -122,7 +122,13 @@
writeDynamicDispatchMetadata();
writeGlobals();
- writer.writeln('${mainCall.code};');
+ writer.writeln("if (typeof window != 'undefined' && window.addEventListener) {");
vsm 2012/03/28 17:17:57 line length > 80?
+ writer.writeln(" window.addEventListener('DOMContentLoaded', function(e) {");
+ writer.writeln(" ${mainCall.code};");
+ writer.writeln(" });");
+ writer.writeln("} else {");
+ writer.writeln(" ${mainCall.code};");
+ writer.writeln("}");
}
void markLibrariesUsed(List<Library> libs) =>
« client/tools/htmlconverter.py ('K') | « client/tools/htmlconverter.py ('k') | frog/minfrog » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698