We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 45a03cf commit 41bcae3Copy full SHA for 41bcae3
src/bscPlugin/treeShaker/TreeShaker.spec.ts
@@ -455,6 +455,25 @@ describe('TreeShaker', () => {
455
expect(code).not.to.include('sub unused()');
456
});
457
458
+ it('preserves a function passed by reference as an argument to another function', async () => {
459
+ program.setFile('source/main.bs', `
460
+ sub init()
461
+ setHandler(mySub1)
462
+ end sub
463
+
464
+ sub mySub1()
465
+ print "hey"
466
467
468
+ sub unused()
469
470
+ `);
471
472
+ const code = await getTranspiled('source/main.bs');
473
+ expect(code).to.include('sub mySub1()');
474
+ expect(code).not.to.include('sub unused()');
475
+ });
476
477
it('preserves functions called via @. callfunc shorthand', async () => {
478
program.setFile('source/main.bs', `
479
sub init()
0 commit comments