Skip to content
This repository has been archived by the owner on Feb 26, 2022. It is now read-only.

Commit

Permalink
Attempting to access response.xml now raises the following error:
Browse files Browse the repository at this point in the history
  Sorry, the 'xml' property is no longer available. See bug 611042
  for more information.
  • Loading branch information
toolness committed Nov 11, 2010
1 parent 8e7f688 commit 5e6ca0e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/addon-kit/lib/request.js
Expand Up @@ -221,7 +221,10 @@ function fixedEncodeURIComponent (str) {
function Response(request) {
// Define the straight mappings of our value to original request value
xpcom.utils.defineLazyGetter(this, "text", function () request.responseText);
xpcom.utils.defineLazyGetter(this, "xml", function () request.responseXML);
xpcom.utils.defineLazyGetter(this, "xml", function () {
throw new Error("Sorry, the 'xml' property is no longer available. " +
"see bug 611042 for more information.");
});
xpcom.utils.defineLazyGetter(this, "status", function () request.status);
xpcom.utils.defineLazyGetter(this, "statusText", function () request.statusText);

Expand Down
5 changes: 5 additions & 0 deletions packages/addon-kit/tests/test-request.js
Expand Up @@ -99,6 +99,11 @@ exports.testSimpleXML = function (test) {
url: "http://playground.zpao.com/jetpack/request/note.xml",
onComplete: function (response, request) {
// response.xml should be a document, so lets use it
test.assertRaises(function() { response.xml },
"Sorry, the 'xml' property is no longer available. " +
"see bug 611042 for more information.");
test.done();
return;
let xml = response.xml;
let notes = xml.getElementsByTagName("note");
// Notes should have length of 1
Expand Down

0 comments on commit 5e6ca0e

Please sign in to comment.