Skip to content

Variable from a top-level closure gets overridden in a nested level function which creates a new variable with the same name #11

@harpreetkhalsagtbit

Description

@harpreetkhalsagtbit

I have a following case(I can understand its a very rare case)

(function() {
    return (function(i) {
        function() {
            function() {
                if() {
                    if(!i){
                        // this is replacing the value of i
                        // from top closures
                        var i = 'somehing';
                        // this variable should not be i

                        //call i from top closures
                        i() // error not a function
                    }
                } else {

                }
            }
        }
    })
})()()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions