diff --git a/lib/event.js b/lib/event.js index b41d826..0214ca0 100644 --- a/lib/event.js +++ b/lib/event.js @@ -74,39 +74,47 @@ _flag: { configurable: false, enumerable: false, - value: Object.create(Object.prototype, { - canceled: { - configurable: false, - enumerable: true, - value: false, - writable: true - }, - dispatch: { - configurable: false, - enumerable: true, - value: false, - writable: true - }, - initialized: { - configurable: false, - enumerable: true, - value: false, - writable: true - }, - stopImmediatePropagation: { - configurable: false, - enumerable: true, - value: false, - writable: true - }, - stopPropagation: { + get: function getter() { + var flag = Object.create(Object.prototype, { + canceled: { + configurable: false, + enumerable: true, + value: false, + writable: true + }, + dispatch: { + configurable: false, + enumerable: true, + value: false, + writable: true + }, + initialized: { + configurable: false, + enumerable: true, + value: false, + writable: true + }, + stopImmediatePropagation: { + configurable: false, + enumerable: true, + value: false, + writable: true + }, + stopPropagation: { + configurable: false, + enumerable: true, + value: false, + writable: true + } + }); + Object.defineProperty(this, '_flag', { configurable: false, - enumerable: true, - value: false, - writable: true - } - }), - writable: false + enumerable: false, + value: flag, + writable: false + }); + return flag; + } }, bubbles: { configurable: true, diff --git a/lib/xmlhttprequest.js b/lib/xmlhttprequest.js index c8ff8e7..f012e77 100644 --- a/lib/xmlhttprequest.js +++ b/lib/xmlhttprequest.js @@ -99,33 +99,41 @@ _flag: { configurable: false, enumerable: false, - value: Object.create(Object.prototype, { - anonymous: { - configurable: false, - enumerable: true, - value: false, - writable: true - }, - synchronous: { - configurable: false, - enumerable: true, - value: false, - writable: true - }, - uploadComplete: { - configurable: false, - enumerable: true, - value: false, - writable: true - }, - uploadEvents: { + get: function getter() { + var flag = Object.create(Object.prototype, { + anonymous: { + configurable: false, + enumerable: true, + value: false, + writable: true + }, + synchronous: { + configurable: false, + enumerable: true, + value: false, + writable: true + }, + uploadComplete: { + configurable: false, + enumerable: true, + value: false, + writable: true + }, + uploadEvents: { + configurable: false, + enumerable: true, + value: false, + writable: true + } + }); + Object.defineProperty(this, '_flag', { configurable: false, - enumerable: true, - value: false, - writable: true - } - }), - writable: false + enumerable: false, + value: flag, + writable: false + }); + return flag; + } }, _properties: { configurable: false,