infernu icon indicating copy to clipboard operation
infernu copied to clipboard

`catch` etc are not a keyword in the method position

Open spion opened this issue 8 years ago • 1 comments

Try checking the following

function test() {
  return Promise.resolve(1).catch(function(e) {
    return 2;
  });
}

Result

infernu: user error ("test.js" (line 2, column 34):
unexpected reserved word "catch"
expecting letter or digit)

spion avatar Mar 12 '16 22:03 spion

Yes, the problem is the parser lib being used. There's an ES5 branch of infernu that should work (didn't check yet)

On Sun, Mar 13, 2016 at 12:47 AM, Gorgi Kosev [email protected] wrote:

Try checking the following

function test() { return Promise.resolve(1).catch(function(e) { return 2; }); }

Result

infernu: user error ("test.js" (line 2, column 34): unexpected reserved word "catch" expecting letter or digit)

— Reply to this email directly or view it on GitHub https://github.com/sinelaw/infernu/issues/31.

sinelaw avatar Mar 13 '16 08:03 sinelaw