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
97169e42
Commit
97169e42
authored
Nov 06, 2025
by
Luke Sandberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
support null safe access
parent
f525a90e
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
3598 additions
and
8 deletions
+3598
-8
graph.rs
turbopack/crates/turbopack-ecmascript/src/analyzer/graph.rs
+234
-2
mod.rs
turbopack/crates/turbopack-ecmascript/src/analyzer/mod.rs
+13
-0
mod.rs
turbopack/crates/turbopack-ecmascript/src/references/mod.rs
+25
-1
graph-effects.snapshot
...cript/tests/analyzer/graph/logical/graph-effects.snapshot
+2783
-0
graph-explained.snapshot
...ipt/tests/analyzer/graph/logical/graph-explained.snapshot
+30
-0
graph.snapshot
...ck-ecmascript/tests/analyzer/graph/logical/graph.snapshot
+277
-0
input.js
...urbopack-ecmascript/tests/analyzer/graph/logical/input.js
+19
-0
resolved-effects.snapshot
...pt/tests/analyzer/graph/logical/resolved-effects.snapshot
+120
-0
resolved-explained.snapshot
.../tests/analyzer/graph/logical/resolved-explained.snapshot
+90
-0
index.js
...opack-tests/tests/snapshot/comptime/define/input/index.js
+1
-0
aaf3a_crates_turbopack-tests_tests_snapshot_comptime_define_input_index_aec19b5a.js
...ts_tests_snapshot_comptime_define_input_index_aec19b5a.js
+4
-3
aaf3a_crates_turbopack-tests_tests_snapshot_comptime_define_input_index_aec19b5a.js.map
...ests_snapshot_comptime_define_input_index_aec19b5a.js.map
+2
-2
No files found.
turbopack/crates/turbopack-ecmascript/src/analyzer/graph.rs
View file @
97169e42
This diff is collapsed.
Click to expand it.
turbopack/crates/turbopack-ecmascript/src/analyzer/mod.rs
View file @
97169e42
...
@@ -4215,6 +4215,19 @@ mod tests {
...
@@ -4215,6 +4215,19 @@ mod tests {
));
));
obj_steps
+
prop_steps
obj_steps
+
prop_steps
}
}
Effect
::
NullSafeAccessReceiver
{
obj
,
effects
,
..
}
=>
{
let
(
obj
,
obj_steps
)
=
resolve
(
&
var_graph
,
*
obj
,
ImportAttributes
::
empty_ref
(),
&
var_cache
,
)
.await
;
resolved
.push
((
format!
(
"{parent} -> {i} null safe receiver"
),
obj
));
queue
.extend
(
effects
.effects
.into_iter
()
.rev
()
.map
(|
e
|
(
i
,
e
)));
obj_steps
}
Effect
::
Unreachable
{
..
}
=>
{
Effect
::
Unreachable
{
..
}
=>
{
resolved
.push
((
resolved
.push
((
format!
(
"{parent} -> {i} unreachable"
),
format!
(
"{parent} -> {i} unreachable"
),
...
...
turbopack/crates/turbopack-ecmascript/src/references/mod.rs
View file @
97169e42
...
@@ -312,7 +312,7 @@ impl AnalyzeEcmascriptModuleResultBuilder {
...
@@ -312,7 +312,7 @@ impl AnalyzeEcmascriptModuleResultBuilder {
self
.async_module
=
ResolvedVc
::
cell
(
Some
(
async_module
));
self
.async_module
=
ResolvedVc
::
cell
(
Some
(
async_module
));
}
}
/// Set whether this module is side-eff
f
ect free according to a user-provided directive.
/// Set whether this module is side-effect free according to a user-provided directive.
pub
fn
set_has_side_effect_free_directive
(
&
mut
self
,
value
:
bool
)
{
pub
fn
set_has_side_effect_free_directive
(
&
mut
self
,
value
:
bool
)
{
self
.has_side_effect_free_directive
=
value
;
self
.has_side_effect_free_directive
=
value
;
}
}
...
@@ -1373,6 +1373,30 @@ async fn analyze_ecmascript_module_internal(
...
@@ -1373,6 +1373,30 @@ async fn analyze_ecmascript_module_internal(
handle_member
(
&
ast_path
,
obj
,
prop
,
span
,
&
analysis_state
,
&
mut
analysis
)
handle_member
(
&
ast_path
,
obj
,
prop
,
span
,
&
analysis_state
,
&
mut
analysis
)
.await
?
;
.await
?
;
}
}
Effect
::
NullSafeAccessReceiver
{
obj
,
ast_path
,
effects
,
}
=>
{
// Intentionally not awaited because `handle_member` reads this only when needed
let
obj
=
analysis_state
.link_value
(
*
obj
,
ImportAttributes
::
empty_ref
())
.await
?
;
if
matches!
(
obj
.is_nullish
(),
Some
(
true
))
{
// Replace the receiver expression but don't bother simplifying the chain,
// SWC can do that as part of minification.
if
analyze_mode
.is_code_gen
()
&&
!
obj
.has_side_effects
()
{
analysis
.add_code_gen
(
ConstantConditionCodeGen
::
new
(
ConstantConditionValue
::
Nullish
,
ast_path
.to_vec
()
.into
(),
));
}
}
else
{
queue_stack
.get_mut
()
.extend
(
effects
.effects
.into_iter
()
.map
(
Action
::
Effect
)
.rev
())
}
}
Effect
::
ImportedBinding
{
Effect
::
ImportedBinding
{
esm_reference_index
,
esm_reference_index
,
export
,
export
,
...
...
turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/logical/graph-effects.snapshot
View file @
97169e42
This diff is collapsed.
Click to expand it.
turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/logical/graph-explained.snapshot
View file @
97169e42
...
@@ -12,6 +12,34 @@ d (const after eval) = !(x)
...
@@ -12,6 +12,34 @@ d (const after eval) = !(x)
e (const after eval) = !(!(x))
e (const after eval) = !(!(x))
nullValue (const after eval) = null
opt1 (const after eval) = FreeVar(obj)["prop"]
opt10 (const after eval) = undefinedValue["prop"]
opt11 (const after eval) = nullValue["method"]()
opt12 (const after eval) = undefined
opt13 (const after eval) = undefined
opt2 (const after eval) = FreeVar(obj)["method"]()
opt3 (const after eval) = FreeVar(obj)["prop"]["nested"]
opt4 (const after eval) = FreeVar(obj)["prop"]["nested"]
opt5 (const after eval) = FreeVar(obj)["method"]()["result"]
opt6 (const after eval) = FreeVar(obj)["prop"]["method"]()["result"]
opt7 (const after eval) = FreeVar(obj)[FreeVar(computed)]
opt8 (const after eval) = FreeVar(obj)[FreeVar(computed)]["nested"]
opt9 (const after eval) = nullValue["prop"]
resolve1 (const after eval) = (1 && 2 && FreeVar(global) && 3 && 4)
resolve1 (const after eval) = (1 && 2 && FreeVar(global) && 3 && 4)
resolve2 (const after eval) = (1 && 2 && 0 && FreeVar(global) && 4)
resolve2 (const after eval) = (1 && 2 && 0 && FreeVar(global) && 4)
...
@@ -24,6 +52,8 @@ resolve5 (const after eval) = (FreeVar(global) && false)
...
@@ -24,6 +52,8 @@ resolve5 (const after eval) = (FreeVar(global) && false)
resolve6 (const after eval) = (false && FreeVar(global))
resolve6 (const after eval) = (false && FreeVar(global))
undefinedValue (const after eval) = undefined
x (const after eval) = true
x (const after eval) = true
y (const after eval) = false
y (const after eval) = false
turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/logical/graph.snapshot
View file @
97169e42
...
@@ -168,6 +168,277 @@
...
@@ -168,6 +168,277 @@
),
),
),
),
),
),
(
"nullValue",
Constant(
Null,
),
),
(
"opt1",
Member(
3,
FreeVar(
"obj",
),
Constant(
Str(
Atom(
"prop",
),
),
),
),
),
(
"opt10",
Member(
3,
Variable(
(
"undefinedValue",
#2,
),
),
Constant(
Str(
Atom(
"prop",
),
),
),
),
),
(
"opt11",
Call(
4,
Member(
3,
Variable(
(
"nullValue",
#2,
),
),
Constant(
Str(
Atom(
"method",
),
),
),
),
[],
),
),
(
"opt12",
Constant(
Undefined,
),
),
(
"opt13",
Constant(
Undefined,
),
),
(
"opt2",
Call(
4,
Member(
3,
FreeVar(
"obj",
),
Constant(
Str(
Atom(
"method",
),
),
),
),
[],
),
),
(
"opt3",
Member(
5,
Member(
3,
FreeVar(
"obj",
),
Constant(
Str(
Atom(
"prop",
),
),
),
),
Constant(
Str(
Atom(
"nested",
),
),
),
),
),
(
"opt4",
Member(
5,
Member(
3,
FreeVar(
"obj",
),
Constant(
Str(
Atom(
"prop",
),
),
),
),
Constant(
Str(
Atom(
"nested",
),
),
),
),
),
(
"opt5",
Member(
6,
Call(
4,
Member(
3,
FreeVar(
"obj",
),
Constant(
Str(
Atom(
"method",
),
),
),
),
[],
),
Constant(
Str(
Atom(
"result",
),
),
),
),
),
(
"opt6",
Member(
8,
Call(
6,
Member(
5,
Member(
3,
FreeVar(
"obj",
),
Constant(
Str(
Atom(
"prop",
),
),
),
),
Constant(
Str(
Atom(
"method",
),
),
),
),
[],
),
Constant(
Str(
Atom(
"result",
),
),
),
),
),
(
"opt7",
Member(
3,
FreeVar(
"obj",
),
FreeVar(
"computed",
),
),
),
(
"opt8",
Member(
5,
Member(
3,
FreeVar(
"obj",
),
FreeVar(
"computed",
),
),
Constant(
Str(
Atom(
"nested",
),
),
),
),
),
(
"opt9",
Member(
3,
Variable(
(
"nullValue",
#2,
),
),
Constant(
Str(
Atom(
"prop",
),
),
),
),
),
(
(
"resolve1",
"resolve1",
Logical(
Logical(
...
@@ -308,6 +579,12 @@
...
@@ -308,6 +579,12 @@
],
],
),
),
),
),
(
"undefinedValue",
Constant(
Undefined,
),
),
(
(
"x",
"x",
Constant(
Constant(
...
...
turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/logical/input.js
View file @
97169e42
...
@@ -14,3 +14,22 @@ let resolve3 = global || true;
...
@@ -14,3 +14,22 @@ let resolve3 = global || true;
let
resolve4
=
true
||
global
;
let
resolve4
=
true
||
global
;
let
resolve5
=
global
&&
false
;
let
resolve5
=
global
&&
false
;
let
resolve6
=
false
&&
global
;
let
resolve6
=
false
&&
global
;
// Optional chaining tests
let
opt1
=
obj
?.
prop
;
let
opt2
=
obj
?.
method
();
let
opt3
=
obj
?.
prop
.
nested
;
let
opt4
=
obj
?.
prop
?.
nested
;
let
opt5
=
obj
?.
method
()?.
result
;
let
opt6
=
obj
?.
prop
?.
method
?.().
result
;
let
opt7
=
obj
?.[
computed
];
let
opt8
=
obj
?.[
computed
]?.
nested
;
// Optional chaining with known null/undefined values
let
nullValue
=
null
;
let
undefinedValue
=
undefined
;
let
opt9
=
nullValue
?.
prop
;
let
opt10
=
undefinedValue
?.
prop
;
let
opt11
=
nullValue
?.
method
();
let
opt12
=
null
?.
prop
;
let
opt13
=
undefined
?.
prop
;
turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/logical/resolved-effects.snapshot
View file @
97169e42
...
@@ -75,3 +75,123 @@
...
@@ -75,3 +75,123 @@
0 -> 29 conditional = false
0 -> 29 conditional = false
29 -> 30 free var = FreeVar(global)
29 -> 30 free var = FreeVar(global)
0 -> 31 free var = FreeVar(obj)
0 -> 32 null safe receiver = ???*0*
- *0* FreeVar(obj)
⚠️ unknown global
⚠️ This value might have side effects
0 -> 34 free var = FreeVar(obj)
0 -> 35 null safe receiver = ???*0*
- *0* FreeVar(obj)
⚠️ unknown global
⚠️ This value might have side effects
0 -> 38 free var = FreeVar(obj)
0 -> 39 null safe receiver = ???*0*
- *0* FreeVar(obj)
⚠️ unknown global
⚠️ This value might have side effects
0 -> 41 free var = FreeVar(obj)
0 -> 42 null safe receiver = ???*0*
- *0* FreeVar(obj)
⚠️ unknown global
⚠️ This value might have side effects
0 -> 44 null safe receiver = ???*0*
- *0* ???*1*["prop"]
⚠️ unknown object
⚠️ This value might have side effects
- *1* FreeVar(obj)
⚠️ unknown global
⚠️ This value might have side effects
0 -> 46 free var = FreeVar(obj)
0 -> 47 null safe receiver = ???*0*
- *0* FreeVar(obj)
⚠️ unknown global
⚠️ This value might have side effects
0 -> 49 null safe receiver = ???*0*()
- *0* ???*1*["method"]
⚠️ unknown object
⚠️ This value might have side effects
- *1* FreeVar(obj)
⚠️ unknown global
⚠️ This value might have side effects
0 -> 52 free var = FreeVar(obj)
0 -> 53 null safe receiver = ???*0*
- *0* FreeVar(obj)
⚠️ unknown global
⚠️ This value might have side effects
0 -> 55 null safe receiver = ???*0*
- *0* ???*1*["prop"]
⚠️ unknown object
⚠️ This value might have side effects
- *1* FreeVar(obj)
⚠️ unknown global
⚠️ This value might have side effects
0 -> 57 null safe receiver = ???*0*
- *0* ???*1*["method"]
⚠️ unknown object
⚠️ This value might have side effects
- *1* ???*2*["prop"]
⚠️ unknown object
⚠️ This value might have side effects
- *2* FreeVar(obj)
⚠️ unknown global
⚠️ This value might have side effects
57 -> 58 call = ???*0*()
- *0* ???*1*["method"]
⚠️ unknown object
⚠️ This value might have side effects
- *1* ???*2*["prop"]
⚠️ unknown object
⚠️ This value might have side effects
- *2* FreeVar(obj)
⚠️ unknown global
⚠️ This value might have side effects
0 -> 59 free var = FreeVar(obj)
0 -> 60 null safe receiver = ???*0*
- *0* FreeVar(obj)
⚠️ unknown global
⚠️ This value might have side effects
0 -> 62 free var = FreeVar(obj)
0 -> 63 null safe receiver = ???*0*
- *0* FreeVar(obj)
⚠️ unknown global
⚠️ This value might have side effects
0 -> 65 null safe receiver = ???*0*
- *0* ???*1*[FreeVar(computed)]
⚠️ unknown object
⚠️ This value might have side effects
- *1* FreeVar(obj)
⚠️ unknown global
⚠️ This value might have side effects
0 -> 67 null safe receiver = null
0 -> 69 null safe receiver = undefined
0 -> 71 null safe receiver = null
0 -> 73 null safe receiver = null
0 -> 75 null safe receiver = undefined
turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/logical/resolved-explained.snapshot
View file @
97169e42
...
@@ -18,6 +18,94 @@ d = false
...
@@ -18,6 +18,94 @@ d = false
e = true
e = true
nullValue = null
opt1 = ???*0*
- *0* ???*1*["prop"]
⚠️ unknown object
⚠️ This value might have side effects
- *1* FreeVar(obj)
⚠️ unknown global
⚠️ This value might have side effects
opt10 = undefined["prop"]
opt11 = null["method"]()
opt12 = undefined
opt13 = undefined
opt2 = ???*0*()
- *0* ???*1*["method"]
⚠️ unknown object
⚠️ This value might have side effects
- *1* FreeVar(obj)
⚠️ unknown global
⚠️ This value might have side effects
opt3 = ???*0*
- *0* ???*1*["nested"]
⚠️ unknown object
⚠️ This value might have side effects
- *1* ???*2*["prop"]
⚠️ unknown object
⚠️ This value might have side effects
- *2* FreeVar(obj)
⚠️ unknown global
⚠️ This value might have side effects
opt4 = ???*0*
- *0* ???*1*["nested"]
⚠️ unknown object
⚠️ This value might have side effects
- *1* ???*2*["prop"]
⚠️ unknown object
⚠️ This value might have side effects
- *2* FreeVar(obj)
⚠️ unknown global
⚠️ This value might have side effects
opt5 = ???*0*()["result"]
- *0* ???*1*["method"]
⚠️ unknown object
⚠️ This value might have side effects
- *1* FreeVar(obj)
⚠️ unknown global
⚠️ This value might have side effects
opt6 = ???*0*()["result"]
- *0* ???*1*["method"]
⚠️ unknown object
⚠️ This value might have side effects
- *1* ???*2*["prop"]
⚠️ unknown object
⚠️ This value might have side effects
- *2* FreeVar(obj)
⚠️ unknown global
⚠️ This value might have side effects
opt7 = ???*0*
- *0* ???*1*[FreeVar(computed)]
⚠️ unknown object
⚠️ This value might have side effects
- *1* FreeVar(obj)
⚠️ unknown global
⚠️ This value might have side effects
opt8 = ???*0*
- *0* ???*1*["nested"]
⚠️ unknown object
⚠️ This value might have side effects
- *1* ???*2*[FreeVar(computed)]
⚠️ unknown object
⚠️ This value might have side effects
- *2* FreeVar(obj)
⚠️ unknown global
⚠️ This value might have side effects
opt9 = null["prop"]
resolve1 = (???*0* | 4)
resolve1 = (???*0* | 4)
- *0* FreeVar(global)
- *0* FreeVar(global)
⚠️ unknown global
⚠️ unknown global
...
@@ -39,6 +127,8 @@ resolve5 = (???*0* | false){falsy}
...
@@ -39,6 +127,8 @@ resolve5 = (???*0* | false){falsy}
resolve6 = false
resolve6 = false
undefinedValue = undefined
x = true
x = true
y = false
y = false
turbopack/crates/turbopack-tests/tests/snapshot/comptime/define/input/index.js
View file @
97169e42
...
@@ -58,5 +58,6 @@ p.env.NODE_ENV == 'production'
...
@@ -58,5 +58,6 @@ p.env.NODE_ENV == 'production'
p
.
env
.
NODE_ENV
!=
'production'
&&
console
.
log
(
'development'
)
p
.
env
.
NODE_ENV
!=
'production'
&&
console
.
log
(
'development'
)
p
.
env
.
NODE_ENV
==
'production'
&&
console
.
log
(
'production'
)
p
.
env
.
NODE_ENV
==
'production'
&&
console
.
log
(
'production'
)
console
.
log
(
DEFINED_NULL
?.
foo
??
console
.
log
(
'defined'
))
console
.
log
(
__dirname
)
console
.
log
(
__dirname
)
turbopack/crates/turbopack-tests/tests/snapshot/comptime/define/output/aaf3a_crates_turbopack-tests_tests_snapshot_comptime_define_input_index_aec19b5a.js
View file @
97169e42
...
@@ -54,10 +54,11 @@ console.log(("TURBOPACK compile-time value", "development"));
...
@@ -54,10 +54,11 @@ console.log(("TURBOPACK compile-time value", "development"));
if
(
"TURBOPACK compile-time falsy"
,
0
)
//TURBOPACK unreachable
if
(
"TURBOPACK compile-time falsy"
,
0
)
//TURBOPACK unreachable
;
;
(
"TURBOPACK compile-time falsy"
,
0
)
?
"TURBOPACK unreachable"
:
console
.
log
(
'development'
);
(
"TURBOPACK compile-time falsy"
,
0
)
?
"TURBOPACK unreachable"
:
console
.
log
(
'development'
);
"TURBOPACK simplified expression"
,
console
.
log
(
'development'
);
(
"TURBOPACK compile-time truthy"
,
1
)
&&
console
.
log
(
'development'
);
"TURBOPACK simplified expression"
,
(
"TURBOPACK compile-time value"
,
"development"
)
==
'production'
;
(
"TURBOPACK compile-time value"
,
"development"
)
==
'production'
&&
"TURBOPACK unreachable"
;
console
.
log
(
DEFINED_NULL
?.
foo
??
console
.
log
(
'defined'
));
console
.
log
((
"TURBOPACK compile-time value"
,
"/ROOT/turbopack/crates/turbopack-tests/tests/snapshot/comptime/define/input"
));
console
.
log
((
"TURBOPACK compile-time value"
,
"/ROOT/turbopack/crates/turbopack-tests/tests/snapshot/comptime/define/input"
));
}),
}),
]);
]);
//# sourceMappingURL=aaf3a_crates_turbopack-tests_tests_snapshot_comptime_define_input_index_aec19b5a.js.map
//# sourceMappingURL=aaf3a_crates_turbopack-tests_tests_snapshot_comptime_define_input_index_aec19b5a.js.map
\ No newline at end of file
turbopack/crates/turbopack-tests/tests/snapshot/comptime/define/output/aaf3a_crates_turbopack-tests_tests_snapshot_comptime_define_input_index_aec19b5a.js.map
View file @
97169e42
...
@@ -2,5 +2,5 @@
...
@@ -2,5 +2,5 @@
"version": 3,
"version": 3,
"sources": [],
"sources": [],
"sections": [
"sections": [
{"offset": {"line": 3, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/comptime/define/input/index.js"],"sourcesContent":["if (DEFINED_VALUE) {\n console.log('DEFINED_VALUE')\n}\n\nif (DEFINED_TRUE) {\n console.log('DEFINED_VALUE')\n}\n\nif (!DEFINED_NULL) {\n console.log('DEFINED_NULL', DEFINED_NULL)\n}\n\nif (DEFINED_INT) {\n console.log('DEFINED_INT', DEFINED_INT)\n}\n\nif (DEFINED_FLOAT) {\n console.log('DEFINED_FLOAT', DEFINED_FLOAT)\n}\n\nif (DEFINED_ARRAY) {\n console.log('DEFINED_ARRAY', DEFINED_ARRAY)\n}\n\nif (DEFINED_EVALUATE) {\n console.log('DEFINED_EVALUATE', DEFINED_EVALUATE)\n}\n\nif (DEFINED_EVALUATE_NESTED) {\n console.log('DEFINED_EVALUATE_NESTED', DEFINED_EVALUATE_NESTED)\n}\n\nif (A.VERY.LONG.DEFINED.VALUE) {\n console.log('A.VERY.LONG.DEFINED.VALUE')\n}\n\nif (process.env.NODE_ENV) {\n console.log('something')\n}\n\nif (process.env.NODE_ENV === 'production') {\n console.log('production')\n}\n\nvar p = process\n\nconsole.log(A.VERY.LONG.DEFINED.VALUE)\nconsole.log(DEFINED_VALUE)\nconsole.log(p.env.NODE_ENV)\n\nif (p.env.NODE_ENV === 'production') {\n console.log('production')\n}\n\np.env.NODE_ENV == 'production'\n ? console.log('production')\n : console.log('development')\n\np.env.NODE_ENV != 'production' && console.log('development')\np.env.NODE_ENV == 'production' && console.log('production')\n\nconsole.log(__dirname)\n"],"names":[],"mappings":"AAAA,wCAAmB;IACjB,QAAQ,GAAG,CAAC;AACd;AAEA,wCAAkB;IAChB,QAAQ,GAAG,CAAC;AACd;AAEA,wCAAmB;IACjB,QAAQ,GAAG,CAAC;AACd;AAEA,wCAAiB;IACf,QAAQ,GAAG,CAAC;AACd;AAEA,wCAAmB;IACjB,QAAQ,GAAG,CAAC;AACd;AAEA,wCAAmB;IACjB,QAAQ,GAAG,CAAC;;;;;;;;;AACd;AAEA,wCAAsB;IACpB,QAAQ,GAAG,CAAC,qDAzBd,IAAI;AA0BJ;AAEA,wCAA6B;IAC3B,QAAQ,GAAG,CAAC;;;yCA7Bd,IAAM;;AA8BN;AAEA,wCAA+B;IAC7B,QAAQ,GAAG,CAAC;AACd;AAEA,wCAA0B;IACxB,QAAQ,GAAG,CAAC;AACd;AAEA;;AAIA,IAAI,IAAI;AAER,QAAQ,GAAG;;;AACX,QAAQ,GAAG;AACX,QAAQ,GAAG;AAEX;;AAIA,sCACI,0BACA,QAAQ,GAAG,CAAC;mCAEkB,QAAQ,GAAG,CAAC;mCAC9C,mDAAkB;AAElB,QAAQ,GAAG"}}]
{"offset": {"line": 3, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/comptime/define/input/index.js"],"sourcesContent":["if (DEFINED_VALUE) {\n console.log('DEFINED_VALUE')\n}\n\nif (DEFINED_TRUE) {\n console.log('DEFINED_VALUE')\n}\n\nif (!DEFINED_NULL) {\n console.log('DEFINED_NULL', DEFINED_NULL)\n}\n\nif (DEFINED_INT) {\n console.log('DEFINED_INT', DEFINED_INT)\n}\n\nif (DEFINED_FLOAT) {\n console.log('DEFINED_FLOAT', DEFINED_FLOAT)\n}\n\nif (DEFINED_ARRAY) {\n console.log('DEFINED_ARRAY', DEFINED_ARRAY)\n}\n\nif (DEFINED_EVALUATE) {\n console.log('DEFINED_EVALUATE', DEFINED_EVALUATE)\n}\n\nif (DEFINED_EVALUATE_NESTED) {\n console.log('DEFINED_EVALUATE_NESTED', DEFINED_EVALUATE_NESTED)\n}\n\nif (A.VERY.LONG.DEFINED.VALUE) {\n console.log('A.VERY.LONG.DEFINED.VALUE')\n}\n\nif (process.env.NODE_ENV) {\n console.log('something')\n}\n\nif (process.env.NODE_ENV === 'production') {\n console.log('production')\n}\n\nvar p = process\n\nconsole.log(A.VERY.LONG.DEFINED.VALUE)\nconsole.log(DEFINED_VALUE)\nconsole.log(p.env.NODE_ENV)\n\nif (p.env.NODE_ENV === 'production') {\n console.log('production')\n}\n\np.env.NODE_ENV == 'production'\n ? console.log('production')\n : console.log('development')\n\np.env.NODE_ENV != 'production' && console.log('development')\np.env.NODE_ENV == 'production' && console.log('production')\nconsole.log(DEFINED_NULL?.foo ?? console.log('defined'))\n\nconsole.log(__dirname)\n"],"names":[],"mappings":"AAAA,wCAAmB;IACjB,QAAQ,GAAG,CAAC;AACd;AAEA,wCAAkB;IAChB,QAAQ,GAAG,CAAC;AACd;AAEA,wCAAmB;IACjB,QAAQ,GAAG,CAAC;AACd;AAEA,wCAAiB;IACf,QAAQ,GAAG,CAAC;AACd;AAEA,wCAAmB;IACjB,QAAQ,GAAG,CAAC;AACd;AAEA,wCAAmB;IACjB,QAAQ,GAAG,CAAC;;;;;;;;;AACd;AAEA,wCAAsB;IACpB,QAAQ,GAAG,CAAC,qDAzBd,IAAI;AA0BJ;AAEA,wCAA6B;IAC3B,QAAQ,GAAG,CAAC;;;yCA7Bd,IAAM;;AA8BN;AAEA,wCAA+B;IAC7B,QAAQ,GAAG,CAAC;AACd;AAEA,wCAA0B;IACxB,QAAQ,GAAG,CAAC;AACd;AAEA;;AAIA,IAAI,IAAI;AAER,QAAQ,GAAG;;;AACX,QAAQ,GAAG;AACX,QAAQ,GAAG;AAEX;;AAIA,sCACI,0BACA,QAAQ,GAAG,CAAC;AAEhB,wCAAkC,QAAQ,GAAG,CAAC;AAC9C,mDAAkB,gBAAgB;AAClC,QAAQ,GAAG,CAAC,cAAc,OAAO,QAAQ,GAAG,CAAC;AAE7C,QAAQ,GAAG"}}]
}
}
\ No newline at end of file
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