File tree Expand file tree Collapse file tree 3 files changed +16
-2
lines changed
Expand file tree Collapse file tree 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) {
551551 case "CallExpression" :
552552 if ( expression . callee . type === "FunctionExpression" && expression . arguments ) {
553553 // (function(...) { }(...))
554- var args = expression . arguments . map ( function ( arg ) {
554+ var args = expression . arguments . map ( function ( arg , idx ) {
555555 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 ;
557559 if ( ! result ) {
558560 this . walkExpression ( arg ) ;
559561 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) {
179179 } . bind ( null , 123 ) ) ;
180180} ) ;
181181
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+
182191it ( "should not fail issue #138 second" , function ( ) {
183192 ( function ( define , global ) { 'use strict' ;
184193 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