File tree 3 files changed +16
-2
lines changed
3 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -551,9 +551,11 @@ Parser.prototype.walkExpression = function walkExpression(expression) {
551
551
case "CallExpression" :
552
552
if ( expression . callee . type === "FunctionExpression" && expression . arguments ) {
553
553
// (function(...) { }(...))
554
- var args = expression . arguments . map ( function ( arg ) {
554
+ var args = expression . arguments . map ( function ( arg , idx ) {
555
555
var result = this . evaluateExpression ( arg ) ;
556
- if ( ! result . isIdentifier ( ) ) result = undefined ;
556
+ if ( result && ! result . isIdentifier ( ) ) result = undefined ;
557
+ if ( result && ( ! expression . callee . params [ idx ] || expression . callee . params [ idx ] . name !== result . identifier ) )
558
+ result = undefined ;
557
559
if ( ! result ) {
558
560
this . walkExpression ( arg ) ;
559
561
return ;
Original file line number Diff line number Diff line change @@ -179,6 +179,15 @@ it("should parse a bound function expression 4", function(done) {
179
179
} . bind ( null , 123 ) ) ;
180
180
} ) ;
181
181
182
+ it ( "should create a context if require passed to IIFE (renaming todo)" , function ( done ) {
183
+ require . ensure ( [ ] , function ( require ) {
184
+ ( function ( req ) {
185
+ req . keys . should . be . type ( "function" ) ;
186
+ done ( ) ;
187
+ } ( require ) ) ;
188
+ } ) ;
189
+ } ) ;
190
+
182
191
it ( "should not fail issue #138 second" , function ( ) {
183
192
( function ( define , global ) { 'use strict' ;
184
193
define ( function ( require ) {
Original file line number Diff line number Diff line change
1
+ module . exports = [
2
+ [ / C r i t i c a l d e p e n d e n c i e s / ]
3
+ ] ;
You can’t perform that action at this time.
0 commit comments