diff --git a/colors.js b/colors.js index b981317..44ee612 100644 --- a/colors.js +++ b/colors.js @@ -48,7 +48,9 @@ var addProperty = function (color, func) { exports[color] = function (str) { return func.apply(str); }; - String.prototype.__defineGetter__(color, func); + Object.defineProperty(String.prototype, color, { + get: func + }); }; @@ -301,4 +303,4 @@ function zalgo(text, options) { // don't summon zalgo addProperty('zalgo', function () { return zalgo(this); -}); \ No newline at end of file +});