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

Fix switch default execution #2907

Merged
merged 3 commits into from
May 7, 2023
Merged

Fix switch default execution #2907

merged 3 commits into from
May 7, 2023

Conversation

HalidOdat
Copy link
Member

@HalidOdat HalidOdat commented May 5, 2023

Fixes switch default case execution, when a default case has regular switch cases below it (as in this test262 test ) we execute the default case body at the end, we should execute the cases in order.

EDIT:

Fixes/closes #2405

@HalidOdat HalidOdat added bug Something isn't working execution Issues or PRs related to code execution labels May 5, 2023
@HalidOdat HalidOdat requested a review from a team May 5, 2023 23:33
@github-actions
Copy link

github-actions bot commented May 5, 2023

Test262 conformance changes

Test result main count PR count difference
Total 94,601 94,601 0
Passed 73,331 73,341 +10
Ignored 17,505 17,505 0
Failed 3,765 3,755 -10
Panics 0 0 0
Conformance 77.52% 77.53% +0.01%
Fixed tests (10):
test/language/statements/switch/scope-lex-close-dflt.js [strict mode] (previously Failed)
test/language/statements/switch/scope-lex-close-dflt.js (previously Failed)
test/language/statements/switch/S12.11_A1_T3.js [strict mode] (previously Failed)
test/language/statements/switch/S12.11_A1_T3.js (previously Failed)
test/language/statements/switch/S12.11_A1_T1.js [strict mode] (previously Failed)
test/language/statements/switch/S12.11_A1_T1.js (previously Failed)
test/language/statements/switch/S12.11_A1_T4.js [strict mode] (previously Failed)
test/language/statements/switch/S12.11_A1_T4.js (previously Failed)
test/language/statements/switch/S12.11_A1_T2.js [strict mode] (previously Failed)
test/language/statements/switch/S12.11_A1_T2.js (previously Failed)

@HalidOdat HalidOdat force-pushed the fix/switch-default-case-order branch from f425a18 to 5d63cf4 Compare May 6, 2023 00:22
Copy link
Member

@raskad raskad left a comment

Choose a reason for hiding this comment

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

Nice work! Just got a typo :)

boa_engine/src/bytecompiler/mod.rs Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented May 6, 2023

Codecov Report

Merging #2907 (fa95d51) into main (990e4df) will decrease coverage by 0.05%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #2907      +/-   ##
==========================================
- Coverage   51.88%   51.84%   -0.05%     
==========================================
  Files         431      431              
  Lines       43230    43313      +83     
==========================================
+ Hits        22429    22454      +25     
- Misses      20801    20859      +58     
Impacted Files Coverage Δ
boa_engine/src/bytecompiler/mod.rs 63.85% <ø> (ø)
boa_ast/src/statement/switch.rs 100.00% <100.00%> (ø)
boa_engine/src/bytecompiler/statement/switch.rs 100.00% <100.00%> (ø)
boa_engine/src/vm/opcode/mod.rs 45.45% <100.00%> (ø)
boa_parser/src/parser/statement/switch/mod.rs 75.00% <100.00%> (ø)

... and 5 files with indirect coverage changes

Copy link
Member

@nekevss nekevss left a comment

Choose a reason for hiding this comment

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

Looks pretty good to me 😄 Just one doc nitpick.

boa_ast/src/statement/switch.rs Outdated Show resolved Hide resolved
@HalidOdat HalidOdat requested a review from nekevss May 7, 2023 14:55
@jedel1043 jedel1043 enabled auto-merge May 7, 2023 17:28
Copy link
Member

@nekevss nekevss left a comment

Choose a reason for hiding this comment

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

LGTM 😄 Nice work!

@jedel1043 jedel1043 added this pull request to the merge queue May 7, 2023
Merged via the queue into main with commit 908015f May 7, 2023
@raskad raskad deleted the fix/switch-default-case-order branch May 7, 2023 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working execution Issues or PRs related to code execution
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Default cases on switch statements not cascading to below cases
4 participants