Skip to content

Transition to TryStatement single handler #1031

@ariya

Description

@ariya

To facilitate the transition of TryStatement from the old handlers to the new handler (see #1030), Esprima should produce both properties. Once all the major downstream tools have been ported to use the handler only, handlers can be safely removed in the next major version.

In the current master branch:

> require('./esprima').parse('try{}catch(e){}')
{ type: 'Program',
  body: 
   [ { type: 'TryStatement',
       block: [Object],
       guardedHandlers: [],
       handlers: [Object],
       finalizer: null } ] }

Once this transition step is implemented, it will look like:

> require('./esprima').parse('try{}catch(e){}')
{ type: 'Program',
  body: 
   [ { type: 'TryStatement',
       block: [Object],
       guardedHandlers: [],
       handlers: [Object],
       handler: [Object],
       finalizer: null } ] }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions