Bug 188784

Summary: Wrong Reference Error Output
Product: WebKit Reporter: sunlili
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: fpizlo, ysuzuki
Priority: P2    
Version: WebKit Local Build   
Hardware: Unspecified   
OS: Unspecified   

Description sunlili 2018-08-21 04:50:01 PDT
Executing following code :
----------------------------------------------------------
let testCases = [ function(){return 1;}, function(){return 2} ];
let passed = true;
const isFloatTest = true;
function makeArray(size = 10){
}
function makeSource(size = 10) {
}

for(let testCase of testCases) {
  let results = [];
  let testInfo = testCase();
  let src;
  if(!testInfo.makeSource) {
      src = makeSource(testInfo.end - testInfo.start);
  }
  function run(gen) {
    if(testInfo.makeSource) {
      src = testInfo.makeSource();
    }
  }
  run(makeArray);
}
if(passed) {
  print("PASSED");
} else {
  print("FAILED");
}
print("BT_FLAG");
-------------------------------------------------------

The output(ChakraCore, V8, SpiderMonkey) should be : 
PASSED
BT_FLAG

However, JavaScriptCore throws a Reference Error:
Exception: ReferenceError: Can't find variable: testInfo

BT_GROUP
2018/8/21
Comment 1 Yusuke Suzuki 2018-08-31 04:24:49 PDT

*** This bug has been marked as a duplicate of bug 187945 ***