Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
c741628d
Commit
c741628d
authored
Aug 20, 2025
by
Luke Sandberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add a test
parent
5064eefd
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
508 additions
and
0 deletions
+508
-0
resolved-effects.snapshot
...ests/analyzer/graph/cycle-cache/resolved-effects.snapshot
+0
-0
graph-effects.snapshot
...nalyzer/graph/non-root-assignments/graph-effects.snapshot
+225
-0
graph-explained.snapshot
...lyzer/graph/non-root-assignments/graph-explained.snapshot
+27
-0
graph.snapshot
.../tests/analyzer/graph/non-root-assignments/graph.snapshot
+178
-0
input.js
...script/tests/analyzer/graph/non-root-assignments/input.js
+41
-0
resolved-effects.snapshot
...yzer/graph/non-root-assignments/resolved-effects.snapshot
+10
-0
resolved-explained.snapshot
...er/graph/non-root-assignments/resolved-explained.snapshot
+27
-0
No files found.
turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/cycle-cache/resolved-effects.snapshot
0 → 100644
View file @
c741628d
turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/non-root-assignments/graph-effects.snapshot
0 → 100644
View file @
c741628d
[
FreeVar {
var: FreeVar(
"d1",
),
ast_path: [
Program(
Module,
),
Module(
Body(
3,
),
),
ModuleItem(
Stmt,
),
Stmt(
For,
),
ForStmt(
Body,
),
Stmt(
Block,
),
BlockStmt(
Stmts(
0,
),
),
Stmt(
Expr,
),
ExprStmt(
Expr,
),
Expr(
Assign,
),
AssignExpr(
Left,
),
AssignTarget(
Simple,
),
SimpleAssignTarget(
Ident,
),
BindingIdent(
Id,
),
],
span: 342..344,
in_try: false,
},
FreeVar {
var: FreeVar(
"e4",
),
ast_path: [
Program(
Module,
),
Module(
Body(
9,
),
),
ModuleItem(
ModuleDecl,
),
ModuleDecl(
ExportNamed,
),
NamedExport(
Specifiers(
0,
),
),
ExportSpecifier(
Named,
),
ExportNamedSpecifier(
Exported,
),
ModuleExportName(
Ident,
),
],
span: 814..816,
in_try: false,
},
FreeVar {
var: FreeVar(
"setTimeout",
),
ast_path: [
Program(
Module,
),
Module(
Body(
11,
),
),
ModuleItem(
Stmt,
),
Stmt(
Expr,
),
ExprStmt(
Expr,
),
Expr(
Call,
),
CallExpr(
Callee,
),
Callee(
Expr,
),
Expr(
Ident,
),
],
span: 896..906,
in_try: false,
},
Call {
func: FreeVar(
"setTimeout",
),
args: [
Closure(
Variable(
(
"*arrow function 907*",
#0,
),
),
EffectsBlock {
effects: [],
range: Exact(
[
Program(
Module,
),
Module(
Body(
11,
),
),
ModuleItem(
Stmt,
),
Stmt(
Expr,
),
ExprStmt(
Expr,
),
Expr(
Call,
),
CallExpr(
Args(
0,
),
),
ExprOrSpread(
Expr,
),
Expr(
Arrow,
),
ArrowExpr(
Body,
),
BlockStmtOrExpr(
BlockStmt,
),
],
),
},
),
Value(
Constant(
Num(
ConstantNumber(
1.0,
),
),
),
),
],
ast_path: [
Program(
Module,
),
Module(
Body(
11,
),
),
ModuleItem(
Stmt,
),
Stmt(
Expr,
),
ExprStmt(
Expr,
),
Expr(
Call,
),
],
span: 896..964,
in_try: false,
new: false,
},
]
turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/non-root-assignments/graph-explained.snapshot
0 → 100644
View file @
c741628d
*arrow function 907* (const after eval) = (...) => undefined
ConstAfterEvalClass (const after eval) = ???*0*
- *0* unsupported expression
⚠️ This value might have side effects
d1 (const after eval) = 2
default_function_export_const_after_eval (const after eval) = (...) => undefined
i (const after eval) = (0 | ???*0*)
- *0* updated with update expression
⚠️ This value might have side effects
named_const_export_const_after_eval (const after eval) = 3
named_function_export_const_after_eval (const after eval) = ((...) => undefined | 2)
named_let_export_const_after_eval (const after eval) = 2
named_let_export_const_after_eval_2 (const after eval) = (???*0* | 5)
- *0* named_let_export_const_after_eval_2
⚠️ pattern without value
named_let_export_not_const_after_eval = (1 | 5)
named_let_export_not_const_after_eval_2 = (1 | 3)
turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/non-root-assignments/graph.snapshot
0 → 100644
View file @
c741628d
[
(
"*arrow function 907*",
Function(
2,
907,
Constant(
Undefined,
),
),
),
(
"ConstAfterEvalClass",
Unknown {
original_value: None,
reason: "unsupported expression",
has_side_effects: true,
},
),
(
"d1",
Constant(
Num(
ConstantNumber(
2.0,
),
),
),
),
(
"default_function_export_const_after_eval",
Function(
2,
251,
Constant(
Undefined,
),
),
),
(
"i",
Alternatives {
total_nodes: 3,
values: [
Constant(
Num(
ConstantNumber(
0.0,
),
),
),
Unknown {
original_value: None,
reason: "updated with update expression",
has_side_effects: true,
},
],
logical_property: None,
},
),
(
"named_const_export_const_after_eval",
Constant(
Num(
ConstantNumber(
3.0,
),
),
),
),
(
"named_function_export_const_after_eval",
Alternatives {
total_nodes: 4,
values: [
Function(
2,
65,
Constant(
Undefined,
),
),
Constant(
Num(
ConstantNumber(
2.0,
),
),
),
],
logical_property: None,
},
),
(
"named_let_export_const_after_eval",
Constant(
Num(
ConstantNumber(
2.0,
),
),
),
),
(
"named_let_export_const_after_eval_2",
Alternatives {
total_nodes: 3,
values: [
Unknown {
original_value: Some(
Variable(
(
"named_let_export_const_after_eval_2",
#2,
),
),
),
reason: "pattern without value",
has_side_effects: false,
},
Constant(
Num(
ConstantNumber(
5.0,
),
),
),
],
logical_property: None,
},
),
(
"named_let_export_not_const_after_eval",
Alternatives {
total_nodes: 3,
values: [
Constant(
Num(
ConstantNumber(
1.0,
),
),
),
Constant(
Num(
ConstantNumber(
5.0,
),
),
),
],
logical_property: None,
},
),
(
"named_let_export_not_const_after_eval_2",
Alternatives {
total_nodes: 3,
values: [
Constant(
Num(
ConstantNumber(
1.0,
),
),
),
Constant(
Num(
ConstantNumber(
3.0,
),
),
),
],
logical_property: None,
},
),
]
turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/non-root-assignments/input.js
0 → 100644
View file @
c741628d
// should be inferred as not having non-root assignments
export
function
named_function_export_const_after_eval
()
{
}
if
(
true
)
{
named_function_export_const_after_eval
=
2
}
// should be inferred as not having non-root assignments
export
default
function
default_function_export_const_after_eval
()
{
}
for
(
let
i
=
0
;
i
<
10
;
i
++
)
{
d1
=
2
}
// should be inferred as not having non-root assignments
export
let
named_let_export_const_after_eval
=
2
// ditto
export
const
named_const_export_const_after_eval
=
3
// should be inferred as not having non-root assignments
let
named_let_export_const_after_eval_2
// should be inferred as having non-root assignments
let
named_let_export_not_const_after_eval
=
1
let
named_let_export_not_const_after_eval_2
=
1
export
{
named_let_export_not_const_after_eval
as
e4
,
named_let_export_const_after_eval_2
}
named_let_export_const_after_eval_2
=
5
setTimeout
(()
=>
{
named_let_export_not_const_after_eval
=
5
},
1
);
export
class
ConstAfterEvalClass
{
named_class_method_export_const_after_eval
()
{
named_let_export_not_const_after_eval_2
=
3
}
}
turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/non-root-assignments/resolved-effects.snapshot
0 → 100644
View file @
c741628d
0 -> 1 free var = FreeVar(d1)
0 -> 2 free var = FreeVar(e4)
0 -> 3 free var = FreeVar(setTimeout)
0 -> 4 call = ???*0*((...) => undefined, 1)
- *0* FreeVar(setTimeout)
⚠️ unknown global
⚠️ This value might have side effects
turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/non-root-assignments/resolved-explained.snapshot
0 → 100644
View file @
c741628d
*arrow function 907* = (...) => undefined
ConstAfterEvalClass = ???*0*
- *0* unsupported expression
⚠️ This value might have side effects
d1 = 2
default_function_export_const_after_eval = (...) => undefined
i = (0 | ???*0*)
- *0* updated with update expression
⚠️ This value might have side effects
named_const_export_const_after_eval = 3
named_function_export_const_after_eval = ((...) => undefined | 2)
named_let_export_const_after_eval = 2
named_let_export_const_after_eval_2 = (???*0* | 5)
- *0* named_let_export_const_after_eval_2
⚠️ pattern without value
named_let_export_not_const_after_eval = (1 | 5)
named_let_export_not_const_after_eval_2 = (1 | 3)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment