Skip to content

let scope is not well supported  #21370

@tiancaiamao

Description

@tiancaiamao

I'm new to node and javascript, I expect this code should work:

function test() {
    let TMP = false;
    (function() {
        let TMP = TMP || true;
    })();
}
test()

but when I run it, I get this error:

ReferenceError: TMP is not defined

Metadata

Metadata

Assignees

No one assigned

    Labels

    invalidIssues and PRs that are invalid.questionIssues that look for answers.wrong repoIssues that should be opened in another repository.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions