hermes
hermes copied to clipboard
An issue about Immediately Invoked Function Expression
Description
As the following test case showed, there is a variable called v1
with the same name as the function. In this case, Hermes treats v1
as the variable whose value is 20. But other engines such as v8, spidermonkey, javascriptcore and chakra think that v1
is the function. Is this a normal behavior of the Hermes engine?
Testcase
(function v1(){
v1 = 20;
print(v1 !== 20);
print(typeof v1);
}());
Version
Command
./build/bin/hermes -w testcase.js
Output
false
number
Expected Output
true
function
contributor:@QuXing9
Thank you for reporting this! It is a known issue and we are working on it.