Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TryStatement should use handler instead of handlers #1030

Closed
ariya opened this issue Feb 13, 2015 · 3 comments
Closed

TryStatement should use handler instead of handlers #1030

ariya opened this issue Feb 13, 2015 · 3 comments
Assignees
Milestone

Comments

@ariya
Copy link
Contributor

ariya commented Feb 13, 2015

The TryStatement node has changed according to estree/estree#1 from

interface TryStatement <: Statement {
    type: "TryStatement";
    block: BlockStatement;
    handlers: [ CatchClause ];
    guardedHandlers: [];
    finalizer: BlockStatement | null;
}

to

interface TryStatement <: Statement {
    type: "TryStatement";
    block: BlockStatement;
    handler: CatchClause | null;
    finalizer: BlockStatement | null;
}

The differences are:

  • handlers (an array of CatchClause) is changed to handler (a single CatchClause, if any)
  • guardedHandlers is gone

See also https://bugzilla.mozilla.org/show_bug.cgi?id=742612.

(Migrated from https://code.google.com/p/esprima/issues/detail?id=433)

@ariya
Copy link
Contributor Author

ariya commented Feb 13, 2015

Since this a breaking change for Esprima (requiring a major version bump), I will also file an issue for a transition step.

@ariya
Copy link
Contributor Author

ariya commented Feb 16, 2015

I've updated it so that the empty guardedHandlers should be also removed (ref estree/estree#24).

@ariya
Copy link
Contributor Author

ariya commented Oct 31, 2015

From our downstream tests, this is going to break (at least) js2cofee and webpack. I plan to propose a change to those projects before changing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants