Skip to content

Stepper: Added Breakpoints#1926

Merged
martin-henz merged 3 commits intomasterfrom
breakpoint
Apr 2, 2026
Merged

Stepper: Added Breakpoints#1926
martin-henz merged 3 commits intomasterfrom
breakpoint

Conversation

@Raaghulk04
Copy link
Copy Markdown
Contributor

@Raaghulk04 Raaghulk04 commented Mar 28, 2026

Co-Authored-by Kin Chong wongkinchong75@gmail.com

Description

This PR is related to source-academy/frontend#3702
Now, debugger statements are no longer removed from the program. We have added support for the DebuggerStatement node type in the js-slang tracer. This allows the Source Academy Stepper to correctly identify, display, and evaluate the debugger statement in the programs.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Code quality improvements

How to test

Upon adding a breakpoint at a certain line,
image
You should be able to see the debugger; statement in the stepper.

Checklist

  • I have tested this code.
    • Tests pass with yarn test
    • js-slang executable is verified to work
    • Did I have to reduce the strength of some tests?
      • If so, why...
  • I have updated the documentation

Co-Authored-by Kin Chong wongkinchong75@gmail.com
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the tracer to support debugger statements by introducing the StepperDebuggerStatement class and removing the previous logic that stripped these statements. Review feedback suggests improving code consistency by adding a space in an import statement and standardizing indentation and semicolon usage in the new file.

Comment thread src/tracer/nodes/Statement/DebuggerStatement.ts Outdated
Comment thread src/tracer/nodes/Statement/DebuggerStatement.ts
@coveralls
Copy link
Copy Markdown

coveralls commented Mar 28, 2026

Pull Request Test Coverage Report for Build 23892138051

Details

  • 1 of 20 (5.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.2%) to 77.091%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/tracer/generator.ts 1 3 33.33%
src/tracer/nodes/Statement/DebuggerStatement.ts 0 17 0.0%
Totals Coverage Status
Change from base Build 23692415163: -0.2%
Covered Lines: 7135
Relevant Lines: 9010

💛 - Coveralls

@Raaghulk04 Raaghulk04 changed the title Added Breakpoints Stepper: Added Breakpoints Mar 28, 2026
Copy link
Copy Markdown
Member

@martin-henz martin-henz 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 to me.
Let's merge to make progress in the frontend.

Let's add test cases in a separate PR.

@martin-henz martin-henz merged commit d86c302 into master Apr 2, 2026
4 of 5 checks passed
@martin-henz martin-henz deleted the breakpoint branch April 2, 2026 08:52
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