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

Commit

Permalink
fix: preserve setters when wrapping XMLHttpRequest
Browse files Browse the repository at this point in the history
change suggested by @tbosch (thx!)

Closes #17
  • Loading branch information
btford committed Apr 24, 2014
1 parent d1a2c8e commit fb46688
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/zone.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,14 @@ describe('Zone.patch', function () {
expect(hasParent).toBe(true);
});
});

it('should preserve other setters', function () {
var req = new XMLHttpRequest();
req.open('get', '/', true);
req.send();
req.responseType = 'document';
expect(req.responseType).toBe('document');
});
});


Expand Down
2 changes: 2 additions & 0 deletions zone.js
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,8 @@ Zone.patchClass = function (className) {
set: function (fn) {
if (typeof fn === 'function') {
this._o[prop] = zone.bind(fn);
} else {
this._o[prop] = fn;
}
},
get: function () {
Expand Down

0 comments on commit fb46688

Please sign in to comment.