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: ignore debugger statement #3976

Merged
merged 1 commit into from
Sep 3, 2024
Merged

fix: ignore debugger statement #3976

merged 1 commit into from
Sep 3, 2024

Conversation

shurizzle
Copy link
Contributor

Right now, if I try to run js code with a debugger statement in it, I got the error:
SyntaxError: unexpected token 'debugger', primary expression at line 14, col 645.

In this PR, I’m simply ignoring the debugger statement. I know it’s not a definitive solution, but at least it allows the code to run.

Copy link
Member

@jedel1043 jedel1043 left a comment

Choose a reason for hiding this comment

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

Looks great! And yeah, long term we should add a new API that's the dual of eval and run but that it also allows to stop the execution and inspect the current VM when we reach a debugger statement.

@jedel1043 jedel1043 requested a review from a team September 3, 2024 13:59
@jedel1043 jedel1043 added enhancement New feature or request parser Issues surrounding the parser labels Sep 3, 2024
@jedel1043 jedel1043 added this to the next-release milestone Sep 3, 2024
Copy link

codecov bot commented Sep 3, 2024

Codecov Report

Attention: Patch coverage is 0% with 7 lines in your changes missing coverage. Please review.

Project coverage is 51.85%. Comparing base (6ddc2b4) to head (9c2db28).
Report is 245 commits behind head on main.

Files with missing lines Patch % Lines
core/ast/src/expression/mod.rs 0.00% 3 Missing ⚠️
core/parser/src/parser/expression/primary/mod.rs 0.00% 3 Missing ⚠️
core/engine/src/bytecompiler/expression/mod.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3976      +/-   ##
==========================================
+ Coverage   47.24%   51.85%   +4.60%     
==========================================
  Files         476      468       -8     
  Lines       46892    45300    -1592     
==========================================
+ Hits        22154    23490    +1336     
+ Misses      24738    21810    -2928     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

@jedel1043 jedel1043 added this pull request to the merge queue Sep 3, 2024
Merged via the queue into boa-dev:main with commit 9a553db Sep 3, 2024
14 checks passed
hansl pushed a commit to hansl/boa that referenced this pull request Sep 12, 2024
Co-authored-by: shurizzle <me@shurizzle.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request parser Issues surrounding the parser
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants