Unverified Commit 33efdc2d 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 1d0ed883
......@@ -1485,7 +1485,7 @@ async fn analyze_ecmascript_module_internal(
.get_inline_export(esm_reference_index, export.clone())
.await?
{
analysis.add_code_gen(ConstantValueCodeGen::new_inline_export(
analysis.add_code_gen(ConstantValueCodeGen::new(
c,
analysis.intern_path(&ast_path),
));
......
......@@ -5,8 +5,8 @@ it('inlines across an import cycle without retaining the constants module', () =
const source = readA.toString()
expect(source).toContain('"a"')
expect(source).not.toContain('TURBOPACK compile-time value')
expect(source).not.toContain('value')
expect(source).toContain('TURBOPACK compile-time value')
expect(source).not.toContain('return value')
const modules = Array.from(__turbopack_modules__.keys())
expect(modules).toContainEqual(expect.stringMatching(/input\/b\.js/))
......
......@@ -25,7 +25,7 @@ it('preserves analyzer-aware precedence and falls back to codegen-only inlining'
expect(readAnnotationOff()).toBe('off')
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(readAnnotationOff.toString()).not.toContain('annotationOff')
......@@ -36,7 +36,9 @@ it('preserves analyzer-aware precedence and falls back to codegen-only inlining'
expect(modules).not.toContainEqual(
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.stringMatching(/input\/annotation-off-marker\.js/)
)
......
......@@ -75,7 +75,7 @@ it('inlines short primitive exports during code generation', () => {
expect(source).toContain('false')
expect(source).toContain('null')
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('smallNumber')
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