Unverified Commit 2957868a authored by vercel-fleet-prod[bot]'s avatar vercel-fleet-prod[bot] Committed by GitHub

Keep markers for inlined export values

Co-authored-by: 's avatarTobias Koppers <1365881+sokra@users.noreply.github.com>
parent 9941eddc
...@@ -1439,10 +1439,8 @@ async fn analyze_ecmascript_module_internal( ...@@ -1439,10 +1439,8 @@ async fn analyze_ecmascript_module_internal(
.get_inline_export(esm_reference_index, export.clone()) .get_inline_export(esm_reference_index, export.clone())
.await? .await?
{ {
analysis.add_code_gen(ConstantValueCodeGen::new_inline_export( analysis
c, .add_code_gen(ConstantValueCodeGen::new(c, ast_path.to_vec().into()));
ast_path.to_vec().into(),
));
} else if let Some("__turbopack_module_id__") = export.as_deref() { } else if let Some("__turbopack_module_id__") = export.as_deref() {
let chunking_type = r.await?.chunking_type(); let chunking_type = r.await?.chunking_type();
analysis.add_reference_code_gen( analysis.add_reference_code_gen(
......
...@@ -5,8 +5,8 @@ it('inlines across an import cycle without retaining the constants module', () = ...@@ -5,8 +5,8 @@ it('inlines across an import cycle without retaining the constants module', () =
const source = readA.toString() const source = readA.toString()
expect(source).toContain('"a"') expect(source).toContain('"a"')
expect(source).not.toContain('TURBOPACK compile-time value') expect(source).toContain('TURBOPACK compile-time value')
expect(source).not.toContain('value') expect(source).not.toContain('return value')
const modules = Array.from(__turbopack_modules__.keys()) const modules = Array.from(__turbopack_modules__.keys())
expect(modules).toContainEqual(expect.stringMatching(/input\/b\.js/)) expect(modules).toContainEqual(expect.stringMatching(/input\/b\.js/))
......
...@@ -25,7 +25,7 @@ it('preserves analyzer-aware precedence and falls back to codegen-only inlining' ...@@ -25,7 +25,7 @@ it('preserves analyzer-aware precedence and falls back to codegen-only inlining'
expect(readAnnotationOff()).toBe('off') expect(readAnnotationOff()).toBe('off')
expect(readAnalyzed.toString()).toContain('TURBOPACK compile-time value') expect(readAnalyzed.toString()).toContain('TURBOPACK compile-time value')
expect(readLate.toString()).not.toContain('TURBOPACK compile-time value') expect(readLate.toString()).toContain('TURBOPACK compile-time value')
expect(readLate.toString()).not.toContain('late') expect(readLate.toString()).not.toContain('late')
expect(readAnnotationOff.toString()).not.toContain('annotationOff') expect(readAnnotationOff.toString()).not.toContain('annotationOff')
...@@ -36,7 +36,9 @@ it('preserves analyzer-aware precedence and falls back to codegen-only inlining' ...@@ -36,7 +36,9 @@ it('preserves analyzer-aware precedence and falls back to codegen-only inlining'
expect(modules).not.toContainEqual( expect(modules).not.toContainEqual(
expect.stringMatching(/input\/forced-marker\.js/) expect.stringMatching(/input\/forced-marker\.js/)
) )
expect(modules).toContainEqual(expect.stringMatching(/input\/late-marker\.js/)) expect(modules).toContainEqual(
expect.stringMatching(/input\/late-marker\.js/)
)
expect(modules).toContainEqual( expect(modules).toContainEqual(
expect.stringMatching(/input\/annotation-off-marker\.js/) expect.stringMatching(/input\/annotation-off-marker\.js/)
) )
......
...@@ -75,7 +75,7 @@ it('inlines short primitive exports during code generation', () => { ...@@ -75,7 +75,7 @@ it('inlines short primitive exports during code generation', () => {
expect(source).toContain('false') expect(source).toContain('false')
expect(source).toContain('null') expect(source).toContain('null')
expect(source).toContain('void 0') expect(source).toContain('void 0')
expect(source).not.toContain('TURBOPACK compile-time value') expect(source).toContain('TURBOPACK compile-time value')
expect(source).not.toContain('shortString') expect(source).not.toContain('shortString')
expect(source).not.toContain('smallNumber') expect(source).not.toContain('smallNumber')
expect(readStaticNamespace.toString()).not.toContain('staticNamespace') expect(readStaticNamespace.toString()).not.toContain('staticNamespace')
......
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