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

Fails with nested fat arrow functions

Open SomeKittens opened this issue 8 years ago • 1 comments

Input:

a => {
  return new Promise((resolve, reject) => {
    setTimeout(() => resolve(a * 2), 500);
  });
}

Expected output:

['a']

Output:

[ '(resolve', 'reject' ]

Other things I tried that broke:

a => {
  setTimeout(() => resolve(a * 2), 500);
}

Output: [ '(' ]

a => {
  return new Promise(resolve => {
    setTimeout(() => resolve(a * 2), 500);
  });
}

Output: [ 'resolve', 'setTimeout((' ]

a => {
  return new Promise(resolve => {
  });
}

Output: [ 'resolve', '}' ]

$ node -v
v5.9.1

SomeKittens avatar Mar 31 '16 23:03 SomeKittens

Should be fixed by PR #7

CaptEmulation avatar Jul 12 '16 15:07 CaptEmulation