more optimizations that v1 does and some cleanups
- a = a + x ==> a+=x - joining consecutive var statements (hoisting is not always desirable) - x == false ==> x == 0, x != true ==> x != 1 - x, x ==> x; x = exp(), x ==> x = exp() - discarding useless break-s
This commit is contained in:
10
tmp/todo
10
tmp/todo
@@ -1,11 +1,11 @@
|
||||
a = a + x ==> a+=x
|
||||
✓ a = a + x ==> a+=x
|
||||
|
||||
*******
|
||||
|
||||
join consecutive var statements
|
||||
✓ join consecutive var statements
|
||||
|
||||
*******
|
||||
|
||||
✓
|
||||
x == false ==> x == 0
|
||||
x == true ==> x == 1
|
||||
|
||||
@@ -14,6 +14,8 @@ JS is so sloppy that this could be an indication of a bug.
|
||||
|
||||
*******
|
||||
|
||||
✓
|
||||
|
||||
x, x ==> x
|
||||
x = foo, x ==> x
|
||||
|
||||
@@ -30,6 +32,8 @@ XXX? Not sure if this is worth the trouble.
|
||||
|
||||
*******
|
||||
|
||||
✓
|
||||
|
||||
discard spurious break statements
|
||||
|
||||
*******
|
||||
|
||||
Reference in New Issue
Block a user