Skip to content

Commit

Permalink
Update goja to modules branch
Browse files Browse the repository at this point in the history
  • Loading branch information
mstoykov committed Jun 21, 2024
1 parent 61cf872 commit 9150a95
Show file tree
Hide file tree
Showing 22 changed files with 2,651 additions and 108 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ require (
github.com/go-sourcemap/sourcemap v2.1.4+incompatible
github.com/golang/protobuf v1.5.4
github.com/gorilla/websocket v1.5.1
github.com/grafana/sobek v0.0.0-20240611084759-1a77bdaf1a4a
github.com/grafana/sobek v0.0.0-20240621115154-ed22587d72ba
github.com/grafana/xk6-browser v1.5.2-0.20240607140836-ffcc1f5169ad
github.com/grafana/xk6-dashboard v0.7.4
github.com/grafana/xk6-output-prometheus-remote v0.4.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY=
github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY=
github.com/grafana/sobek v0.0.0-20240611084759-1a77bdaf1a4a h1:RE9WtCdu6yQ5kfHA5ophYdf2FSchssXt85USln9eks0=
github.com/grafana/sobek v0.0.0-20240611084759-1a77bdaf1a4a/go.mod h1:tUEHKWaMrxFGrMgjeAH85OEceCGQiSl6a/6Wckj/Vf4=
github.com/grafana/sobek v0.0.0-20240621115154-ed22587d72ba h1:5jGQ3qO7gvAshMmQOAS4bf7LCV8MIH7pf+oXMU2iewk=
github.com/grafana/sobek v0.0.0-20240621115154-ed22587d72ba/go.mod h1:tUEHKWaMrxFGrMgjeAH85OEceCGQiSl6a/6Wckj/Vf4=
github.com/grafana/xk6-browser v1.5.2-0.20240607140836-ffcc1f5169ad h1:q3sB942oYrD7NlcsS9hz26I9W+EKfpKVmhKe7dWUp3s=
github.com/grafana/xk6-browser v1.5.2-0.20240607140836-ffcc1f5169ad/go.mod h1:xLaGGhTMHIRsMvkVWFYh9RPy87kG2n4L4Or6DeI8U+o=
github.com/grafana/xk6-dashboard v0.7.4 h1:0ZRPTAXW+6A3Xqq/a/OaIZhxUt1SOMwUFff0IPwBHrs=
Expand Down
8 changes: 0 additions & 8 deletions js/bundle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,6 @@ func TestNewBundle(t *testing.T) {
"InvalidCompat", "es1", `export default function() {};`,
`invalid compatibility mode "es1". Use: "extended", "base", "experimental_enhanced"`,
},
// ES2015 modules are not supported
{
"Modules", "base", `export default function() {};`,
"file:///script.js: Line 1:28 Unexpected reserved word (and 2 more errors)",
},
// BigInt is not supported
{
"BigInt", "base",
Expand Down Expand Up @@ -504,7 +499,6 @@ func TestNewBundleFromArchive(t *testing.T) {

checkArchive(t, arc, lib.RuntimeOptions{}, "") // default options
checkArchive(t, arc, extCompatModeRtOpts, "")
checkArchive(t, arc, baseCompatModeRtOpts, "Unexpected reserved word")
})

t.Run("es6_script_explicit", func(t *testing.T) {
Expand All @@ -515,7 +509,6 @@ func TestNewBundleFromArchive(t *testing.T) {

checkArchive(t, arc, lib.RuntimeOptions{}, "")
checkArchive(t, arc, extCompatModeRtOpts, "")
checkArchive(t, arc, baseCompatModeRtOpts, "Unexpected reserved word")
})

t.Run("es5_script_with_extended", func(t *testing.T) {
Expand Down Expand Up @@ -554,7 +547,6 @@ func TestNewBundleFromArchive(t *testing.T) {
arc.CompatibilityMode = "blah" // intentionally break the archive
checkArchive(t, arc, lib.RuntimeOptions{}, "invalid compatibility mode") // fails when it uses the archive one
checkArchive(t, arc, extCompatModeRtOpts, "") // works when I force the compat mode
checkArchive(t, arc, baseCompatModeRtOpts, "Unexpected reserved word") // failes because of ES6
})

t.Run("script_options_dont_overwrite_metadata", func(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion vendor/github.com/grafana/sobek/.tc39_test262_checkout.sh

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

2 changes: 1 addition & 1 deletion vendor/github.com/grafana/sobek/README.md

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

91 changes: 91 additions & 0 deletions vendor/github.com/grafana/sobek/ast/node.go

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

23 changes: 8 additions & 15 deletions vendor/github.com/grafana/sobek/builtin_object.go

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

Loading

0 comments on commit 9150a95

Please sign in to comment.