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

Unified Diff: frog/minfrog

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 | « frog/gen.dart ('k') | lib/compiler/implementation/emitter.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: frog/minfrog
===================================================================
--- frog/minfrog (revision 5976)
+++ frog/minfrog (working copy)
@@ -1610,7 +1610,7 @@
return this._length == (0);
}
StringBufferImpl.prototype.add = function(obj) {
- var str = obj.toString$0();
+ var str = obj.toString();
if (null == str || str.isEmpty()) return this;
this._buffer.add(str);
this._length = this._length + str.length;
@@ -3400,7 +3400,8 @@
if (this._mixins != null) this.writer.write(this._mixins.get$text());
this.writeDynamicDispatchMetadata();
this.writeGlobals();
- this.writer.writeln("if (typeof window != 'undefined' && window.addEventListener) {");
+ this.writer.writeln("if (typeof window != 'undefined' && typeof document != 'undefined' &&");
+ this.writer.writeln(" window.addEventListener && document.readyState == 'loading') {");
this.writer.writeln(" window.addEventListener('DOMContentLoaded', function(e) {");
this.writer.writeln((" " + mainCall.get$code() + ";"));
this.writer.writeln(" });");
@@ -15114,7 +15115,8 @@
var const$0013 = new JSSyntaxRegExp("^[a-zA-Z][a-zA-Z_$0-9]*$");
var $globals = {};
$static_init();
-if (typeof window != 'undefined' && window.addEventListener) {
+if (typeof window != 'undefined' && typeof document != 'undefined' &&
+ window.addEventListener && document.readyState == 'loading') {
window.addEventListener('DOMContentLoaded', function(e) {
main();
});
« no previous file with comments | « frog/gen.dart ('k') | lib/compiler/implementation/emitter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698