Skip to content

test262 : Cannot read property '0' of undefined #42088

@jsjzgy

Description

@jsjzgy

Bug Report

language\statements\for\S12.6.3_A2.1.js
language\statements\for\S12.6.3_A2.2.js
language\statements\for\S12.6.3_A2.js

When using tsc to execute the above three 262 use cases, the following error will be reported.
How can I fix this problem

throw err;
^
TypeError: Cannot read property '0' of undefined
at isReachableFlowNodeWorker (/home/share/ts2panda/script-application-engine/ts2panda/node_modules/typescript/lib/typescript.js:53339:44)
at isReachableFlowNode (/home/share/ts2panda/script-application-engine/ts2panda/node_modules/typescript/lib/typescript.js:53290:26)
at checkSourceElementWorker (/home/share/ts2panda/script-application-engine/ts2panda/node_modules/typescript/lib/typescript.js:66495:106)
at checkSourceElement (/home/share/ts2panda/script-application-engine/ts2panda/node_modules/typescript/lib/typescript.js:66472:17)
at Object.forEach (/home/share/ts2panda/script-application-engine/ts2panda/node_modules/typescript/lib/typescript.js:317:30)
at checkBlock (/home/share/ts2panda/script-application-engine/ts2panda/node_modules/typescript/lib/typescript.js:63707:20)
at checkSourceElementWorker (/home/share/ts2panda/script-application-engine/ts2panda/node_modules/typescript/lib/typescript.js:66590:28)
at checkSourceElement (/home/share/ts2panda/script-application-engine/ts2panda/node_modules/typescript/lib/typescript.js:66472:17)
at checkForStatement (/home/share/ts2panda/script-application-engine/ts2panda/node_modules/typescript/lib/typescript.js:64183:13)
at checkSourceElementWorker (/home/share/ts2panda/script-application-engine/ts2panda/node_modules/typescript/lib/typescript.js:66602:28)

🔎 Search Terms

🕗 Version & Regression Information

  • This is a crash
  • This changed between versions ______ and _______
  • This is the behavior in every version I tried, and I reviewed the FAQ for entries about _________
  • I was unable to test this on prior versions because _______

⏯ Playground Link

Playground link with relevant code

💻 Code

// We can quickly address your report if:
//  - The code sample is short. Nearly all TypeScript bugs can be demonstrated in 20-30 lines of code!
//  - It doesn't use external libraries. These are often issues with the type definitions rather than TypeScript bugs.
//  - The incorrectness of the behavior is readily apparent from reading the sample.
// Reports are slower to investigate if:
//  - We have to pare too much extraneous code.
//  - We have to clone a large repo and validate that the problem isn't elsewhere.
//  - The sample is confusing or doesn't clearly demonstrate what's wrong.

🙁 Actual behavior

🙂 Expected behavior

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFix AvailableA PR has been opened for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions