Skip to content

Commit

Permalink
printer: preserve single-line status of block body
Browse files Browse the repository at this point in the history
  • Loading branch information
evanw committed May 6, 2024
1 parent f426153 commit 0861625
Show file tree
Hide file tree
Showing 13 changed files with 565 additions and 706 deletions.
34 changes: 11 additions & 23 deletions internal/bundler_tests/snapshots/snapshots_dce.txt
Original file line number Diff line number Diff line change
Expand Up @@ -660,8 +660,7 @@ TestDCETypeOfEqualsString
---------- /out.js ----------
(() => {
// entry.js
if (false)
console.log(hasBar);
if (false) console.log(hasBar);
})();

================================================================================
Expand Down Expand Up @@ -814,16 +813,12 @@ function testStmts() {
do
var b;
while (x);
for (var c; ; )
;
for (var d in x)
;
for (var e of x)
;
for (var c; ; ) ;
for (var d in x) ;
for (var e of x) ;
if (x)
var f;
if (!x)
var g;
if (!x) var g;
var h, i;
}
testReturn();
Expand Down Expand Up @@ -865,14 +860,10 @@ export {
TestDropLabels
---------- /out.js ----------
// entry.js
keep_1:
require("foo1");
keep_1: require("foo1");
exports.bar = function() {
if (x)
;
if (y)
keep_2:
require("bar2");
if (x) ;
if (y) keep_2: require("bar2");
};

================================================================================
Expand Down Expand Up @@ -915,8 +906,7 @@ foo();
console.log(foo());
console.log((foo(), void 0));
console.log((foo(), void 0));
for (; void 0; )
;
for (; void 0; ) ;
foo();
foo();
foo();
Expand Down Expand Up @@ -1060,11 +1050,9 @@ export let shouldBeWrapped = [
TestInlineFunctionCallForInitDecl
---------- /out/entry.js ----------
// entry.js
for (y = void 0; !1; )
;
for (y = void 0; !1; ) ;
var y;
for (z = 123; !1; )
;
for (z = 123; !1; ) ;
var z;

================================================================================
Expand Down

0 comments on commit 0861625

Please sign in to comment.