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

Refactor misc. statement tests for parsers #2117

Merged
merged 2 commits into from
Apr 2, 2019

Conversation

jugglinmike
Copy link
Contributor

This is in service of gh-1356.

The tests for the parsing of various statement were expressed using
eval. This made the tests more complex than necessary and also prevented
the tests from providing value to ECMAScript parsers.

Remove the use of eval and instead express the expectations with literal
source text. Rename the files to make each test's purpose more clear.
Previously, some tests verified two independent concerns simultaneously:
syntactic validity and runtime completion value. The former is relevant
for ECMAScript runtimes and parsers alike, but the latter is only
observable by runtimes.

Express expectations regarding syntactic validity using literal program
code so they can be used by parsers. Maintain the original tests which
rely on eval in order to preserve coverage for statement completion
values.
@jugglinmike
Copy link
Contributor Author

@isiahmeadows I didn't touch a handful of tests from your report in gh-1356:

  • test/language/statements/do-while/S12.6.1_A5.js
  • test/language/statements/do-while/S12.6.1_A8.js
  • test/language/statements/for-in/S12.6.4_A3.1.js
  • test/language/statements/for-in/S12.6.4_A3.js
  • test/language/statements/for-in/S12.6.4_A4.1.js
  • test/language/statements/for-in/S12.6.4_A4.js
  • test/language/statements/while/S12.6.2_A8.js

These tests concern statement completion values, so their use of eval is unavoidable. I was tempted to create corresponding syntax tests, but since they don't describe particularly interesting edge-cases, I decided to skip that.

@dead-claudia
Copy link

dead-claudia commented Apr 1, 2019 via email

break
FOR1;
} while(0);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JS can be so beautiful!

description: Using eval
---*/

var supreme, count;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The supreme count of JS.

@leobalter leobalter merged commit cd1df5f into tc39:master Apr 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants