Skip to content

Commit

Permalink
Update goja to prevent hangs around try/catch and Interrupts (#2600)
Browse files Browse the repository at this point in the history
As explained in the [upstream PR](dop251/goja#405) previous to these changes,
there was a way for Interrupt to basically be catched by a `try/catch`. 

This is still possible now, but it requiers that go code does actually clear the interrupt. 

It also clears the promise jobs if the whole execution gets interrupted which also would've been a
problem, once we actually used them more.

For more info see the [upstream changes and tests](dop251/goja@8795259)
  • Loading branch information
mstoykov authored Jul 14, 2022
1 parent 17e5a84 commit 2983faf
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 7 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/PuerkitoBio/goquery v1.8.0
github.com/Soontao/goHttpDigestClient v0.0.0-20170320082612-6d28bb1415c5
github.com/andybalholm/brotli v1.0.4
github.com/dop251/goja v0.0.0-20220705101429-189bfeb9f530
github.com/dop251/goja v0.0.0-20220714114325-87952593a54c
github.com/fatih/color v1.13.0
github.com/golang/protobuf v1.5.2
github.com/gorilla/websocket v1.5.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
github.com/dlclark/regexp2 v1.4.1-0.20201116162257-a2a8dda75c91 h1:Izz0+t1Z5nI16/II7vuEo/nHjodOg0p7+OiDpjX5t1E=
github.com/dlclark/regexp2 v1.4.1-0.20201116162257-a2a8dda75c91/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc=
github.com/dop251/goja v0.0.0-20211022113120-dc8c55024d06/go.mod h1:R9ET47fwRVRPZnOGvHxxhuZcbrMCuiqOz3Rlrh4KSnk=
github.com/dop251/goja v0.0.0-20220705101429-189bfeb9f530 h1:936YSsrki8Z6H48PPFbATV674Gpmh444xXaX+O5wwFQ=
github.com/dop251/goja v0.0.0-20220705101429-189bfeb9f530/go.mod h1:TQJQ+ZNyFVvUtUEtCZxBhfWiH7RJqR3EivNmvD6Waik=
github.com/dop251/goja v0.0.0-20220714114325-87952593a54c h1:OtwWjp/Il88H3JTvdrdaPo7Gw3ZUu2O+PWOzlE7yNOk=
github.com/dop251/goja v0.0.0-20220714114325-87952593a54c/go.mod h1:TQJQ+ZNyFVvUtUEtCZxBhfWiH7RJqR3EivNmvD6Waik=
github.com/dop251/goja_nodejs v0.0.0-20210225215109-d91c329300e7/go.mod h1:hn7BA7c8pLvoGndExHudxTDKZ84Pyvv+90pbBjbTz0Y=
github.com/dop251/goja_nodejs v0.0.0-20211022123610-8dd9abb0616d/go.mod h1:DngW8aVqWbuLRMHItjPUyqdj+HWPvnQe8V8y1nDpIbM=
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
Expand Down
16 changes: 15 additions & 1 deletion vendor/github.com/dop251/goja/runtime.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions vendor/github.com/dop251/goja/vm.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ github.com/davecgh/go-spew/spew
## explicit
github.com/dlclark/regexp2
github.com/dlclark/regexp2/syntax
# github.com/dop251/goja v0.0.0-20220705101429-189bfeb9f530
# github.com/dop251/goja v0.0.0-20220714114325-87952593a54c
## explicit; go 1.14
github.com/dop251/goja
github.com/dop251/goja/ast
Expand Down

0 comments on commit 2983faf

Please sign in to comment.