mirror of
https://github.com/flynx/colors.js.git
synced 2025-10-29 11:00:11 +00:00
[fix] Removed Object.define property entirely
This commit is contained in:
parent
c0bc636d4d
commit
38db25ad14
13
colors.js
13
colors.js
@ -48,20 +48,9 @@ var addProperty = function (color, func) {
|
||||
exports[color] = function (str) {
|
||||
return func.apply(str);
|
||||
};
|
||||
|
||||
if (Object.defineProperty) {
|
||||
Object.defineProperty(String.prototype, color, {
|
||||
get : func,
|
||||
configurable: true,
|
||||
enumerable: false
|
||||
});
|
||||
} else {
|
||||
String.prototype.__defineGetter__(color, func);
|
||||
}
|
||||
String.prototype.__defineGetter__(color, func);
|
||||
};
|
||||
|
||||
|
||||
|
||||
function stylize(str, style) {
|
||||
|
||||
var styles;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user