chakra-core/ChakraCore

A question about uninitialized variables

Open

#6.516 geöffnet am 5. Okt. 2020

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

Repository-Metriken

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

Beschreibung

Version

chakra-1_11_22

Test case
var h = function f(a0 = function () {
  a2;
}(), a2) {
};
h();
Execution steps
./ChakraCore/out/Debug/ch testcase.js
Output
Expected behavior
ReferenceError: can't access lexical declaration `a2' before initialization
Description

When executing this test case, a2 is not initialized before the call, other engines (such as v8, spiderMonkey, JavaScriptCore, etc.) threw a ReferenceError, but chakra did not do so. Is this a different implementation of chakra?

Contributor Guide