From 88a967d512360efb1095a481a1bbd34e029b5829 Mon Sep 17 00:00:00 2001 From: Mihail Stoykov Date: Tue, 11 Jun 2024 12:02:39 +0300 Subject: [PATCH] Move to the forked sobek code There are still some leftover comments and names referencing goja that need to be updated, but this compiles. This closes #3772 and closes #3773 --- go.mod | 3 +- go.sum | 5 +- js/bundle_test.go | 2 +- js/compiler/compiler.go | 2 +- js/compiler/enhanced.go | 4 +- js/compiler/enhanced_test.go | 2 +- js/tc39/tc39_test.go | 2 +- vendor/github.com/dop251/goja/LICENSE | 15 - vendor/github.com/dop251/goja/README.md | 334 ------------------ .../{dop251/goja => grafana/sobek}/.gitignore | 0 .../sobek}/.tc39_test262_checkout.sh | 0 vendor/github.com/grafana/sobek/README.md | 330 ++++++++++++++++- vendor/github.com/grafana/sobek/aliases.go | 130 ------- .../{dop251/goja => grafana/sobek}/array.go | 4 +- .../goja => grafana/sobek}/array_sparse.go | 4 +- .../sobek}/ast/README.markdown | 2 +- .../goja => grafana/sobek}/ast/node.go | 6 +- .../goja => grafana/sobek}/builtin_array.go | 2 +- .../goja => grafana/sobek}/builtin_boolean.go | 2 +- .../goja => grafana/sobek}/builtin_date.go | 2 +- .../goja => grafana/sobek}/builtin_error.go | 4 +- .../sobek}/builtin_function.go | 2 +- .../goja => grafana/sobek}/builtin_global.go | 4 +- .../goja => grafana/sobek}/builtin_json.go | 4 +- .../goja => grafana/sobek}/builtin_map.go | 2 +- .../goja => grafana/sobek}/builtin_math.go | 2 +- .../goja => grafana/sobek}/builtin_number.go | 4 +- .../goja => grafana/sobek}/builtin_object.go | 2 +- .../goja => grafana/sobek}/builtin_promise.go | 10 +- .../goja => grafana/sobek}/builtin_proxy.go | 4 +- .../goja => grafana/sobek}/builtin_reflect.go | 2 +- .../goja => grafana/sobek}/builtin_regexp.go | 4 +- .../goja => grafana/sobek}/builtin_set.go | 2 +- .../goja => grafana/sobek}/builtin_string.go | 6 +- .../goja => grafana/sobek}/builtin_symbol.go | 4 +- .../sobek}/builtin_typedarrays.go | 4 +- .../goja => grafana/sobek}/builtin_weakmap.go | 2 +- .../goja => grafana/sobek}/builtin_weakset.go | 2 +- .../goja => grafana/sobek}/compiler.go | 10 +- .../goja => grafana/sobek}/compiler_expr.go | 10 +- .../goja => grafana/sobek}/compiler_stmt.go | 10 +- .../{dop251/goja => grafana/sobek}/date.go | 2 +- .../goja => grafana/sobek}/date_parser.go | 2 +- .../goja => grafana/sobek}/destruct.go | 4 +- .../sobek}/extract_failed_tests.sh | 0 .../sobek}/file/README.markdown | 2 +- .../goja => grafana/sobek}/file/file.go | 0 .../sobek}/ftoa/LICENSE_LUCENE | 0 .../goja => grafana/sobek}/ftoa/common.go | 0 .../goja => grafana/sobek}/ftoa/ftoa.go | 0 .../goja => grafana/sobek}/ftoa/ftobasestr.go | 0 .../goja => grafana/sobek}/ftoa/ftostr.go | 2 +- .../sobek}/ftoa/internal/fast/LICENSE_V8 | 0 .../sobek}/ftoa/internal/fast/cachedpower.go | 0 .../sobek}/ftoa/internal/fast/common.go | 0 .../sobek}/ftoa/internal/fast/diyfp.go | 0 .../sobek}/ftoa/internal/fast/dtoa.go | 0 .../{dop251/goja => grafana/sobek}/func.go | 4 +- .../{dop251/goja => grafana/sobek}/ipow.go | 2 +- .../{dop251/goja => grafana/sobek}/map.go | 2 +- .../{dop251/goja => grafana/sobek}/object.go | 4 +- .../goja => grafana/sobek}/object_args.go | 4 +- .../goja => grafana/sobek}/object_dynamic.go | 4 +- .../sobek}/object_goarray_reflect.go | 4 +- .../goja => grafana/sobek}/object_gomap.go | 4 +- .../sobek}/object_gomap_reflect.go | 4 +- .../sobek}/object_goreflect.go | 6 +- .../goja => grafana/sobek}/object_goslice.go | 4 +- .../sobek}/object_goslice_reflect.go | 4 +- .../goja => grafana/sobek}/object_template.go | 4 +- .../sobek}/parser/README.markdown | 4 +- .../goja => grafana/sobek}/parser/error.go | 4 +- .../sobek}/parser/expression.go | 8 +- .../goja => grafana/sobek}/parser/lexer.go | 6 +- .../goja => grafana/sobek}/parser/parser.go | 10 +- .../goja => grafana/sobek}/parser/regexp.go | 0 .../goja => grafana/sobek}/parser/scope.go | 4 +- .../sobek}/parser/statement.go | 6 +- .../goja => grafana/sobek}/profiler.go | 2 +- .../{dop251/goja => grafana/sobek}/proxy.go | 4 +- .../{dop251/goja => grafana/sobek}/regexp.go | 4 +- .../{dop251/goja => grafana/sobek}/runtime.go | 14 +- .../goja => grafana/sobek}/staticcheck.conf | 0 .../{dop251/goja => grafana/sobek}/string.go | 4 +- .../goja => grafana/sobek}/string_ascii.go | 4 +- .../goja => grafana/sobek}/string_imported.go | 6 +- .../goja => grafana/sobek}/string_unicode.go | 6 +- .../sobek}/token/README.markdown | 2 +- .../goja => grafana/sobek}/token/token.go | 0 .../sobek}/token/token_const.go | 0 .../goja => grafana/sobek}/token/tokenfmt | 0 .../goja => grafana/sobek}/typedarrays.go | 4 +- .../sobek}/unistring/string.go | 0 .../{dop251/goja => grafana/sobek}/value.go | 6 +- .../{dop251/goja => grafana/sobek}/vm.go | 4 +- vendor/modules.txt | 19 +- 96 files changed, 483 insertions(+), 645 deletions(-) delete mode 100644 vendor/github.com/dop251/goja/LICENSE delete mode 100644 vendor/github.com/dop251/goja/README.md rename vendor/github.com/{dop251/goja => grafana/sobek}/.gitignore (100%) rename vendor/github.com/{dop251/goja => grafana/sobek}/.tc39_test262_checkout.sh (100%) delete mode 100644 vendor/github.com/grafana/sobek/aliases.go rename vendor/github.com/{dop251/goja => grafana/sobek}/array.go (99%) rename vendor/github.com/{dop251/goja => grafana/sobek}/array_sparse.go (99%) rename vendor/github.com/{dop251/goja => grafana/sobek}/ast/README.markdown (99%) rename vendor/github.com/{dop251/goja => grafana/sobek}/ast/node.go (99%) rename vendor/github.com/{dop251/goja => grafana/sobek}/builtin_array.go (99%) rename vendor/github.com/{dop251/goja => grafana/sobek}/builtin_boolean.go (99%) rename vendor/github.com/{dop251/goja => grafana/sobek}/builtin_date.go (99%) rename vendor/github.com/{dop251/goja => grafana/sobek}/builtin_error.go (99%) rename vendor/github.com/{dop251/goja => grafana/sobek}/builtin_function.go (99%) rename vendor/github.com/{dop251/goja => grafana/sobek}/builtin_global.go (99%) rename vendor/github.com/{dop251/goja => grafana/sobek}/builtin_json.go (99%) rename vendor/github.com/{dop251/goja => grafana/sobek}/builtin_map.go (99%) rename vendor/github.com/{dop251/goja => grafana/sobek}/builtin_math.go (99%) rename vendor/github.com/{dop251/goja => grafana/sobek}/builtin_number.go (99%) rename vendor/github.com/{dop251/goja => grafana/sobek}/builtin_object.go (99%) rename vendor/github.com/{dop251/goja => grafana/sobek}/builtin_promise.go (98%) rename vendor/github.com/{dop251/goja => grafana/sobek}/builtin_proxy.go (99%) rename vendor/github.com/{dop251/goja => grafana/sobek}/builtin_reflect.go (99%) rename vendor/github.com/{dop251/goja => grafana/sobek}/builtin_regexp.go (99%) rename vendor/github.com/{dop251/goja => grafana/sobek}/builtin_set.go (99%) rename vendor/github.com/{dop251/goja => grafana/sobek}/builtin_string.go (99%) rename vendor/github.com/{dop251/goja => grafana/sobek}/builtin_symbol.go (98%) rename vendor/github.com/{dop251/goja => grafana/sobek}/builtin_typedarrays.go (99%) rename vendor/github.com/{dop251/goja => grafana/sobek}/builtin_weakmap.go (99%) rename vendor/github.com/{dop251/goja => grafana/sobek}/builtin_weakset.go (99%) rename vendor/github.com/{dop251/goja => grafana/sobek}/compiler.go (99%) rename vendor/github.com/{dop251/goja => grafana/sobek}/compiler_expr.go (99%) rename vendor/github.com/{dop251/goja => grafana/sobek}/compiler_stmt.go (99%) rename vendor/github.com/{dop251/goja => grafana/sobek}/date.go (99%) rename vendor/github.com/{dop251/goja => grafana/sobek}/date_parser.go (99%) rename vendor/github.com/{dop251/goja => grafana/sobek}/destruct.go (99%) rename vendor/github.com/{dop251/goja => grafana/sobek}/extract_failed_tests.sh (100%) rename vendor/github.com/{dop251/goja => grafana/sobek}/file/README.markdown (97%) rename vendor/github.com/{dop251/goja => grafana/sobek}/file/file.go (100%) rename vendor/github.com/{dop251/goja => grafana/sobek}/ftoa/LICENSE_LUCENE (100%) rename vendor/github.com/{dop251/goja => grafana/sobek}/ftoa/common.go (100%) rename vendor/github.com/{dop251/goja => grafana/sobek}/ftoa/ftoa.go (100%) rename vendor/github.com/{dop251/goja => grafana/sobek}/ftoa/ftobasestr.go (100%) rename vendor/github.com/{dop251/goja => grafana/sobek}/ftoa/ftostr.go (98%) rename vendor/github.com/{dop251/goja => grafana/sobek}/ftoa/internal/fast/LICENSE_V8 (100%) rename vendor/github.com/{dop251/goja => grafana/sobek}/ftoa/internal/fast/cachedpower.go (100%) rename vendor/github.com/{dop251/goja => grafana/sobek}/ftoa/internal/fast/common.go (100%) rename vendor/github.com/{dop251/goja => grafana/sobek}/ftoa/internal/fast/diyfp.go (100%) rename vendor/github.com/{dop251/goja => grafana/sobek}/ftoa/internal/fast/dtoa.go (100%) rename vendor/github.com/{dop251/goja => grafana/sobek}/func.go (99%) rename vendor/github.com/{dop251/goja => grafana/sobek}/ipow.go (99%) rename vendor/github.com/{dop251/goja => grafana/sobek}/map.go (99%) rename vendor/github.com/{dop251/goja => grafana/sobek}/object.go (99%) rename vendor/github.com/{dop251/goja => grafana/sobek}/object_args.go (98%) rename vendor/github.com/{dop251/goja => grafana/sobek}/object_dynamic.go (99%) rename vendor/github.com/{dop251/goja => grafana/sobek}/object_goarray_reflect.go (99%) rename vendor/github.com/{dop251/goja => grafana/sobek}/object_gomap.go (98%) rename vendor/github.com/{dop251/goja => grafana/sobek}/object_gomap_reflect.go (99%) rename vendor/github.com/{dop251/goja => grafana/sobek}/object_goreflect.go (99%) rename vendor/github.com/{dop251/goja => grafana/sobek}/object_goslice.go (99%) rename vendor/github.com/{dop251/goja => grafana/sobek}/object_goslice_reflect.go (97%) rename vendor/github.com/{dop251/goja => grafana/sobek}/object_template.go (99%) rename vendor/github.com/{dop251/goja => grafana/sobek}/parser/README.markdown (97%) rename vendor/github.com/{dop251/goja => grafana/sobek}/parser/error.go (98%) rename vendor/github.com/{dop251/goja => grafana/sobek}/parser/expression.go (99%) rename vendor/github.com/{dop251/goja => grafana/sobek}/parser/lexer.go (99%) rename vendor/github.com/{dop251/goja => grafana/sobek}/parser/parser.go (97%) rename vendor/github.com/{dop251/goja => grafana/sobek}/parser/regexp.go (100%) rename vendor/github.com/{dop251/goja => grafana/sobek}/parser/scope.go (93%) rename vendor/github.com/{dop251/goja => grafana/sobek}/parser/statement.go (99%) rename vendor/github.com/{dop251/goja => grafana/sobek}/profiler.go (99%) rename vendor/github.com/{dop251/goja => grafana/sobek}/proxy.go (99%) rename vendor/github.com/{dop251/goja => grafana/sobek}/regexp.go (99%) rename vendor/github.com/{dop251/goja => grafana/sobek}/runtime.go (99%) rename vendor/github.com/{dop251/goja => grafana/sobek}/staticcheck.conf (100%) rename vendor/github.com/{dop251/goja => grafana/sobek}/string.go (99%) rename vendor/github.com/{dop251/goja => grafana/sobek}/string_ascii.go (99%) rename vendor/github.com/{dop251/goja => grafana/sobek}/string_imported.go (98%) rename vendor/github.com/{dop251/goja => grafana/sobek}/string_unicode.go (99%) rename vendor/github.com/{dop251/goja => grafana/sobek}/token/README.markdown (98%) rename vendor/github.com/{dop251/goja => grafana/sobek}/token/token.go (100%) rename vendor/github.com/{dop251/goja => grafana/sobek}/token/token_const.go (100%) rename vendor/github.com/{dop251/goja => grafana/sobek}/token/tokenfmt (100%) rename vendor/github.com/{dop251/goja => grafana/sobek}/typedarrays.go (99%) rename vendor/github.com/{dop251/goja => grafana/sobek}/unistring/string.go (100%) rename vendor/github.com/{dop251/goja => grafana/sobek}/value.go (99%) rename vendor/github.com/{dop251/goja => grafana/sobek}/vm.go (99%) diff --git a/go.mod b/go.mod index 3df238da64be..6ff52666a065 100644 --- a/go.mod +++ b/go.mod @@ -8,13 +8,12 @@ require ( github.com/PuerkitoBio/goquery v1.9.1 github.com/Soontao/goHttpDigestClient v0.0.0-20170320082612-6d28bb1415c5 github.com/andybalholm/brotli v1.1.0 - github.com/dop251/goja v0.0.0-20240516125602-ccbae20bcec2 github.com/evanw/esbuild v0.21.2 github.com/fatih/color v1.16.0 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-20240607083612-4f0cd64f4e78 + github.com/grafana/sobek v0.0.0-20240611084759-1a77bdaf1a4a 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 diff --git a/go.sum b/go.sum index b7ea98f0d1a2..15aec58cd8b5 100644 --- a/go.sum +++ b/go.sum @@ -43,7 +43,6 @@ github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cu github.com/dlclark/regexp2 v1.9.0 h1:pTK/l/3qYIKaRXuHnEnIf7Y5NxfRPfpb7dis6/gdlVI= github.com/dlclark/regexp2 v1.9.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= github.com/dop251/goja v0.0.0-20240516125602-ccbae20bcec2 h1:OFTHt+yJDo/uaIKMGjEKzc3DGhrpQZoqvMUIloZv6ZY= -github.com/dop251/goja v0.0.0-20240516125602-ccbae20bcec2/go.mod h1:o31y53rb/qiIAONF7w3FHJZRqqP3fzHUr1HqanthByw= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= @@ -83,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-20240607083612-4f0cd64f4e78 h1:rVCZdB+13G+aQoGm3CBVaDGl0uxZxfjvQgEJy4IeHTA= -github.com/grafana/sobek v0.0.0-20240607083612-4f0cd64f4e78/go.mod h1:6ZH0b0iOxyigeTh+/IlGoL0Hd3lVXA94xoXf0ldNgCM= +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/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= diff --git a/js/bundle_test.go b/js/bundle_test.go index 90620325a627..6e3ac505c4b9 100644 --- a/js/bundle_test.go +++ b/js/bundle_test.go @@ -202,7 +202,7 @@ BigInt(1231412444)`, Expr, Error string }{ "Array": {`[]`, "json: cannot unmarshal array into Go value of type lib.Options"}, - "Function": {`function(){}`, "error parsing script options: json: unsupported type: func(goja.FunctionCall) goja.Value"}, + "Function": {`function(){}`, "error parsing script options: json: unsupported type: func(sobek.FunctionCall) sobek.Value"}, } for name, data := range invalidOptions { t.Run(name, func(t *testing.T) { diff --git a/js/compiler/compiler.go b/js/compiler/compiler.go index f0f9d7acc110..40ab043c4bbf 100644 --- a/js/compiler/compiler.go +++ b/js/compiler/compiler.go @@ -14,9 +14,9 @@ import ( "sync" "time" - "github.com/dop251/goja/parser" "github.com/go-sourcemap/sourcemap" "github.com/grafana/sobek" + "github.com/grafana/sobek/parser" "github.com/sirupsen/logrus" "go.k6.io/k6/lib" diff --git a/js/compiler/enhanced.go b/js/compiler/enhanced.go index 228686a44243..0841448c417b 100644 --- a/js/compiler/enhanced.go +++ b/js/compiler/enhanced.go @@ -3,9 +3,9 @@ package compiler import ( "path/filepath" - "github.com/dop251/goja/file" - "github.com/dop251/goja/parser" "github.com/evanw/esbuild/pkg/api" + "github.com/grafana/sobek/file" + "github.com/grafana/sobek/parser" ) func esbuildTransform(src, filename string) (code string, srcMap []byte, err error) { diff --git a/js/compiler/enhanced_test.go b/js/compiler/enhanced_test.go index 4e06f694d9ce..e1c8bd55390b 100644 --- a/js/compiler/enhanced_test.go +++ b/js/compiler/enhanced_test.go @@ -4,8 +4,8 @@ import ( "errors" "testing" - "github.com/dop251/goja/parser" "github.com/grafana/sobek" + "github.com/grafana/sobek/parser" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.k6.io/k6/lib" diff --git a/js/tc39/tc39_test.go b/js/tc39/tc39_test.go index 93f79d1090f2..fc9b3525c6f6 100644 --- a/js/tc39/tc39_test.go +++ b/js/tc39/tc39_test.go @@ -22,8 +22,8 @@ import ( "testing" "time" - "github.com/dop251/goja/parser" "github.com/grafana/sobek" + "github.com/grafana/sobek/parser" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.k6.io/k6/js/compiler" diff --git a/vendor/github.com/dop251/goja/LICENSE b/vendor/github.com/dop251/goja/LICENSE deleted file mode 100644 index 09c000454f72..000000000000 --- a/vendor/github.com/dop251/goja/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -Copyright (c) 2016 Dmitry Panov - -Copyright (c) 2012 Robert Krimen - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -documentation files (the "Software"), to deal in the Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/github.com/dop251/goja/README.md b/vendor/github.com/dop251/goja/README.md deleted file mode 100644 index a4d0c09be115..000000000000 --- a/vendor/github.com/dop251/goja/README.md +++ /dev/null @@ -1,334 +0,0 @@ -goja -==== - -ECMAScript 5.1(+) implementation in Go. - -[![Go Reference](https://pkg.go.dev/badge/github.com/dop251/goja.svg)](https://pkg.go.dev/github.com/dop251/goja) - -Goja is an implementation of ECMAScript 5.1 in pure Go with emphasis on standard compliance and -performance. - -This project was largely inspired by [otto](https://github.com/robertkrimen/otto). - -The minimum required Go version is 1.20. - -Features --------- - - * Full ECMAScript 5.1 support (including regex and strict mode). - * Passes nearly all [tc39 tests](https://github.com/tc39/test262) for the features implemented so far. The goal is to - pass all of them. See .tc39_test262_checkout.sh for the latest working commit id. - * Capable of running Babel, Typescript compiler and pretty much anything written in ES5. - * Sourcemaps. - * Most of ES6 functionality, still work in progress, see https://github.com/dop251/goja/milestone/1?closed=1 - -Known incompatibilities and caveats ------------------------------------ - -### WeakMap -WeakMap is implemented by embedding references to the values into the keys. This means that as long -as the key is reachable all values associated with it in any weak maps also remain reachable and therefore -cannot be garbage collected even if they are not otherwise referenced, even after the WeakMap is gone. -The reference to the value is dropped either when the key is explicitly removed from the WeakMap or when the -key becomes unreachable. - -To illustrate this: - -```javascript -var m = new WeakMap(); -var key = {}; -var value = {/* a very large object */}; -m.set(key, value); -value = undefined; -m = undefined; // The value does NOT become garbage-collectable at this point -key = undefined; // Now it does -// m.delete(key); // This would work too -``` - -The reason for it is the limitation of the Go runtime. At the time of writing (version 1.15) having a finalizer -set on an object which is part of a reference cycle makes the whole cycle non-garbage-collectable. The solution -above is the only reasonable way I can think of without involving finalizers. This is the third attempt -(see https://github.com/dop251/goja/issues/250 and https://github.com/dop251/goja/issues/199 for more details). - -Note, this does not have any effect on the application logic, but may cause a higher-than-expected memory usage. - -### WeakRef and FinalizationRegistry -For the reason mentioned above implementing WeakRef and FinalizationRegistry does not seem to be possible at this stage. - -### JSON -`JSON.parse()` uses the standard Go library which operates in UTF-8. Therefore, it cannot correctly parse broken UTF-16 -surrogate pairs, for example: - -```javascript -JSON.parse(`"\\uD800"`).charCodeAt(0).toString(16) // returns "fffd" instead of "d800" -``` - -### Date -Conversion from calendar date to epoch timestamp uses the standard Go library which uses `int`, rather than `float` as per -ECMAScript specification. This means if you pass arguments that overflow int to the `Date()` constructor or if there is -an integer overflow, the result will be incorrect, for example: - -```javascript -Date.UTC(1970, 0, 1, 80063993375, 29, 1, -288230376151711740) // returns 29256 instead of 29312 -``` - -FAQ ---- - -### How fast is it? - -Although it's faster than many scripting language implementations in Go I have seen -(for example it's 6-7 times faster than otto on average) it is not a -replacement for V8 or SpiderMonkey or any other general-purpose JavaScript engine. -You can find some benchmarks [here](https://github.com/dop251/goja/issues/2). - -### Why would I want to use it over a V8 wrapper? - -It greatly depends on your usage scenario. If most of the work is done in javascript -(for example crypto or any other heavy calculations) you are definitely better off with V8. - -If you need a scripting language that drives an engine written in Go so that -you need to make frequent calls between Go and javascript passing complex data structures -then the cgo overhead may outweigh the benefits of having a faster javascript engine. - -Because it's written in pure Go there are no cgo dependencies, it's very easy to build and it -should run on any platform supported by Go. - -It gives you a much better control over execution environment so can be useful for research. - -### Is it goroutine-safe? - -No. An instance of goja.Runtime can only be used by a single goroutine -at a time. You can create as many instances of Runtime as you like but -it's not possible to pass object values between runtimes. - -### Where is setTimeout()? - -setTimeout() assumes concurrent execution of code which requires an execution -environment, for example an event loop similar to nodejs or a browser. -There is a [separate project](https://github.com/dop251/goja_nodejs) aimed at providing some NodeJS functionality, -and it includes an event loop. - -### Can you implement (feature X from ES6 or higher)? - -I will be adding features in their dependency order and as quickly as time permits. Please do not ask -for ETAs. Features that are open in the [milestone](https://github.com/dop251/goja/milestone/1) are either in progress -or will be worked on next. - -The ongoing work is done in separate feature branches which are merged into master when appropriate. -Every commit in these branches represents a relatively stable state (i.e. it compiles and passes all enabled tc39 tests), -however because the version of tc39 tests I use is quite old, it may be not as well tested as the ES5.1 functionality. Because there are (usually) no major breaking changes between ECMAScript revisions -it should not break your existing code. You are encouraged to give it a try and report any bugs found. Please do not submit fixes though without discussing it first, as the code could be changed in the meantime. - -### How do I contribute? - -Before submitting a pull request please make sure that: - -- You followed ECMA standard as close as possible. If adding a new feature make sure you've read the specification, -do not just base it on a couple of examples that work fine. -- Your change does not have a significant negative impact on performance (unless it's a bugfix and it's unavoidable) -- It passes all relevant tc39 tests. - -Current Status --------------- - - * There should be no breaking changes in the API, however it may be extended. - * Some of the AnnexB functionality is missing. - -Basic Example -------------- - -Run JavaScript and get the result value. - -```go -vm := goja.New() -v, err := vm.RunString("2 + 2") -if err != nil { - panic(err) -} -if num := v.Export().(int64); num != 4 { - panic(num) -} -``` - -Passing Values to JS --------------------- -Any Go value can be passed to JS using Runtime.ToValue() method. See the method's [documentation](https://pkg.go.dev/github.com/dop251/goja#Runtime.ToValue) for more details. - -Exporting Values from JS ------------------------- -A JS value can be exported into its default Go representation using Value.Export() method. - -Alternatively it can be exported into a specific Go variable using [Runtime.ExportTo()](https://pkg.go.dev/github.com/dop251/goja#Runtime.ExportTo) method. - -Within a single export operation the same Object will be represented by the same Go value (either the same map, slice or -a pointer to the same struct). This includes circular objects and makes it possible to export them. - -Calling JS functions from Go ----------------------------- -There are 2 approaches: - -- Using [AssertFunction()](https://pkg.go.dev/github.com/dop251/goja#AssertFunction): -```go -const SCRIPT = ` -function sum(a, b) { - return +a + b; -} -` - -vm := goja.New() -_, err := vm.RunString(SCRIPT) -if err != nil { - panic(err) -} -sum, ok := goja.AssertFunction(vm.Get("sum")) -if !ok { - panic("Not a function") -} - -res, err := sum(goja.Undefined(), vm.ToValue(40), vm.ToValue(2)) -if err != nil { - panic(err) -} -fmt.Println(res) -// Output: 42 -``` -- Using [Runtime.ExportTo()](https://pkg.go.dev/github.com/dop251/goja#Runtime.ExportTo): -```go -const SCRIPT = ` -function sum(a, b) { - return +a + b; -} -` - -vm := goja.New() -_, err := vm.RunString(SCRIPT) -if err != nil { - panic(err) -} - -var sum func(int, int) int -err = vm.ExportTo(vm.Get("sum"), &sum) -if err != nil { - panic(err) -} - -fmt.Println(sum(40, 2)) // note, _this_ value in the function will be undefined. -// Output: 42 -``` - -The first one is more low level and allows specifying _this_ value, whereas the second one makes the function look like -a normal Go function. - -Mapping struct field and method names -------------------------------------- -By default, the names are passed through as is which means they are capitalised. This does not match -the standard JavaScript naming convention, so if you need to make your JS code look more natural or if you are -dealing with a 3rd party library, you can use a [FieldNameMapper](https://pkg.go.dev/github.com/dop251/goja#FieldNameMapper): - -```go -vm := goja.New() -vm.SetFieldNameMapper(TagFieldNameMapper("json", true)) -type S struct { - Field int `json:"field"` -} -vm.Set("s", S{Field: 42}) -res, _ := vm.RunString(`s.field`) // without the mapper it would have been s.Field -fmt.Println(res.Export()) -// Output: 42 -``` - -There are two standard mappers: [TagFieldNameMapper](https://pkg.go.dev/github.com/dop251/goja#TagFieldNameMapper) and -[UncapFieldNameMapper](https://pkg.go.dev/github.com/dop251/goja#UncapFieldNameMapper), or you can use your own implementation. - -Native Constructors -------------------- - -In order to implement a constructor function in Go use `func (goja.ConstructorCall) *goja.Object`. -See [Runtime.ToValue()](https://pkg.go.dev/github.com/dop251/goja#Runtime.ToValue) documentation for more details. - -Regular Expressions -------------------- - -Goja uses the embedded Go regexp library where possible, otherwise it falls back to [regexp2](https://github.com/dlclark/regexp2). - -Exceptions ----------- - -Any exception thrown in JavaScript is returned as an error of type *Exception. It is possible to extract the value thrown -by using the Value() method: - -```go -vm := goja.New() -_, err := vm.RunString(` - -throw("Test"); - -`) - -if jserr, ok := err.(*Exception); ok { - if jserr.Value().Export() != "Test" { - panic("wrong value") - } -} else { - panic("wrong type") -} -``` - -If a native Go function panics with a Value, it is thrown as a Javascript exception (and therefore can be caught): - -```go -var vm *Runtime - -func Test() { - panic(vm.ToValue("Error")) -} - -vm = goja.New() -vm.Set("Test", Test) -_, err := vm.RunString(` - -try { - Test(); -} catch(e) { - if (e !== "Error") { - throw e; - } -} - -`) - -if err != nil { - panic(err) -} -``` - -Interrupting ------------- - -```go -func TestInterrupt(t *testing.T) { - const SCRIPT = ` - var i = 0; - for (;;) { - i++; - } - ` - - vm := goja.New() - time.AfterFunc(200 * time.Millisecond, func() { - vm.Interrupt("halt") - }) - - _, err := vm.RunString(SCRIPT) - if err == nil { - t.Fatal("Err is nil") - } - // err is of type *InterruptError and its Value() method returns whatever has been passed to vm.Interrupt() -} -``` - -NodeJS Compatibility --------------------- - -There is a [separate project](https://github.com/dop251/goja_nodejs) aimed at providing some of the NodeJS functionality. diff --git a/vendor/github.com/dop251/goja/.gitignore b/vendor/github.com/grafana/sobek/.gitignore similarity index 100% rename from vendor/github.com/dop251/goja/.gitignore rename to vendor/github.com/grafana/sobek/.gitignore diff --git a/vendor/github.com/dop251/goja/.tc39_test262_checkout.sh b/vendor/github.com/grafana/sobek/.tc39_test262_checkout.sh similarity index 100% rename from vendor/github.com/dop251/goja/.tc39_test262_checkout.sh rename to vendor/github.com/grafana/sobek/.tc39_test262_checkout.sh diff --git a/vendor/github.com/grafana/sobek/README.md b/vendor/github.com/grafana/sobek/README.md index 51d78207ef68..70dc1cdb3f71 100644 --- a/vendor/github.com/grafana/sobek/README.md +++ b/vendor/github.com/grafana/sobek/README.md @@ -1,7 +1,329 @@ -## Sobek +sobek +==== -Is a fork of [goja](https://github.com/dop251/goja) named after the [ancient Egyptian god](https://en.wikipedia.org/wiki/Sobek) of the same name +ECMAScript 5.1(+) implementation in Go. -The fork is currently just aliasing types in order to facilitate the moving of the current k6 codebase and extension to it with less friction. +[![Go Reference](https://pkg.go.dev/badge/github.com/grafana/sobek.svg)](https://pkg.go.dev/github.com/grafana/sobek) -The plan and discussion on the transition can be find in [this issue](https://github.com/grafana/k6/issues/3773). +Sobek is an implementation of ECMAScript 5.1 in pure Go with emphasis on standard compliance and +performance. + +This project is a fork of [goja](https://github.com/dop251/goja). + +This project was largely inspired by [otto](https://github.com/robertkrimen/otto). + +The minimum required Go version is 1.20. + +Features +-------- + + * Full ECMAScript 5.1 support (including regex and strict mode). + * Passes nearly all [tc39 tests](https://github.com/tc39/test262) for the features implemented so far. The goal is to + pass all of them. See .tc39_test262_checkout.sh for the latest working commit id. + * Capable of running Babel, Typescript compiler and pretty much anything written in ES5. + * Sourcemaps. + * Most of ES6 functionality, still work in progress, see https://github.com/grafana/sobek/milestone/1?closed=1 + +Known incompatibilities and caveats +----------------------------------- + +### WeakMap +WeakMap is implemented by embedding references to the values into the keys. This means that as long +as the key is reachable all values associated with it in any weak maps also remain reachable and therefore +cannot be garbage collected even if they are not otherwise referenced, even after the WeakMap is gone. +The reference to the value is dropped either when the key is explicitly removed from the WeakMap or when the +key becomes unreachable. + +To illustrate this: + +```javascript +var m = new WeakMap(); +var key = {}; +var value = {/* a very large object */}; +m.set(key, value); +value = undefined; +m = undefined; // The value does NOT become garbage-collectable at this point +key = undefined; // Now it does +// m.delete(key); // This would work too +``` + +The reason for it is the limitation of the Go runtime. At the time of writing (version 1.15) having a finalizer +set on an object which is part of a reference cycle makes the whole cycle non-garbage-collectable. The solution +above is the only reasonable way I can think of without involving finalizers. This is the third attempt +(see https://github.com/dop251/goja/issues/250 and https://github.com/dop251/goja/issues/199 for more details). + +Note, this does not have any effect on the application logic, but may cause a higher-than-expected memory usage. + +### WeakRef and FinalizationRegistry +For the reason mentioned above implementing WeakRef and FinalizationRegistry does not seem to be possible at this stage. + +### JSON +`JSON.parse()` uses the standard Go library which operates in UTF-8. Therefore, it cannot correctly parse broken UTF-16 +surrogate pairs, for example: + +```javascript +JSON.parse(`"\\uD800"`).charCodeAt(0).toString(16) // returns "fffd" instead of "d800" +``` + +### Date +Conversion from calendar date to epoch timestamp uses the standard Go library which uses `int`, rather than `float` as per +ECMAScript specification. This means if you pass arguments that overflow int to the `Date()` constructor or if there is +an integer overflow, the result will be incorrect, for example: + +```javascript +Date.UTC(1970, 0, 1, 80063993375, 29, 1, -288230376151711740) // returns 29256 instead of 29312 +``` + +FAQ +--- + +### How fast is it? + +Although it's faster than many scripting language implementations in Go I have seen +(for example it's 6-7 times faster than otto on average) it is not a +replacement for V8 or SpiderMonkey or any other general-purpose JavaScript engine. +You can find some benchmarks [here](https://github.com/dop251/goja/issues/2). + +### Why would I want to use it over a V8 wrapper? + +It greatly depends on your usage scenario. If most of the work is done in javascript +(for example crypto or any other heavy calculations) you are definitely better off with V8. + +If you need a scripting language that drives an engine written in Go so that +you need to make frequent calls between Go and javascript passing complex data structures +then the cgo overhead may outweigh the benefits of having a faster javascript engine. + +Because it's written in pure Go there are no cgo dependencies, it's very easy to build and it +should run on any platform supported by Go. + +It gives you a much better control over execution environment so can be useful for research. + +### Is it goroutine-safe? + +No. An instance of sobek.Runtime can only be used by a single goroutine +at a time. You can create as many instances of Runtime as you like but +it's not possible to pass object values between runtimes. + +### Where is setTimeout()? + +setTimeout() assumes concurrent execution of code which requires an execution +environment, for example an event loop similar to nodejs or a browser. + +### Can you implement (feature X from ES6 or higher)? + +I will be adding features in their dependency order and as quickly as time permits. Please do not ask +for ETAs. Features that are open in the [milestone](https://github.com/grafana/sobek/milestone/1) are either in progress +or will be worked on next. + +The ongoing work is done in separate feature branches which are merged into master when appropriate. +Every commit in these branches represents a relatively stable state (i.e. it compiles and passes all enabled tc39 tests), +however because the version of tc39 tests I use is quite old, it may be not as well tested as the ES5.1 functionality. Because there are (usually) no major breaking changes between ECMAScript revisions +it should not break your existing code. You are encouraged to give it a try and report any bugs found. Please do not submit fixes though without discussing it first, as the code could be changed in the meantime. + +### How do I contribute? + +Before submitting a pull request please make sure that: + +- You followed ECMA standard as close as possible. If adding a new feature make sure you've read the specification, +do not just base it on a couple of examples that work fine. +- Your change does not have a significant negative impact on performance (unless it's a bugfix and it's unavoidable) +- It passes all relevant tc39 tests. + +Current Status +-------------- + + * There should be no breaking changes in the API, however it may be extended. + * Some of the AnnexB functionality is missing. + +Basic Example +------------- + +Run JavaScript and get the result value. + +```go +vm := sobek.New() +v, err := vm.RunString("2 + 2") +if err != nil { + panic(err) +} +if num := v.Export().(int64); num != 4 { + panic(num) +} +``` + +Passing Values to JS +-------------------- +Any Go value can be passed to JS using Runtime.ToValue() method. See the method's [documentation](https://pkg.go.dev/github.com/grafana/sobek#Runtime.ToValue) for more details. + +Exporting Values from JS +------------------------ +A JS value can be exported into its default Go representation using Value.Export() method. + +Alternatively it can be exported into a specific Go variable using [Runtime.ExportTo()](https://pkg.go.dev/github.com/grafana/sobek#Runtime.ExportTo) method. + +Within a single export operation the same Object will be represented by the same Go value (either the same map, slice or +a pointer to the same struct). This includes circular objects and makes it possible to export them. + +Calling JS functions from Go +---------------------------- +There are 2 approaches: + +- Using [AssertFunction()](https://pkg.go.dev/github.com/grafana/sobek#AssertFunction): +```go +const SCRIPT = ` +function sum(a, b) { + return +a + b; +} +` + +vm := sobek.New() +_, err := vm.RunString(SCRIPT) +if err != nil { + panic(err) +} +sum, ok := sobek.AssertFunction(vm.Get("sum")) +if !ok { + panic("Not a function") +} + +res, err := sum(sobek.Undefined(), vm.ToValue(40), vm.ToValue(2)) +if err != nil { + panic(err) +} +fmt.Println(res) +// Output: 42 +``` +- Using [Runtime.ExportTo()](https://pkg.go.dev/github.com/grafana/sobek#Runtime.ExportTo): +```go +const SCRIPT = ` +function sum(a, b) { + return +a + b; +} +` + +vm := sobek.New() +_, err := vm.RunString(SCRIPT) +if err != nil { + panic(err) +} + +var sum func(int, int) int +err = vm.ExportTo(vm.Get("sum"), &sum) +if err != nil { + panic(err) +} + +fmt.Println(sum(40, 2)) // note, _this_ value in the function will be undefined. +// Output: 42 +``` + +The first one is more low level and allows specifying _this_ value, whereas the second one makes the function look like +a normal Go function. + +Mapping struct field and method names +------------------------------------- +By default, the names are passed through as is which means they are capitalised. This does not match +the standard JavaScript naming convention, so if you need to make your JS code look more natural or if you are +dealing with a 3rd party library, you can use a [FieldNameMapper](https://pkg.go.dev/github.com/grafana/sobek#FieldNameMapper): + +```go +vm := sobek.New() +vm.SetFieldNameMapper(TagFieldNameMapper("json", true)) +type S struct { + Field int `json:"field"` +} +vm.Set("s", S{Field: 42}) +res, _ := vm.RunString(`s.field`) // without the mapper it would have been s.Field +fmt.Println(res.Export()) +// Output: 42 +``` + +There are two standard mappers: [TagFieldNameMapper](https://pkg.go.dev/github.com/grafana/sobek#TagFieldNameMapper) and +[UncapFieldNameMapper](https://pkg.go.dev/github.com/grafana/sobek#UncapFieldNameMapper), or you can use your own implementation. + +Native Constructors +------------------- + +In order to implement a constructor function in Go use `func (sobek.ConstructorCall) *sobek.Object`. +See [Runtime.ToValue()](https://pkg.go.dev/github.com/grafana/sobek#Runtime.ToValue) documentation for more details. + +Regular Expressions +------------------- + +Sobek uses the embedded Go regexp library where possible, otherwise it falls back to [regexp2](https://github.com/dlclark/regexp2). + +Exceptions +---------- + +Any exception thrown in JavaScript is returned as an error of type *Exception. It is possible to extract the value thrown +by using the Value() method: + +```go +vm := sobek.New() +_, err := vm.RunString(` + +throw("Test"); + +`) + +if jserr, ok := err.(*Exception); ok { + if jserr.Value().Export() != "Test" { + panic("wrong value") + } +} else { + panic("wrong type") +} +``` + +If a native Go function panics with a Value, it is thrown as a Javascript exception (and therefore can be caught): + +```go +var vm *Runtime + +func Test() { + panic(vm.ToValue("Error")) +} + +vm = sobek.New() +vm.Set("Test", Test) +_, err := vm.RunString(` + +try { + Test(); +} catch(e) { + if (e !== "Error") { + throw e; + } +} + +`) + +if err != nil { + panic(err) +} +``` + +Interrupting +------------ + +```go +func TestInterrupt(t *testing.T) { + const SCRIPT = ` + var i = 0; + for (;;) { + i++; + } + ` + + vm := sobek.New() + time.AfterFunc(200 * time.Millisecond, func() { + vm.Interrupt("halt") + }) + + _, err := vm.RunString(SCRIPT) + if err == nil { + t.Fatal("Err is nil") + } + // err is of type *InterruptError and its Value() method returns whatever has been passed to vm.Interrupt() +} +``` diff --git a/vendor/github.com/grafana/sobek/aliases.go b/vendor/github.com/grafana/sobek/aliases.go deleted file mode 100644 index 01a8772d8a1c..000000000000 --- a/vendor/github.com/grafana/sobek/aliases.go +++ /dev/null @@ -1,130 +0,0 @@ -package sobek - -import ( - "github.com/dop251/goja" - "github.com/dop251/goja/ast" - "github.com/dop251/goja/parser" -) - -const ( - FLAG_NOT_SET Flag = iota - FLAG_FALSE - FLAG_TRUE -) - -func Null() Value { return goja.Null() } - -func IsInfinity(v Value) bool { return goja.IsInfinity(v) } - -func IsNaN(v Value) bool { return goja.IsNaN(v) } - -func IsNull(v Value) bool { return goja.IsNull(v) } - -func IsUndefined(v Value) bool { return goja.IsUndefined(v) } - -func Parse(name, src string, options ...parser.Option) (prg *ast.Program, err error) { - return goja.Parse(name, src, options...) -} - -func AssertFunction(v Value) (Callable, bool) { return goja.AssertFunction(v) } - -func AssertConstructor(v Value) (Constructor, bool) { return goja.AssertConstructor(v) } - -func Undefined() Value { return goja.Undefined() } - -func CompileAST(prg *ast.Program, strict bool) (*Program, error) { - return goja.CompileAST(prg, strict) -} - -func Compile(name, src string, strict bool) (*Program, error) { - return goja.Compile(name, src, strict) -} - -func MustCompile(name, src string, strict bool) *Program { - return goja.MustCompile(name, src, strict) -} - -func New() *Runtime { - return goja.New() -} - -type ArrayBuffer = goja.ArrayBuffer - -type ( - AsyncContextTracker = goja.AsyncContextTracker - Callable = goja.Callable -) - -type ( - CompilerError = goja.CompilerError - CompilerReferenceError = goja.CompilerReferenceError -) - -type CompilerSyntaxError = goja.CompilerSyntaxError - -type Constructor = goja.Constructor - -type ConstructorCall = goja.ConstructorCall - -type ( - DynamicArray = goja.DynamicArray - DynamicObject = goja.DynamicObject - Exception = goja.Exception -) - -type FieldNameMapper = goja.FieldNameMapper - -type ( - Flag = goja.Flag - FunctionCall = goja.FunctionCall -) - -type InterruptedError = goja.InterruptedError - -type ( - JsonEncodable = goja.JsonEncodable - Now = goja.Now - Object = goja.Object -) - -type Program = goja.Program - -type Promise = goja.Promise - -type ( - PromiseRejectionOperation = goja.PromiseRejectionOperation - PromiseRejectionTracker = goja.PromiseRejectionTracker - PromiseState = goja.PromiseState - PropertyDescriptor = goja.PropertyDescriptor -) - -const ( - PromiseRejectionReject PromiseRejectionOperation = iota - PromiseRejectionHandle -) - -const ( - PromiseStatePending PromiseState = iota - PromiseStateFulfilled - PromiseStateRejected -) - -type Proxy = goja.Proxy - -type ( - ProxyTrapConfig = goja.ProxyTrapConfig - RandSource = goja.RandSource - Runtime = goja.Runtime -) - -type StackFrame = goja.StackFrame - -type ( - StackOverflowError = goja.StackOverflowError - String = goja.String - StringBuilder = goja.StringBuilder - Symbol = goja.Symbol - Value = goja.Value -) - -func UncapFieldNameMapper() FieldNameMapper { return goja.UncapFieldNameMapper() } diff --git a/vendor/github.com/dop251/goja/array.go b/vendor/github.com/grafana/sobek/array.go similarity index 99% rename from vendor/github.com/dop251/goja/array.go rename to vendor/github.com/grafana/sobek/array.go index 7a67a47c16ee..ef12dc558fba 100644 --- a/vendor/github.com/dop251/goja/array.go +++ b/vendor/github.com/grafana/sobek/array.go @@ -1,4 +1,4 @@ -package goja +package sobek import ( "fmt" @@ -7,7 +7,7 @@ import ( "reflect" "strconv" - "github.com/dop251/goja/unistring" + "github.com/grafana/sobek/unistring" ) type arrayIterObject struct { diff --git a/vendor/github.com/dop251/goja/array_sparse.go b/vendor/github.com/grafana/sobek/array_sparse.go similarity index 99% rename from vendor/github.com/dop251/goja/array_sparse.go rename to vendor/github.com/grafana/sobek/array_sparse.go index f99afd7e6dda..877d281976ae 100644 --- a/vendor/github.com/dop251/goja/array_sparse.go +++ b/vendor/github.com/grafana/sobek/array_sparse.go @@ -1,4 +1,4 @@ -package goja +package sobek import ( "fmt" @@ -8,7 +8,7 @@ import ( "sort" "strconv" - "github.com/dop251/goja/unistring" + "github.com/grafana/sobek/unistring" ) type sparseArrayItem struct { diff --git a/vendor/github.com/dop251/goja/ast/README.markdown b/vendor/github.com/grafana/sobek/ast/README.markdown similarity index 99% rename from vendor/github.com/dop251/goja/ast/README.markdown rename to vendor/github.com/grafana/sobek/ast/README.markdown index aba088e261cc..65aa0018e00e 100644 --- a/vendor/github.com/dop251/goja/ast/README.markdown +++ b/vendor/github.com/grafana/sobek/ast/README.markdown @@ -1,6 +1,6 @@ # ast -- - import "github.com/dop251/goja/ast" + import "github.com/grafana/sobek/ast" Package ast declares types representing a JavaScript AST. diff --git a/vendor/github.com/dop251/goja/ast/node.go b/vendor/github.com/grafana/sobek/ast/node.go similarity index 99% rename from vendor/github.com/dop251/goja/ast/node.go rename to vendor/github.com/grafana/sobek/ast/node.go index 3bec89db4935..0663ba8daea9 100644 --- a/vendor/github.com/dop251/goja/ast/node.go +++ b/vendor/github.com/grafana/sobek/ast/node.go @@ -9,9 +9,9 @@ node types are concerned) and may change in the future. package ast import ( - "github.com/dop251/goja/file" - "github.com/dop251/goja/token" - "github.com/dop251/goja/unistring" + "github.com/grafana/sobek/file" + "github.com/grafana/sobek/token" + "github.com/grafana/sobek/unistring" ) type PropertyKind string diff --git a/vendor/github.com/dop251/goja/builtin_array.go b/vendor/github.com/grafana/sobek/builtin_array.go similarity index 99% rename from vendor/github.com/dop251/goja/builtin_array.go rename to vendor/github.com/grafana/sobek/builtin_array.go index 6ba8802c282a..7121bfa7c4ad 100644 --- a/vendor/github.com/dop251/goja/builtin_array.go +++ b/vendor/github.com/grafana/sobek/builtin_array.go @@ -1,4 +1,4 @@ -package goja +package sobek import ( "math" diff --git a/vendor/github.com/dop251/goja/builtin_boolean.go b/vendor/github.com/grafana/sobek/builtin_boolean.go similarity index 99% rename from vendor/github.com/dop251/goja/builtin_boolean.go rename to vendor/github.com/grafana/sobek/builtin_boolean.go index 8476328511b9..757f8ad74235 100644 --- a/vendor/github.com/dop251/goja/builtin_boolean.go +++ b/vendor/github.com/grafana/sobek/builtin_boolean.go @@ -1,4 +1,4 @@ -package goja +package sobek func (r *Runtime) booleanproto_toString(call FunctionCall) Value { var b bool diff --git a/vendor/github.com/dop251/goja/builtin_date.go b/vendor/github.com/grafana/sobek/builtin_date.go similarity index 99% rename from vendor/github.com/dop251/goja/builtin_date.go rename to vendor/github.com/grafana/sobek/builtin_date.go index 84a80ac02b22..b67e7f0e1798 100644 --- a/vendor/github.com/dop251/goja/builtin_date.go +++ b/vendor/github.com/grafana/sobek/builtin_date.go @@ -1,4 +1,4 @@ -package goja +package sobek import ( "fmt" diff --git a/vendor/github.com/dop251/goja/builtin_error.go b/vendor/github.com/grafana/sobek/builtin_error.go similarity index 99% rename from vendor/github.com/dop251/goja/builtin_error.go rename to vendor/github.com/grafana/sobek/builtin_error.go index b07bf6a777e4..99532542caeb 100644 --- a/vendor/github.com/dop251/goja/builtin_error.go +++ b/vendor/github.com/grafana/sobek/builtin_error.go @@ -1,6 +1,6 @@ -package goja +package sobek -import "github.com/dop251/goja/unistring" +import "github.com/grafana/sobek/unistring" const propNameStack = "stack" diff --git a/vendor/github.com/dop251/goja/builtin_function.go b/vendor/github.com/grafana/sobek/builtin_function.go similarity index 99% rename from vendor/github.com/dop251/goja/builtin_function.go rename to vendor/github.com/grafana/sobek/builtin_function.go index 26a1287c836f..64332f953249 100644 --- a/vendor/github.com/dop251/goja/builtin_function.go +++ b/vendor/github.com/grafana/sobek/builtin_function.go @@ -1,4 +1,4 @@ -package goja +package sobek import ( "math" diff --git a/vendor/github.com/dop251/goja/builtin_global.go b/vendor/github.com/grafana/sobek/builtin_global.go similarity index 99% rename from vendor/github.com/dop251/goja/builtin_global.go rename to vendor/github.com/grafana/sobek/builtin_global.go index 5ef4176b49d1..d7ba9b457b5a 100644 --- a/vendor/github.com/dop251/goja/builtin_global.go +++ b/vendor/github.com/grafana/sobek/builtin_global.go @@ -1,8 +1,8 @@ -package goja +package sobek import ( "errors" - "github.com/dop251/goja/unistring" + "github.com/grafana/sobek/unistring" "io" "math" "regexp" diff --git a/vendor/github.com/dop251/goja/builtin_json.go b/vendor/github.com/grafana/sobek/builtin_json.go similarity index 99% rename from vendor/github.com/dop251/goja/builtin_json.go rename to vendor/github.com/grafana/sobek/builtin_json.go index e99771cf12ea..57f7ccd798c2 100644 --- a/vendor/github.com/dop251/goja/builtin_json.go +++ b/vendor/github.com/grafana/sobek/builtin_json.go @@ -1,4 +1,4 @@ -package goja +package sobek import ( "bytes" @@ -12,7 +12,7 @@ import ( "unicode/utf16" "unicode/utf8" - "github.com/dop251/goja/unistring" + "github.com/grafana/sobek/unistring" ) const hex = "0123456789abcdef" diff --git a/vendor/github.com/dop251/goja/builtin_map.go b/vendor/github.com/grafana/sobek/builtin_map.go similarity index 99% rename from vendor/github.com/dop251/goja/builtin_map.go rename to vendor/github.com/grafana/sobek/builtin_map.go index 819d025fe108..c0c887fcc5d2 100644 --- a/vendor/github.com/dop251/goja/builtin_map.go +++ b/vendor/github.com/grafana/sobek/builtin_map.go @@ -1,4 +1,4 @@ -package goja +package sobek import ( "reflect" diff --git a/vendor/github.com/dop251/goja/builtin_math.go b/vendor/github.com/grafana/sobek/builtin_math.go similarity index 99% rename from vendor/github.com/dop251/goja/builtin_math.go rename to vendor/github.com/grafana/sobek/builtin_math.go index 169ea18ca4be..a31d7c32e041 100644 --- a/vendor/github.com/dop251/goja/builtin_math.go +++ b/vendor/github.com/grafana/sobek/builtin_math.go @@ -1,4 +1,4 @@ -package goja +package sobek import ( "math" diff --git a/vendor/github.com/dop251/goja/builtin_number.go b/vendor/github.com/grafana/sobek/builtin_number.go similarity index 99% rename from vendor/github.com/dop251/goja/builtin_number.go rename to vendor/github.com/grafana/sobek/builtin_number.go index 43add4ffb3e6..f7b2ee040d41 100644 --- a/vendor/github.com/dop251/goja/builtin_number.go +++ b/vendor/github.com/grafana/sobek/builtin_number.go @@ -1,10 +1,10 @@ -package goja +package sobek import ( "math" "sync" - "github.com/dop251/goja/ftoa" + "github.com/grafana/sobek/ftoa" ) func (r *Runtime) toNumber(v Value) Value { diff --git a/vendor/github.com/dop251/goja/builtin_object.go b/vendor/github.com/grafana/sobek/builtin_object.go similarity index 99% rename from vendor/github.com/dop251/goja/builtin_object.go rename to vendor/github.com/grafana/sobek/builtin_object.go index 6bf1ff80ae91..d7c5aa922acb 100644 --- a/vendor/github.com/dop251/goja/builtin_object.go +++ b/vendor/github.com/grafana/sobek/builtin_object.go @@ -1,4 +1,4 @@ -package goja +package sobek import ( "fmt" diff --git a/vendor/github.com/dop251/goja/builtin_promise.go b/vendor/github.com/grafana/sobek/builtin_promise.go similarity index 98% rename from vendor/github.com/dop251/goja/builtin_promise.go rename to vendor/github.com/grafana/sobek/builtin_promise.go index d51f27d17afb..a4a1255a1411 100644 --- a/vendor/github.com/dop251/goja/builtin_promise.go +++ b/vendor/github.com/grafana/sobek/builtin_promise.go @@ -1,7 +1,7 @@ -package goja +package sobek import ( - "github.com/dop251/goja/unistring" + "github.com/grafana/sobek/unistring" "reflect" ) @@ -605,18 +605,18 @@ func (r *Runtime) wrapPromiseReaction(fObj *Object) func(interface{}) { // NewPromise creates and returns a Promise and resolving functions for it. // // WARNING: The returned values are not goroutine-safe and must not be called in parallel with VM running. -// In order to make use of this method you need an event loop such as the one in goja_nodejs (https://github.com/dop251/goja_nodejs) +// In order to make use of this method you need an event loop such as the one in sobek_nodejs (https://github.com/grafana/sobek_nodejs) // where it can be used like this: // // loop := NewEventLoop() // loop.Start() // defer loop.Stop() -// loop.RunOnLoop(func(vm *goja.Runtime) { +// loop.RunOnLoop(func(vm *sobek.Runtime) { // p, resolve, _ := vm.NewPromise() // vm.Set("p", p) // go func() { // time.Sleep(500 * time.Millisecond) // or perform any other blocking operation -// loop.RunOnLoop(func(*goja.Runtime) { // resolve() must be called on the loop, cannot call it here +// loop.RunOnLoop(func(*sobek.Runtime) { // resolve() must be called on the loop, cannot call it here // resolve(result) // }) // }() diff --git a/vendor/github.com/dop251/goja/builtin_proxy.go b/vendor/github.com/grafana/sobek/builtin_proxy.go similarity index 99% rename from vendor/github.com/dop251/goja/builtin_proxy.go rename to vendor/github.com/grafana/sobek/builtin_proxy.go index f589930677e8..4ec5ba01745b 100644 --- a/vendor/github.com/dop251/goja/builtin_proxy.go +++ b/vendor/github.com/grafana/sobek/builtin_proxy.go @@ -1,7 +1,7 @@ -package goja +package sobek import ( - "github.com/dop251/goja/unistring" + "github.com/grafana/sobek/unistring" ) type nativeProxyHandler struct { diff --git a/vendor/github.com/dop251/goja/builtin_reflect.go b/vendor/github.com/grafana/sobek/builtin_reflect.go similarity index 99% rename from vendor/github.com/dop251/goja/builtin_reflect.go rename to vendor/github.com/grafana/sobek/builtin_reflect.go index 17bb11a36d6f..8ee0d7cf5a78 100644 --- a/vendor/github.com/dop251/goja/builtin_reflect.go +++ b/vendor/github.com/grafana/sobek/builtin_reflect.go @@ -1,4 +1,4 @@ -package goja +package sobek func (r *Runtime) builtin_reflect_apply(call FunctionCall) Value { return r.toCallable(call.Argument(0))(FunctionCall{ diff --git a/vendor/github.com/dop251/goja/builtin_regexp.go b/vendor/github.com/grafana/sobek/builtin_regexp.go similarity index 99% rename from vendor/github.com/dop251/goja/builtin_regexp.go rename to vendor/github.com/grafana/sobek/builtin_regexp.go index 89402820e995..a606da0ce0e7 100644 --- a/vendor/github.com/dop251/goja/builtin_regexp.go +++ b/vendor/github.com/grafana/sobek/builtin_regexp.go @@ -1,8 +1,8 @@ -package goja +package sobek import ( "fmt" - "github.com/dop251/goja/parser" + "github.com/grafana/sobek/parser" "regexp" "strings" "unicode/utf16" diff --git a/vendor/github.com/dop251/goja/builtin_set.go b/vendor/github.com/grafana/sobek/builtin_set.go similarity index 99% rename from vendor/github.com/dop251/goja/builtin_set.go rename to vendor/github.com/grafana/sobek/builtin_set.go index eeedb887c7ff..45d956f11507 100644 --- a/vendor/github.com/dop251/goja/builtin_set.go +++ b/vendor/github.com/grafana/sobek/builtin_set.go @@ -1,4 +1,4 @@ -package goja +package sobek import ( "fmt" diff --git a/vendor/github.com/dop251/goja/builtin_string.go b/vendor/github.com/grafana/sobek/builtin_string.go similarity index 99% rename from vendor/github.com/dop251/goja/builtin_string.go rename to vendor/github.com/grafana/sobek/builtin_string.go index b2a0e4ea816b..2343ed236fbe 100644 --- a/vendor/github.com/dop251/goja/builtin_string.go +++ b/vendor/github.com/grafana/sobek/builtin_string.go @@ -1,14 +1,14 @@ -package goja +package sobek import ( - "github.com/dop251/goja/unistring" + "github.com/grafana/sobek/unistring" "math" "strings" "sync" "unicode/utf16" "unicode/utf8" - "github.com/dop251/goja/parser" + "github.com/grafana/sobek/parser" "golang.org/x/text/collate" "golang.org/x/text/language" "golang.org/x/text/unicode/norm" diff --git a/vendor/github.com/dop251/goja/builtin_symbol.go b/vendor/github.com/grafana/sobek/builtin_symbol.go similarity index 98% rename from vendor/github.com/dop251/goja/builtin_symbol.go rename to vendor/github.com/grafana/sobek/builtin_symbol.go index 8231b7bfcb78..b0c5fc867217 100644 --- a/vendor/github.com/dop251/goja/builtin_symbol.go +++ b/vendor/github.com/grafana/sobek/builtin_symbol.go @@ -1,6 +1,6 @@ -package goja +package sobek -import "github.com/dop251/goja/unistring" +import "github.com/grafana/sobek/unistring" var ( SymHasInstance = newSymbol(asciiString("Symbol.hasInstance")) diff --git a/vendor/github.com/dop251/goja/builtin_typedarrays.go b/vendor/github.com/grafana/sobek/builtin_typedarrays.go similarity index 99% rename from vendor/github.com/dop251/goja/builtin_typedarrays.go rename to vendor/github.com/grafana/sobek/builtin_typedarrays.go index 1fd672c147bc..7ad737fceb07 100644 --- a/vendor/github.com/dop251/goja/builtin_typedarrays.go +++ b/vendor/github.com/grafana/sobek/builtin_typedarrays.go @@ -1,4 +1,4 @@ -package goja +package sobek import ( "fmt" @@ -7,7 +7,7 @@ import ( "sync" "unsafe" - "github.com/dop251/goja/unistring" + "github.com/grafana/sobek/unistring" ) type typedArraySortCtx struct { diff --git a/vendor/github.com/dop251/goja/builtin_weakmap.go b/vendor/github.com/grafana/sobek/builtin_weakmap.go similarity index 99% rename from vendor/github.com/dop251/goja/builtin_weakmap.go rename to vendor/github.com/grafana/sobek/builtin_weakmap.go index 40fc717db13d..24bfdd2a41e4 100644 --- a/vendor/github.com/dop251/goja/builtin_weakmap.go +++ b/vendor/github.com/grafana/sobek/builtin_weakmap.go @@ -1,4 +1,4 @@ -package goja +package sobek type weakMap uint64 diff --git a/vendor/github.com/dop251/goja/builtin_weakset.go b/vendor/github.com/grafana/sobek/builtin_weakset.go similarity index 99% rename from vendor/github.com/dop251/goja/builtin_weakset.go rename to vendor/github.com/grafana/sobek/builtin_weakset.go index cd8183e59127..e1f842ef0b00 100644 --- a/vendor/github.com/dop251/goja/builtin_weakset.go +++ b/vendor/github.com/grafana/sobek/builtin_weakset.go @@ -1,4 +1,4 @@ -package goja +package sobek type weakSetObject struct { baseObject diff --git a/vendor/github.com/dop251/goja/compiler.go b/vendor/github.com/grafana/sobek/compiler.go similarity index 99% rename from vendor/github.com/dop251/goja/compiler.go rename to vendor/github.com/grafana/sobek/compiler.go index 2abd9ba528b4..edebf8c6ce9c 100644 --- a/vendor/github.com/dop251/goja/compiler.go +++ b/vendor/github.com/grafana/sobek/compiler.go @@ -1,13 +1,13 @@ -package goja +package sobek import ( "fmt" - "github.com/dop251/goja/token" + "github.com/grafana/sobek/token" "sort" - "github.com/dop251/goja/ast" - "github.com/dop251/goja/file" - "github.com/dop251/goja/unistring" + "github.com/grafana/sobek/ast" + "github.com/grafana/sobek/file" + "github.com/grafana/sobek/unistring" ) type blockType int diff --git a/vendor/github.com/dop251/goja/compiler_expr.go b/vendor/github.com/grafana/sobek/compiler_expr.go similarity index 99% rename from vendor/github.com/dop251/goja/compiler_expr.go rename to vendor/github.com/grafana/sobek/compiler_expr.go index 477580aecf6e..69d37153cd5c 100644 --- a/vendor/github.com/dop251/goja/compiler_expr.go +++ b/vendor/github.com/grafana/sobek/compiler_expr.go @@ -1,10 +1,10 @@ -package goja +package sobek import ( - "github.com/dop251/goja/ast" - "github.com/dop251/goja/file" - "github.com/dop251/goja/token" - "github.com/dop251/goja/unistring" + "github.com/grafana/sobek/ast" + "github.com/grafana/sobek/file" + "github.com/grafana/sobek/token" + "github.com/grafana/sobek/unistring" ) type compiledExpr interface { diff --git a/vendor/github.com/dop251/goja/compiler_stmt.go b/vendor/github.com/grafana/sobek/compiler_stmt.go similarity index 99% rename from vendor/github.com/dop251/goja/compiler_stmt.go rename to vendor/github.com/grafana/sobek/compiler_stmt.go index 2d3d83b95e91..f9599b7e329e 100644 --- a/vendor/github.com/dop251/goja/compiler_stmt.go +++ b/vendor/github.com/grafana/sobek/compiler_stmt.go @@ -1,10 +1,10 @@ -package goja +package sobek import ( - "github.com/dop251/goja/ast" - "github.com/dop251/goja/file" - "github.com/dop251/goja/token" - "github.com/dop251/goja/unistring" + "github.com/grafana/sobek/ast" + "github.com/grafana/sobek/file" + "github.com/grafana/sobek/token" + "github.com/grafana/sobek/unistring" ) func (c *compiler) compileStatement(v ast.Statement, needResult bool) { diff --git a/vendor/github.com/dop251/goja/date.go b/vendor/github.com/grafana/sobek/date.go similarity index 99% rename from vendor/github.com/dop251/goja/date.go rename to vendor/github.com/grafana/sobek/date.go index ee29a21e7dee..d06841db7055 100644 --- a/vendor/github.com/dop251/goja/date.go +++ b/vendor/github.com/grafana/sobek/date.go @@ -1,4 +1,4 @@ -package goja +package sobek import ( "math" diff --git a/vendor/github.com/dop251/goja/date_parser.go b/vendor/github.com/grafana/sobek/date_parser.go similarity index 99% rename from vendor/github.com/dop251/goja/date_parser.go rename to vendor/github.com/grafana/sobek/date_parser.go index f83605329293..a956426d3d7d 100644 --- a/vendor/github.com/dop251/goja/date_parser.go +++ b/vendor/github.com/grafana/sobek/date_parser.go @@ -1,4 +1,4 @@ -package goja +package sobek // This is a slightly modified version of the standard Go parser to make it more compatible with ECMAScript 5.1 // Changes: diff --git a/vendor/github.com/dop251/goja/destruct.go b/vendor/github.com/grafana/sobek/destruct.go similarity index 99% rename from vendor/github.com/dop251/goja/destruct.go rename to vendor/github.com/grafana/sobek/destruct.go index 66792dc3f65c..01e457ace253 100644 --- a/vendor/github.com/dop251/goja/destruct.go +++ b/vendor/github.com/grafana/sobek/destruct.go @@ -1,7 +1,7 @@ -package goja +package sobek import ( - "github.com/dop251/goja/unistring" + "github.com/grafana/sobek/unistring" "reflect" ) diff --git a/vendor/github.com/dop251/goja/extract_failed_tests.sh b/vendor/github.com/grafana/sobek/extract_failed_tests.sh similarity index 100% rename from vendor/github.com/dop251/goja/extract_failed_tests.sh rename to vendor/github.com/grafana/sobek/extract_failed_tests.sh diff --git a/vendor/github.com/dop251/goja/file/README.markdown b/vendor/github.com/grafana/sobek/file/README.markdown similarity index 97% rename from vendor/github.com/dop251/goja/file/README.markdown rename to vendor/github.com/grafana/sobek/file/README.markdown index e9228c2f5e37..f64210029dfc 100644 --- a/vendor/github.com/dop251/goja/file/README.markdown +++ b/vendor/github.com/grafana/sobek/file/README.markdown @@ -1,6 +1,6 @@ # file -- - import "github.com/dop251/goja/file" + import "github.com/grafana/sobek/file" Package file encapsulates the file abstractions used by the ast & parser. diff --git a/vendor/github.com/dop251/goja/file/file.go b/vendor/github.com/grafana/sobek/file/file.go similarity index 100% rename from vendor/github.com/dop251/goja/file/file.go rename to vendor/github.com/grafana/sobek/file/file.go diff --git a/vendor/github.com/dop251/goja/ftoa/LICENSE_LUCENE b/vendor/github.com/grafana/sobek/ftoa/LICENSE_LUCENE similarity index 100% rename from vendor/github.com/dop251/goja/ftoa/LICENSE_LUCENE rename to vendor/github.com/grafana/sobek/ftoa/LICENSE_LUCENE diff --git a/vendor/github.com/dop251/goja/ftoa/common.go b/vendor/github.com/grafana/sobek/ftoa/common.go similarity index 100% rename from vendor/github.com/dop251/goja/ftoa/common.go rename to vendor/github.com/grafana/sobek/ftoa/common.go diff --git a/vendor/github.com/dop251/goja/ftoa/ftoa.go b/vendor/github.com/grafana/sobek/ftoa/ftoa.go similarity index 100% rename from vendor/github.com/dop251/goja/ftoa/ftoa.go rename to vendor/github.com/grafana/sobek/ftoa/ftoa.go diff --git a/vendor/github.com/dop251/goja/ftoa/ftobasestr.go b/vendor/github.com/grafana/sobek/ftoa/ftobasestr.go similarity index 100% rename from vendor/github.com/dop251/goja/ftoa/ftobasestr.go rename to vendor/github.com/grafana/sobek/ftoa/ftobasestr.go diff --git a/vendor/github.com/dop251/goja/ftoa/ftostr.go b/vendor/github.com/grafana/sobek/ftoa/ftostr.go similarity index 98% rename from vendor/github.com/dop251/goja/ftoa/ftostr.go rename to vendor/github.com/grafana/sobek/ftoa/ftostr.go index a9d2d2409438..d1d9c3f1d979 100644 --- a/vendor/github.com/dop251/goja/ftoa/ftostr.go +++ b/vendor/github.com/grafana/sobek/ftoa/ftostr.go @@ -4,7 +4,7 @@ import ( "math" "strconv" - "github.com/dop251/goja/ftoa/internal/fast" + "github.com/grafana/sobek/ftoa/internal/fast" ) type FToStrMode int diff --git a/vendor/github.com/dop251/goja/ftoa/internal/fast/LICENSE_V8 b/vendor/github.com/grafana/sobek/ftoa/internal/fast/LICENSE_V8 similarity index 100% rename from vendor/github.com/dop251/goja/ftoa/internal/fast/LICENSE_V8 rename to vendor/github.com/grafana/sobek/ftoa/internal/fast/LICENSE_V8 diff --git a/vendor/github.com/dop251/goja/ftoa/internal/fast/cachedpower.go b/vendor/github.com/grafana/sobek/ftoa/internal/fast/cachedpower.go similarity index 100% rename from vendor/github.com/dop251/goja/ftoa/internal/fast/cachedpower.go rename to vendor/github.com/grafana/sobek/ftoa/internal/fast/cachedpower.go diff --git a/vendor/github.com/dop251/goja/ftoa/internal/fast/common.go b/vendor/github.com/grafana/sobek/ftoa/internal/fast/common.go similarity index 100% rename from vendor/github.com/dop251/goja/ftoa/internal/fast/common.go rename to vendor/github.com/grafana/sobek/ftoa/internal/fast/common.go diff --git a/vendor/github.com/dop251/goja/ftoa/internal/fast/diyfp.go b/vendor/github.com/grafana/sobek/ftoa/internal/fast/diyfp.go similarity index 100% rename from vendor/github.com/dop251/goja/ftoa/internal/fast/diyfp.go rename to vendor/github.com/grafana/sobek/ftoa/internal/fast/diyfp.go diff --git a/vendor/github.com/dop251/goja/ftoa/internal/fast/dtoa.go b/vendor/github.com/grafana/sobek/ftoa/internal/fast/dtoa.go similarity index 100% rename from vendor/github.com/dop251/goja/ftoa/internal/fast/dtoa.go rename to vendor/github.com/grafana/sobek/ftoa/internal/fast/dtoa.go diff --git a/vendor/github.com/dop251/goja/func.go b/vendor/github.com/grafana/sobek/func.go similarity index 99% rename from vendor/github.com/dop251/goja/func.go rename to vendor/github.com/grafana/sobek/func.go index c04695696642..ef7c846a2dd0 100644 --- a/vendor/github.com/dop251/goja/func.go +++ b/vendor/github.com/grafana/sobek/func.go @@ -1,10 +1,10 @@ -package goja +package sobek import ( "fmt" "reflect" - "github.com/dop251/goja/unistring" + "github.com/grafana/sobek/unistring" ) type resultType uint8 diff --git a/vendor/github.com/dop251/goja/ipow.go b/vendor/github.com/grafana/sobek/ipow.go similarity index 99% rename from vendor/github.com/dop251/goja/ipow.go rename to vendor/github.com/grafana/sobek/ipow.go index 5ee0d4db9178..1d9ef0c3722c 100644 --- a/vendor/github.com/dop251/goja/ipow.go +++ b/vendor/github.com/grafana/sobek/ipow.go @@ -1,4 +1,4 @@ -package goja +package sobek // inspired by https://gist.github.com/orlp/3551590 diff --git a/vendor/github.com/dop251/goja/map.go b/vendor/github.com/grafana/sobek/map.go similarity index 99% rename from vendor/github.com/dop251/goja/map.go rename to vendor/github.com/grafana/sobek/map.go index b092b0d0494b..26dd400cf87f 100644 --- a/vendor/github.com/dop251/goja/map.go +++ b/vendor/github.com/grafana/sobek/map.go @@ -1,4 +1,4 @@ -package goja +package sobek import ( "hash/maphash" diff --git a/vendor/github.com/dop251/goja/object.go b/vendor/github.com/grafana/sobek/object.go similarity index 99% rename from vendor/github.com/dop251/goja/object.go rename to vendor/github.com/grafana/sobek/object.go index 79bd67df4297..906fe42e9ce5 100644 --- a/vendor/github.com/dop251/goja/object.go +++ b/vendor/github.com/grafana/sobek/object.go @@ -1,4 +1,4 @@ -package goja +package sobek import ( "fmt" @@ -6,7 +6,7 @@ import ( "reflect" "sort" - "github.com/dop251/goja/unistring" + "github.com/grafana/sobek/unistring" ) const ( diff --git a/vendor/github.com/dop251/goja/object_args.go b/vendor/github.com/grafana/sobek/object_args.go similarity index 98% rename from vendor/github.com/dop251/goja/object_args.go rename to vendor/github.com/grafana/sobek/object_args.go index eb41d01ce045..3ef097fd2812 100644 --- a/vendor/github.com/dop251/goja/object_args.go +++ b/vendor/github.com/grafana/sobek/object_args.go @@ -1,6 +1,6 @@ -package goja +package sobek -import "github.com/dop251/goja/unistring" +import "github.com/grafana/sobek/unistring" type argumentsObject struct { baseObject diff --git a/vendor/github.com/dop251/goja/object_dynamic.go b/vendor/github.com/grafana/sobek/object_dynamic.go similarity index 99% rename from vendor/github.com/dop251/goja/object_dynamic.go rename to vendor/github.com/grafana/sobek/object_dynamic.go index b1e3161e9443..a2ebc9784852 100644 --- a/vendor/github.com/dop251/goja/object_dynamic.go +++ b/vendor/github.com/grafana/sobek/object_dynamic.go @@ -1,11 +1,11 @@ -package goja +package sobek import ( "fmt" "reflect" "strconv" - "github.com/dop251/goja/unistring" + "github.com/grafana/sobek/unistring" ) /* diff --git a/vendor/github.com/dop251/goja/object_goarray_reflect.go b/vendor/github.com/grafana/sobek/object_goarray_reflect.go similarity index 99% rename from vendor/github.com/dop251/goja/object_goarray_reflect.go rename to vendor/github.com/grafana/sobek/object_goarray_reflect.go index e40364db9e90..05bb5d4179b3 100644 --- a/vendor/github.com/dop251/goja/object_goarray_reflect.go +++ b/vendor/github.com/grafana/sobek/object_goarray_reflect.go @@ -1,10 +1,10 @@ -package goja +package sobek import ( "reflect" "strconv" - "github.com/dop251/goja/unistring" + "github.com/grafana/sobek/unistring" ) type objectGoArrayReflect struct { diff --git a/vendor/github.com/dop251/goja/object_gomap.go b/vendor/github.com/grafana/sobek/object_gomap.go similarity index 98% rename from vendor/github.com/dop251/goja/object_gomap.go rename to vendor/github.com/grafana/sobek/object_gomap.go index 82138c28aafd..d526403ca563 100644 --- a/vendor/github.com/dop251/goja/object_gomap.go +++ b/vendor/github.com/grafana/sobek/object_gomap.go @@ -1,9 +1,9 @@ -package goja +package sobek import ( "reflect" - "github.com/dop251/goja/unistring" + "github.com/grafana/sobek/unistring" ) type objectGoMapSimple struct { diff --git a/vendor/github.com/dop251/goja/object_gomap_reflect.go b/vendor/github.com/grafana/sobek/object_gomap_reflect.go similarity index 99% rename from vendor/github.com/dop251/goja/object_gomap_reflect.go rename to vendor/github.com/grafana/sobek/object_gomap_reflect.go index 531c165243eb..bf8b41a6bf23 100644 --- a/vendor/github.com/dop251/goja/object_gomap_reflect.go +++ b/vendor/github.com/grafana/sobek/object_gomap_reflect.go @@ -1,9 +1,9 @@ -package goja +package sobek import ( "reflect" - "github.com/dop251/goja/unistring" + "github.com/grafana/sobek/unistring" ) type objectGoMapReflect struct { diff --git a/vendor/github.com/dop251/goja/object_goreflect.go b/vendor/github.com/grafana/sobek/object_goreflect.go similarity index 99% rename from vendor/github.com/dop251/goja/object_goreflect.go rename to vendor/github.com/grafana/sobek/object_goreflect.go index 7ad5970efb82..143fc5cd20b3 100644 --- a/vendor/github.com/dop251/goja/object_goreflect.go +++ b/vendor/github.com/grafana/sobek/object_goreflect.go @@ -1,4 +1,4 @@ -package goja +package sobek import ( "fmt" @@ -6,8 +6,8 @@ import ( "reflect" "strings" - "github.com/dop251/goja/parser" - "github.com/dop251/goja/unistring" + "github.com/grafana/sobek/parser" + "github.com/grafana/sobek/unistring" ) // JsonEncodable allows custom JSON encoding by JSON.stringify() diff --git a/vendor/github.com/dop251/goja/object_goslice.go b/vendor/github.com/grafana/sobek/object_goslice.go similarity index 99% rename from vendor/github.com/dop251/goja/object_goslice.go rename to vendor/github.com/grafana/sobek/object_goslice.go index 1a5220746d88..7f71dfdfb179 100644 --- a/vendor/github.com/dop251/goja/object_goslice.go +++ b/vendor/github.com/grafana/sobek/object_goslice.go @@ -1,4 +1,4 @@ -package goja +package sobek import ( "math" @@ -6,7 +6,7 @@ import ( "reflect" "strconv" - "github.com/dop251/goja/unistring" + "github.com/grafana/sobek/unistring" ) type objectGoSlice struct { diff --git a/vendor/github.com/dop251/goja/object_goslice_reflect.go b/vendor/github.com/grafana/sobek/object_goslice_reflect.go similarity index 97% rename from vendor/github.com/dop251/goja/object_goslice_reflect.go rename to vendor/github.com/grafana/sobek/object_goslice_reflect.go index 4c28d8cd00f6..378322a4d2cf 100644 --- a/vendor/github.com/dop251/goja/object_goslice_reflect.go +++ b/vendor/github.com/grafana/sobek/object_goslice_reflect.go @@ -1,11 +1,11 @@ -package goja +package sobek import ( "math" "math/bits" "reflect" - "github.com/dop251/goja/unistring" + "github.com/grafana/sobek/unistring" ) type objectGoSliceReflect struct { diff --git a/vendor/github.com/dop251/goja/object_template.go b/vendor/github.com/grafana/sobek/object_template.go similarity index 99% rename from vendor/github.com/dop251/goja/object_template.go rename to vendor/github.com/grafana/sobek/object_template.go index 6d42f9f9805c..fa39133b0840 100644 --- a/vendor/github.com/dop251/goja/object_template.go +++ b/vendor/github.com/grafana/sobek/object_template.go @@ -1,8 +1,8 @@ -package goja +package sobek import ( "fmt" - "github.com/dop251/goja/unistring" + "github.com/grafana/sobek/unistring" "math" "reflect" "sort" diff --git a/vendor/github.com/dop251/goja/parser/README.markdown b/vendor/github.com/grafana/sobek/parser/README.markdown similarity index 97% rename from vendor/github.com/dop251/goja/parser/README.markdown rename to vendor/github.com/grafana/sobek/parser/README.markdown index ec1186d4638b..3d19db26957a 100644 --- a/vendor/github.com/dop251/goja/parser/README.markdown +++ b/vendor/github.com/grafana/sobek/parser/README.markdown @@ -1,11 +1,11 @@ # parser -- - import "github.com/dop251/goja/parser" + import "github.com/grafana/sobek/parser" Package parser implements a parser for JavaScript. Borrowed from https://github.com/robertkrimen/otto/tree/master/parser import ( - "github.com/dop251/goja/parser" + "github.com/grafana/sobek/parser" ) Parse and return an AST diff --git a/vendor/github.com/dop251/goja/parser/error.go b/vendor/github.com/grafana/sobek/parser/error.go similarity index 98% rename from vendor/github.com/dop251/goja/parser/error.go rename to vendor/github.com/grafana/sobek/parser/error.go index cf4d2c3810ab..39d61fa7747a 100644 --- a/vendor/github.com/dop251/goja/parser/error.go +++ b/vendor/github.com/grafana/sobek/parser/error.go @@ -4,8 +4,8 @@ import ( "fmt" "sort" - "github.com/dop251/goja/file" - "github.com/dop251/goja/token" + "github.com/grafana/sobek/file" + "github.com/grafana/sobek/token" ) const ( diff --git a/vendor/github.com/dop251/goja/parser/expression.go b/vendor/github.com/grafana/sobek/parser/expression.go similarity index 99% rename from vendor/github.com/dop251/goja/parser/expression.go rename to vendor/github.com/grafana/sobek/parser/expression.go index 305bed499fb9..74d346a014c1 100644 --- a/vendor/github.com/dop251/goja/parser/expression.go +++ b/vendor/github.com/grafana/sobek/parser/expression.go @@ -3,10 +3,10 @@ package parser import ( "strings" - "github.com/dop251/goja/ast" - "github.com/dop251/goja/file" - "github.com/dop251/goja/token" - "github.com/dop251/goja/unistring" + "github.com/grafana/sobek/ast" + "github.com/grafana/sobek/file" + "github.com/grafana/sobek/token" + "github.com/grafana/sobek/unistring" ) func (self *_parser) parseIdentifier() *ast.Identifier { diff --git a/vendor/github.com/dop251/goja/parser/lexer.go b/vendor/github.com/grafana/sobek/parser/lexer.go similarity index 99% rename from vendor/github.com/dop251/goja/parser/lexer.go rename to vendor/github.com/grafana/sobek/parser/lexer.go index 68d56d20b1b2..234d5b963bb0 100644 --- a/vendor/github.com/dop251/goja/parser/lexer.go +++ b/vendor/github.com/grafana/sobek/parser/lexer.go @@ -11,9 +11,9 @@ import ( "golang.org/x/text/unicode/rangetable" - "github.com/dop251/goja/file" - "github.com/dop251/goja/token" - "github.com/dop251/goja/unistring" + "github.com/grafana/sobek/file" + "github.com/grafana/sobek/token" + "github.com/grafana/sobek/unistring" ) var ( diff --git a/vendor/github.com/dop251/goja/parser/parser.go b/vendor/github.com/grafana/sobek/parser/parser.go similarity index 97% rename from vendor/github.com/dop251/goja/parser/parser.go rename to vendor/github.com/grafana/sobek/parser/parser.go index 24b380249f5a..9adfe3ab8770 100644 --- a/vendor/github.com/dop251/goja/parser/parser.go +++ b/vendor/github.com/grafana/sobek/parser/parser.go @@ -2,7 +2,7 @@ Package parser implements a parser for JavaScript. import ( - "github.com/dop251/goja/parser" + "github.com/grafana/sobek/parser" ) Parse and return an AST @@ -38,10 +38,10 @@ import ( "io" "os" - "github.com/dop251/goja/ast" - "github.com/dop251/goja/file" - "github.com/dop251/goja/token" - "github.com/dop251/goja/unistring" + "github.com/grafana/sobek/ast" + "github.com/grafana/sobek/file" + "github.com/grafana/sobek/token" + "github.com/grafana/sobek/unistring" ) // A Mode value is a set of flags (or 0). They control optional parser functionality. diff --git a/vendor/github.com/dop251/goja/parser/regexp.go b/vendor/github.com/grafana/sobek/parser/regexp.go similarity index 100% rename from vendor/github.com/dop251/goja/parser/regexp.go rename to vendor/github.com/grafana/sobek/parser/regexp.go diff --git a/vendor/github.com/dop251/goja/parser/scope.go b/vendor/github.com/grafana/sobek/parser/scope.go similarity index 93% rename from vendor/github.com/dop251/goja/parser/scope.go rename to vendor/github.com/grafana/sobek/parser/scope.go index 5e28ef46756e..f9936dafbfe1 100644 --- a/vendor/github.com/dop251/goja/parser/scope.go +++ b/vendor/github.com/grafana/sobek/parser/scope.go @@ -1,8 +1,8 @@ package parser import ( - "github.com/dop251/goja/ast" - "github.com/dop251/goja/unistring" + "github.com/grafana/sobek/ast" + "github.com/grafana/sobek/unistring" ) type _scope struct { diff --git a/vendor/github.com/dop251/goja/parser/statement.go b/vendor/github.com/grafana/sobek/parser/statement.go similarity index 99% rename from vendor/github.com/dop251/goja/parser/statement.go rename to vendor/github.com/grafana/sobek/parser/statement.go index 8ec5cdeb7709..03e1de46632b 100644 --- a/vendor/github.com/dop251/goja/parser/statement.go +++ b/vendor/github.com/grafana/sobek/parser/statement.go @@ -6,10 +6,10 @@ import ( "os" "strings" - "github.com/dop251/goja/ast" - "github.com/dop251/goja/file" - "github.com/dop251/goja/token" "github.com/go-sourcemap/sourcemap" + "github.com/grafana/sobek/ast" + "github.com/grafana/sobek/file" + "github.com/grafana/sobek/token" ) func (self *_parser) parseBlockStatement() *ast.BlockStatement { diff --git a/vendor/github.com/dop251/goja/profiler.go b/vendor/github.com/grafana/sobek/profiler.go similarity index 99% rename from vendor/github.com/dop251/goja/profiler.go rename to vendor/github.com/grafana/sobek/profiler.go index 3d21ad1d95e3..01a33b14c968 100644 --- a/vendor/github.com/dop251/goja/profiler.go +++ b/vendor/github.com/grafana/sobek/profiler.go @@ -1,4 +1,4 @@ -package goja +package sobek import ( "errors" diff --git a/vendor/github.com/dop251/goja/proxy.go b/vendor/github.com/grafana/sobek/proxy.go similarity index 99% rename from vendor/github.com/dop251/goja/proxy.go rename to vendor/github.com/grafana/sobek/proxy.go index e9bd8c96752d..0662cde9d295 100644 --- a/vendor/github.com/dop251/goja/proxy.go +++ b/vendor/github.com/grafana/sobek/proxy.go @@ -1,10 +1,10 @@ -package goja +package sobek import ( "fmt" "reflect" - "github.com/dop251/goja/unistring" + "github.com/grafana/sobek/unistring" ) // Proxy is a Go wrapper around ECMAScript Proxy. Calling Runtime.ToValue() on it diff --git a/vendor/github.com/dop251/goja/regexp.go b/vendor/github.com/grafana/sobek/regexp.go similarity index 99% rename from vendor/github.com/dop251/goja/regexp.go rename to vendor/github.com/grafana/sobek/regexp.go index 1c3e7e06dadb..bdc15a1cb97b 100644 --- a/vendor/github.com/dop251/goja/regexp.go +++ b/vendor/github.com/grafana/sobek/regexp.go @@ -1,9 +1,9 @@ -package goja +package sobek import ( "fmt" "github.com/dlclark/regexp2" - "github.com/dop251/goja/unistring" + "github.com/grafana/sobek/unistring" "io" "regexp" "sort" diff --git a/vendor/github.com/dop251/goja/runtime.go b/vendor/github.com/grafana/sobek/runtime.go similarity index 99% rename from vendor/github.com/dop251/goja/runtime.go rename to vendor/github.com/grafana/sobek/runtime.go index 0139ef10db18..27404f594e06 100644 --- a/vendor/github.com/dop251/goja/runtime.go +++ b/vendor/github.com/grafana/sobek/runtime.go @@ -1,4 +1,4 @@ -package goja +package sobek import ( "bytes" @@ -16,10 +16,10 @@ import ( "golang.org/x/text/collate" - js_ast "github.com/dop251/goja/ast" - "github.com/dop251/goja/file" - "github.com/dop251/goja/parser" - "github.com/dop251/goja/unistring" + js_ast "github.com/grafana/sobek/ast" + "github.com/grafana/sobek/file" + "github.com/grafana/sobek/parser" + "github.com/grafana/sobek/unistring" ) const ( @@ -1613,7 +1613,7 @@ func(FunctionCall, *Runtime) Value is treated as above, except the *Runtime is a func(ConstructorCall) *Object is treated as a native constructor, allowing to use it with the new operator: - func MyObject(call goja.ConstructorCall) *goja.Object { + func MyObject(call sobek.ConstructorCall) *sobek.Object { // call.This contains the newly created object as per http://www.ecma-international.org/ecma-262/5.1/index.html#sec-13.2.2 // call.Arguments contain arguments passed to the function @@ -1623,7 +1623,7 @@ operator: // If return value is a non-nil *Object, it will be used instead of call.This // This way it is possible to return a Go struct or a map converted - // into goja.Value using ToValue(), however in this case + // into sobek.Value using ToValue(), however in this case // instanceof will not work as expected, unless you set the prototype: // // instance := &myCustomStruct{} diff --git a/vendor/github.com/dop251/goja/staticcheck.conf b/vendor/github.com/grafana/sobek/staticcheck.conf similarity index 100% rename from vendor/github.com/dop251/goja/staticcheck.conf rename to vendor/github.com/grafana/sobek/staticcheck.conf diff --git a/vendor/github.com/dop251/goja/string.go b/vendor/github.com/grafana/sobek/string.go similarity index 99% rename from vendor/github.com/dop251/goja/string.go rename to vendor/github.com/grafana/sobek/string.go index 632f1e3b5476..833bc3aa448e 100644 --- a/vendor/github.com/dop251/goja/string.go +++ b/vendor/github.com/grafana/sobek/string.go @@ -1,4 +1,4 @@ -package goja +package sobek import ( "io" @@ -6,7 +6,7 @@ import ( "strings" "unicode/utf8" - "github.com/dop251/goja/unistring" + "github.com/grafana/sobek/unistring" ) const ( diff --git a/vendor/github.com/dop251/goja/string_ascii.go b/vendor/github.com/grafana/sobek/string_ascii.go similarity index 99% rename from vendor/github.com/dop251/goja/string_ascii.go rename to vendor/github.com/grafana/sobek/string_ascii.go index 5ff21bf7b79b..df622f41c3a3 100644 --- a/vendor/github.com/dop251/goja/string_ascii.go +++ b/vendor/github.com/grafana/sobek/string_ascii.go @@ -1,4 +1,4 @@ -package goja +package sobek import ( "hash/maphash" @@ -8,7 +8,7 @@ import ( "strconv" "strings" - "github.com/dop251/goja/unistring" + "github.com/grafana/sobek/unistring" ) type asciiString string diff --git a/vendor/github.com/dop251/goja/string_imported.go b/vendor/github.com/grafana/sobek/string_imported.go similarity index 98% rename from vendor/github.com/dop251/goja/string_imported.go rename to vendor/github.com/grafana/sobek/string_imported.go index 1c6cae88d099..e61cb77c41d1 100644 --- a/vendor/github.com/dop251/goja/string_imported.go +++ b/vendor/github.com/grafana/sobek/string_imported.go @@ -1,4 +1,4 @@ -package goja +package sobek import ( "hash/maphash" @@ -9,8 +9,8 @@ import ( "unicode/utf16" "unicode/utf8" - "github.com/dop251/goja/parser" - "github.com/dop251/goja/unistring" + "github.com/grafana/sobek/parser" + "github.com/grafana/sobek/unistring" "golang.org/x/text/cases" "golang.org/x/text/language" diff --git a/vendor/github.com/dop251/goja/string_unicode.go b/vendor/github.com/grafana/sobek/string_unicode.go similarity index 99% rename from vendor/github.com/dop251/goja/string_unicode.go rename to vendor/github.com/grafana/sobek/string_unicode.go index 49e363fe8f95..b755978cc620 100644 --- a/vendor/github.com/dop251/goja/string_unicode.go +++ b/vendor/github.com/grafana/sobek/string_unicode.go @@ -1,4 +1,4 @@ -package goja +package sobek import ( "errors" @@ -10,8 +10,8 @@ import ( "unicode/utf16" "unicode/utf8" - "github.com/dop251/goja/parser" - "github.com/dop251/goja/unistring" + "github.com/grafana/sobek/parser" + "github.com/grafana/sobek/unistring" "golang.org/x/text/cases" "golang.org/x/text/language" ) diff --git a/vendor/github.com/dop251/goja/token/README.markdown b/vendor/github.com/grafana/sobek/token/README.markdown similarity index 98% rename from vendor/github.com/dop251/goja/token/README.markdown rename to vendor/github.com/grafana/sobek/token/README.markdown index 66dd2abde711..7b643660c13c 100644 --- a/vendor/github.com/dop251/goja/token/README.markdown +++ b/vendor/github.com/grafana/sobek/token/README.markdown @@ -1,6 +1,6 @@ # token -- - import "github.com/dop251/goja/token" + import "github.com/grafana/sobek/token" Package token defines constants representing the lexical tokens of JavaScript (ECMA5). diff --git a/vendor/github.com/dop251/goja/token/token.go b/vendor/github.com/grafana/sobek/token/token.go similarity index 100% rename from vendor/github.com/dop251/goja/token/token.go rename to vendor/github.com/grafana/sobek/token/token.go diff --git a/vendor/github.com/dop251/goja/token/token_const.go b/vendor/github.com/grafana/sobek/token/token_const.go similarity index 100% rename from vendor/github.com/dop251/goja/token/token_const.go rename to vendor/github.com/grafana/sobek/token/token_const.go diff --git a/vendor/github.com/dop251/goja/token/tokenfmt b/vendor/github.com/grafana/sobek/token/tokenfmt similarity index 100% rename from vendor/github.com/dop251/goja/token/tokenfmt rename to vendor/github.com/grafana/sobek/token/tokenfmt diff --git a/vendor/github.com/dop251/goja/typedarrays.go b/vendor/github.com/grafana/sobek/typedarrays.go similarity index 99% rename from vendor/github.com/dop251/goja/typedarrays.go rename to vendor/github.com/grafana/sobek/typedarrays.go index 9af03503dbb4..cfe19bc66d3e 100644 --- a/vendor/github.com/dop251/goja/typedarrays.go +++ b/vendor/github.com/grafana/sobek/typedarrays.go @@ -1,4 +1,4 @@ -package goja +package sobek import ( "math" @@ -6,7 +6,7 @@ import ( "strconv" "unsafe" - "github.com/dop251/goja/unistring" + "github.com/grafana/sobek/unistring" ) type byteOrder bool diff --git a/vendor/github.com/dop251/goja/unistring/string.go b/vendor/github.com/grafana/sobek/unistring/string.go similarity index 100% rename from vendor/github.com/dop251/goja/unistring/string.go rename to vendor/github.com/grafana/sobek/unistring/string.go diff --git a/vendor/github.com/dop251/goja/value.go b/vendor/github.com/grafana/sobek/value.go similarity index 99% rename from vendor/github.com/dop251/goja/value.go rename to vendor/github.com/grafana/sobek/value.go index aeb96762c8fc..9faabefbf96f 100644 --- a/vendor/github.com/dop251/goja/value.go +++ b/vendor/github.com/grafana/sobek/value.go @@ -1,4 +1,4 @@ -package goja +package sobek import ( "fmt" @@ -8,8 +8,8 @@ import ( "strconv" "unsafe" - "github.com/dop251/goja/ftoa" - "github.com/dop251/goja/unistring" + "github.com/grafana/sobek/ftoa" + "github.com/grafana/sobek/unistring" ) var ( diff --git a/vendor/github.com/dop251/goja/vm.go b/vendor/github.com/grafana/sobek/vm.go similarity index 99% rename from vendor/github.com/dop251/goja/vm.go rename to vendor/github.com/grafana/sobek/vm.go index 30b79331628b..8fa60e4c8a39 100644 --- a/vendor/github.com/dop251/goja/vm.go +++ b/vendor/github.com/grafana/sobek/vm.go @@ -1,4 +1,4 @@ -package goja +package sobek import ( "fmt" @@ -9,7 +9,7 @@ import ( "sync/atomic" "time" - "github.com/dop251/goja/unistring" + "github.com/grafana/sobek/unistring" ) const ( diff --git a/vendor/modules.txt b/vendor/modules.txt index a468c7cea71b..5f25cf4b5ff3 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -105,16 +105,6 @@ github.com/dgryski/go-rendezvous ## explicit; go 1.13 github.com/dlclark/regexp2 github.com/dlclark/regexp2/syntax -# github.com/dop251/goja v0.0.0-20240516125602-ccbae20bcec2 -## explicit; go 1.20 -github.com/dop251/goja -github.com/dop251/goja/ast -github.com/dop251/goja/file -github.com/dop251/goja/ftoa -github.com/dop251/goja/ftoa/internal/fast -github.com/dop251/goja/parser -github.com/dop251/goja/token -github.com/dop251/goja/unistring # github.com/evanw/esbuild v0.21.2 ## explicit; go 1.13 github.com/evanw/esbuild/internal/api_helpers @@ -173,9 +163,16 @@ github.com/google/uuid # github.com/gorilla/websocket v1.5.1 ## explicit; go 1.20 github.com/gorilla/websocket -# github.com/grafana/sobek v0.0.0-20240607083612-4f0cd64f4e78 +# github.com/grafana/sobek v0.0.0-20240611084759-1a77bdaf1a4a ## explicit; go 1.20 github.com/grafana/sobek +github.com/grafana/sobek/ast +github.com/grafana/sobek/file +github.com/grafana/sobek/ftoa +github.com/grafana/sobek/ftoa/internal/fast +github.com/grafana/sobek/parser +github.com/grafana/sobek/token +github.com/grafana/sobek/unistring # github.com/grafana/xk6-browser v1.5.2-0.20240607140836-ffcc1f5169ad ## explicit; go 1.20 github.com/grafana/xk6-browser/browser