diff --git a/test/zone.spec.js b/test/zone.spec.js index c4b8d9c21..449b8e937 100644 --- a/test/zone.spec.js +++ b/test/zone.spec.js @@ -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'); + }); }); diff --git a/zone.js b/zone.js index 59864f2b8..62ba7c0ff 100644 --- a/zone.js +++ b/zone.js @@ -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 () {