chakra-core/ChakraCore

A question about uninitialized variables

Aperta

#6516 aperta il 5 ott 2020

 (5 commenti) (0 reazioni) (0 assegnatari)JavaScript (1225 fork)batch import
BugSeverity: 3help wanted

Metriche repository

Star
 (9258 stelle)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

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?

Guida contributor