| 
									
										
										
										
											2013-01-31 01:49:25 +08:00
										 |  |  | /* | 
					
						
							|  |  |  | 	MIT License http://www.opensource.org/licenses/mit-license.php
 | 
					
						
							|  |  |  | 	Author Tobias Koppers @sokra | 
					
						
							|  |  |  | */ | 
					
						
							|  |  |  | var path = require("path"); | 
					
						
							| 
									
										
										
										
											2013-02-05 15:31:46 +08:00
										 |  |  | var ModuleParserHelpers = require("./ModuleParserHelpers"); | 
					
						
							| 
									
										
										
										
											2013-01-31 01:49:25 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | function ConsolePlugin() { | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | module.exports = ConsolePlugin; | 
					
						
							|  |  |  | ConsolePlugin.prototype.apply = function(compiler) { | 
					
						
							|  |  |  | 	function ignore() { return true; } | 
					
						
							|  |  |  | 	compiler.parser.plugin("expression console", function(expr) { | 
					
						
							| 
									
										
										
										
											2013-02-13 20:00:01 +08:00
										 |  |  | 		return ModuleParserHelpers.addParsedVariable(this, "console", "require(" + JSON.stringify(path.join(__dirname, "..", "buildin", "console.js")) + ")"); | 
					
						
							| 
									
										
										
										
											2013-01-31 01:49:25 +08:00
										 |  |  | 	}); | 
					
						
							|  |  |  | }; |