qooxdoo / qooxdoo

qooxdoo - Universal JavaScript Framework
http://qooxdoo.org
Other
764 stars 259 forks source link

`CatchClause` visitor: permit catch block without thrown value trap #10653

Closed WillsterJohnsonAtZenesis closed 3 months ago

WillsterJohnsonAtZenesis commented 3 months ago

The object at path.node.param is null for the below code, as it intends to refer to the (err) part of some catch (err) {} clause. The call t.addDeclaration(path.node.param.name) will fail with TypeError: Cannot read properties of null (reading 'name'), this commit resolve this issue.

//...

try {
  // ...
} catch { // note: not using `catch (err) {`
  // ...
}