Unverified Commit e07cc5cc authored by Luke Sandberg's avatar Luke Sandberg Committed by GitHub

[turbopack] Refactor the analyzer to fix a few issues and prepare to split it up (#86265)

# Refactor Analyzer State Management in Turbopack

This PR refactors the state management in the Turbopack ECMAScript analyzer to improve code organization and maintainability. The changes include:

- Introduced a `LexicalContext` enum to track the current execution context (function, module, control flow) and remove most dependencies on AstPath
- Moved early return stack and variable declaration kind into the `AnalyzerState` struct
- Added helper methods for entering and exiting different block types
- Improved handling of nested blocks and control flow
- Fixed unreachable code detection in anonymous blocks which allows us to drop some redundant unreachable effects from loops
 - Handle more cases for nested `var` declarations

These refactorings are all either fixing minor issues or regularizing state management.  This is preparation for splitting this AST traversal into two pieces.
parent 5b62dd85
...@@ -113,7 +113,7 @@ impl<'a> ApplyVisitors<'a, '_> { ...@@ -113,7 +113,7 @@ impl<'a> ApplyVisitors<'a, '_> {
} }
return; return;
} else { } else {
// `current_visitors` has the invariant that is must not be empty. // `current_visitors` has the invariant that it must not be empty.
// When it becomes empty, we must early exit // When it becomes empty, we must early exit
current_visitors = &visitors[nested_visitors_start..]; current_visitors = &visitors[nested_visitors_start..];
if current_visitors.is_empty() { if current_visitors.is_empty() {
......
...@@ -2843,7 +2843,7 @@ b#494 = di() ...@@ -2843,7 +2843,7 @@ b#494 = di()
b#5 = arguments[1] b#5 = arguments[1]
b#50 = (a["render"] | (a["displayName"] || null) | a["_payload"]) b#50 = (a["render"] | undefined | (a["displayName"] || null) | a["_payload"])
b#501 = di() b#501 = di()
...@@ -3230,7 +3230,7 @@ b#979 = arguments[1] ...@@ -3230,7 +3230,7 @@ b#979 = arguments[1]
b#986 = arguments[1] b#986 = arguments[1]
b#990 = a["stateNode"] b#990 = (a["stateNode"] | undefined)
b#992 = Zg(a, 1) b#992 = Zg(a, 1)
...@@ -3454,6 +3454,7 @@ c#361 = Bg(5, null, null, 0) ...@@ -3454,6 +3454,7 @@ c#361 = Bg(5, null, null, 0)
c#362 = ( c#362 = (
| a["type"] | a["type"]
| undefined
| ((null !== qg) ? {"id": rg, "overflow": sg} : null) | ((null !== qg) ? {"id": rg, "overflow": sg} : null)
| Bg(18, null, null, 0) | Bg(18, null, null, 0)
) )
...@@ -3687,7 +3688,7 @@ c#64 = b["getValue"]() ...@@ -3687,7 +3688,7 @@ c#64 = b["getValue"]()
c#644 = arguments[2] c#644 = arguments[2]
c#645 = (null | b | a["tail"] | c["sibling"]) c#645 = (null | undefined | b | a["tail"] | c["sibling"])
c#646 = (0 | ???*0*) c#646 = (0 | ???*0*)
- *0* unsupported assign operation - *0* unsupported assign operation
...@@ -4228,7 +4229,7 @@ d#621 = (b["pendingProps"] | M["current"] | ???*0* | ???*1*) ...@@ -4228,7 +4229,7 @@ d#621 = (b["pendingProps"] | M["current"] | ???*0* | ???*1*)
- *1* unsupported assign operation - *1* unsupported assign operation
⚠️ This value might have side effects ⚠️ This value might have side effects
d#631 = (b["type"]["_context"] | b["memoizedState"] | (0 !== ???*0*)) d#631 = (b["type"]["_context"] | undefined | b["memoizedState"] | (0 !== ???*0*))
- *0* unsupported expression - *0* unsupported expression
⚠️ This value might have side effects ⚠️ This value might have side effects
...@@ -4241,7 +4242,7 @@ d#64 = ( ...@@ -4241,7 +4242,7 @@ d#64 = (
d#644 = arguments[3] d#644 = arguments[3]
d#645 = (null | c) d#645 = (null | undefined | c)
d#646 = (0 | ???*0*) d#646 = (0 | ???*0*)
- *0* unsupported assign operation - *0* unsupported assign operation
...@@ -4287,13 +4288,13 @@ d#703 = a["tag"] ...@@ -4287,13 +4288,13 @@ d#703 = a["tag"]
d#704 = a["tag"] d#704 = a["tag"]
d#706 = (X | c["updateQueue"] | d["lastEffect"] | d["next"] | c["stateNode"] | U) d#706 = (X | undefined | c["updateQueue"] | d["lastEffect"] | d["next"] | c["stateNode"] | U)
d#71 = b["type"] d#71 = b["type"]
d#715 = ck["bind"](null, a, b) d#715 = ck["bind"](null, a, b)
d#716 = (0 | ???*0*) d#716 = (0 | undefined | ???*0*)
- *0* updated with update expression - *0* updated with update expression
⚠️ This value might have side effects ⚠️ This value might have side effects
...@@ -4357,10 +4358,11 @@ d#910 = (b["stateNode"] | undefined) ...@@ -4357,10 +4358,11 @@ d#910 = (b["stateNode"] | undefined)
d#915 = a["pingCache"] d#915 = a["pingCache"]
d#918 = a["stateNode"] d#918 = (a["stateNode"] | undefined)
d#919 = ( d#919 = (
| b["type"] | b["type"]
| undefined
| b["elementType"] | b["elementType"]
| e(d["_payload"]) | e(d["_payload"])
| b["pendingProps"] | b["pendingProps"]
...@@ -4491,7 +4493,7 @@ e#266 = (c["textContent"]["length"] | undefined | d | Ke(c, f)) ...@@ -4491,7 +4493,7 @@ e#266 = (c["textContent"]["length"] | undefined | d | Ke(c, f))
e#275 = (d["event"] | undefined) e#275 = (d["event"] | undefined)
e#285 = (ed | gd | fd | undefined | !(0)) e#285 = (ed | undefined | gd | fd | !(0))
e#286 = arguments[4] e#286 = arguments[4]
...@@ -4619,14 +4621,15 @@ e#620 = arguments[4] ...@@ -4619,14 +4621,15 @@ e#620 = arguments[4]
e#621 = (d["revealOrder"] | null | c | b["child"] | c["sibling"] | a) e#621 = (d["revealOrder"] | null | c | b["child"] | c["sibling"] | a)
e#631 = (b["memoizedProps"]["value"] | b["memoizedState"]) e#631 = (b["memoizedProps"]["value"] | undefined | b["memoizedState"])
e#639 = (a["memoizedProps"] | Ya(a, e) | A({}, e, {"value": undefined}) | gb(a, e)) e#639 = (a["memoizedProps"] | Ya(a, e) | A({}, e, {"value": undefined}) | gb(a, e))
e#646 = (a["child"] | e["sibling"]) e#646 = (a["child"] | undefined | e["sibling"])
e#647 = ( e#647 = (
| Hh(Gh["current"]) | Hh(Gh["current"])
| undefined
| 0 | 0
| ???*0* | ???*0*
| null | null
...@@ -4644,7 +4647,7 @@ e#673 = (d["anchorOffset"] | undefined) ...@@ -4644,7 +4647,7 @@ e#673 = (d["anchorOffset"] | undefined)
e#687 = (d["next"] | undefined | e["next"]) e#687 = (d["next"] | undefined | e["next"])
e#706 = (Yj | d["next"] | e["next"]) e#706 = (Yj | undefined | d["next"] | e["next"])
e#716 = (c[d] | undefined) e#716 = (c[d] | undefined)
...@@ -4687,10 +4690,11 @@ e#883 = (K | undefined) ...@@ -4687,10 +4690,11 @@ e#883 = (K | undefined)
e#9 = arguments[4] e#9 = arguments[4]
e#918 = a["memoizedState"] e#918 = (a["memoizedState"] | undefined)
e#919 = ( e#919 = (
| Yf(b, H["current"]) | Yf(b, H["current"])
| undefined
| Xh(null, b, d, a, e, c) | Xh(null, b, d, a, e, c)
| d["_init"] | d["_init"]
| $k(d) | $k(d)
...@@ -4776,7 +4780,7 @@ f#169 = (???*0* | undefined) ...@@ -4776,7 +4780,7 @@ f#169 = (???*0* | undefined)
f#175 = arguments[5] f#175 = arguments[5]
f#176 = e["pointerId"] f#176 = (e["pointerId"] | undefined)
f#193 = cd["transition"] f#193 = cd["transition"]
...@@ -4959,6 +4963,7 @@ f#9 = arguments[5] ...@@ -4959,6 +4963,7 @@ f#9 = arguments[5]
f#919 = ( f#919 = (
| bi() | bi()
| undefined
| !(0) | !(0)
| !(1) | !(1)
| b["memoizedState"] | b["memoizedState"]
......
...@@ -4060,7 +4060,16 @@ a#5 = (???*0* | 0 | ???*1*) ...@@ -4060,7 +4060,16 @@ a#5 = (???*0* | 0 | ???*1*)
- *1* updated with update expression - *1* updated with update expression
⚠️ This value might have side effects ⚠️ This value might have side effects
a#50 = (???*0* | ???*1* | null["displayName"] | null["name"] | "" | (???*3* ? ???*5* : "ForwardRef")) a#50 = (
| ???*0*
| ???*1*
| undefined["displayName"]
| null["displayName"]
| undefined["name"]
| null["name"]
| ""
| (???*3* ? ???*5* : "ForwardRef")
)
- *0* arguments[0] - *0* arguments[0]
⚠️ function calls are not analyzed yet ⚠️ function calls are not analyzed yet
- *1* ???*2*["displayName"] - *1* ???*2*["displayName"]
...@@ -7563,6 +7572,7 @@ b#50 = ( ...@@ -7563,6 +7572,7 @@ b#50 = (
| ???*0* | ???*0*
| ""["render"] | ""["render"]
| (???*2* ? ???*4* : "ForwardRef")["render"] | (???*2* ? ???*4* : "ForwardRef")["render"]
| undefined
| ""["displayName"] | ""["displayName"]
| (???*6* ? ???*8* : "ForwardRef")["displayName"] | (???*6* ? ???*8* : "ForwardRef")["displayName"]
| null | null
...@@ -9282,7 +9292,7 @@ b#986 = ???*0* ...@@ -9282,7 +9292,7 @@ b#986 = ???*0*
- *0* arguments[1] - *0* arguments[1]
⚠️ function calls are not analyzed yet ⚠️ function calls are not analyzed yet
b#990 = ???*0* b#990 = (???*0* | undefined)
- *0* ???*1*["stateNode"] - *0* ???*1*["stateNode"]
⚠️ unknown object ⚠️ unknown object
- *1* arguments[0] - *1* arguments[0]
...@@ -11486,7 +11496,7 @@ c#644 = ???*0* ...@@ -11486,7 +11496,7 @@ c#644 = ???*0*
- *0* arguments[2] - *0* arguments[2]
⚠️ function calls are not analyzed yet ⚠️ function calls are not analyzed yet
c#645 = (null | ???*0* | ???*1*) c#645 = (null | undefined | ???*0* | ???*1*)
- *0* arguments[1] - *0* arguments[1]
⚠️ function calls are not analyzed yet ⚠️ function calls are not analyzed yet
- *1* ???*2*["tail"] - *1* ???*2*["tail"]
...@@ -11884,7 +11894,7 @@ c#917 = (0 | ???*0*) ...@@ -11884,7 +11894,7 @@ c#917 = (0 | ???*0*)
- *2* arguments[0] - *2* arguments[0]
⚠️ function calls are not analyzed yet ⚠️ function calls are not analyzed yet
c#918 = (0 | ???*0*) c#918 = (0 | ???*0* | undefined["retryLane"])
- *0* ???*1*["retryLane"] - *0* ???*1*["retryLane"]
⚠️ unknown object ⚠️ unknown object
- *1* ???*2*["memoizedState"] - *1* ???*2*["memoizedState"]
...@@ -12051,6 +12061,7 @@ c#990 = ( ...@@ -12051,6 +12061,7 @@ c#990 = (
| 536870912 | 536870912
| 1073741824 | 1073741824
| ???*1* | ???*1*
| undefined["pendingLanes"]
| undefined | undefined
) )
- *0* unsupported expression - *0* unsupported expression
...@@ -13878,7 +13889,7 @@ d#621 = (???*0* | 0 | ???*2* | ???*3* | ???*4*) ...@@ -13878,7 +13889,7 @@ d#621 = (???*0* | 0 | ???*2* | ???*3* | ???*4*)
- *4* unsupported assign operation - *4* unsupported assign operation
⚠️ This value might have side effects ⚠️ This value might have side effects
d#631 = (???*0* | (0 !== ???*3*)) d#631 = (???*0* | undefined | (0 !== ???*3*))
- *0* ???*1*["_context"] - *0* ???*1*["_context"]
⚠️ unknown object ⚠️ unknown object
- *1* ???*2*["type"] - *1* ???*2*["type"]
...@@ -13951,7 +13962,7 @@ d#644 = ???*0* ...@@ -13951,7 +13962,7 @@ d#644 = ???*0*
- *0* arguments[3] - *0* arguments[3]
⚠️ function calls are not analyzed yet ⚠️ function calls are not analyzed yet
d#645 = (null | ???*0* | ???*1*) d#645 = (null | undefined | ???*0* | ???*1*)
- *0* arguments[1] - *0* arguments[1]
⚠️ function calls are not analyzed yet ⚠️ function calls are not analyzed yet
- *1* ???*2*["tail"] - *1* ???*2*["tail"]
...@@ -14057,7 +14068,7 @@ d#715 = (...) => undefined["bind"](null, ???*0*, ???*1*) ...@@ -14057,7 +14068,7 @@ d#715 = (...) => undefined["bind"](null, ???*0*, ???*1*)
- *1* arguments[0] - *1* arguments[0]
⚠️ function calls are not analyzed yet ⚠️ function calls are not analyzed yet
d#716 = (0 | ???*0*) d#716 = (0 | undefined | ???*0*)
- *0* updated with update expression - *0* updated with update expression
⚠️ This value might have side effects ⚠️ This value might have side effects
...@@ -14407,7 +14418,7 @@ d#915 = ???*0* ...@@ -14407,7 +14418,7 @@ d#915 = ???*0*
- *1* arguments[0] - *1* arguments[0]
⚠️ function calls are not analyzed yet ⚠️ function calls are not analyzed yet
d#918 = ???*0* d#918 = (???*0* | undefined)
- *0* ???*1*["stateNode"] - *0* ???*1*["stateNode"]
⚠️ unknown object ⚠️ unknown object
- *1* arguments[0] - *1* arguments[0]
...@@ -16298,7 +16309,7 @@ e#621 = (???*0* | 0["revealOrder"] | ???*3* | null | ???*5* | ???*6* | null["sib ...@@ -16298,7 +16309,7 @@ e#621 = (???*0* | 0["revealOrder"] | ???*3* | null | ???*5* | ???*6* | null["sib
- *6* e - *6* e
⚠️ circular variable reference ⚠️ circular variable reference
e#631 = ???*0* e#631 = (???*0* | undefined)
- *0* ???*1*["value"] - *0* ???*1*["value"]
⚠️ unknown object ⚠️ unknown object
- *1* ???*2*["memoizedProps"] - *1* ???*2*["memoizedProps"]
...@@ -16343,7 +16354,7 @@ e#639 = (???*0* | ???*2*) ...@@ -16343,7 +16354,7 @@ e#639 = (???*0* | ???*2*)
- *12* arguments[0] - *12* arguments[0]
⚠️ function calls are not analyzed yet ⚠️ function calls are not analyzed yet
e#646 = ???*0* e#646 = (???*0* | undefined)
- *0* ???*1*["child"] - *0* ???*1*["child"]
⚠️ unknown object ⚠️ unknown object
- *1* arguments[0] - *1* arguments[0]
...@@ -16577,7 +16588,7 @@ e#9 = ???*0* ...@@ -16577,7 +16588,7 @@ e#9 = ???*0*
- *0* arguments[4] - *0* arguments[4]
⚠️ function calls are not analyzed yet ⚠️ function calls are not analyzed yet
e#918 = ???*0* e#918 = (???*0* | undefined)
- *0* ???*1*["memoizedState"] - *0* ???*1*["memoizedState"]
⚠️ unknown object ⚠️ unknown object
- *1* arguments[0] - *1* arguments[0]
...@@ -16891,7 +16902,7 @@ f#175 = ???*0* ...@@ -16891,7 +16902,7 @@ f#175 = ???*0*
- *0* arguments[5] - *0* arguments[5]
⚠️ function calls are not analyzed yet ⚠️ function calls are not analyzed yet
f#176 = ???*0* f#176 = (???*0* | undefined)
- *0* ???*1*["pointerId"] - *0* ???*1*["pointerId"]
⚠️ unknown object ⚠️ unknown object
- *1* arguments[4] - *1* arguments[4]
......
[
Member {
obj: Unknown {
original_value: None,
reason: "unsupported expression",
has_side_effects: true,
},
prop: Constant(
Str(
Atom(
"name",
),
),
),
ast_path: [
Program(
Script,
),
Script(
Body(
0,
),
),
Stmt(
Decl,
),
Decl(
Class,
),
ClassDecl(
Class,
),
Class(
Body(
0,
),
),
ClassMember(
ClassProp,
),
ClassProp(
Value,
),
Expr(
Member,
),
],
span: 39..48,
},
FreeVar {
var: "this",
ast_path: [
Program(
Script,
),
Script(
Body(
1,
),
),
Stmt(
Decl,
),
Decl(
Var,
),
VarDecl(
Decls(
0,
),
),
VarDeclarator(
Init,
),
Expr(
This,
),
],
span: 243..247,
},
]
X (const after eval) = ???*0*
- *0* unsupported expression
⚠️ This value might have side effects
bound_this_ctor = ???*0*
- *0* unsupported expression
⚠️ This value might have side effects
bound_this_static (const after eval) = ???*0*
- *0* unsupported expression
⚠️ This value might have side effects
free_this_root (const after eval) = ???*0*
- *0* unsupported expression
⚠️ This value might have side effects
[
(
"X",
Unknown {
original_value: None,
reason: "unsupported expression",
has_side_effects: true,
},
),
(
"bound_this_ctor",
Unknown {
original_value: None,
reason: "unsupported expression",
has_side_effects: true,
},
),
(
"bound_this_static",
Unknown {
original_value: None,
reason: "unsupported expression",
has_side_effects: true,
},
),
(
"free_this_root",
Unknown {
original_value: None,
reason: "unsupported expression",
has_side_effects: true,
},
),
]
class X {
static bound_this_field = this.name
static {
const bound_this_static = this;
}
constructor() {
const bound_this_ctor = this;
}
}
// We should generate a freevar effect for this and only this
const free_this_root = this;
X = ???*0*
- *0* unsupported expression
⚠️ This value might have side effects
bound_this_ctor = ???*0*
- *0* unsupported expression
⚠️ This value might have side effects
bound_this_static = ???*0*
- *0* unsupported expression
⚠️ This value might have side effects
free_this_root = ???*0*
- *0* unsupported expression
⚠️ This value might have side effects
...@@ -166,47 +166,6 @@ ...@@ -166,47 +166,6 @@
), ),
], ],
}, },
Unreachable {
start_ast_path: [
Program(
Module,
),
Module(
Body(
1,
),
),
ModuleItem(
Stmt,
),
Stmt(
Decl,
),
Decl(
Fn,
),
FnDecl(
Function,
),
Function(
Body,
),
BlockStmt(
Stmts(
1,
),
),
Stmt(
While,
),
WhileStmt(
Body,
),
Stmt(
Block,
),
],
},
ImportedBinding { ImportedBinding {
esm_reference_index: 7, esm_reference_index: 7,
export: Some( export: Some(
...@@ -520,47 +479,6 @@ ...@@ -520,47 +479,6 @@
), ),
], ],
}, },
Unreachable {
start_ast_path: [
Program(
Module,
),
Module(
Body(
2,
),
),
ModuleItem(
Stmt,
),
Stmt(
Decl,
),
Decl(
Fn,
),
FnDecl(
Function,
),
Function(
Body,
),
BlockStmt(
Stmts(
0,
),
),
Stmt(
While,
),
WhileStmt(
Body,
),
Stmt(
Block,
),
],
},
ImportedBinding { ImportedBinding {
esm_reference_index: 2, esm_reference_index: 2,
export: Some( export: Some(
...@@ -874,47 +792,6 @@ ...@@ -874,47 +792,6 @@
), ),
], ],
}, },
Unreachable {
start_ast_path: [
Program(
Module,
),
Module(
Body(
3,
),
),
ModuleItem(
Stmt,
),
Stmt(
Decl,
),
Decl(
Fn,
),
FnDecl(
Function,
),
Function(
Body,
),
BlockStmt(
Stmts(
0,
),
),
Stmt(
While,
),
WhileStmt(
Body,
),
Stmt(
Block,
),
],
},
ImportedBinding { ImportedBinding {
esm_reference_index: 4, esm_reference_index: 4,
export: Some( export: Some(
......
...@@ -4,32 +4,20 @@ ...@@ -4,32 +4,20 @@
- *0* unreachable - *0* unreachable
⚠️ This value might have side effects ⚠️ This value might have side effects
0 -> 4 unreachable = ???*0* 0 -> 5 call = module<foo, {}>["unreachableA3"]()
- *0* unreachable
⚠️ This value might have side effects
0 -> 6 call = module<foo, {}>["unreachableA3"]()
0 -> 8 call = module<foo, {}>["unreachableB1"]() 0 -> 7 call = module<foo, {}>["unreachableB1"]()
0 -> 9 unreachable = ???*0* 0 -> 8 unreachable = ???*0*
- *0* unreachable - *0* unreachable
⚠️ This value might have side effects ⚠️ This value might have side effects
0 -> 10 unreachable = ???*0* 0 -> 10 call = module<foo, {}>["calledB1"]()
- *0* unreachable
⚠️ This value might have side effects
0 -> 12 call = module<foo, {}>["calledB1"]() 0 -> 12 call = module<foo, {}>["calledC1"]()
0 -> 14 call = module<foo, {}>["calledC1"]()
0 -> 15 unreachable = ???*0*
- *0* unreachable
⚠️ This value might have side effects
0 -> 16 unreachable = ???*0* 0 -> 13 unreachable = ???*0*
- *0* unreachable - *0* unreachable
⚠️ This value might have side effects ⚠️ This value might have side effects
0 -> 18 call = module<foo, {}>["calledC2"]() 0 -> 15 call = module<foo, {}>["calledC2"]()
...@@ -293,44 +293,6 @@ ...@@ -293,44 +293,6 @@
), ),
], ],
}, },
Unreachable {
start_ast_path: [
Program(
Script,
),
Script(
Body(
1,
),
),
Stmt(
Decl,
),
Decl(
Fn,
),
FnDecl(
Function,
),
Function(
Body,
),
BlockStmt(
Stmts(
0,
),
),
Stmt(
While,
),
WhileStmt(
Body,
),
Stmt(
Block,
),
],
},
FreeVar { FreeVar {
var: "b3", var: "b3",
ast_path: [ ast_path: [
...@@ -593,44 +555,6 @@ ...@@ -593,44 +555,6 @@
), ),
], ],
}, },
Unreachable {
start_ast_path: [
Program(
Script,
),
Script(
Body(
2,
),
),
Stmt(
Decl,
),
Decl(
Fn,
),
FnDecl(
Function,
),
Function(
Body,
),
BlockStmt(
Stmts(
0,
),
),
Stmt(
DoWhile,
),
DoWhileStmt(
Body,
),
Stmt(
Block,
),
],
},
FreeVar { FreeVar {
var: "c3", var: "c3",
ast_path: [ ast_path: [
...@@ -893,44 +817,6 @@ ...@@ -893,44 +817,6 @@
), ),
], ],
}, },
Unreachable {
start_ast_path: [
Program(
Script,
),
Script(
Body(
3,
),
),
Stmt(
Decl,
),
Decl(
Fn,
),
FnDecl(
Function,
),
Function(
Body,
),
BlockStmt(
Stmts(
0,
),
),
Stmt(
For,
),
ForStmt(
Body,
),
Stmt(
Block,
),
],
},
FreeVar { FreeVar {
var: "d3", var: "d3",
ast_path: [ ast_path: [
...@@ -1193,44 +1079,6 @@ ...@@ -1193,44 +1079,6 @@
), ),
], ],
}, },
Unreachable {
start_ast_path: [
Program(
Script,
),
Script(
Body(
4,
),
),
Stmt(
Decl,
),
Decl(
Fn,
),
FnDecl(
Function,
),
Function(
Body,
),
BlockStmt(
Stmts(
0,
),
),
Stmt(
ForIn,
),
ForInStmt(
Body,
),
Stmt(
Block,
),
],
},
FreeVar { FreeVar {
var: "e3", var: "e3",
ast_path: [ ast_path: [
...@@ -1493,44 +1341,6 @@ ...@@ -1493,44 +1341,6 @@
), ),
], ],
}, },
Unreachable {
start_ast_path: [
Program(
Script,
),
Script(
Body(
5,
),
),
Stmt(
Decl,
),
Decl(
Fn,
),
FnDecl(
Function,
),
Function(
Body,
),
BlockStmt(
Stmts(
0,
),
),
Stmt(
ForOf,
),
ForOfStmt(
Body,
),
Stmt(
Block,
),
],
},
FreeVar { FreeVar {
var: "f3", var: "f3",
ast_path: [ ast_path: [
...@@ -2210,4 +2020,186 @@ ...@@ -2210,4 +2020,186 @@
in_try: false, in_try: false,
new: false, new: false,
}, },
FreeVar {
var: "i1",
ast_path: [
Program(
Script,
),
Script(
Body(
8,
),
),
Stmt(
Decl,
),
Decl(
Fn,
),
FnDecl(
Function,
),
Function(
Body,
),
BlockStmt(
Stmts(
0,
),
),
Stmt(
Block,
),
BlockStmt(
Stmts(
0,
),
),
Stmt(
Expr,
),
ExprStmt(
Expr,
),
Expr(
Call,
),
CallExpr(
Callee,
),
Callee(
Expr,
),
Expr(
Ident,
),
],
span: 645..647,
},
Call {
func: FreeVar(
"i1",
),
args: [],
ast_path: [
Program(
Script,
),
Script(
Body(
8,
),
),
Stmt(
Decl,
),
Decl(
Fn,
),
FnDecl(
Function,
),
Function(
Body,
),
BlockStmt(
Stmts(
0,
),
),
Stmt(
Block,
),
BlockStmt(
Stmts(
0,
),
),
Stmt(
Expr,
),
ExprStmt(
Expr,
),
Expr(
Call,
),
],
span: 645..649,
in_try: false,
new: false,
},
Unreachable {
start_ast_path: [
Program(
Script,
),
Script(
Body(
8,
),
),
Stmt(
Decl,
),
Decl(
Fn,
),
FnDecl(
Function,
),
Function(
Body,
),
BlockStmt(
Stmts(
0,
),
),
Stmt(
Block,
),
BlockStmt(
Stmts(
1,
),
),
Stmt(
Return,
),
],
},
Unreachable {
start_ast_path: [
Program(
Script,
),
Script(
Body(
8,
),
),
Stmt(
Decl,
),
Decl(
Fn,
),
FnDecl(
Function,
),
Function(
Body,
),
BlockStmt(
Stmts(
0,
),
),
Stmt(
Block,
),
],
},
] ]
...@@ -20,6 +20,8 @@ g (const after eval) = (...) => undefined ...@@ -20,6 +20,8 @@ g (const after eval) = (...) => undefined
h (const after eval) = (...) => undefined h (const after eval) = (...) => undefined
i (const after eval) = (...) => undefined
x#10 = ???*0* x#10 = ???*0*
- *0* for-in variable currently not analyzed - *0* for-in variable currently not analyzed
......
...@@ -104,6 +104,16 @@ ...@@ -104,6 +104,16 @@
), ),
), ),
), ),
(
"i",
Function(
2,
622,
Constant(
Undefined,
),
),
),
( (
"x#10", "x#10",
Unknown { Unknown {
......
...@@ -67,3 +67,11 @@ function h() { ...@@ -67,3 +67,11 @@ function h() {
}; };
h3(); h3();
} }
function i() {
{
i1();
return;
i2();
}
i3();
}
...@@ -20,109 +20,107 @@ ...@@ -20,109 +20,107 @@
- *0* unreachable - *0* unreachable
⚠️ This value might have side effects ⚠️ This value might have side effects
0 -> 7 unreachable = ???*0* 0 -> 7 free var = FreeVar(b3)
- *0* unreachable
⚠️ This value might have side effects
0 -> 8 free var = FreeVar(b3)
0 -> 9 call = ???*0*() 0 -> 8 call = ???*0*()
- *0* FreeVar(b3) - *0* FreeVar(b3)
⚠️ unknown global ⚠️ unknown global
⚠️ This value might have side effects ⚠️ This value might have side effects
0 -> 10 free var = FreeVar(c1) 0 -> 9 free var = FreeVar(c1)
0 -> 11 call = ???*0*() 0 -> 10 call = ???*0*()
- *0* FreeVar(c1) - *0* FreeVar(c1)
⚠️ unknown global ⚠️ unknown global
⚠️ This value might have side effects ⚠️ This value might have side effects
0 -> 12 unreachable = ???*0* 0 -> 11 unreachable = ???*0*
- *0* unreachable
⚠️ This value might have side effects
0 -> 13 unreachable = ???*0*
- *0* unreachable - *0* unreachable
⚠️ This value might have side effects ⚠️ This value might have side effects
0 -> 14 free var = FreeVar(c3) 0 -> 12 free var = FreeVar(c3)
0 -> 15 call = ???*0*() 0 -> 13 call = ???*0*()
- *0* FreeVar(c3) - *0* FreeVar(c3)
⚠️ unknown global ⚠️ unknown global
⚠️ This value might have side effects ⚠️ This value might have side effects
0 -> 16 free var = FreeVar(d1) 0 -> 14 free var = FreeVar(d1)
0 -> 17 call = ???*0*() 0 -> 15 call = ???*0*()
- *0* FreeVar(d1) - *0* FreeVar(d1)
⚠️ unknown global ⚠️ unknown global
⚠️ This value might have side effects ⚠️ This value might have side effects
0 -> 18 unreachable = ???*0* 0 -> 16 unreachable = ???*0*
- *0* unreachable - *0* unreachable
⚠️ This value might have side effects ⚠️ This value might have side effects
0 -> 19 unreachable = ???*0* 0 -> 17 free var = FreeVar(d3)
- *0* unreachable
⚠️ This value might have side effects
0 -> 20 free var = FreeVar(d3) 0 -> 18 call = ???*0*()
0 -> 21 call = ???*0*()
- *0* FreeVar(d3) - *0* FreeVar(d3)
⚠️ unknown global ⚠️ unknown global
⚠️ This value might have side effects ⚠️ This value might have side effects
0 -> 22 free var = FreeVar(e1) 0 -> 19 free var = FreeVar(e1)
0 -> 23 call = ???*0*() 0 -> 20 call = ???*0*()
- *0* FreeVar(e1) - *0* FreeVar(e1)
⚠️ unknown global ⚠️ unknown global
⚠️ This value might have side effects ⚠️ This value might have side effects
0 -> 24 unreachable = ???*0* 0 -> 21 unreachable = ???*0*
- *0* unreachable
⚠️ This value might have side effects
0 -> 25 unreachable = ???*0*
- *0* unreachable - *0* unreachable
⚠️ This value might have side effects ⚠️ This value might have side effects
0 -> 26 free var = FreeVar(e3) 0 -> 22 free var = FreeVar(e3)
0 -> 27 call = ???*0*() 0 -> 23 call = ???*0*()
- *0* FreeVar(e3) - *0* FreeVar(e3)
⚠️ unknown global ⚠️ unknown global
⚠️ This value might have side effects ⚠️ This value might have side effects
0 -> 28 free var = FreeVar(f1) 0 -> 24 free var = FreeVar(f1)
0 -> 29 call = ???*0*() 0 -> 25 call = ???*0*()
- *0* FreeVar(f1) - *0* FreeVar(f1)
⚠️ unknown global ⚠️ unknown global
⚠️ This value might have side effects ⚠️ This value might have side effects
0 -> 30 unreachable = ???*0* 0 -> 26 unreachable = ???*0*
- *0* unreachable - *0* unreachable
⚠️ This value might have side effects ⚠️ This value might have side effects
0 -> 27 free var = FreeVar(f3)
0 -> 28 call = ???*0*()
- *0* FreeVar(f3)
⚠️ unknown global
⚠️ This value might have side effects
0 -> 29 free var = FreeVar(g1)
0 -> 30 call = ???*0*()
- *0* FreeVar(g1)
⚠️ unknown global
⚠️ This value might have side effects
0 -> 31 unreachable = ???*0* 0 -> 31 unreachable = ???*0*
- *0* unreachable - *0* unreachable
⚠️ This value might have side effects ⚠️ This value might have side effects
0 -> 32 free var = FreeVar(f3) 0 -> 32 free var = FreeVar(g3)
0 -> 33 call = ???*0*() 0 -> 33 call = ???*0*()
- *0* FreeVar(f3) - *0* FreeVar(g3)
⚠️ unknown global ⚠️ unknown global
⚠️ This value might have side effects ⚠️ This value might have side effects
0 -> 34 free var = FreeVar(g1) 0 -> 34 free var = FreeVar(h1)
0 -> 35 call = ???*0*() 0 -> 35 call = ???*0*()
- *0* FreeVar(g1) - *0* FreeVar(h1)
⚠️ unknown global ⚠️ unknown global
⚠️ This value might have side effects ⚠️ This value might have side effects
...@@ -130,17 +128,17 @@ ...@@ -130,17 +128,17 @@
- *0* unreachable - *0* unreachable
⚠️ This value might have side effects ⚠️ This value might have side effects
0 -> 37 free var = FreeVar(g3) 0 -> 37 free var = FreeVar(h3)
0 -> 38 call = ???*0*() 0 -> 38 call = ???*0*()
- *0* FreeVar(g3) - *0* FreeVar(h3)
⚠️ unknown global ⚠️ unknown global
⚠️ This value might have side effects ⚠️ This value might have side effects
0 -> 39 free var = FreeVar(h1) 0 -> 39 free var = FreeVar(i1)
0 -> 40 call = ???*0*() 0 -> 40 call = ???*0*()
- *0* FreeVar(h1) - *0* FreeVar(i1)
⚠️ unknown global ⚠️ unknown global
⚠️ This value might have side effects ⚠️ This value might have side effects
...@@ -148,9 +146,6 @@ ...@@ -148,9 +146,6 @@
- *0* unreachable - *0* unreachable
⚠️ This value might have side effects ⚠️ This value might have side effects
0 -> 42 free var = FreeVar(h3) 0 -> 42 unreachable = ???*0*
- *0* unreachable
0 -> 43 call = ???*0*()
- *0* FreeVar(h3)
⚠️ unknown global
⚠️ This value might have side effects ⚠️ This value might have side effects
...@@ -20,6 +20,8 @@ g = (...) => undefined ...@@ -20,6 +20,8 @@ g = (...) => undefined
h = (...) => undefined h = (...) => undefined
i = (...) => undefined
x#10 = ???*0* x#10 = ???*0*
- *0* for-in variable currently not analyzed - *0* for-in variable currently not analyzed
......
...@@ -6,19 +6,19 @@ ...@@ -6,19 +6,19 @@
__unused_webpack_module = arguments[0] __unused_webpack_module = arguments[0]
__webpack_exec__ = (*arrow function 1213* | undefined) __webpack_exec__ = *arrow function 1213*
__webpack_exports__#3 = (__webpack_exec__(5166) | undefined) __webpack_exports__#3 = __webpack_exec__(5166)
__webpack_exports__#4 = arguments[1] __webpack_exports__#4 = arguments[1]
__webpack_require__#3 = (FreeVar(require)("../../webpack-api-runtime.js") | undefined) __webpack_require__#3 = FreeVar(require)("../../webpack-api-runtime.js")
__webpack_require__#4 = arguments[2] __webpack_require__#4 = arguments[2]
_req = arguments[0] _req = arguments[0]
exports = ({} | undefined) exports = {}
handler = (...) => Promise<undefined> handler = (...) => Promise<undefined>
......
...@@ -55,51 +55,33 @@ ...@@ -55,51 +55,33 @@
), ),
( (
"__webpack_exec__", "__webpack_exec__",
Alternatives { Variable(
total_nodes: 3, (
values: [ "*arrow function 1213*",
Variable( #0,
( ),
"*arrow function 1213*", ),
#0,
),
),
Constant(
Undefined,
),
],
logical_property: None,
},
), ),
( (
"__webpack_exports__#3", "__webpack_exports__#3",
Alternatives { Call(
total_nodes: 5, 3,
values: [ Variable(
Call( (
3, "__webpack_exec__",
Variable( #3,
(
"__webpack_exec__",
#3,
),
),
[
Constant(
Num(
ConstantNumber(
5166.0,
),
),
),
],
), ),
),
[
Constant( Constant(
Undefined, Num(
ConstantNumber(
5166.0,
),
),
), ),
], ],
logical_property: None, ),
},
), ),
( (
"__webpack_exports__#4", "__webpack_exports__#4",
...@@ -110,30 +92,21 @@ ...@@ -110,30 +92,21 @@
), ),
( (
"__webpack_require__#3", "__webpack_require__#3",
Alternatives { Call(
total_nodes: 5, 3,
values: [ FreeVar(
Call( "require",
3, ),
FreeVar( [
"require",
),
[
Constant(
Str(
Atom(
"../../webpack-api-runtime.js",
),
),
),
],
),
Constant( Constant(
Undefined, Str(
Atom(
"../../webpack-api-runtime.js",
),
),
), ),
], ],
logical_property: None, ),
},
), ),
( (
"__webpack_require__#4", "__webpack_require__#4",
...@@ -151,19 +124,10 @@ ...@@ -151,19 +124,10 @@
), ),
( (
"exports", "exports",
Alternatives { Object {
total_nodes: 3, total_nodes: 1,
values: [ parts: [],
Object { mutable: true,
total_nodes: 1,
parts: [],
mutable: true,
},
Constant(
Undefined,
),
],
logical_property: None,
}, },
), ),
( (
......
...@@ -39,12 +39,12 @@ ...@@ -39,12 +39,12 @@
0 -> 17 call = require*0*("../../webpack-api-runtime.js") 0 -> 17 call = require*0*("../../webpack-api-runtime.js")
- *0* require: The require method from CommonJS - *0* require: The require method from CommonJS
0 -> 19 member call = (module<../../webpack-api-runtime.js, {}> | undefined)["C"](({} | undefined)) 0 -> 19 member call = module<../../webpack-api-runtime.js, {}>["C"]({})
0 -> 21 call = (module<../../webpack-api-runtime.js, {}> | undefined)(???*0*) 0 -> 21 call = module<../../webpack-api-runtime.js, {}>(???*0*)
- *0* arguments[0] - *0* arguments[0]
⚠️ function calls are not analyzed yet ⚠️ function calls are not analyzed yet
0 -> 22 call = ((...) => __webpack_require__(moduleId) | undefined)(5166) 0 -> 22 call = (...) => __webpack_require__(moduleId)(5166)
0 -> 24 free var = FreeVar(module) 0 -> 24 free var = FreeVar(module)
...@@ -8,17 +8,15 @@ __unused_webpack_module = ???*0* ...@@ -8,17 +8,15 @@ __unused_webpack_module = ???*0*
- *0* arguments[0] - *0* arguments[0]
⚠️ function calls are not analyzed yet ⚠️ function calls are not analyzed yet
__webpack_exec__ = ((...) => __webpack_require__(moduleId) | undefined) __webpack_exec__ = (...) => __webpack_require__(moduleId)
__webpack_exports__#3 = (???*0* | undefined) __webpack_exports__#3 = module<../../webpack-api-runtime.js, {}>(5166)
- *0* ((...) => __webpack_require__(moduleId) | undefined)(5166)
⚠️ non-function callee
__webpack_exports__#4 = ???*0* __webpack_exports__#4 = ???*0*
- *0* arguments[1] - *0* arguments[1]
⚠️ function calls are not analyzed yet ⚠️ function calls are not analyzed yet
__webpack_require__#3 = (module<../../webpack-api-runtime.js, {}> | undefined) __webpack_require__#3 = module<../../webpack-api-runtime.js, {}>
__webpack_require__#4 = ???*0* __webpack_require__#4 = ???*0*
- *0* arguments[2] - *0* arguments[2]
...@@ -28,7 +26,7 @@ _req = ???*0* ...@@ -28,7 +26,7 @@ _req = ???*0*
- *0* arguments[0] - *0* arguments[0]
⚠️ function calls are not analyzed yet ⚠️ function calls are not analyzed yet
exports = ({} | undefined) exports = {}
handler = (...) => Promise<undefined> handler = (...) => Promise<undefined>
......
...@@ -200,6 +200,24 @@ function p() { ...@@ -200,6 +200,24 @@ function p() {
p4() p4()
} }
function q() {
while (false) {
q1()
return
q2()
}
q3()
}
function r() {
{
r1()
return
r2()
}
r3()
}
z1() z1()
return return
......
...@@ -195,6 +195,25 @@ function p() { ...@@ -195,6 +195,25 @@ function p() {
//TURBOPACK unreachable //TURBOPACK unreachable
; ;
} }
function q() {
while(false){
q1();
return;
//TURBOPACK unreachable
;
}
q3();
}
function r() {
{
r1();
return;
//TURBOPACK unreachable
;
}
//TURBOPACK unreachable
;
}
z1(); z1();
return; return;
z2(); z2();
......
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
"version": 3, "version": 3,
"sources": [], "sources": [],
"sections": [ "sections": [
{"offset": {"line": 4, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/comptime/early-return/input/module.js"],"sourcesContent":["export function a() {\n if (true) {\n a1()\n return\n }\n a2()\n var a3 = 3\n function a4() {\n var a5\n }\n ;(function a6() {\n var a7\n })\n const a8 = () => {\n var a9\n }\n class a10 {}\n let a11 = 11\n let {\n a12 = 12,\n a14: {\n a15,\n a16: [a17, ...a18],\n },\n ...a19\n } = {}\n function a20() {\n return\n a21()\n }\n ;({\n get a22() {\n var a23\n },\n set a22(value) {\n var a24\n },\n a25() {\n var a26\n },\n })\n {\n let a27\n var a28\n }\n}\n\nexport function b() {\n if (true) {\n b1()\n return\n } else {\n b2()\n }\n b3()\n}\n\nexport function c() {\n if (true) {\n return\n }\n c1()\n}\n\nexport function d() {\n if (true) {\n return\n } else {\n d1()\n }\n d2()\n}\n\nexport function e() {\n if (false) {\n e1()\n } else {\n return\n }\n e2()\n}\n\nexport function f() {\n if (false) {\n } else {\n return\n }\n f1()\n}\n\nexport function g() {\n if (false) {\n g1()\n } else {\n g2()\n return\n }\n g3()\n}\n\nexport function h() {\n if (false) {\n } else {\n h1()\n return\n }\n h2()\n}\n\nexport function i(j) {\n if (j < 1) return i1()\n return i2()\n}\n\nexport function j(j) {\n if (j < 1) {\n return i1()\n }\n return i2()\n}\n\nclass K {\n constructor() {\n try {\n k1()\n } catch (e) {\n k2()\n return\n k3()\n } finally {\n k4()\n }\n k5()\n }\n\n l() {\n try {\n l1()\n } catch (e) {\n l2()\n } finally {\n l3()\n return\n l4()\n }\n l5()\n }\n\n get m() {\n if (true) {\n m1()\n return\n }\n m2()\n }\n\n set m(value) {\n m1()\n return m2()\n m3()\n }\n\n n = () => {\n switch (42) {\n case 1:\n n1()\n return\n n2()\n case 2:\n n3()\n break\n default:\n n4()\n }\n n5()\n }\n\n o() {\n if (something) {\n require('./module')\n return\n } else {\n require('./module')\n return\n }\n }\n}\n\nfunction p() {\n class C {\n constructor() {\n p1()\n return\n p2()\n }\n }\n\n p3()\n return\n p4()\n}\n\nz1()\n\nreturn\n\nz2()\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAO,SAAS;IACd,wCAAU;QACR;QACA;IACF;;;IAEA,IAAI;IACJ,SAAS;QACP,IAAI;IACN;IAIA,MAAM;IAGA,IAAA;IACN,IAAI;IACJ,IACE,KAEE,KACM,KAAQ,KAEb;IAEL,SAAS;QACP;;;IAEF;IAcE,IAAI;AAER;AAEO,SAAS;IACd,wCAAU;QACR;QACA;IACF;;;;AAIF;AAEO,SAAS;IACd,wCAAU;QACR;IACF;;;AAEF;AAEO,SAAS;IACd,wCAAU;QACR;IACF;;;;AAIF;AAEO,SAAS;IACd;;SAEO;QACL;IACF;;;AAEF;AAEO,SAAS;IACd,uCAAW,CACX,OAAO;QACL;IACF;;;AAEF;AAEO,SAAS;IACd;;SAEO;QACL;QACA;IACF;;;AAEF;AAEO,SAAS;IACd,uCAAW,CACX,OAAO;QACL;QACA;IACF;;;AAEF;AAEO,SAAS,EAAE,CAAC;IACjB,IAAI,IAAI,GAAG,OAAO;IAClB,OAAO;AACT;AAEO,SAAS,EAAE,CAAC;IACjB,IAAI,IAAI,GAAG;QACT,OAAO;IACT;IACA,OAAO;AACT;AAEA,MAAM;IACJ,aAAc;QACZ,IAAI;YACF;QACF,EAAE,OAAO,GAAG;YACV;YACA;;;QAEF,SAAU;YACR;QACF;QACA;IACF;IAEA,IAAI;QACF,IAAI;YACF;QACF,EAAE,OAAO,GAAG;YACV;QACF,SAAU;YACR;YACA;;;QAEF;;;IAEF;IAEA,IAAI,IAAI;QACN,wCAAU;YACR;YACA;QACF;;;IAEF;IAEA,IAAI,EAAE,KAAK,EAAE;QACX;QACA,OAAO;;;IAET;IAEA,IAAI;QACF,OAAQ;YACN,KAAK;gBACH;gBACA;;;YAEF,KAAK;gBACH;gBACA;YACF;gBACE;QACJ;QACA;IACF,EAAC;IAED,IAAI;QACF,IAAI,WAAW;;YAEb;QACF,OAAO;;YAEL;QACF;IACF;AACF;AAEA,SAAS;IACP,MAAM;QACJ,aAAc;YACZ;YACA;;;QAEF;IACF;IAEA;IACA;;;AAEF;AAEA;AAEA;AAEA"}}, {"offset": {"line": 4, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/comptime/early-return/input/module.js"],"sourcesContent":["export function a() {\n if (true) {\n a1()\n return\n }\n a2()\n var a3 = 3\n function a4() {\n var a5\n }\n ;(function a6() {\n var a7\n })\n const a8 = () => {\n var a9\n }\n class a10 {}\n let a11 = 11\n let {\n a12 = 12,\n a14: {\n a15,\n a16: [a17, ...a18],\n },\n ...a19\n } = {}\n function a20() {\n return\n a21()\n }\n ;({\n get a22() {\n var a23\n },\n set a22(value) {\n var a24\n },\n a25() {\n var a26\n },\n })\n {\n let a27\n var a28\n }\n}\n\nexport function b() {\n if (true) {\n b1()\n return\n } else {\n b2()\n }\n b3()\n}\n\nexport function c() {\n if (true) {\n return\n }\n c1()\n}\n\nexport function d() {\n if (true) {\n return\n } else {\n d1()\n }\n d2()\n}\n\nexport function e() {\n if (false) {\n e1()\n } else {\n return\n }\n e2()\n}\n\nexport function f() {\n if (false) {\n } else {\n return\n }\n f1()\n}\n\nexport function g() {\n if (false) {\n g1()\n } else {\n g2()\n return\n }\n g3()\n}\n\nexport function h() {\n if (false) {\n } else {\n h1()\n return\n }\n h2()\n}\n\nexport function i(j) {\n if (j < 1) return i1()\n return i2()\n}\n\nexport function j(j) {\n if (j < 1) {\n return i1()\n }\n return i2()\n}\n\nclass K {\n constructor() {\n try {\n k1()\n } catch (e) {\n k2()\n return\n k3()\n } finally {\n k4()\n }\n k5()\n }\n\n l() {\n try {\n l1()\n } catch (e) {\n l2()\n } finally {\n l3()\n return\n l4()\n }\n l5()\n }\n\n get m() {\n if (true) {\n m1()\n return\n }\n m2()\n }\n\n set m(value) {\n m1()\n return m2()\n m3()\n }\n\n n = () => {\n switch (42) {\n case 1:\n n1()\n return\n n2()\n case 2:\n n3()\n break\n default:\n n4()\n }\n n5()\n }\n\n o() {\n if (something) {\n require('./module')\n return\n } else {\n require('./module')\n return\n }\n }\n}\n\nfunction p() {\n class C {\n constructor() {\n p1()\n return\n p2()\n }\n }\n\n p3()\n return\n p4()\n}\n\nfunction q() {\n while (false) {\n q1()\n return\n q2()\n }\n q3()\n}\n\nfunction r() {\n {\n r1()\n return\n r2()\n }\n r3()\n}\n\nz1()\n\nreturn\n\nz2()\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAO,SAAS;IACd,wCAAU;QACR;QACA;IACF;;;IAEA,IAAI;IACJ,SAAS;QACP,IAAI;IACN;IAIA,MAAM;IAGA,IAAA;IACN,IAAI;IACJ,IACE,KAEE,KACM,KAAQ,KAEb;IAEL,SAAS;QACP;;;IAEF;IAcE,IAAI;AAER;AAEO,SAAS;IACd,wCAAU;QACR;QACA;IACF;;;;AAIF;AAEO,SAAS;IACd,wCAAU;QACR;IACF;;;AAEF;AAEO,SAAS;IACd,wCAAU;QACR;IACF;;;;AAIF;AAEO,SAAS;IACd;;SAEO;QACL;IACF;;;AAEF;AAEO,SAAS;IACd,uCAAW,CACX,OAAO;QACL;IACF;;;AAEF;AAEO,SAAS;IACd;;SAEO;QACL;QACA;IACF;;;AAEF;AAEO,SAAS;IACd,uCAAW,CACX,OAAO;QACL;QACA;IACF;;;AAEF;AAEO,SAAS,EAAE,CAAC;IACjB,IAAI,IAAI,GAAG,OAAO;IAClB,OAAO;AACT;AAEO,SAAS,EAAE,CAAC;IACjB,IAAI,IAAI,GAAG;QACT,OAAO;IACT;IACA,OAAO;AACT;AAEA,MAAM;IACJ,aAAc;QACZ,IAAI;YACF;QACF,EAAE,OAAO,GAAG;YACV;YACA;;;QAEF,SAAU;YACR;QACF;QACA;IACF;IAEA,IAAI;QACF,IAAI;YACF;QACF,EAAE,OAAO,GAAG;YACV;QACF,SAAU;YACR;YACA;;;QAEF;;;IAEF;IAEA,IAAI,IAAI;QACN,wCAAU;YACR;YACA;QACF;;;IAEF;IAEA,IAAI,EAAE,KAAK,EAAE;QACX;QACA,OAAO;;;IAET;IAEA,IAAI;QACF,OAAQ;YACN,KAAK;gBACH;gBACA;;;YAEF,KAAK;gBACH;gBACA;YACF;gBACE;QACJ;QACA;IACF,EAAC;IAED,IAAI;QACF,IAAI,WAAW;;YAEb;QACF,OAAO;;YAEL;QACF;IACF;AACF;AAEA,SAAS;IACP,MAAM;QACJ,aAAc;YACZ;YACA;;;QAEF;IACF;IAEA;IACA;;;AAEF;AAEA,SAAS;IACP,MAAO,MAAO;QACZ;QACA;;;IAEF;IACA;AACF;AAEA,SAAS;IACP;QACE;QACA;;;IAEF;;;AAEF;AAEA;AAEA;AAEA"}},
{"offset": {"line": 204, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/comptime/early-return/input/index.js"],"sourcesContent":["import * as module from './module'\nconsole.log(module)\n"],"names":[],"mappings":";AAAA;;AACA,QAAQ,GAAG,CAAC"}}] {"offset": {"line": 223, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/comptime/early-return/input/index.js"],"sourcesContent":["import * as module from './module'\nconsole.log(module)\n"],"names":[],"mappings":";AAAA;;AACA,QAAQ,GAAG,CAAC"}}]
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment