Bug 791944 - Use Object.defineProperty() instead of __defineGetter__ in XPCOMUtils.defineLazyGetter(). r=mak77

This commit is contained in:
OHZEKI Tetsuharu 2012-09-25 11:04:25 -04:00
parent 02dc2fbc6f
commit b810714776

View File

@ -171,9 +171,13 @@ var XPCOMUtils = {
*/
defineLazyGetter: function XPCU_defineLazyGetter(aObject, aName, aLambda)
{
aObject.__defineGetter__(aName, function() {
delete aObject[aName];
return aObject[aName] = aLambda.apply(aObject);
Object.defineProperty(aObject, aName, {
get: function () {
delete aObject[aName];
return aObject[aName] = aLambda.apply(aObject);
},
configurable: true,
enumerable: true
});
},