File tree Expand file tree Collapse file tree
test/cases/parsing/renaming Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -597,7 +597,7 @@ Parser.prototype.walkExpression = function walkExpression(expression) {
597597 } ) , function ( ) {
598598 args . forEach ( function ( arg , idx ) {
599599 if ( ! arg ) return ;
600- if ( params [ idx ] . type !== "Identifier" ) return ;
600+ if ( ! params [ idx ] || params [ idx ] . type !== "Identifier" ) return ;
601601 this . scope . renames [ "$" + params [ idx ] . name ] = arg ;
602602 } , this ) ;
603603 if ( functionExpression . body . type === "BlockStatement" )
Original file line number Diff line number Diff line change @@ -55,6 +55,18 @@ it("should be able to rename stuff by IIFE call", function() {
5555 require ) ;
5656} ) ;
5757
58+ it ( "should accept less parameters in a IIFE call" , function ( ) {
59+ ( function ( r , require ) {
60+ r ( "./file" ) . should . be . eql ( "ok" ) ;
61+ ( typeof require ) . should . be . eql ( "undefined" ) ;
62+ } ( require ) ) ;
63+ } ) ;
64+
65+ it ( "should accept more parameters in a IIFE call" , function ( ) {
66+ ( function ( ) {
67+ } ( require ) ) ;
68+ } ) ;
69+
5870it ( "should be able to rename stuff by IIFE call" , function ( ) {
5971 ( function ( _exports , _module , _define , _require ) {
6072 _define ( function ( R , E , M ) {
You can’t perform that action at this time.
0 commit comments