Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Delta Between Two Patch Sets: assets/js/XMLHttpRequest.jsm

Issue 8482109: ABP/Android JavaScript code (Closed)
Left Patch Set: ABP/Android JavaScript code Created Nov. 12, 2012, 9:32 a.m.
Right Patch Set: ABP/Android JavaScript code Created Nov. 13, 2012, 9:44 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « assets/js/Synchronizer.jsm ('k') | assets/js/basedomain.js » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 1
2 XMLHttpRequest = function() 2 XMLHttpRequest = function()
3 { 3 {
4 this.headers = {}; 4 this.headers = {};
5 this.responseHeaders = {}; 5 this.responseHeaders = {};
6 }; 6 };
7 7
8 XMLHttpRequest.UNSENT = 0; 8 XMLHttpRequest.UNSENT = 0;
9 XMLHttpRequest.OPEN = 1; 9 XMLHttpRequest.OPEN = 1;
10 XMLHttpRequest.HEADERS_RECEIVED = 2; 10 XMLHttpRequest.HEADERS_RECEIVED = 2;
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 }, 70 },
71 onreadystatechange: function(){}, 71 onreadystatechange: function(){},
72 getResponseHeader: function(header) 72 getResponseHeader: function(header)
73 { 73 {
74 if (this.readyState < XMLHttpRequest.LOADING) 74 if (this.readyState < XMLHttpRequest.LOADING)
75 throw new Error("INVALID_STATE_ERR"); 75 throw new Error("INVALID_STATE_ERR");
76 else 76 else
77 { 77 {
78 var lcHeader = header.toLowerCase(); 78 var lcHeader = header.toLowerCase();
79 var returnedHeaders = []; 79 var returnedHeaders = [];
80 for (var rHeader in this.responseHeaders) 80 for (var rHeader in this.responseHeaders)
Felix Dahlke 2012/11/13 07:53:14 You might want to make sure that you're not iterat
Andrey Novikov 2012/11/13 09:44:54 Done.
81 { 81 {
82 if (rHeader.toLowerCase() == lcHeader) 82 if (this.responseHeaders.hasOwnProperty(rHeader) && rHeader.toLowerCase( ) == lcHeader)
83 returnedHeaders.push(this.responseHeaders[rHeader]); 83 returnedHeaders.push(this.responseHeaders[rHeader]);
84 } 84 }
85 85
86 if (returnedHeaders.length) 86 if (returnedHeaders.length)
87 return returnedHeaders.join(", "); 87 return returnedHeaders.join(", ");
88 } 88 }
89 89
90 return null; 90 return null;
91 }, 91 },
92 getAllResponseHeaders: function(header) 92 getAllResponseHeaders: function(header)
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 status: -1, 161 status: -1,
162 notificationCallbacks: {}, 162 notificationCallbacks: {},
163 loadFlags: 0, 163 loadFlags: 0,
164 INHIBIT_CACHING: 0, 164 INHIBIT_CACHING: 0,
165 VALIDATE_ALWAYS: 0, 165 VALIDATE_ALWAYS: 0,
166 QueryInterface: function() 166 QueryInterface: function()
167 { 167 {
168 return this; 168 return this;
169 } 169 }
170 }; 170 };
LEFTRIGHT

Powered by Google App Engine
This is Rietveld