chakra-core/ChakraCore

Hoisting a var declaration past a lexical declaration of the same name should be a SyntaxError

Open

#357 geöffnet am 19. Feb. 2016

Auf GitHub ansehen
 (4 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)JavaScript (1.374 Forks)batch import
BugSeverity: 2help wanted

Repository-Metriken

Stars
 (9.000 Stars)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

Second bullet point of block static semantics and similarly for function body static semantics.

E.g.

let x;
{
    var x; // error (already works)
    let y;
    var y; // should be an error (doesn't work)
    {
        var y; // should also be an error (doesn't work)
    }
}

This applies for var declarations hoisting past all lexical declarations, i.e. let, const, class, function (and generators and async functions).

Contributor Guide