Skip to content

Commit

Permalink
uglify tests: enable issue_4464_3, which now works
Browse files Browse the repository at this point in the history
  • Loading branch information
evanw committed Dec 22, 2021
1 parent 228478c commit c370315
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
26 changes: 26 additions & 0 deletions internal/bundler/bundler_default_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5156,3 +5156,29 @@ func TestToESMWrapperOmission(t *testing.T) {
},
})
}

// This is coverage for a past bug in esbuild. We used to generate this, which is wrong:
//
// let x = function(foo) {
// var foo2;
// return foo2;
// };
//
func TestNamedFunctionExpressionArgumentCollision(t *testing.T) {
loader_suite.expectBundled(t, bundled{
files: map[string]string{
"/entry.js": `
let x = function foo(foo) {
var foo;
return foo;
}
`,
},
entryPaths: []string{"/entry.js"},
options: config.Options{
Mode: config.ModePassThrough,
AbsOutputDir: "/out",
MangleSyntax: true,
},
})
}
8 changes: 8 additions & 0 deletions internal/bundler/snapshots/snapshots_loader.txt
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,14 @@ var o=123;console.log(o,"no identifier in this file should be named W, X, Y, or
---------- /out/require.js ----------
var i=r((t,e)=>{e.exports=123});var s=i();console.log(s,"no identifier in this file should be named A, B, C, or D");

================================================================================
TestNamedFunctionExpressionArgumentCollision
---------- /out/entry.js ----------
let x = function(foo) {
var foo;
return foo;
};

================================================================================
TestRequireCustomExtensionBase64
---------- /out.js ----------
Expand Down
1 change: 0 additions & 1 deletion scripts/uglify-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,6 @@ async function test_case(esbuild, test, basename) {
'const.js: use_before_init_3',
'destructured.js: funarg_side_effects_2',
'destructured.js: funarg_side_effects_3',
'drop-unused.js: issue_4464_3',
'let.js: issue_4225',
'let.js: issue_4229',
'let.js: issue_4245',
Expand Down

0 comments on commit c370315

Please sign in to comment.