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
5064eefd
Commit
5064eefd
authored
Aug 20, 2025
by
Luke Sandberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add variable assignment location analysis
parent
02862aa6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
57 changed files
with
1079 additions
and
996 deletions
+1079
-996
analyzer.rs
turbopack/crates/turbopack-ecmascript/benches/analyzer.rs
+3
-3
graph.rs
turbopack/crates/turbopack-ecmascript/src/analyzer/graph.rs
+67
-3
linker.rs
turbopack/crates/turbopack-ecmascript/src/analyzer/linker.rs
+4
-3
mod.rs
turbopack/crates/turbopack-ecmascript/src/analyzer/mod.rs
+28
-10
graph-explained.snapshot
...cmascript/tests/analyzer/graph/1/graph-explained.snapshot
+3
-3
graph-explained.snapshot
...cmascript/tests/analyzer/graph/2/graph-explained.snapshot
+3
-3
graph-explained.snapshot
...t/tests/analyzer/graph/array-map/graph-explained.snapshot
+8
-8
graph-explained.snapshot
...cript/tests/analyzer/graph/array/graph-explained.snapshot
+9
-9
graph-explained.snapshot
...cript/tests/analyzer/graph/arrow/graph-explained.snapshot
+13
-13
graph-explained.snapshot
...ript/tests/analyzer/graph/assign/graph-explained.snapshot
+6
-6
graph-explained.snapshot
...tests/analyzer/graph/class_super/graph-explained.snapshot
+2
-2
graph-explained.snapshot
...ript/tests/analyzer/graph/concat/graph-explained.snapshot
+4
-4
graph-explained.snapshot
...nalyzer/graph/conditional-import/graph-explained.snapshot
+4
-4
graph-explained.snapshot
...tests/analyzer/graph/cycle-cache/graph-explained.snapshot
+68
-68
graph-explained.snapshot
...ests/analyzer/graph/declarations/graph-explained.snapshot
+12
-12
graph-explained.snapshot
...ests/analyzer/graph/default-args/graph-explained.snapshot
+3
-3
graph-explained.snapshot
...ests/analyzer/graph/early-return/graph-explained.snapshot
+10
-10
graph-explained.snapshot
...s/analyzer/graph/esbuild-reduced/graph-explained.snapshot
+6
-6
graph-explained.snapshot
...ipt/tests/analyzer/graph/esbuild/graph-explained.snapshot
+12
-12
graph-explained.snapshot
.../tests/analyzer/graph/fn-array-2/graph-explained.snapshot
+4
-4
graph-explained.snapshot
...pt/tests/analyzer/graph/fn-array/graph-explained.snapshot
+4
-4
graph-explained.snapshot
...t/tests/analyzer/graph/free-vars/graph-explained.snapshot
+1
-1
graph-explained.snapshot
...ript/tests/analyzer/graph/iife-2/graph-explained.snapshot
+2
-2
graph-explained.snapshot
...script/tests/analyzer/graph/iife/graph-explained.snapshot
+7
-7
graph-explained.snapshot
.../analyzer/graph/import-meta-prop/graph-explained.snapshot
+1
-1
graph-explained.snapshot
...ipt/tests/analyzer/graph/imports/graph-explained.snapshot
+3
-3
graph-explained.snapshot
...tests/analyzer/graph/issue-75938/graph-explained.snapshot
+2
-2
graph-explained.snapshot
...tests/analyzer/graph/issue-77083/graph-explained.snapshot
+1
-1
graph-explained.snapshot
...tests/analyzer/graph/issue-77126/graph-explained.snapshot
+3
-3
graph-explained.snapshot
...ipt/tests/analyzer/graph/logical/graph-explained.snapshot
+15
-15
graph-explained.snapshot
...tests/analyzer/graph/md5-reduced/graph-explained.snapshot
+3
-3
graph-explained.snapshot
...ascript/tests/analyzer/graph/md5/graph-explained.snapshot
+11
-11
graph-explained.snapshot
...cript/tests/analyzer/graph/md5_2/graph-explained.snapshot
+11
-11
graph-explained.snapshot
...tests/analyzer/graph/member-call/graph-explained.snapshot
+8
-8
graph-explained.snapshot
.../analyzer/graph/mongoose-reduced/graph-explained.snapshot
+3
-3
graph-explained.snapshot
...tests/analyzer/graph/nested-args/graph-explained.snapshot
+6
-6
graph-explained.snapshot
...ript/tests/analyzer/graph/nested/graph-explained.snapshot
+9
-9
graph-explained.snapshot
...ipt/tests/analyzer/graph/new-url/graph-explained.snapshot
+1
-1
graph-explained.snapshot
...ript/tests/analyzer/graph/object/graph-explained.snapshot
+32
-32
graph-explained.snapshot
...t/tests/analyzer/graph/op-assign/graph-explained.snapshot
+2
-2
graph-explained.snapshot
...s/analyzer/graph/other-free-vars/graph-explained.snapshot
+3
-3
graph-explained.snapshot
...t/tests/analyzer/graph/pack-2236/graph-explained.snapshot
+1
-1
graph-explained.snapshot
...t/tests/analyzer/graph/pack-2521/graph-explained.snapshot
+7
-7
graph-explained.snapshot
...t/tests/analyzer/graph/pack-2682/graph-explained.snapshot
+3
-3
graph-explained.snapshot
...t/tests/analyzer/graph/path-join/graph-explained.snapshot
+12
-12
graph-explained.snapshot
...nalyzer/graph/pattern-assignment/graph-explained.snapshot
+4
-4
graph-explained.snapshot
...ascript/tests/analyzer/graph/peg/graph-explained.snapshot
+4
-4
graph-explained.snapshot
...ts/analyzer/graph/process-and-os/graph-explained.snapshot
+11
-11
graph-explained.snapshot
...lyzer/graph/react-dom-production/graph-explained.snapshot
+609
-609
graph-explained.snapshot
...s/analyzer/graph/require-context/graph-explained.snapshot
+4
-4
graph-explained.snapshot
...t/tests/analyzer/graph/sequences/graph-explained.snapshot
+2
-2
graph-explained.snapshot
...ascript/tests/analyzer/graph/try/graph-explained.snapshot
+2
-2
graph-explained.snapshot
.../analyzer/graph/turbopack-ignore/graph-explained.snapshot
+5
-5
graph-explained.snapshot
...analyzer/graph/unreachable-break/graph-explained.snapshot
+3
-3
graph-explained.snapshot
...tests/analyzer/graph/unreachable/graph-explained.snapshot
+8
-8
graph-explained.snapshot
...alyzer/graph/webpack-target-node/graph-explained.snapshot
+6
-6
graph-explained.snapshot
...ript/tests/analyzer/graph/worker/graph-explained.snapshot
+1
-1
No files found.
turbopack/crates/turbopack-ecmascript/benches/analyzer.rs
View file @
5064eefd
...
...
@@ -18,7 +18,7 @@ use turbopack_core::{
target
::
CompileTarget
,
};
use
turbopack_ecmascript
::
analyzer
::{
graph
::{
EvalContext
,
VarGraph
,
create_graph
},
graph
::{
EvalContext
,
VarGraph
,
VarMeta
,
create_graph
},
imports
::
ImportAttributes
,
linker
::
link
,
test_utils
::{
early_visitor
,
visitor
},
...
...
@@ -100,7 +100,7 @@ fn bench_link(b: &mut Bencher, input: &BenchInput) {
b
.to_async
(
rt
)
.iter
(||
async
{
let
var_cache
=
Default
::
default
();
for
val
in
input
.var_graph.values
.values
()
{
for
VarMeta
{
value
,
..
}
in
input
.var_graph.values
.values
()
{
VcStorage
::
with
(
async
{
let
compile_time_info
=
CompileTimeInfo
::
builder
(
Environment
::
new
(
ExecutionEnvironment
::
NodeJsLambda
(
...
...
@@ -118,7 +118,7 @@ fn bench_link(b: &mut Bencher, input: &BenchInput) {
.await
?
;
link
(
&
input
.var_graph
,
val
.clone
(),
val
ue
.clone
(),
&
early_visitor
,
&
(|
val
|
visitor
(
val
,
compile_time_info
,
ImportAttributes
::
empty_ref
())),
&
Default
::
default
(),
...
...
turbopack/crates/turbopack-ecmascript/src/analyzer/graph.rs
View file @
5064eefd
...
...
@@ -254,10 +254,69 @@ impl Effect {
}
}
pub
enum
AssignmentKind
{
InRootScope
,
InFunction
,
}
#[derive(Debug,
Copy,
Clone,
PartialEq,
Eq)]
pub
enum
AssignmentKinds
{
AllInRootScope
,
AllInFunction
,
Mixed
,
}
impl
AssignmentKinds
{
fn
new
(
initial
:
AssignmentKind
)
->
Self
{
match
initial
{
AssignmentKind
::
InRootScope
=>
AssignmentKinds
::
AllInRootScope
,
AssignmentKind
::
InFunction
=>
AssignmentKinds
::
AllInFunction
,
}
}
fn
merge
(
self
,
other
:
AssignmentKind
)
->
Self
{
// If the other assignment kind is the same as the current one, return the current one.
if
self
==
Self
::
new
(
other
)
{
self
}
else
{
AssignmentKinds
::
Mixed
}
}
}
#[derive(Debug,
Clone)]
pub
struct
VarMeta
{
pub
value
:
JsValue
,
// Tracks the locations where this was assigned to:
// - [AssignmentKinds::AllInRootScope] if it was assigned only in the root scope
// - [AssignmentKinds::AllInFunction] if it was assigned in function scopes
// - [AssignmentKinds::Mixed] if it was assigned in both
// This is used to track the _liveness_ of exports.
pub
assignment_kinds
:
AssignmentKinds
,
}
impl
VarMeta
{
pub
fn
new
(
value
:
JsValue
,
kind
:
AssignmentKind
)
->
Self
{
Self
{
value
,
assignment_kinds
:
AssignmentKinds
::
new
(
kind
),
}
}
pub
fn
normalize
(
&
mut
self
)
{
self
.value
.normalize
();
}
fn
add_alt
(
&
mut
self
,
value
:
JsValue
,
kind
:
AssignmentKind
)
{
self
.value
.add_alt
(
value
);
self
.assignment_kinds
=
self
.assignment_kinds
.merge
(
kind
);
}
}
#[derive(Debug)]
pub
struct
VarGraph
{
pub
values
:
FxHashMap
<
Id
,
JsValue
>
,
pub
values
:
FxHashMap
<
Id
,
VarMeta
>
,
/// Map FreeVar names to their Id to facilitate lookups into [values]
/// Doesn't necessarily contain every FreeVar, just those who have non trivial values.
pub
free_var_ids
:
FxHashMap
<
Atom
,
Id
>
,
pub
effects
:
Vec
<
Effect
>
,
...
...
@@ -972,10 +1031,15 @@ impl Analyzer<'_> {
self
.data.free_var_ids
.insert
(
id
.
0
.clone
(),
id
.clone
());
}
let
kind
=
if
self
.is_in_fn
()
{
AssignmentKind
::
InFunction
}
else
{
AssignmentKind
::
InRootScope
};
if
let
Some
(
prev
)
=
self
.data.values
.get_mut
(
&
id
)
{
prev
.add_alt
(
value
);
prev
.add_alt
(
value
,
kind
);
}
else
{
self
.data.values
.insert
(
id
,
value
);
self
.data.values
.insert
(
id
,
VarMeta
::
new
(
value
,
kind
)
);
}
// TODO(kdy1): We may need to report an error for this.
// Variables declared with `var` are hoisted, but using undefined as its
...
...
turbopack/crates/turbopack-ecmascript/src/analyzer/linker.rs
View file @
5064eefd
...
...
@@ -6,6 +6,7 @@ use rustc_hash::{FxHashMap, FxHashSet};
use
swc_core
::
ecma
::
ast
::
Id
;
use
super
::{
JsValue
,
graph
::
VarGraph
};
use
crate
::
analyzer
::
graph
::
VarMeta
;
pub
async
fn
link
<
'a
,
B
,
RB
,
F
,
RF
>
(
graph
:
&
VarGraph
,
...
...
@@ -122,11 +123,11 @@ where
if
let
Some
(
val
)
=
var_cache_lock
.as_deref
()
.and_then
(|
cache
|
cache
.get
(
&
var
))
{
total_nodes
+=
val
.total_nodes
();
done
.push
(
val
.clone
());
}
else
if
let
Some
(
val
)
=
graph
.values
.get
(
&
var
)
{
}
else
if
let
Some
(
VarMeta
{
value
,
..
}
)
=
graph
.values
.get
(
&
var
)
{
cycle_stack
.insert
(
var
.clone
());
work_queue_stack
.push
(
Step
::
LeaveVar
(
var
));
total_nodes
+=
val
.total_nodes
();
work_queue_stack
.push
(
Step
::
Enter
(
val
.clone
()));
total_nodes
+=
val
ue
.total_nodes
();
work_queue_stack
.push
(
Step
::
Enter
(
val
ue
.clone
()));
}
else
{
total_nodes
+=
1
;
done
.push
(
JsValue
::
unknown
(
...
...
turbopack/crates/turbopack-ecmascript/src/analyzer/mod.rs
View file @
5064eefd
...
...
@@ -4071,7 +4071,10 @@ mod tests {
graph
::{
ConditionalKind
,
Effect
,
EffectArg
,
EvalContext
,
VarGraph
,
create_graph
},
linker
::
link
,
};
use
crate
::
analyzer
::
imports
::
ImportAttributes
;
use
crate
::
analyzer
::{
graph
::{
AssignmentKinds
,
VarMeta
},
imports
::
ImportAttributes
,
};
#[fixture(
"tests/analyzer/graph/**/input.js"
)]
fn
fixture
(
input
:
PathBuf
)
{
...
...
@@ -4132,13 +4135,17 @@ mod tests {
named_values
.sort_by
(|
a
,
b
|
a
.
0
.cmp
(
&
b
.
0
));
fn
explain_all
<
'a
>
(
values
:
impl
IntoIterator
<
Item
=
(
&
'a
String
,
&
'a
JsValue
)
>
,
values
:
impl
IntoIterator
<
Item
=
(
&
'a
String
,
&
'a
JsValue
,
Option
<
AssignmentKinds
>
)
>
,
)
->
String
{
values
.into_iter
()
.map
(|(
id
,
value
)|
{
.map
(|(
id
,
value
,
assignment_kinds
)|
{
let
non_root_assignments
=
match
assignment_kinds
{
Some
(
AssignmentKinds
::
AllInRootScope
)
=>
" (const after eval)"
,
_
=>
""
,
};
let
(
explainer
,
hints
)
=
value
.explain
(
10
,
5
);
format!
(
"{id} = {explainer}{hints}"
)
format!
(
"{id}
{non_root_assignments}
= {explainer}{hints}"
)
})
.collect
::
<
Vec
<
_
>>
()
.join
(
"
\n\n
"
)
...
...
@@ -4154,15 +4161,24 @@ mod tests {
"{:#?}"
,
named_values
.iter
()
.map
(|(
name
,
(
_
,
value
))|
(
name
,
value
))
.map
(|(
name
,
(
_
,
VarMeta
{
value
,
..
}
))|
(
name
,
value
))
.collect
::
<
Vec
<
_
>>
()
))
.compare_to_file
(
&
graph_snapshot_path
)
.unwrap
();
}
NormalizedOutput
::
from
(
explain_all
(
named_values
.iter
()
.map
(|(
name
,
(
_
,
value
))|
(
name
,
value
)),
))
NormalizedOutput
::
from
(
explain_all
(
named_values
.iter
()
.map
(
|(
name
,
(
_
,
VarMeta
{
value
,
assignment_kinds
,
},
),
)|
(
name
,
value
,
Some
(
*
assignment_kinds
)),
)))
.compare_to_file
(
&
graph_explained_snapshot_path
)
.unwrap
();
if
!
large
{
...
...
@@ -4206,7 +4222,8 @@ mod tests {
}
let
start
=
Instant
::
now
();
let
explainer
=
explain_all
(
resolved
.iter
()
.map
(|(
name
,
value
)|
(
name
,
value
)));
let
explainer
=
explain_all
(
resolved
.iter
()
.map
(|(
name
,
value
)|
(
name
,
value
,
None
)));
let
time
=
start
.elapsed
();
if
time
.as_millis
()
>
1
{
println!
(
...
...
@@ -4431,7 +4448,8 @@ mod tests {
}
let
start
=
Instant
::
now
();
let
explainer
=
explain_all
(
resolved
.iter
()
.map
(|(
name
,
value
)|
(
name
,
value
)));
let
explainer
=
explain_all
(
resolved
.iter
()
.map
(|(
name
,
value
)|
(
name
,
value
,
None
)));
let
time
=
start
.elapsed
();
if
time
.as_millis
()
>
1
{
println!
(
...
...
turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/1/graph-explained.snapshot
View file @
5064eefd
a = (...) => undefined
a
(const after eval)
= (...) => undefined
b = (...) => undefined
b
(const after eval)
= (...) => undefined
c = (...) => undefined
c
(const after eval)
= (...) => undefined
x = (1 | `${y}.js`)
...
...
turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/2/graph-explained.snapshot
View file @
5064eefd
x = (1 | y)
x
(const after eval)
= (1 | y)
y = x
y
(const after eval)
= x
z = x
z
(const after eval)
= x
turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/array-map/graph-explained.snapshot
View file @
5064eefd
*anonymous function 170* = (...) => [file]
*anonymous function 170*
(const after eval)
= (...) => [file]
*anonymous function 254* = (...) => FreeVar(require)["resolve"](file)
*anonymous function 254*
(const after eval)
= (...) => FreeVar(require)["resolve"](file)
*anonymous function 88* = (...) => file
*anonymous function 88*
(const after eval)
= (...) => file
a = ["../lib/a.js", "../lib/b.js"]
a
(const after eval)
= ["../lib/a.js", "../lib/b.js"]
b = ["../lib/a.js", "../lib/b.js"]["map"](*anonymous function 88*)
b
(const after eval)
= ["../lib/a.js", "../lib/b.js"]["map"](*anonymous function 88*)
c = ["../lib/a.js", "../lib/b.js"]["map"](*anonymous function 170*)
c
(const after eval)
= ["../lib/a.js", "../lib/b.js"]["map"](*anonymous function 170*)
d = ["../lib/a.js", "../lib/b.js"]["map"](*anonymous function 254*)
d
(const after eval)
= ["../lib/a.js", "../lib/b.js"]["map"](*anonymous function 254*)
file#3 = arguments[0]
...
...
@@ -20,4 +20,4 @@ file#5 = arguments[0]
file#6 = arguments[0]
func = (...) => FreeVar(require)["resolve"](file)
func
(const after eval)
= (...) => FreeVar(require)["resolve"](file)
turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/array/graph-explained.snapshot
View file @
5064eefd
a = 1
a
(const after eval)
= 1
b = "foo"
b
(const after eval)
= "foo"
c = [1, "foo"][FreeVar(global)["index"]]
c
(const after eval)
= [1, "foo"][FreeVar(global)["index"]]
d1 = [1, "foo"]
d1
(const after eval)
= [1, "foo"]
d2 = d1[FreeVar(global)["index"]]
d2
(const after eval)
= d1[FreeVar(global)["index"]]
d3 = d1[1]
d3
(const after eval)
= d1[1]
d4 = d1[2]
d4
(const after eval)
= d1[2]
value#3 = Iterated(d1)
value#3
(const after eval)
= Iterated(d1)
value#5 = Iterated([])
value#5
(const after eval)
= Iterated([])
turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/arrow/graph-explained.snapshot
View file @
5064eefd
*anonymous function 116* = (...) => 3
*anonymous function 116*
(const after eval)
= (...) => 3
*anonymous function 339* = (...) => 3
*arrow function 11* = (...) => 1
*arrow function 11*
(const after eval)
= (...) => 1
*arrow function 214* = (...) => 1
...
...
@@ -12,27 +12,27 @@
*arrow function 299* = (...) => 2
*arrow function 30* = (...) => 2
*arrow function 30*
(const after eval)
= (...) => 2
*arrow function 50* = (...) => 1
*arrow function 50*
(const after eval)
= (...) => 1
*arrow function 83* = (...) => 2
*arrow function 83*
(const after eval)
= (...) => 2
a = *arrow function 11*
a
(const after eval)
= *arrow function 11*
b = *arrow function 30*
b
(const after eval)
= *arrow function 30*
c = *arrow function 50*
c
(const after eval)
= *arrow function 50*
d = *arrow function 83*
d
(const after eval)
= *arrow function 83*
e#2 = *anonymous function 116*
e#2
(const after eval)
= *anonymous function 116*
e#6 = (...) => 4
e#6
(const after eval)
= (...) => 4
f = e
f
(const after eval)
= e
x = (...) => undefined
x
(const after eval)
= (...) => undefined
xa = *arrow function 214*
...
...
turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/assign/graph-explained.snapshot
View file @
5064eefd
a = ("" | `${a}x`)
a
(const after eval)
= ("" | `${a}x`)
b = (0 | ???*0*)
b
(const after eval)
= (0 | ???*0*)
- *0* unsupported assign operation
⚠️ This value might have side effects
c = (0 | ???*0*)
c
(const after eval)
= (0 | ???*0*)
- *0* updated with update expression
⚠️ This value might have side effects
d = (0 | 1)
d
(const after eval)
= (0 | 1)
e = (1 | 2)
e
(const after eval)
= (1 | 2)
f = (1 | 2)
f
(const after eval)
= (1 | 2)
turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/class_super/graph-explained.snapshot
View file @
5064eefd
*arrow function 138* = (...) => undefined
BaseClass = ???*0*
BaseClass
(const after eval)
= ???*0*
- *0* unsupported expression
⚠️ This value might have side effects
SubClass = ???*0*
SubClass
(const after eval)
= ???*0*
- *0* unsupported expression
⚠️ This value might have side effects
...
...
turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/concat/graph-explained.snapshot
View file @
5064eefd
a = ""
a
(const after eval)
= ""
b = "hello"
b
(const after eval)
= "hello"
c = "--service=0.14.12"
c
(const after eval)
= "--service=0.14.12"
d = "--service=0.14.12"
d
(const after eval)
= "--service=0.14.12"
turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/conditional-import/graph-explained.snapshot
View file @
5064eefd
a = FreeVar(import)("a")
a
(const after eval)
= FreeVar(import)("a")
b = (???*0* | FreeVar(import)("a") | FreeVar(import)("b"))
b
(const after eval)
= (???*0* | FreeVar(import)("a") | FreeVar(import)("b"))
- *0* b
⚠️ pattern without value
c = FreeVar(import)(
c
(const after eval)
= FreeVar(import)(
((FreeVar(process)["env"]["NEXT_RUNTIME"] === "edge") ? "next/dist/compiled/@vercel/og/index.edge.js" : "next/dist/compiled/@vercel/og/index.node.js")
)
earlyExit = (...) => (hoisted | undefined)
earlyExit
(const after eval)
= (...) => (hoisted | undefined)
hoisted = (...) => undefined
turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/cycle-cache/graph-explained.snapshot
View file @
5064eefd
*arrow function 425* = (...) => *arrow function 431*
*arrow function 425*
(const after eval)
= (...) => *arrow function 431*
*arrow function 431* = (...) => *arrow function 437*
...
...
@@ -8,7 +8,7 @@
*arrow function 449* = (...) => 1
*arrow function 468* = (...) => *arrow function 474*
*arrow function 468*
(const after eval)
= (...) => *arrow function 474*
*arrow function 474* = (...) => *arrow function 480*
...
...
@@ -18,7 +18,7 @@
*arrow function 492* = (...) => 2
*arrow function 511* = (...) => *arrow function 517*
*arrow function 511*
(const after eval)
= (...) => *arrow function 517*
*arrow function 517* = (...) => *arrow function 523*
...
...
@@ -28,7 +28,7 @@
*arrow function 535* = (...) => 2
*arrow function 554* = (...) => *arrow function 560*
*arrow function 554*
(const after eval)
= (...) => *arrow function 560*
*arrow function 560* = (...) => *arrow function 566*
...
...
@@ -38,13 +38,13 @@
*arrow function 578* = (...) => 1
a = (1 | 2 | 3 | b)
a
(const after eval)
= (1 | 2 | 3 | b)
b = (4 | 5 | 6 | c)
b
(const after eval)
= (4 | 5 | 6 | c)
c = (7 | 8 | 9 | a)
c
(const after eval)
= (7 | 8 | 9 | a)
d = (
d
(const after eval)
= (
| f11
| f22
| f32
...
...
@@ -68,122 +68,122 @@ d = (
| fl2
)
f11 = (*arrow function 425* | *arrow function 468*)
f11
(const after eval)
= (*arrow function 425* | *arrow function 468*)
f12 = (*arrow function 511* | *arrow function 554*)
f12
(const after eval)
= (*arrow function 511* | *arrow function 554*)
f21 = (f11 | f12)
f21
(const after eval)
= (f11 | f12)
f22 = (f12 | f11)
f22
(const after eval)
= (f12 | f11)
f31 = (f21 | f22)
f31
(const after eval)
= (f21 | f22)
f32 = (f22 | f21)
f32
(const after eval)
= (f22 | f21)
f41 = (f31 | f32)
f41
(const after eval)
= (f31 | f32)
f42 = (f32 | f31)
f42
(const after eval)
= (f32 | f31)
f51 = (f41 | f42)
f51
(const after eval)
= (f41 | f42)
f52 = (f42 | f41)
f52
(const after eval)
= (f42 | f41)
f61 = (f51 | f52)
f61
(const after eval)
= (f51 | f52)
f62 = (f52 | f51)
f62
(const after eval)
= (f52 | f51)
f71 = (f61 | f62)
f71
(const after eval)
= (f61 | f62)
f72 = (f62 | f61)
f72
(const after eval)
= (f62 | f61)
f81 = (f71 | f72)
f81
(const after eval)
= (f71 | f72)
f82 = (f72 | f71)
f82
(const after eval)
= (f72 | f71)
f91 = (f81 | f82)
f91
(const after eval)
= (f81 | f82)
f92 = (f82 | f81)
f92
(const after eval)
= (f82 | f81)
fa1 = (f91 | f92)
fa1
(const after eval)
= (f91 | f92)
fa2 = (f92 | f91)
fa2
(const after eval)
= (f92 | f91)
fb1 = (fa1 | fa2)
fb1
(const after eval)
= (fa1 | fa2)
fb2 = (fa2 | fa1)
fb2
(const after eval)
= (fa2 | fa1)
fc1 = (fb1 | fb2)
fc1
(const after eval)
= (fb1 | fb2)
fc2 = (fb2 | fb1)
fc2
(const after eval)
= (fb2 | fb1)
fd1 = (fc1 | fc2)
fd1
(const after eval)
= (fc1 | fc2)
fd2 = (fc2 | fc1)
fd2
(const after eval)
= (fc2 | fc1)
fe1 = (fd1 | fd2)
fe1
(const after eval)
= (fd1 | fd2)
fe2 = (fd2 | fd1)
fe2
(const after eval)
= (fd2 | fd1)
ff1 = (fe1 | fe2)
ff1
(const after eval)
= (fe1 | fe2)
ff2 = (fe2 | fe1)
ff2
(const after eval)
= (fe2 | fe1)
fg1 = (ff1 | ff2)
fg1
(const after eval)
= (ff1 | ff2)
fg2 = (ff2 | ff1)
fg2
(const after eval)
= (ff2 | ff1)
fh1 = (fg1 | fg2)
fh1
(const after eval)
= (fg1 | fg2)
fh2 = (fg2 | fg1)
fh2
(const after eval)
= (fg2 | fg1)
fi1 = (fh1 | fh2)
fi1
(const after eval)
= (fh1 | fh2)
fi2 = (fh2 | fh1)
fi2
(const after eval)
= (fh2 | fh1)
fj1 = (fi1 | fi2)
fj1
(const after eval)
= (fi1 | fi2)
fj2 = (fi2 | fi1)
fj2
(const after eval)
= (fi2 | fi1)
fk1 = (fj1 | fj2)
fk1
(const after eval)
= (fj1 | fj2)
fk2 = (fj2 | fj1)
fk2
(const after eval)
= (fj2 | fj1)
fl1 = (fk1 | fk2)
fl1
(const after eval)
= (fk1 | fk2)
fl2 = (fk2 | fk1)
fl2
(const after eval)
= (fk2 | fk1)
x = (a | b | c)
x
(const after eval)
= (a | b | c)
x1 = (x1 | x2 | x3 | x4 | x5 | x6)
x1
(const after eval)
= (x1 | x2 | x3 | x4 | x5 | x6)
x2 = (x1 | x2 | x3 | x4 | x5 | x6)
x2
(const after eval)
= (x1 | x2 | x3 | x4 | x5 | x6)
x3 = (x1 | x2 | x3 | x4 | x5 | x6)
x3
(const after eval)
= (x1 | x2 | x3 | x4 | x5 | x6)
x4 = (x1 | x2 | x3 | x4 | x5 | x6)
x4
(const after eval)
= (x1 | x2 | x3 | x4 | x5 | x6)
x5 = (x1 | x2 | x3 | x4 | x5 | x6)
x5
(const after eval)
= (x1 | x2 | x3 | x4 | x5 | x6)
x6 = (x1 | x2 | x3 | x4 | x5 | x6)
x6
(const after eval)
= (x1 | x2 | x3 | x4 | x5 | x6)
y = (a | b | c | x)
y
(const after eval)
= (a | b | c | x)
z = (a | b | c | y)
z
(const after eval)
= (a | b | c | y)
z1 = z
z1
(const after eval)
= z
z2 = z1
z2
(const after eval)
= z1
z3 = z2
z3
(const after eval)
= z2
z4 = z3
z4
(const after eval)
= z3
z5 = z4
z5
(const after eval)
= z4
z6 = z5
z6
(const after eval)
= z5
z7 = z6
z7
(const after eval)
= z6
z8 = z7
z8
(const after eval)
= z7
z9 = z8
z9
(const after eval)
= z8
turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/declarations/graph-explained.snapshot
View file @
5064eefd
*anonymous function 25* = (...) => undefined
*anonymous function 25*
(const after eval)
= (...) => undefined
a = (...) => undefined
a
(const after eval)
= (...) => undefined
aa = a
aa
(const after eval)
= a
b = *anonymous function 25*
b
(const after eval)
= *anonymous function 25*
bb = b
bb
(const after eval)
= b
c = 123
c
(const after eval)
= 123
cc = c
cc
(const after eval)
= c
d = "hello"
d
(const after eval)
= "hello"
dd = d
dd
(const after eval)
= d
e = ???*0*
e
(const after eval)
= ???*0*
- *0* unsupported expression
⚠️ This value might have side effects
ee = e
ee
(const after eval)
= e
ff = FreeVar(f)
ff
(const after eval)
= FreeVar(f)
turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/default-args/graph-explained.snapshot
View file @
5064eefd
*arrow function 105* = (...) => value2
*arrow function 105*
(const after eval)
= (...) => value2
Fun = (...) => value
Fun
(const after eval)
= (...) => value
Fun2 = *arrow function 105*
Fun2
(const after eval)
= *arrow function 105*
value = (arguments[0]["value"] | module<./module.js, {}>["named"])
...
...
turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/early-return/graph-explained.snapshot
View file @
5064eefd
a = (...) => undefined
a
(const after eval)
= (...) => undefined
b = (...) => undefined
b
(const after eval)
= (...) => undefined
c = (...) => undefined
c
(const after eval)
= (...) => undefined
d = (...) => undefined
d
(const after eval)
= (...) => undefined
e = (...) => undefined
e
(const after eval)
= (...) => undefined
f = (...) => undefined
f
(const after eval)
= (...) => undefined
g = (...) => undefined
g
(const after eval)
= (...) => undefined
h = (...) => undefined
h
(const after eval)
= (...) => undefined
i = (...) => (FreeVar(i1)() | FreeVar(i2)())
i
(const after eval)
= (...) => (FreeVar(i1)() | FreeVar(i2)())
j#2 = (...) => (FreeVar(i1)() | FreeVar(i2)())
j#2
(const after eval)
= (...) => (FreeVar(i1)() | FreeVar(i2)())
j#25 = arguments[0]
...
...
turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/esbuild-reduced/graph-explained.snapshot
View file @
5064eefd
...
...
@@ -6,17 +6,17 @@ e = ???*0*
- *0* e
⚠️ pattern without value
generateBinPath = (...) => binPath
generateBinPath
(const after eval)
= (...) => binPath
knownWindowsPackages = {
knownWindowsPackages
(const after eval)
= {
"win32 arm64 LE": "esbuild-windows-arm64",
"win32 ia32 LE": "esbuild-windows-32",
"win32 x64 LE": "esbuild-windows-64"
}
path = FreeVar(require)("path")
path
(const after eval)
= FreeVar(require)("path")
path2 = FreeVar(require)("path")
path2
(const after eval)
= FreeVar(require)("path")
pkg#3 = (???*0* | knownWindowsPackages[FreeVar(platformKey)])
- *0* pkg
...
...
@@ -24,7 +24,7 @@ pkg#3 = (???*0* | knownWindowsPackages[FreeVar(platformKey)])
pkg#4 = pkgAndSubpathForCurrentPlatform()["pkg"]
pkgAndSubpathForCurrentPlatform = (...) => {"pkg": pkg, "subpath": subpath}
pkgAndSubpathForCurrentPlatform
(const after eval)
= (...) => {"pkg": pkg, "subpath": subpath}
subpath#3 = (???*0* | "esbuild.exe")
- *0* subpath
...
...
@@ -32,4 +32,4 @@ subpath#3 = (???*0* | "esbuild.exe")
subpath#4 = pkgAndSubpathForCurrentPlatform()["subpath"]
x = generateBinPath()
x
(const after eval)
= generateBinPath()
turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/esbuild/graph-explained.snapshot
View file @
5064eefd
*arrow function 2666* = (...) => (
*arrow function 2666*
(const after eval)
= (...) => (
| [
"node",
[
...
...
@@ -8,7 +8,7 @@
| [generateBinPath(), []]
)
args = esbuildCommandAndArgs()[1]
args
(const after eval)
= esbuildCommandAndArgs()[1]
binPath = (
| ???*0*
...
...
@@ -20,7 +20,7 @@ binPath = (
binTargetPath = path["join"](esbuildLibDir, `pnpapi-${pkg}-${path["basename"](subpath)}`)
command = esbuildCommandAndArgs()[0]
command
(const after eval)
= esbuildCommandAndArgs()[0]
e#10 = ???*0*
- *0* e
...
...
@@ -30,15 +30,15 @@ e#15 = ???*0*
- *0* e
⚠️ pattern without value
esbuildCommandAndArgs = *arrow function 2666*
esbuildCommandAndArgs
(const after eval)
= *arrow function 2666*
esbuildLibDir = path["dirname"](FreeVar(require)["resolve"]("esbuild"))
generateBinPath = (...) => (FreeVar(ESBUILD_BINARY_PATH) | binTargetPath | binPath)
generateBinPath
(const after eval)
= (...) => (FreeVar(ESBUILD_BINARY_PATH) | binTargetPath | binPath)
isYarnPnP = (false | true)
knownUnixlikePackages = {
knownUnixlikePackages
(const after eval)
= {
"android arm64 LE": "esbuild-android-arm64",
"darwin arm64 LE": "esbuild-darwin-arm64",
"darwin x64 LE": "esbuild-darwin-64",
...
...
@@ -56,17 +56,17 @@ knownUnixlikePackages = {
"sunos x64 LE": "esbuild-sunos-64"
}
knownWindowsPackages = {
knownWindowsPackages
(const after eval)
= {
"win32 arm64 LE": "esbuild-windows-arm64",
"win32 ia32 LE": "esbuild-windows-32",
"win32 x64 LE": "esbuild-windows-64"
}
os = FreeVar(require)("os")
os
(const after eval)
= FreeVar(require)("os")
path = FreeVar(require)("path")
path
(const after eval)
= FreeVar(require)("path")
path2 = FreeVar(require)("path")
path2
(const after eval)
= FreeVar(require)("path")
pkg#3 = (???*0* | knownWindowsPackages[platformKey] | knownUnixlikePackages[platformKey])
- *0* pkg
...
...
@@ -74,7 +74,7 @@ pkg#3 = (???*0* | knownWindowsPackages[platformKey] | knownUnixlikePackages[plat
pkg#7 = pkgAndSubpathForCurrentPlatform()["pkg"]
pkgAndSubpathForCurrentPlatform = (...) => {"pkg": pkg, "subpath": subpath}
pkgAndSubpathForCurrentPlatform
(const after eval)
= (...) => {"pkg": pkg, "subpath": subpath}
platformKey = `${FreeVar(process)["platform"]} ${os["arch"]()} ${os["endianness"]()}`
...
...
@@ -84,4 +84,4 @@ subpath#3 = (???*0* | "esbuild.exe" | "bin/esbuild")
subpath#7 = pkgAndSubpathForCurrentPlatform()["subpath"]
x = args["concat"]("--service=0.14.12", "--ping")
x
(const after eval)
= args["concat"]("--service=0.14.12", "--ping")
turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/fn-array-2/graph-explained.snapshot
View file @
5064eefd
...
...
@@ -2,12 +2,12 @@ a = arguments[0]
b = arguments[1]
c = (...) => [`${a}${x}`, a]
c
(const after eval)
= (...) => [`${a}${x}`, a]
d = c("1", "2")
d
(const after eval)
= c("1", "2")
e = d[0]
e
(const after eval)
= d[0]
f = d[1]
f
(const after eval)
= d[1]
x = b
turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/fn-array/graph-explained.snapshot
View file @
5064eefd
...
...
@@ -2,10 +2,10 @@ a = arguments[0]
b = arguments[1]
c = (...) => [`${a}${b}`, a]
c
(const after eval)
= (...) => [`${a}${b}`, a]
d = c("1", "2")
d
(const after eval)
= c("1", "2")
e = d[0]
e
(const after eval)
= d[0]
f = d[1]
f
(const after eval)
= d[1]
turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/free-vars/graph-explained.snapshot
View file @
5064eefd
buf = FreeVar(Buffer)["from"]("Hello World")
buf
(const after eval)
= FreeVar(Buffer)["from"]("Hello World")
turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/iife-2/graph-explained.snapshot
View file @
5064eefd
_ = (...) => parent
_
(const after eval)
= (...) => parent
i = (0 | ???*0*)
- *0* updated with update expression
...
...
@@ -14,4 +14,4 @@ parent = arguments[2]
path = arguments[1]
root = {}
root
(const after eval)
= {}
turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/iife/graph-explained.snapshot
View file @
5064eefd
a = FreeVar(require)
a
(const after eval)
= FreeVar(require)
b = a
b
(const after eval)
= a
c = b
c
(const after eval)
= b
d = a
d
(const after eval)
= a
e = d
e
(const after eval)
= d
f = a
f
(const after eval)
= a
g = f
g
(const after eval)
= f
turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/import-meta-prop/graph-explained.snapshot
View file @
5064eefd
x = import.meta*0*["prop"]
x
(const after eval)
= import.meta*0*["prop"]
- *0* import.meta: The import.meta object
turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/imports/graph-explained.snapshot
View file @
5064eefd
aa = module<x2, {}>["a"]
aa
(const after eval)
= module<x2, {}>["a"]
xx = module<x1, {}>["default"]
xx
(const after eval)
= module<x1, {}>["default"]
yy = module<x3, {}>
yy
(const after eval)
= module<x3, {}>
turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/issue-75938/graph-explained.snapshot
View file @
5064eefd
...
...
@@ -4,11 +4,11 @@
*arrow function 471* = (...) => undefined
HelloWorld = ???*0*
HelloWorld
(const after eval)
= ???*0*
- *0* unsupported expression
⚠️ This value might have side effects
Home = (...) => module<https://esm.sh/preact/jsx-runtime, {}>["jsx"](
Home
(const after eval)
= (...) => module<https://esm.sh/preact/jsx-runtime, {}>["jsx"](
"button",
{"onClick": *arrow function 362*, "children": "Click me"}
)
...
...
turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/issue-77083/graph-explained.snapshot
View file @
5064eefd
runGetClassesOrUseCache = (...) => ("value a" | "value b")
runGetClassesOrUseCache
(const after eval)
= (...) => ("value a" | "value b")
turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/issue-77126/graph-explained.snapshot
View file @
5064eefd
*arrow function 19* = (...) => false
*arrow function 19*
(const after eval)
= (...) => false
run = (...) => ("should not run" | "should run")
run
(const after eval)
= (...) => ("should not run" | "should run")
shouldRun = *arrow function 19*
shouldRun
(const after eval)
= *arrow function 19*
x = (true | undefined)
turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/logical/graph-explained.snapshot
View file @
5064eefd
a = (x && y)
a
(const after eval)
= (x && y)
b = (x || y)
b
(const after eval)
= (x || y)
c = (x ?? y)
c
(const after eval)
= (x ?? y)
chain1 = (1 && 2 && 3 && FreeVar(global))
chain1
(const after eval)
= (1 && 2 && 3 && FreeVar(global))
chain2 = ((1 && 2 && FreeVar(global)) || 3 || 4)
chain2
(const after eval)
= ((1 && 2 && FreeVar(global)) || 3 || 4)
d = !(x)
d
(const after eval)
= !(x)
e = !(!(x))
e
(const after eval)
= !(!(x))
resolve1 = (1 && 2 && FreeVar(global) && 3 && 4)
resolve1
(const after eval)
= (1 && 2 && FreeVar(global) && 3 && 4)
resolve2 = (1 && 2 && 0 && FreeVar(global) && 4)
resolve2
(const after eval)
= (1 && 2 && 0 && FreeVar(global) && 4)
resolve3 = (FreeVar(global) || true)
resolve3
(const after eval)
= (FreeVar(global) || true)
resolve4 = (true || FreeVar(global))
resolve4
(const after eval)
= (true || FreeVar(global))
resolve5 = (FreeVar(global) && false)
resolve5
(const after eval)
= (FreeVar(global) && false)
resolve6 = (false && FreeVar(global))
resolve6
(const after eval)
= (false && FreeVar(global))
x = true
x
(const after eval)
= true
y = false
y
(const after eval)
= false
turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/md5-reduced/graph-explained.snapshot
View file @
5064eefd
...
...
@@ -74,7 +74,7 @@ i = (???*0* | 0 | (i + 16))
len = arguments[1]
md5cmn = (...) => FreeVar(safeAdd)(
md5cmn
(const after eval)
= (...) => FreeVar(safeAdd)(
FreeVar(bitRotateLeft)(
FreeVar(safeAdd)(FreeVar(safeAdd)(a, q), FreeVar(safeAdd)(x, t)),
s
...
...
@@ -82,7 +82,7 @@ md5cmn = (...) => FreeVar(safeAdd)(
b
)
md5ff = (...) => md5cmn(???*0*, a, b, x, s, t)
md5ff
(const after eval)
= (...) => md5cmn(???*0*, a, b, x, s, t)
- *0* unsupported expression
⚠️ This value might have side effects
...
...
@@ -112,7 +112,7 @@ t#5 = arguments[5]
t#6 = arguments[6]
wordsToMd5 = (...) => [a, b, c, d]
wordsToMd5
(const after eval)
= (...) => [a, b, c, d]
x#3 = arguments[0]
...
...
turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/md5/graph-explained.snapshot
View file @
5064eefd
...
...
@@ -106,13 +106,13 @@ b#7 = (
- *12* unsupported expression
⚠️ This value might have side effects
bitRotateLeft = (...) => ???*0*
bitRotateLeft
(const after eval)
= (...) => ???*0*
- *0* unsupported expression
⚠️ This value might have side effects
bytes = (arguments[0] | new FreeVar(Array)(msg["length"]))
bytesToWords = (...) => output
bytesToWords
(const after eval)
= (...) => output
c#15 = arguments[2]
...
...
@@ -272,30 +272,30 @@ lsw = (???*0* + ???*1*)
- *1* unsupported expression
⚠️ This value might have side effects
md5 = (...) => md5ToHexEncodedArray(wordsToMd5(bytesToWords(bytes), ???*0*))
md5
(const after eval)
= (...) => md5ToHexEncodedArray(wordsToMd5(bytesToWords(bytes), ???*0*))
- *0* unsupported expression
⚠️ This value might have side effects
md5ToHexEncodedArray = (...) => output
md5ToHexEncodedArray
(const after eval)
= (...) => output
md5cmn = (...) => safeAdd(
md5cmn
(const after eval)
= (...) => safeAdd(
bitRotateLeft(safeAdd(safeAdd(a, q), safeAdd(x, t)), s),
b
)
md5ff = (...) => md5cmn(???*0*, a, b, x, s, t)
md5ff
(const after eval)
= (...) => md5cmn(???*0*, a, b, x, s, t)
- *0* unsupported expression
⚠️ This value might have side effects
md5gg = (...) => md5cmn(???*0*, a, b, x, s, t)
md5gg
(const after eval)
= (...) => md5cmn(???*0*, a, b, x, s, t)
- *0* unsupported expression
⚠️ This value might have side effects
md5hh = (...) => md5cmn(???*0*, a, b, x, s, t)
md5hh
(const after eval)
= (...) => md5cmn(???*0*, a, b, x, s, t)
- *0* unsupported expression
⚠️ This value might have side effects
md5ii = (...) => md5cmn(???*0*, a, b, x, s, t)
md5ii
(const after eval)
= (...) => md5cmn(???*0*, a, b, x, s, t)
- *0* unsupported expression
⚠️ This value might have side effects
...
...
@@ -346,7 +346,7 @@ s#17 = arguments[5]
s#18 = arguments[5]
safeAdd = (...) => ???*0*
safeAdd
(const after eval)
= (...) => ???*0*
- *0* unsupported expression
⚠️ This value might have side effects
...
...
@@ -360,7 +360,7 @@ t#17 = arguments[6]
t#18 = arguments[6]
wordsToMd5 = (...) => [a, b, c, d]
wordsToMd5
(const after eval)
= (...) => [a, b, c, d]
x#12 = arguments[0]
...
...
turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/md5_2/graph-explained.snapshot
View file @
5064eefd
*anonymous function 181* = (...) => crypt["endian"]([a, b, c, d])
*anonymous function 181*
(const after eval)
= (...) => crypt["endian"]([a, b, c, d])
*anonymous function 5013* = (...) => (???*0* + b)
*anonymous function 5013*
(const after eval)
= (...) => (???*0* + b)
- *0* unsupported expression
⚠️ This value might have side effects
*anonymous function 5163* = (...) => (???*0* + b)
*anonymous function 5163*
(const after eval)
= (...) => (???*0* + b)
- *0* unsupported expression
⚠️ This value might have side effects
*anonymous function 5313* = (...) => (???*0* + b)
*anonymous function 5313*
(const after eval)
= (...) => (???*0* + b)
- *0* unsupported expression
⚠️ This value might have side effects
*anonymous function 5454* = (...) => (???*0* + b)
*anonymous function 5454*
(const after eval)
= (...) => (???*0* + b)
- *0* unsupported expression
⚠️ This value might have side effects
*anonymous function 5685* = (...) => ((options && options["asBytes"]) ? digestbytes : ((options && options["asString"]) ? bin["bytesToString"](digestbytes) : crypt["bytesToHex"](digestbytes)))
*anonymous function 5685*
(const after eval)
= (...) => ((options && options["asBytes"]) ? digestbytes : ((options && options["asString"]) ? bin["bytesToString"](digestbytes) : crypt["bytesToHex"](digestbytes)))
FF = md5["_ff"]
...
...
@@ -135,7 +135,7 @@ b#9 = arguments[1]
bb = (b | undefined)
bin = FreeVar(require)("charenc")["bin"]
bin
(const after eval)
= FreeVar(require)("charenc")["bin"]
c#10 = arguments[2]
...
...
@@ -189,7 +189,7 @@ c#9 = arguments[2]
cc = (c | undefined)
crypt = FreeVar(require)("crypt")
crypt
(const after eval)
= FreeVar(require)("crypt")
d#10 = arguments[3]
...
...
@@ -254,7 +254,7 @@ i = (0 | ???*0* | (i + 16))
- *0* updated with update expression
⚠️ This value might have side effects
isBuffer = FreeVar(require)("is-buffer")
isBuffer
(const after eval)
= FreeVar(require)("is-buffer")
l = ???*0*
- *0* unsupported expression
...
...
@@ -262,7 +262,7 @@ l = ???*0*
m = crypt["bytesToWords"](message)
md5 = *anonymous function 181*
md5
(const after eval)
= *anonymous function 181*
message#11 = arguments[0]
...
...
@@ -318,7 +318,7 @@ t#8 = arguments[6]
t#9 = arguments[6]
utf8 = FreeVar(require)("charenc")["utf8"]
utf8
(const after eval)
= FreeVar(require)("charenc")["utf8"]
x#10 = arguments[4]
...
...
turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/member-call/graph-explained.snapshot
View file @
5064eefd
array = [1, 2, 3]
array
(const after eval)
= [1, 2, 3]
arrays = ([1, 2, 3] | [4, 5, 6])
arrays
(const after eval)
= ([1, 2, 3] | [4, 5, 6])
concatenated_array = array["concat"](4, 5, 6, [7, 8, 9], `hello ${item}`)
concatenated_array
(const after eval)
= array["concat"](4, 5, 6, [7, 8, 9], `hello ${item}`)
concatenated_array_options = array["concat"]([7, 8, 9])
concatenated_array_options
(const after eval)
= array["concat"]([7, 8, 9])
item = array[1]
item
(const after eval)
= array[1]
item_options = arrays[1]
item_options
(const after eval)
= arrays[1]
pick_array1 = [[1, 2, 3]][0]["concat"]([4, 5, 6, FreeVar(unknown)])
pick_array1
(const after eval)
= [[1, 2, 3]][0]["concat"]([4, 5, 6, FreeVar(unknown)])
pick_array2 = [[1, 2, 3]][0]["concat"](4, 5, 6, FreeVar(unknown))
pick_array2
(const after eval)
= [[1, 2, 3]][0]["concat"](4, 5, 6, FreeVar(unknown))
turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/mongoose-reduced/graph-explained.snapshot
View file @
5064eefd
Collection = FreeVar(require)(`${driver}/collection`)
Collection
(const after eval)
= FreeVar(require)(`${driver}/collection`)
Connection = FreeVar(require)(`${driver}/connection`)
Connection
(const after eval)
= FreeVar(require)(`${driver}/connection`)
driver = (FreeVar(global)["MONGOOSE_DRIVER_PATH"] || "./drivers/node-mongodb-native")
driver
(const after eval)
= (FreeVar(global)["MONGOOSE_DRIVER_PATH"] || "./drivers/node-mongodb-native")
turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/nested-args/graph-explained.snapshot
View file @
5064eefd
...
...
@@ -10,16 +10,16 @@ b#5 = arguments[0]
inner = (...) => (a + b)
outer = (...) => inner("b")
outer
(const after eval)
= (...) => inner("b")
r = (...) => (a | (r((a + 1)) + 1))
r
(const after eval)
= (...) => (a | (r((a + 1)) + 1))
v1 = x(1)(2)
v1
(const after eval)
= x(1)(2)
v2 = r(2)
v2
(const after eval)
= r(2)
v3 = outer("a")
v3
(const after eval)
= outer("a")
x = (...) => y
x
(const after eval)
= (...) => y
y = (...) => (a + b)
turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/nested/graph-explained.snapshot
View file @
5064eefd
*anonymous function 66* = (...) => undefined
*anonymous function 66*
(const after eval)
= (...) => undefined
*arrow function 118* = (...) => undefined
*arrow function 118*
(const after eval)
= (...) => undefined
*arrow function 229* = (...) => undefined
*arrow function 229*
(const after eval)
= (...) => undefined
a = (...) => undefined
a
(const after eval)
= (...) => undefined
b = *anonymous function 66*
b
(const after eval)
= *anonymous function 66*
c = *arrow function 118*
c
(const after eval)
= *arrow function 118*
d = ???*0*
d
(const after eval)
= ???*0*
- *0* unsupported expression
⚠️ This value might have side effects
e = (...) => undefined
e
(const after eval)
= (...) => undefined
f = e
f
(const after eval)
= e
x#3 = 1
...
...
turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/new-url/graph-explained.snapshot
View file @
5064eefd
asset = new FreeVar(URL)("./worker.ts", import.meta*0*["url"])
asset
(const after eval)
= new FreeVar(URL)("./worker.ts", import.meta*0*["url"])
- *0* import.meta: The import.meta object
turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/object/graph-explained.snapshot
View file @
5064eefd
a = object["a"]
a
(const after eval)
= object["a"]
a1 = object["a"]
a1
(const after eval)
= object["a"]
a2 = object["a"]
a2
(const after eval)
= object["a"]
a3 = object_spread["a"]
a3
(const after eval)
= object_spread["a"]
a4 = object["a"]
a4
(const after eval)
= object["a"]
a5 = unknown_spread["a"]
a5
(const after eval)
= unknown_spread["a"]
a6 = object2["a"]
a6
(const after eval)
= object2["a"]
b = object["b"]
b
(const after eval)
= object["b"]
b1 = object["b"]
b1
(const after eval)
= object["b"]
b2 = object["b"]
b2
(const after eval)
= object["b"]
b3 = object_spread["b"]
b3
(const after eval)
= object_spread["b"]
b4 = object["b"]
b4
(const after eval)
= object["b"]
b5 = unknown_spread["b"]
b5
(const after eval)
= unknown_spread["b"]
b6 = object2["b"]
b6
(const after eval)
= object2["b"]
c = object["c"]
c
(const after eval)
= object["c"]
c1 = object["c"]
c1
(const after eval)
= object["c"]
c2 = object["c"]
c2
(const after eval)
= object["c"]
c3 = object_spread["c"]
c3
(const after eval)
= object_spread["c"]
c4 = object["c"]
c4
(const after eval)
= object["c"]
c5 = unknown_spread["c"]
c5
(const after eval)
= unknown_spread["c"]
c6 = object2["c"]
c6
(const after eval)
= object2["c"]
d = object["d"]
d
(const after eval)
= object["d"]
d1 = object["d"]
d1
(const after eval)
= object["d"]
d2 = object["d"]
d2
(const after eval)
= object["d"]
d3 = object_spread["d"]
d3
(const after eval)
= object_spread["d"]
d4 = object["d"]
d4
(const after eval)
= object["d"]
d6 = object2["d"]
d6
(const after eval)
= object2["d"]
e6 = object2["e"]
e6
(const after eval)
= object2["e"]
object = {"a": 1, "b": 2, "c": 3}
object
(const after eval)
= {"a": 1, "b": 2, "c": 3}
object2 = {"a": 1, FreeVar(global): 2, "c": 3, FreeVar(global): 4, "e": 5}
object2
(const after eval)
= {"a": 1, FreeVar(global): 2, "c": 3, FreeVar(global): 4, "e": 5}
object_spread = {"a": 11, ...object, "b": 22}
object_spread
(const after eval)
= {"a": 11, ...object, "b": 22}
unknown_spread = {"a": 1, ...FreeVar(global), "b": 2}
unknown_spread
(const after eval)
= {"a": 1, ...FreeVar(global), "b": 2}
turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/op-assign/graph-explained.snapshot
View file @
5064eefd
...
...
@@ -12,7 +12,7 @@ clientComponentLoadTimes = (0 | (clientComponentLoadTimes + ???*0*))
- *0* unsupported expression
⚠️ This value might have side effects
getClientComponentLoaderMetrics = (...) => metrics
getClientComponentLoaderMetrics
(const after eval)
= (...) => metrics
metrics = ((clientComponentLoadTimes === 0) ? FreeVar(undefined) : {
"clientComponentLoadTimes": clientComponentLoadTimes
...
...
@@ -24,4 +24,4 @@ options = ???*0*
startTime = FreeVar(performance)["now"]()
wrapClientComponentLoader = (...) => {"loadChunk": *arrow function 173*}
wrapClientComponentLoader
(const after eval)
= (...) => {"loadChunk": *arrow function 173*}
turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/other-free-vars/graph-explained.snapshot
View file @
5064eefd
O = FreeVar(Object)
O
(const after eval)
= FreeVar(Object)
a = FreeVar(Object)["keys"](O)
a
(const after eval)
= FreeVar(Object)["keys"](O)
b = O["keys"](FreeVar(Object))
b
(const after eval)
= O["keys"](FreeVar(Object))
turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/pack-2236/graph-explained.snapshot
View file @
5064eefd
Redis = ((typeof(FreeVar(EdgeRuntime)) === "undefined") ? FreeVar(require)("ioredis") : module<@upstash/redis, {}>["Redis"])
Redis
(const after eval)
= ((typeof(FreeVar(EdgeRuntime)) === "undefined") ? FreeVar(require)("ioredis") : module<@upstash/redis, {}>["Redis"])
turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/pack-2521/graph-explained.snapshot
View file @
5064eefd
err = ???*0*
err
(const after eval)
= ???*0*
- *0* err
⚠️ pattern without value
errors = []
errors
(const after eval)
= []
path = Iterated(paths)
path
(const after eval)
= Iterated(paths)
paths = [
paths
(const after eval)
= [
`../src/build/Release/sharp-${runtimePlatform}.node`,
"../src/build/Release/sharp-wasm32.node",
`@img/sharp-${runtimePlatform}/sharp.node`,
"@img/sharp-wasm32/sharp.node"
]
runtimePlatform = runtimePlatformArch()
runtimePlatform
(const after eval)
= runtimePlatformArch()
runtimePlatformArch = FreeVar(require)("./libvips")["runtimePlatformArch"]
runtimePlatformArch
(const after eval)
= FreeVar(require)("./libvips")["runtimePlatformArch"]
sharp = (???*0* | FreeVar(require)(path))
sharp
(const after eval)
= (???*0* | FreeVar(require)(path))
- *0* sharp
⚠️ pattern without value
turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/pack-2682/graph-explained.snapshot
View file @
5064eefd
*arrow function 24* = (...) => FreeVar(JSON)["stringify"](
*arrow function 24*
(const after eval)
= (...) => FreeVar(JSON)["stringify"](
{
"condition": (variable === "true"),
"buggedConditionalCheck": ((variable === "true") ? "true" : "false")
}
)
BuggyArguments = *arrow function 24*
BuggyArguments
(const after eval)
= *arrow function 24*
res = BuggyArguments({"variable": "false"})
res
(const after eval)
= BuggyArguments({"variable": "false"})
variable = (arguments[0]["variable"] | "true")
turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/path-join/graph-explained.snapshot
View file @
5064eefd
a = FreeVar(require)("foo")
a
(const after eval)
= FreeVar(require)("foo")
p1 = FreeVar(require)("path")
p1
(const after eval)
= FreeVar(require)("path")
path = FreeVar(require)("path")
path
(const after eval)
= FreeVar(require)("path")
path_join1 = p1["join"]
path_join1
(const after eval)
= p1["join"]
path_join2 = module<path, {}>["default"]["join"]
path_join2
(const after eval)
= module<path, {}>["default"]["join"]
path_join3 = module<path, {}>["join"]
path_join3
(const after eval)
= module<path, {}>["join"]
path_join4 = await(FreeVar(import)("path"))["join"]
path_join4
(const after eval)
= await(FreeVar(import)("path"))["join"]
z1_joined = path["join"]("foo", "bar")
z1_joined
(const after eval)
= path["join"]("foo", "bar")
z2_joined = path["join"]("foo/", "bar")
z2_joined
(const after eval)
= path["join"]("foo/", "bar")
z3_joined = path["join"]("foo", "/bar")
z3_joined
(const after eval)
= path["join"]("foo", "/bar")
z4_joined = path["join"]("foo/", "/bar")
z4_joined
(const after eval)
= path["join"]("foo/", "/bar")
z5_joined = path["join"]("foo", "bar", "..", "baz", FreeVar(global), "..", "foo")
z5_joined
(const after eval)
= path["join"]("foo", "bar", "..", "baz", FreeVar(global), "..", "foo")
turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/pattern-assignment/graph-explained.snapshot
View file @
5064eefd
arrPatternBool = (true | false)
arrPatternBool
(const after eval)
= (true | false)
nestedPatternBool = ({"inner": [true]}["inner"][0] | {"inner": [false]}["inner"][0])
nestedPatternBool
(const after eval)
= ({"inner": [true]}["inner"][0] | {"inner": [false]}["inner"][0])
objPatternBool = ({"objPatternBool": true}["objPatternBool"] | {"objPatternBool": false}["objPatternBool"])
objPatternBool
(const after eval)
= ({"objPatternBool": true}["objPatternBool"] | {"objPatternBool": false}["objPatternBool"])
singleAssignBool = {"singleAssignBool": true}["singleAssignBool"]
singleAssignBool
(const after eval)
= {"singleAssignBool": true}["singleAssignBool"]
turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/peg/graph-explained.snapshot
View file @
5064eefd
...
...
@@ -140,7 +140,7 @@
*anonymous function 5936* = (...) => {"type": "sort_expression", "expression": expression, "order": order}
*anonymous function 625* = (...) => `Expected ${describeExpected(expected)} but ${describeFound(found)} found.`
*anonymous function 625*
(const after eval)
= (...) => `Expected ${describeExpected(expected)} but ${describeFound(found)} found.`
*anonymous function 6287* = (...) => {"type": "scalar_function_expression", "name": name, "arguments": args, "udf": true}
...
...
@@ -489,7 +489,7 @@ parts = arguments[0]
peg$FAILED = {}
peg$SyntaxError = (...) => undefined
peg$SyntaxError
(const after eval)
= (...) => undefined
peg$anyExpectation = (...) => {"type": "any"}
...
...
@@ -1089,7 +1089,7 @@ peg$maxFailPos = (0 | peg$currPos)
peg$otherExpectation = (...) => {"type": "other", "description": description}
peg$parse = (...) => (peg$result | undefined)
peg$parse
(const after eval)
= (...) => (peg$result | undefined)
peg$parse_ = (...) => s0
...
...
@@ -1370,7 +1370,7 @@ peg$startRuleFunction = (peg$parsesql | peg$startRuleFunctions[options["startRul
peg$startRuleFunctions = {"sql": peg$parsesql}
peg$subclass = (...) => undefined
peg$subclass
(const after eval)
= (...) => undefined
pos = arguments[0]
...
...
turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/process-and-os/graph-explained.snapshot
View file @
5064eefd
arch = FreeVar(require)("os")["arch"]
arch
(const after eval)
= FreeVar(require)("os")["arch"]
binding1 = FreeVar(require)(
binding1
(const after eval)
= FreeVar(require)(
`esbuild-${FreeVar(process)["arch"]}-${platform()}-${endianness()}`
)
binding2 = FreeVar(require)(`esbuild-${arch()}-${platform()}-${endianness()}`)
binding2
(const after eval)
= FreeVar(require)(`esbuild-${arch()}-${platform()}-${endianness()}`)
binding3 = FreeVar(require)(
binding3
(const after eval)
= FreeVar(require)(
`esbuild-${arch()}-${FreeVar(process)["platform"]}-${endianness()}`
)
binding4 = FreeVar(require)(
binding4
(const after eval)
= FreeVar(require)(
`esbuild-${FreeVar(process)["arch"]}-${FreeVar(process)["platform"]}-${endianness()}`
)
binding5 = FreeVar(require)(
binding5
(const after eval)
= FreeVar(require)(
`esbuild-${p["arch"]}-${p["platform"]}-${endianness()}`
)
binding6 = FreeVar(require)(
binding6
(const after eval)
= FreeVar(require)(
`esbuild-${p["arch"]}-${processPlatform}-${endianness()}`
)
endianness = FreeVar(require)("os")["endianness"]
endianness
(const after eval)
= FreeVar(require)("os")["endianness"]
p = FreeVar(process)
p
(const after eval)
= FreeVar(process)
platform = FreeVar(require)("os")["platform"]
platform
(const after eval)
= FreeVar(require)("os")["platform"]
processPlatform = FreeVar(require)("process")["platform"]
processPlatform
(const after eval)
= FreeVar(require)("process")["platform"]
turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/react-dom-production/graph-explained.snapshot
View file @
5064eefd
This diff is collapsed.
Click to expand it.
turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/require-context/graph-explained.snapshot
View file @
5064eefd
a = context["resolve"]("./a")
a
(const after eval)
= context["resolve"]("./a")
context = FreeVar(require)["context"]("./test", false, /\.test\.js$/)
context
(const after eval)
= FreeVar(require)["context"]("./test", false, /\.test\.js$/)
importAll = (...) => r["keys"]()["map"](r)
importAll
(const after eval)
= (...) => r["keys"]()["map"](r)
items = importAll(context)
items
(const after eval)
= importAll(context)
r = arguments[0]
turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/sequences/graph-explained.snapshot
View file @
5064eefd
x = (1 | ???*0*)
x
(const after eval)
= (1 | ???*0*)
- *0* updated with update expression
⚠️ This value might have side effects
y = ???*0*
y
(const after eval)
= ???*0*
- *0* 2
⚠️ sequence with side effects
⚠️ This value might have side effects
turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/try/graph-explained.snapshot
View file @
5064eefd
e = ???*0*
e
(const after eval)
= ???*0*
- *0* e
⚠️ pattern without value
pkg = (???*0* | FreeVar(require)("packages/not-found") | FreeVar(require)("packages/found"))
pkg
(const after eval)
= (???*0* | FreeVar(require)("packages/not-found") | FreeVar(require)("packages/found"))
- *0* pkg
⚠️ pattern without value
turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/turbopack-ignore/graph-explained.snapshot
View file @
5064eefd
exported_t_r = FreeVar(require)("exported_t_r")
exported_t_r
(const after eval)
= FreeVar(require)("exported_t_r")
t_i = await(FreeVar(import)("t_i"))
t_i
(const after eval)
= await(FreeVar(import)("t_i"))
t_r = (
t_r
(const after eval)
= (
| FreeVar(require)("w_i_f")
| FreeVar(require)("t_i_f")
| FreeVar(require)("t_r_t")
| FreeVar(require)("t_r_f")
)
w_i = await(FreeVar(import)("w_i"))
w_i
(const after eval)
= await(FreeVar(import)("w_i"))
w_r = (FreeVar(require)("w_r_t") | FreeVar(require)("w_r_f"))
w_r
(const after eval)
= (FreeVar(require)("w_r_t") | FreeVar(require)("w_r_f"))
turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/unreachable-break/graph-explained.snapshot
View file @
5064eefd
A = (...) => undefined
A
(const after eval)
= (...) => undefined
B = (...) => undefined
B
(const after eval)
= (...) => undefined
C = (...) => undefined
C
(const after eval)
= (...) => undefined
v = arguments[0]
turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/unreachable/graph-explained.snapshot
View file @
5064eefd
*arrow function 567* = (...) => undefined
a = (...) => undefined
a
(const after eval)
= (...) => undefined
b = (...) => undefined
b
(const after eval)
= (...) => undefined
c = (...) => undefined
c
(const after eval)
= (...) => undefined
d = (...) => undefined
d
(const after eval)
= (...) => undefined
e#16 = ???*0*
- *0* e
⚠️ pattern without value
e#2 = (...) => undefined
e#2
(const after eval)
= (...) => undefined
f = (...) => undefined
f
(const after eval)
= (...) => undefined
g = (...) => undefined
g
(const after eval)
= (...) => undefined
h = (...) => undefined
h
(const after eval)
= (...) => undefined
x#10 = ???*0*
- *0* for-in variable currently not analyzed
...
...
turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/webpack-target-node/graph-explained.snapshot
View file @
5064eefd
*arrow function 1213* = (...) => __webpack_require__(???*0*)
*arrow function 1213*
(const after eval)
= (...) => __webpack_require__(???*0*)
- *0* unsupported expression
⚠️ This value might have side effects
*arrow function 131* = (...) => undefined
*arrow function 131*
(const after eval)
= (...) => undefined
*arrow function 389* = (...) => handler
__unused_webpack_module = arguments[0]
__webpack_exec__ = (*arrow function 1213* | undefined)
__webpack_exec__
(const after eval)
= (*arrow function 1213* | undefined)
__webpack_exports__#3 = (__webpack_exec__(5166) | undefined)
__webpack_exports__#3
(const after eval)
= (__webpack_exec__(5166) | undefined)
__webpack_exports__#4 = arguments[1]
__webpack_require__#3 = (FreeVar(require)("../../webpack-api-runtime.js") | undefined)
__webpack_require__#3
(const after eval)
= (FreeVar(require)("../../webpack-api-runtime.js") | undefined)
__webpack_require__#4 = arguments[2]
_req = arguments[0]
exports = ({} | undefined)
exports
(const after eval)
= ({} | undefined)
handler = (...) => undefined
...
...
turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/worker/graph-explained.snapshot
View file @
5064eefd
workerUrl = new FreeVar(URL)("./worker.ts", import.meta*0*["url"])
workerUrl
(const after eval)
= new FreeVar(URL)("./worker.ts", import.meta*0*["url"])
- *0* import.meta: The import.meta object
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