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

Unified 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, 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
« no previous file with comments | « no previous file | frog/minfrog » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: frog/gen.dart
===================================================================
--- frog/gen.dart (revision 5976)
+++ frog/gen.dart (working copy)
@@ -122,7 +122,8 @@
writeDynamicDispatchMetadata();
writeGlobals();
- writer.writeln("if (typeof window != 'undefined' && window.addEventListener) {");
+ writer.writeln("if (typeof window != 'undefined' && typeof document != 'undefined' &&");
+ writer.writeln(" window.addEventListener && document.readyState == 'loading') {");
writer.writeln(" window.addEventListener('DOMContentLoaded', function(e) {");
writer.writeln(" ${mainCall.code};");
writer.writeln(" });");
« 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