mirror of
				https://github.com/flynx/colors.js.git
				synced 2025-10-30 03:20:10 +00:00 
			
		
		
		
	[fix] Removed Object.define property entirely
This commit is contained in:
		
							parent
							
								
									c0bc636d4d
								
							
						
					
					
						commit
						38db25ad14
					
				
							
								
								
									
										11
									
								
								colors.js
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								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); | ||||
|   } | ||||
| }; | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| function stylize(str, style) { | ||||
| 
 | ||||
|   var styles; | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user