mirror of https://github.com/webpack/webpack.git
				
				
				
			bug fix
This commit is contained in:
		
							parent
							
								
									fe2681cb31
								
							
						
					
					
						commit
						1df510b919
					
				| 
						 | 
				
			
			@ -551,9 +551,11 @@ Parser.prototype.walkExpression = function walkExpression(expression) {
 | 
			
		|||
	case "CallExpression":
 | 
			
		||||
		if(expression.callee.type === "FunctionExpression" && expression.arguments) {
 | 
			
		||||
			// (function(...) { }(...))
 | 
			
		||||
			var args = expression.arguments.map(function(arg) {
 | 
			
		||||
			var args = expression.arguments.map(function(arg, idx) {
 | 
			
		||||
				var result = this.evaluateExpression(arg);
 | 
			
		||||
				if(!result.isIdentifier()) result = undefined;
 | 
			
		||||
				if(result && !result.isIdentifier()) result = undefined;
 | 
			
		||||
				if(result && (!expression.callee.params[idx] || expression.callee.params[idx].name !== result.identifier))
 | 
			
		||||
					result = undefined;
 | 
			
		||||
				if(!result) {
 | 
			
		||||
					this.walkExpression(arg);
 | 
			
		||||
					return;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -179,6 +179,15 @@ it("should parse a bound function expression 4", function(done) {
 | 
			
		|||
	}.bind(null, 123));
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
it("should create a context if require passed to IIFE (renaming todo)", function(done) {
 | 
			
		||||
	require.ensure([], function(require) {
 | 
			
		||||
		(function(req) {
 | 
			
		||||
			req.keys.should.be.type("function");
 | 
			
		||||
			done();
 | 
			
		||||
		}(require));
 | 
			
		||||
	});
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
it("should not fail issue #138 second", function() {
 | 
			
		||||
	(function(define, global) { 'use strict';
 | 
			
		||||
		define(function (require) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -0,0 +1,3 @@
 | 
			
		|||
module.exports = [
 | 
			
		||||
	[/Critical dependencies/]
 | 
			
		||||
];
 | 
			
		||||
		Loading…
	
		Reference in New Issue