Skip to content
This repository was archived by the owner on Sep 10, 2025. It is now read-only.

Conversation

@skx
Copy link
Owner

@skx skx commented Dec 23, 2019

Previously the parser would get into an infinite loop when
given an incomplete statement, such as:

if ( true ) {
  let x = 1;

The parser would step forwards one character looking for the
mandatory closing } which didn't exist.

This pull-request adds sanity-checks to the if-handler, the
let, const, and return handlers.

I've added EOF/ILLEGAL token-prefix functions too, to get back
into a good state if we're broken.

Previously the parser would get into an infinite loop when
given an incomplete statement, such as:

    if ( true ) {
      let x = 1;

The parser would step forwards one character looking for the
mandatory closing `}` which didn't exist.

This pull-request adds sanity-checks to the `if`-handler, the
`let`, `const`, and `return` handlers.

I've added EOF/ILLEGAL token-prefix functions too, to get back
into a good state if we're broken.
@skx skx merged commit 967f1d3 into master Dec 23, 2019
@skx skx deleted the parser/fixes branch December 23, 2019 17:37
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