Open NWU-NISL opened 3 years ago
The symbol is defined in the second argument, but used in the first. I need to research the scoping rules a bit more, but if the arguments have to be evaluated left to right, this would be a bug.
The other engines are right. I can imagine a couple of possible root causes: a2 isn't being initialized prior to the evaluation of a0 in a way that supports the use-before-declaration check, or the reference to a2 isn't being properly bound to the parameter.
I am going to cautiously add some labels inviting contributions, I am still on the fence whether this should be a beginner issue.
Hm. I wouldn't necessarily call it a beginner issue. It likely has to do with the binding algorithm in the parser, which isn't trivial.
OK, let's keep this one off "good first issue" list for now.
Version
chakra-1_11_22
Test case
Execution steps
Output
Expected behavior
Description
When executing this test case,
a2
is not initialized before the call, other engines (such as v8, spiderMonkey, JavaScriptCore, etc.) threw aReferenceError
, but chakra did not do so. Is this a different implementation of chakra?