[api fix] Make properties non-enumerable

Fixes #5.
This commit is contained in:
Maciej Małecki 2012-06-27 11:23:45 +02:00
parent 4b2ae6c5ec
commit adf06f0988

View File

@ -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);
});
});