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

Make missing break labels not panic #1859

Closed
wants to merge 1 commit into from

Conversation

addisoncrump
Copy link
Contributor

This PR changes the following:

  • Causes missing break labels to no longer panic
  • Updates relevant test from should_panic to matches Err variant

@codecov
Copy link

codecov bot commented Feb 23, 2022

Codecov Report

Merging #1859 (9a274d9) into main (8c92a8f) will decrease coverage by 0.00%.
The diff coverage is 50.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1859      +/-   ##
==========================================
- Coverage   56.29%   56.29%   -0.01%     
==========================================
  Files         201      201              
  Lines       17936    17937       +1     
==========================================
  Hits        10097    10097              
- Misses       7839     7840       +1     
Impacted Files Coverage Δ
boa_engine/src/bytecompiler.rs 57.99% <50.00%> (-0.05%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8c92a8f...9a274d9. Read the comment docs.

Copy link
Member

@Razican Razican left a comment

Choose a reason for hiding this comment

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

Looks good! Thanks! I would just recommend a small change in the test, for readability.

break nonexistent;
}
"#;

let _ = &exec(src);
assert!(matches!(Context::default().eval(src.as_bytes()), Err(_)));
Copy link
Member

Choose a reason for hiding this comment

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

Could this be changed to assert!(Context::default().eval(&src).is_err())?

It seems simpler :)

@raskad raskad added bug Something isn't working Internal Category for changelog labels Feb 24, 2022
@raskad raskad added this to the v0.14.0 milestone Feb 24, 2022
@HalidOdat
Copy link
Member

This has been fixed by #1874 , so closing this.

@HalidOdat HalidOdat closed this Feb 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Internal Category for changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants