You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm thinking, unless I'm missing something with the grammar or possibly with let block-scoping, that we can detect if a statement block delimited by { .. } (such as, specifically, the consequent clause of an if-statement) only has a single statement in it, and if so, it should be safe to remove the enclosing { } and instead just make sure it ends in a ;. Am I missing something?
if(foo){returnfoo;}
currently minifies to:
if(foo){returnfoo}
but should be safe to instead go to:
if(foo)returnfoo;
which is one character less.
By contrast:
if(foo)returnfoo;
already safely minifies to:
if(foo)returnfoo;
Am I missing something that would make this unsafe or impossible?
The text was updated successfully, but these errors were encountered:
I'm thinking, unless I'm missing something with the grammar or possibly with
let
block-scoping, that we can detect if a statement block delimited by{ .. }
(such as, specifically, the consequent clause of an if-statement) only has a single statement in it, and if so, it should be safe to remove the enclosing{ }
and instead just make sure it ends in a;
. Am I missing something?currently minifies to:
but should be safe to instead go to:
which is one character less.
By contrast:
already safely minifies to:
Am I missing something that would make this unsafe or impossible?
The text was updated successfully, but these errors were encountered: