From 4a0d9cd2243b8765a1bfb2b563cb60f69411ebe8 Mon Sep 17 00:00:00 2001 From: omphalos Date: Sun, 11 Oct 2015 21:27:02 -0500 Subject: [PATCH] Use Object.defineProperty not __defineGetter__ This allows this library to be used in IE9/IE10. --- lib/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/index.js b/lib/index.js index b28c284..2fca56c 100644 --- a/lib/index.js +++ b/lib/index.js @@ -88,8 +88,10 @@ return Object.keys(this)[i]; }; - Storage.prototype.__defineGetter__('length', function () { - return Object.keys(this).length; + Object.defineProperty(Storage.prototype, 'length', { + get: function() { + return Object.keys(this).length; + } }); Storage.prototype.___save___ = function () {