Skip to content

Inline-destructuring of method arguments leads to subtle error  #368

@pichfl

Description

@pichfl

serialize({ transition }) {

This line fails if the destructured object is undefined (which can happen when a custom error is thrown).

It gets translated to

    serialize(_ref) {
      let {
        transition
      } = _ref;

which throws

Uncaught TypeError: _ref is undefined

I'm not entirely sure what's going on here. I will post a PR with a failing test.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions