Permalink
Browse files

Revert "Merge pull request #10 from mozilla-b2g/empty-propstat"

This reverts commit ee5ae7a, reversing
changes made to 75c6e99.
  • Loading branch information...
1 parent ee5ae7a commit a4b6e0a29b42d4ddea8a02d00a97fb49e291bdd5 @lightsofapollo lightsofapollo committed Jan 28, 2013
Showing with 7 additions and 31 deletions.
  1. +2 −10 caldav.js
  2. +2 −10 lib/caldav/sax/dav_response.js
  3. +0 −7 samples/xml/propget.xml
  4. +3 −4 test/caldav/sax/dav_response_test.js
View
12 caldav.js
@@ -2527,30 +2527,22 @@ function write (chunk) {
oncomplete: function() {
var propstat = this.stack[this.stack.length - 1];
- var hash = propstat.propstat;
-
+ propstat = propstat.propstat;
var key;
var status = this.current.status;
var props = this.current.prop;
delete this.current.status;
delete this.current.prop;
- var hasProps = false;
-
for (key in props) {
- hasProps = true;
if (Object.hasOwnProperty.call(props, key)) {
- hash[key] = {
+ propstat[key] = {
status: status,
value: props[key]
};
}
}
-
- if (!hasProps) {
- propstat.propstat = false;
- }
}
});
View
12 lib/caldav/sax/dav_response.js
@@ -165,30 +165,22 @@
oncomplete: function() {
var propstat = this.stack[this.stack.length - 1];
- var hash = propstat.propstat;
-
+ propstat = propstat.propstat;
var key;
var status = this.current.status;
var props = this.current.prop;
delete this.current.status;
delete this.current.prop;
- var hasProps = false;
-
for (key in props) {
- hasProps = true;
if (Object.hasOwnProperty.call(props, key)) {
- hash[key] = {
+ propstat[key] = {
status: status,
value: props[key]
};
}
}
-
- if (!hasProps) {
- propstat.propstat = false;
- }
}
});
View
7 samples/xml/propget.xml
@@ -2,13 +2,6 @@
<D:multistatus xmlns:D="DAV:" xmlns:C="urn:ietf:params:xml:ns:caldav">
<D:response>
- <D:href>/calendar/fake/</D:href>
- <D:propstat>
- <D:status>HTTP/1.1 404 Not Found</D:status>
- </D:propstat>
- </D:response>
-
- <D:response>
<D:href>/calendar/user/</D:href>
View
7 test/caldav/sax/dav_response_test.js
@@ -83,9 +83,8 @@ suite('caldav/sax/dav_response', function() {
});
expected = {
- '/calendar/fake/': false,
-
'/calendar/user/': {
+
'principal-URL': {
status: '200',
value: {
@@ -136,7 +135,7 @@ suite('caldav/sax/dav_response', function() {
'/calendar/user/',
expected['/calendar/user/']
],
- response[1],
+ response[0],
'/calendar/user/ response'
);
@@ -145,7 +144,7 @@ suite('caldav/sax/dav_response', function() {
'/calendar/other',
expected['/calendar/other']
],
- response[2],
+ response[1],
'/calendar/other/ response'
);

0 comments on commit a4b6e0a

Please sign in to comment.