Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

refactor(rslint_parser): Try Statement Facade #1770

Merged
merged 2 commits into from
Nov 11, 2021

Conversation

MichaReiser
Copy link
Contributor

@MichaReiser MichaReiser commented Nov 11, 2021

Summary

Changes the structure and naming of the Try and Throw statements

  • Try Statement
    • Split into TryStatement and TryFinallyStatement so that we can correctly model the optionality of the catch/finally clauses.
    • Rename test child to body
    • Rename handler to catch_clause
    • Rename finalizer to finally_clause to align with catch_clause
    • Extract the JsCatchDeclaration from the JsCatchClause to group the optional (e)
    • Extend the integration tests
  • Throw Statement
    • JsThrowStatement
    • Rename the exception child to argument

Based on #1769 and part of #1725

Test Plan

Verified that coverage doesn't change. Added new integration tests for try statement.

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Nov 11, 2021

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 241373e
Status: ✅  Deploy successful!
Preview URL: https://ca1f7508.tools-8rn.pages.dev

View logs

@MichaReiser
Copy link
Contributor Author

TODO: Change base branch after #1769 is merged.

@MichaReiser MichaReiser force-pushed the feature/restructure-simple-statements branch from 216b8e2 to 5110b41 Compare November 11, 2021 14:01
@MichaReiser MichaReiser force-pushed the feature/restructure-try-statement branch from 4143382 to 4af331e Compare November 11, 2021 14:01
Base automatically changed from feature/restructure-simple-statements to main November 11, 2021 14:14
Changes the structure and naming of the Try Stmt:

* Split into `TryStatement` and `TryFinallyStatement` so that we can correctly model the optionality of the catch/finally clauses.
* Rename `test` child to `body`
* Rename `handler` to `catch_clause`
* Rename `finalizer` to `finally_clause` to align with `catch_clause`
* Extract the `JsCatchDeclaration` from the `JsCatchClause` to group the optional `(e)`
* Extend the integration tests for try statement
* Rename `ThrowStmt` to `JsThrowStatement`
* Rename `exception` field to `argument`
@MichaReiser MichaReiser force-pushed the feature/restructure-try-statement branch from 4af331e to 241373e Compare November 11, 2021 14:21
@MichaReiser MichaReiser merged commit 6fa5491 into main Nov 11, 2021
@MichaReiser MichaReiser deleted the feature/restructure-try-statement branch November 11, 2021 14:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants