Skip to content

Rhino 1.8.0 Debugger does not show block‑scoped (let) variables in scope when paused inside nested block (shadowing declaration) #2092

@pratik2294

Description

@pratik2294

Summary

When pausing at a let declaration that shadows an outer let inside a nested block, the Rhino JavaScript Debugger does not display any of the block‑scoped variables that should be in scope. Additionally, the Watch window does not evaluate them. This makes it impossible to inspect variables like b (which should definitely be in scope) and x (which, at that specific pause location, should at least be reported as “uninitialized (TDZ)” or cause a ReferenceError—not disappear).

Screenshot of Rhino JS Debugger

Image

Minimal script to reproduce issue.

let a = 'top level';
let i = 2;
while (--i > 0) {
    let b = 'inside while loop';
    let x = 1;
    if (b === 'inside while loop') {
        let x = 2; // <-- set breakpoint here (line 7)
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions