From 9198ddbd3d1dbea12f0f20324540956d4c4ca71d Mon Sep 17 00:00:00 2001 From: Steven Parkes Date: Fri, 5 Feb 2010 15:57:42 -0800 Subject: [PATCH 1/3] tweak to make sure docs are loaded async --- src/dom/document.js | 7 +++++-- test/data.js | 6 ++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/dom/document.js b/src/dom/document.js index f0474ffb..af5304d5 100644 --- a/src/dom/document.js +++ b/src/dom/document.js @@ -130,8 +130,11 @@ __extend__(DOMDocument.prototype, { xhr = ({ open: function(){}, send: function(){ - this.responseText = content; - this.onreadystatechange(); + var self = this; + setTimeout(function(){ + self.responseText = content; + self.onreadystatechange(); + },0); }, status: 200 }); diff --git a/test/data.js b/test/data.js index c5c9ef61..2abe7eeb 100755 --- a/test/data.js +++ b/test/data.js @@ -6,7 +6,9 @@ url_escaped = "data:text/html,"+escape(doc); base64 = "data:text/html;base64,"+Base64.encode(doc); debug(url_escaped); window.location = "about:blank"; +Envjs.wait(); window.location = url_escaped; +Envjs.wait(); debug(window.document.documentElement.innerHTML); if(window.document.documentElement.innerHTML != inner){ debug(window.document.documentElement.innerHTML); @@ -15,13 +17,17 @@ if(window.document.documentElement.innerHTML != inner){ } debug(base64); window.location = "about:blank"; +Envjs.wait(); window.location = base64; +Envjs.wait(); debug(window.document.documentElement.innerHTML); if(window.document.documentElement.innerHTML != inner){ throw new Error("b"+window.document.documentElement.innerHTML); } window.location = "about:blank"; +Envjs.wait(); window.location = "data:,"+escape("Hello, World from a data uri!"); +Envjs.wait(); debug(window.location+""); debug(window.document.documentElement.innerHTML); inner = "Hello, World from a data uri!"; From f6235807cbe9b9cfde9d9a87924a43df377beff8 Mon Sep 17 00:00:00 2001 From: Steven Parkes Date: Fri, 5 Feb 2010 16:12:06 -0800 Subject: [PATCH 2/3] ruby authorship .. --- Rakefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Rakefile b/Rakefile index 5fadf955..fdfd9b21 100644 --- a/Rakefile +++ b/Rakefile @@ -70,7 +70,7 @@ begin s.email = "smparkes@smparkes.net" # Just for the ruby part ... s.homepage = "http://github.com/thatcher/env-js" s.description = "Browser environment for javascript interpreters" - s.authors = ["John Resig", "Chris Thatcher" ] + s.authors = ["John Resig", "Chris Thatcher", "Steven Parkes" ] s.add_dependency "johnson", ">= 2.0.0.pre0" s.files = FileList[ "", From dfb5e51a5412ab09c6af4a48c2e0b685a4157779 Mon Sep 17 00:00:00 2001 From: Steven Parkes Date: Fri, 5 Feb 2010 18:33:51 -0800 Subject: [PATCH 3/3] un-vendor johnson (pulled in as dependence); window.toString() is now standard [object Window] --- .gitmodules | 3 --- Rakefile | 6 +++--- src/intro.js | 3 ++- vendor/johnson | 1 - 4 files changed, 5 insertions(+), 8 deletions(-) delete mode 100644 .gitmodules delete mode 160000 vendor/johnson diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 0c99ff51..00000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "vendor/johnson"] - path = vendor/johnson - url = git://github.com/jbarnette/johnson.git diff --git a/Rakefile b/Rakefile index fdfd9b21..0e32f21d 100644 --- a/Rakefile +++ b/Rakefile @@ -50,9 +50,9 @@ namespace :johnson do desc "run tests against johnson" task :test => :compile do - ruby "-Ilib:vendor/johnson/lib bin/envjsrb test/primary-tests.js" - ruby "-Ilib:vendor/johnson/lib bin/envjsrb test/prototype-test.js" - ruby "-Ilib:vendor/johnson/lib bin/envjsrb test/call-load-test.js" + ruby "bin/envjsrb test/primary-tests.js" + ruby "bin/envjsrb test/prototype-test.js" + ruby "bin/envjsrb test/call-load-test.js" end end diff --git a/src/intro.js b/src/intro.js index 8697b3bc..2d9b1155 100644 --- a/src/intro.js +++ b/src/intro.js @@ -35,7 +35,8 @@ $platform.init_window = function(window) { var index = master.window_index++; window.toString = function(){ - return "[object Window "+index+"]"; + // return "[object Window "+index+"]"; + return "[object Window]"; }; }; diff --git a/vendor/johnson b/vendor/johnson deleted file mode 160000 index 99d62bde..00000000 --- a/vendor/johnson +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 99d62bde83996e826c500198d9003bc691dcb133