Skip to content
This repository has been archived by the owner on Aug 11, 2020. It is now read-only.

Commit

Permalink
Only one jslint error
Browse files Browse the repository at this point in the history
  • Loading branch information
aslakhellesoy committed Mar 11, 2009
1 parent 95d8362 commit 104158b
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 7 deletions.
21 changes: 21 additions & 0 deletions README.textile
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,24 @@ Creates the directory.
h3. Dir.rm(callback)

Removes the directory.

h2. Usage

Not written yet - haven't used it in a browser yet :-)

h2. Running tests

You need to download some tools. Run ./install_tools.sh to pull them down.

h3. In shell A

<pre>
cd milton/milton-test
mvn jetty:run
</pre>

h3. In shell B

<pre>
ant jsspec
</pre>
2 changes: 1 addition & 1 deletion build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

<jslint options="undef">
<formatter type="plain" />
<fileset dir="src" includes="*.js" />
<fileset dir="src" includes="webdav.js" />
</jslint>
</target>
</project>
12 changes: 6 additions & 6 deletions src/webdav.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,21 @@ var WebDav = {
if (type == 'xml') {
var xml = xhr.responseXML;
if(xml) {
b = (xml.firstChild.nextSibling) ? xml.firstChild.nextSibling : xml.firstChild;
b = xml.firstChild.nextSibling ? xml.firstChild.nextSibling : xml.firstChild;
}
}
return b;
};

var async = !(callback == null);
var async = !(callback === null);
if(async) {
xhr.onreadystatechange = function(readyState) {
if(readyState == 4 || readyState == null) { // complete. (null check is workaround for env.rhino.js).
if(readyState == 4 || readyState === null) { // complete. (null check is workaround for env.rhino.js).
if(body()) { // Workaround for env.rhino.js
callback(body());
}
}
}
};
}
xhr.open(verb, url, async);
xhr.setRequestHeader("Content-Type", "text/xml; charset=UTF-8");
Expand Down Expand Up @@ -78,7 +78,7 @@ WebDav.Fs = {

this.children = function(callback) {
var childrenFunc = function(doc) {
if(doc.childNodes == null) {
if(doc.childNodes === null) {
throw('No such directory: ' + url);
}
var result = [];
Expand Down Expand Up @@ -118,4 +118,4 @@ WebDav.Fs = {

return this;
}
}
};

0 comments on commit 104158b

Please sign in to comment.