get-parameter-names icon indicating copy to clipboard operation
get-parameter-names copied to clipboard

fix bug when function like as 'f(id = 1)'

Open Rwing opened this issue 8 years ago • 3 comments

function f(id = 1){
    id = 'a,b';
}

getParameterNames(f); // => [ 'id', 'b\';' ]

Rwing avatar Dec 20 '16 09:12 Rwing

@goatslacker Hi, please help me to review it~

Rwing avatar Jan 09 '17 08:01 Rwing

Can you write a unit test to demonstrate this failure? Bonus points if you can also get this function to parse: ( a = 1 , b=2, c = (err, data)=>{}) => {}

CaptEmulation avatar Feb 23 '17 15:02 CaptEmulation

Just FYI that CaptEmulation/get-parameter-names handles this case. npm i @captemulation/get-parameter-names

CaptEmulation avatar Apr 27 '17 14:04 CaptEmulation