fix(cfg): include export default code in CFG instructions (#7862)

Previously any instructions happening inside of the expression passed to
`export default` were invisible in the CFG.

Example:

```
// Uncommenting this line makes the call to bar() disappear from the
// CFG view of the program:
// export default
bar();
```
This commit is contained in:
Jan Olaf Martin 2024-12-13 20:09:28 -08:00 committed by GitHub
parent eb47d433ff
commit 3659e6d768
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 3 deletions

View file

@ -12,7 +12,7 @@ impl<'a> AstKind<'a> {
| Self::DebuggerStatement(_) | Self::EmptyStatement(_) | Self::ExpressionStatement(_)
| Self::LabeledStatement(_) | Self::ReturnStatement(_) | Self::SwitchStatement(_)
| Self::ThrowStatement(_) | Self::TryStatement(_) | Self::WithStatement(_)
| Self::IfStatement(_) | Self::VariableDeclaration(_))
| Self::IfStatement(_) | Self::VariableDeclaration(_) | Self::ExportDefaultDeclaration(_))
}
#[rustfmt::skip]

View file

@ -33,7 +33,7 @@ bb6: {
}
bb7: {
statement
}
bb8: {
@ -172,7 +172,8 @@ ExpressionStatement" shape = box]
5 [ label = "bb5" shape = box]
6 [ label = "bb6
return" shape = box]
7 [ label = "bb7" shape = box]
7 [ label = "bb7
ExportDefaultDeclaration" shape = box]
8 [ label = "bb8" shape = box]
9 [ label = "bb9
return" shape = box]