Skip to content

Commit

Permalink
JS: update tdewolff/parse and fix #656
Browse files Browse the repository at this point in the history
  • Loading branch information
tdewolff committed Jan 11, 2024
1 parent 6b45973 commit 7846cd7
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
github.com/fsnotify/fsnotify v1.7.0
github.com/matryer/try v0.0.0-20161228173917-9ac251b645a2
github.com/tdewolff/argp v0.0.0-20231129210956-bb03d6873d97
github.com/tdewolff/parse/v2 v2.7.7
github.com/tdewolff/parse/v2 v2.7.8
github.com/tdewolff/test v1.0.11-0.20240106005702-7de5f7df4739
)

Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ github.com/matryer/try v0.0.0-20161228173917-9ac251b645a2 h1:JAEbJn3j/FrhdWA9jW8
github.com/matryer/try v0.0.0-20161228173917-9ac251b645a2/go.mod h1:0KeJpeMD6o+O4hW7qJOT7vyQPKrWmj26uf5wMc/IiIs=
github.com/tdewolff/argp v0.0.0-20231129210956-bb03d6873d97 h1:guej/op7QIuHIlsX8wrWimsTzyc3CKAgXvJsUvsoMXc=
github.com/tdewolff/argp v0.0.0-20231129210956-bb03d6873d97/go.mod h1:fF+gnKbmf3iMG+ErLiF+orMU/InyZIEnKVVigUjfriw=
github.com/tdewolff/parse/v2 v2.7.7 h1:V+50eFDH7Piw4IBwH8D8FtYeYbZp3T4SCtIvmBSIMyc=
github.com/tdewolff/parse/v2 v2.7.7/go.mod h1:3FbJWZp3XT9OWVN3Hmfp0p/a08v4h8J9W1aghka0soA=
github.com/tdewolff/parse/v2 v2.7.8 h1:1cnVqa8L63xFkc2vfRsZTM6Qy35nJpTvQ2Uvdv3vbvs=
github.com/tdewolff/parse/v2 v2.7.8/go.mod h1:3FbJWZp3XT9OWVN3Hmfp0p/a08v4h8J9W1aghka0soA=
github.com/tdewolff/test v1.0.6/go.mod h1:6DAvZliBAAnD7rhVgwaM7DE5/d9NMOAJ09SqYqeK4QE=
github.com/tdewolff/test v1.0.11-0.20231101010635-f1265d231d52/go.mod h1:6DAvZliBAAnD7rhVgwaM7DE5/d9NMOAJ09SqYqeK4QE=
github.com/tdewolff/test v1.0.11-0.20240106005702-7de5f7df4739 h1:IkjBCtQOOjIn03u/dMQK9g+Iw9ewps4mCl1nB8Sscbo=
Expand Down
1 change: 1 addition & 0 deletions js/js_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -808,6 +808,7 @@ func TestJS(t *testing.T) {
{`for(var a=0;;){var b=5;for(var c=0;;);}`, `for(var b,c,a=0;;)for(b=5,c=0;;);`}, // #634
{"if(a)for(;;)\n;else b", `if(a)for(;;);else b`}, // #636
{`'\u000A\u000D'`, "`\n\r`"}, // #653
{`for(!a;b;c);`, "`\n\r`"}, // #656
}

m := minify.New()
Expand Down
2 changes: 1 addition & 1 deletion js/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ func isFalsy(i js.IExpr) (bool, bool) {
return !negated, true // falsy
} else if tt == js.TrueToken || tt == js.StringToken {
return negated, true // truthy
} else if tt == js.DecimalToken || tt == js.BinaryToken || tt == js.OctalToken || tt == js.HexadecimalToken || tt == js.BigIntToken {
} else if tt == js.DecimalToken || tt == js.BinaryToken || tt == js.OctalToken || tt == js.HexadecimalToken || tt == js.IntegerToken {
for _, c := range d {
if c == 'e' || c == 'E' || c == 'n' {
break
Expand Down

0 comments on commit 7846cd7

Please sign in to comment.