瀏覽代碼

更新otto

liuxiulin 4 月之前
父節點
當前提交
d78a52e6b2
共有 52 個文件被更改,包括 779 次插入563 次删除
  1. 4 2
      go.mod
  2. 2 2
      go.sum
  3. 27 19
      vendor/github.com/robertkrimen/otto/.golangci.yml
  4. 176 119
      vendor/github.com/robertkrimen/otto/README.md
  5. 1 1
      vendor/github.com/robertkrimen/otto/ast/comments.go
  6. 46 50
      vendor/github.com/robertkrimen/otto/ast/node.go
  7. 4 5
      vendor/github.com/robertkrimen/otto/builtin.go
  8. 13 13
      vendor/github.com/robertkrimen/otto/builtin_array.go
  9. 20 20
      vendor/github.com/robertkrimen/otto/builtin_date.go
  10. 1 1
      vendor/github.com/robertkrimen/otto/builtin_function.go
  11. 22 22
      vendor/github.com/robertkrimen/otto/builtin_json.go
  12. 1 1
      vendor/github.com/robertkrimen/otto/builtin_math.go
  13. 11 0
      vendor/github.com/robertkrimen/otto/builtin_object.go
  14. 18 6
      vendor/github.com/robertkrimen/otto/builtin_string.go
  15. 5 5
      vendor/github.com/robertkrimen/otto/cmpl_evaluate_statement.go
  16. 17 19
      vendor/github.com/robertkrimen/otto/cmpl_parse.go
  17. 2 2
      vendor/github.com/robertkrimen/otto/console.go
  18. 5 5
      vendor/github.com/robertkrimen/otto/error.go
  19. 3 3
      vendor/github.com/robertkrimen/otto/evaluate.go
  20. 4 4
      vendor/github.com/robertkrimen/otto/file/file.go
  21. 1 1
      vendor/github.com/robertkrimen/otto/global.go
  22. 114 0
      vendor/github.com/robertkrimen/otto/inline.go
  23. 7 10
      vendor/github.com/robertkrimen/otto/object.go
  24. 1 1
      vendor/github.com/robertkrimen/otto/object_class.go
  25. 12 13
      vendor/github.com/robertkrimen/otto/otto.go
  26. 4 4
      vendor/github.com/robertkrimen/otto/otto_.go
  27. 3 3
      vendor/github.com/robertkrimen/otto/parser/error.go
  28. 16 18
      vendor/github.com/robertkrimen/otto/parser/expression.go
  29. 66 19
      vendor/github.com/robertkrimen/otto/parser/lexer.go
  30. 21 30
      vendor/github.com/robertkrimen/otto/parser/parser.go
  31. 11 14
      vendor/github.com/robertkrimen/otto/parser/regexp.go
  32. 2 3
      vendor/github.com/robertkrimen/otto/parser/scope.go
  33. 3 3
      vendor/github.com/robertkrimen/otto/parser/statement.go
  34. 10 10
      vendor/github.com/robertkrimen/otto/property.go
  35. 1 1
      vendor/github.com/robertkrimen/otto/registry/registry.go
  36. 4 4
      vendor/github.com/robertkrimen/otto/result.go
  37. 10 11
      vendor/github.com/robertkrimen/otto/runtime.go
  38. 2 3
      vendor/github.com/robertkrimen/otto/scope.go
  39. 1 1
      vendor/github.com/robertkrimen/otto/script.go
  40. 8 8
      vendor/github.com/robertkrimen/otto/stash.go
  41. 4 4
      vendor/github.com/robertkrimen/otto/token/token.go
  42. 4 10
      vendor/github.com/robertkrimen/otto/type_arguments.go
  43. 11 11
      vendor/github.com/robertkrimen/otto/type_date.go
  44. 7 8
      vendor/github.com/robertkrimen/otto/type_function.go
  45. 3 3
      vendor/github.com/robertkrimen/otto/type_go_array.go
  46. 1 1
      vendor/github.com/robertkrimen/otto/type_go_map.go
  47. 4 4
      vendor/github.com/robertkrimen/otto/type_go_struct.go
  48. 6 6
      vendor/github.com/robertkrimen/otto/type_reference.go
  49. 3 3
      vendor/github.com/robertkrimen/otto/type_regexp.go
  50. 3 3
      vendor/github.com/robertkrimen/otto/type_string.go
  51. 52 52
      vendor/github.com/robertkrimen/otto/value.go
  52. 2 2
      vendor/modules.txt

+ 4 - 2
go.mod

@@ -1,6 +1,8 @@
 module sparrow
 module sparrow
 
 
-go 1.21.4
+go 1.22
+
+toolchain go1.22.11
 
 
 require (
 require (
 	github.com/dgrijalva/jwt-go v3.2.0+incompatible
 	github.com/dgrijalva/jwt-go v3.2.0+incompatible
@@ -17,7 +19,7 @@ require (
 	github.com/martini-contrib/render v0.0.0-20150707142108-ec18f8345a11
 	github.com/martini-contrib/render v0.0.0-20150707142108-ec18f8345a11
 	github.com/opentracing/opentracing-go v1.2.0
 	github.com/opentracing/opentracing-go v1.2.0
 	github.com/prometheus/client_golang v1.18.0
 	github.com/prometheus/client_golang v1.18.0
-	github.com/robertkrimen/otto v0.3.0
+	github.com/robertkrimen/otto v0.5.1
 	github.com/robfig/cron v1.2.0
 	github.com/robfig/cron v1.2.0
 	github.com/satori/go.uuid v1.2.0
 	github.com/satori/go.uuid v1.2.0
 	github.com/segmentio/kafka-go v0.4.47
 	github.com/segmentio/kafka-go v0.4.47

+ 2 - 2
go.sum

@@ -238,8 +238,8 @@ github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3c
 github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
 github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
 github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis=
 github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis=
 github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
 github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
-github.com/robertkrimen/otto v0.3.0 h1:5RI+8860NSxvXywDY9ddF5HcPw0puRsd8EgbXV0oqRE=
-github.com/robertkrimen/otto v0.3.0/go.mod h1:uW9yN1CYflmUQYvAMS0m+ZiNo3dMzRUDQJX0jWbzgxw=
+github.com/robertkrimen/otto v0.5.1 h1:avDI4ToRk8k1hppLdYFTuuzND41n37vPGJU7547dGf0=
+github.com/robertkrimen/otto v0.5.1/go.mod h1:bS433I4Q9p+E5pZLu7r17vP6FkE6/wLxBdmKjoqJXF8=
 github.com/robfig/cron v1.2.0 h1:ZjScXvvxeQ63Dbyxy76Fj3AT3Ut0aKsyd2/tl3DTMuQ=
 github.com/robfig/cron v1.2.0 h1:ZjScXvvxeQ63Dbyxy76Fj3AT3Ut0aKsyd2/tl3DTMuQ=
 github.com/robfig/cron v1.2.0/go.mod h1:JGuDeoQd7Z6yL4zQhZ3OPEVHB7fL6Ka6skscFHfmt2k=
 github.com/robfig/cron v1.2.0/go.mod h1:JGuDeoQd7Z6yL4zQhZ3OPEVHB7fL6Ka6skscFHfmt2k=
 github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
 github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=

+ 27 - 19
vendor/github.com/robertkrimen/otto/.golangci.yml

@@ -1,14 +1,12 @@
 run:
 run:
-  deadline: 6m
-  skip-dirs:
-    - terst
-  skip-files:
-    - dbg/dbg.go
-    - token/token_const.go
+  timeout: 6m
 
 
 linters-settings:
 linters-settings:
   govet:
   govet:
-    check-shadowing: false
+    settings:
+      shadow:
+        strict: true
+    enable-all: true
   goconst:
   goconst:
     min-len: 2
     min-len: 2
     min-occurrences: 4
     min-occurrences: 4
@@ -17,6 +15,9 @@ linters-settings:
     rules:
     rules:
     - name: var-naming
     - name: var-naming
       disabled: true
       disabled: true
+  gosec:
+    excludes:
+      - G115 # Too many false positives.
 
 
 linters:
 linters:
   enable-all: true
   enable-all: true
@@ -25,14 +26,13 @@ linters:
     - lll
     - lll
     - gochecknoglobals
     - gochecknoglobals
     - gochecknoinits
     - gochecknoinits
-    - scopelint
     - funlen
     - funlen
     - godox
     - godox
-    - exhaustivestruct
-    - goerr113
+    - err113
     - wsl
     - wsl
     - nlreturn
     - nlreturn
     - gomnd
     - gomnd
+    - mnd
     - paralleltest
     - paralleltest
     - wrapcheck
     - wrapcheck
     - testpackage
     - testpackage
@@ -46,20 +46,28 @@ linters:
     - maintidx
     - maintidx
     - ireturn
     - ireturn
     - exhaustruct
     - exhaustruct
-    - nosnakecase
     - dupword
     - dupword
-    - structcheck
-    - deadcode
-    - golint
-    - varcheck
-    - ifshort
-    - interfacer
-    - maligned
     # Just causes noise
     # Just causes noise
     - depguard
     - depguard
+    # Deprecated
+    - execinquery
+    # Not needed in go 1.22+
+    - exportloopref
 
 
 issues:
 issues:
   exclude-use-default: false
   exclude-use-default: false
   max-same-issues: 0
   max-same-issues: 0
   exclude:
   exclude:
-  - Deferring unsafe method "Close" on type "io\.ReadCloser"
+    - Deferring unsafe method "Close" on type "io\.ReadCloser"
+  exclude-dirs:
+    - terst
+  exclude-files:
+    - dbg/dbg.go
+    - token/token_const.go
+  exclude-rules:
+    # Field alignment in tests isn't a performance issue.
+    - text: fieldalignment
+      path: _test\.go
+    - text: Error return value of `fmt\.Fprint.*` is not checked
+      path: tools/tester/main.go
+

+ 176 - 119
vendor/github.com/robertkrimen/otto/README.md

@@ -1,12 +1,12 @@
 # otto
 # otto
---
-```go
-import "github.com/robertkrimen/otto"
-```
+
+[![GoDoc Reference](https://pkg.go.dev/badge/github.com/robertkrimen/otto.svg)](https://pkg.go.dev/github.com/robertkrimen/otto)
+
+## Basic Usage
 
 
 Package otto is a JavaScript parser and interpreter written natively in Go.
 Package otto is a JavaScript parser and interpreter written natively in Go.
 
 
-http://godoc.org/github.com/robertkrimen/otto
+To use import it with the following:
 
 
 ```go
 ```go
 import (
 import (
@@ -29,7 +29,7 @@ Get a value out of the VM
 ```go
 ```go
 if value, err := vm.Get("abc"); err == nil {
 if value, err := vm.Get("abc"); err == nil {
     if value_int, err := value.ToInteger(); err == nil {
     if value_int, err := value.ToInteger(); err == nil {
-	fmt.Printf("", value_int, err)
+        fmt.Printf("", value_int, err)
     }
     }
 }
 }
 ```
 ```
@@ -104,12 +104,12 @@ result, _ = vm.Run(`
 `)
 `)
 ```
 ```
 
 
-### Parser
+## Parser
 
 
 A separate parser is available in the parser package if you're just interested
 A separate parser is available in the parser package if you're just interested
 in building an AST.
 in building an AST.
 
 
-http://godoc.org/github.com/robertkrimen/otto/parser
+[![GoDoc Reference](https://pkg.go.dev/badge/github.com/robertkrimen/otto/parser.svg)](https://pkg.go.dev/github.com/robertkrimen/otto/parser)
 
 
 Parse and return an AST
 Parse and return an AST
 
 
@@ -133,18 +133,22 @@ src := `
 program, err := parser.ParseFile(nil, filename, src, 0)
 program, err := parser.ParseFile(nil, filename, src, 0)
 ```
 ```
 
 
-### otto
+## Setup
 
 
-You can run (Go) JavaScript from the commandline with:
-http://github.com/robertkrimen/otto/tree/master/otto
+You can run (Go) JavaScript from the command line with
+[otto](http://github.com/robertkrimen/otto/tree/master/otto).
 
 
-    $ go get -v github.com/robertkrimen/otto/otto
+```shell
+go install github.com/robertkrimen/otto/otto@latest
+```
 
 
 Run JavaScript by entering some source on stdin or by giving otto a filename:
 Run JavaScript by entering some source on stdin or by giving otto a filename:
 
 
-    $ otto example.js
+```shell
+otto example.js
+```
 
 
-### underscore
+## Underscore
 
 
 Optionally include the JavaScript utility-belt library, underscore, with this
 Optionally include the JavaScript utility-belt library, underscore, with this
 import:
 import:
@@ -158,41 +162,39 @@ import (
 // Now every otto runtime will come loaded with underscore
 // Now every otto runtime will come loaded with underscore
 ```
 ```
 
 
-For more information: http://github.com/robertkrimen/otto/tree/master/underscore
-
+For more information: [underscore](http://github.com/robertkrimen/otto/tree/master/underscore)
 
 
-### Caveat Emptor
+## Caveat Emptor
 
 
 The following are some limitations with otto:
 The following are some limitations with otto:
 
 
-    * "use strict" will parse, but does nothing.
-    * The regular expression engine (re2/regexp) is not fully compatible with the ECMA5 specification.
-    * Otto targets ES5. ES6 features (eg: Typed Arrays) are not supported.
-
+* `use strict` will parse, but does nothing.
+* The regular expression engine ([re2/regexp](https://pkg.go.dev/regexp)) is not fully compatible with the ECMA5 specification.
+* Otto targets ES5. Some ES6 features e.g. Typed Arrays are not supported, PR's to add functionality are always welcome.
 
 
 ### Regular Expression Incompatibility
 ### Regular Expression Incompatibility
 
 
 Go translates JavaScript-style regular expressions into something that is
 Go translates JavaScript-style regular expressions into something that is
 "regexp" compatible via `parser.TransformRegExp`. Unfortunately, RegExp requires
 "regexp" compatible via `parser.TransformRegExp`. Unfortunately, RegExp requires
-backtracking for some patterns, and backtracking is not supported by the
-standard Go engine: https://code.google.com/p/re2/wiki/Syntax
+backtracking for some patterns, and backtracking is not supported by Go
+[re2](https://github.com/google/re2/wiki/syntax).
 
 
 Therefore, the following syntax is incompatible:
 Therefore, the following syntax is incompatible:
 
 
-    (?=)  // Lookahead (positive), currently a parsing error
-    (?!)  // Lookahead (backhead), currently a parsing error
-    \1    // Backreference (\1, \2, \3, ...), currently a parsing error
+```plaintext
+(?=)  // Lookahead (positive), currently a parsing error
+(?!)  // Lookahead (backhead), currently a parsing error
+\1    // Backreference (\1, \2, \3, ...), currently a parsing error
+```
 
 
-A brief discussion of these limitations: "Regexp (?!re)"
-https://groups.google.com/forum/?fromgroups=#%21topic/golang-nuts/7qgSDWPIh_E
+A brief discussion of these limitations: [Regexp (?!re)](https://groups.google.com/forum/?fromgroups=#%21topic/golang-nuts/7qgSDWPIh_E)
 
 
-More information about re2: https://code.google.com/p/re2/
+More information [about re2](https://github.com/google/re2)
 
 
-In addition to the above, re2 (Go) has a different definition for \s: [\t\n\f\r
-]. The JavaScript definition, on the other hand, also includes \v, Unicode
+In addition to the above, re2 (Go) has a different definition for `\s`: `[\t\n\f\r
+]`. The JavaScript definition, on the other hand, also includes `\v`, Unicode
 "Separator, Space", etc.
 "Separator, Space", etc.
 
 
-
 ### Halting Problem
 ### Halting Problem
 
 
 If you want to stop long running executions (like third-party code), you can use
 If you want to stop long running executions (like third-party code), you can use
@@ -254,24 +256,20 @@ func runUnsafe(unsafe string) {
 }
 }
 ```
 ```
 
 
-Where is setTimeout/setInterval?
+Where is `setTimeout` / `setInterval`?
 
 
-These timing functions are not actually part of the ECMA-262 specification.
+These timing functions are not actually part of the [ECMA-262 specification](https://ecma-international.org/publications-and-standards/standards/ecma-262/).
 Typically, they belong to the `window` object (in the browser). It would not be
 Typically, they belong to the `window` object (in the browser). It would not be
 difficult to provide something like these via Go, but you probably want to wrap
 difficult to provide something like these via Go, but you probably want to wrap
 otto in an event loop in that case.
 otto in an event loop in that case.
 
 
-For an example of how this could be done in Go with otto, see natto:
-
-http://github.com/robertkrimen/natto
+For an example of how this could be done in Go with otto, see [natto](http://github.com/robertkrimen/natto).
 
 
 Here is some more discussion of the issue:
 Here is some more discussion of the issue:
 
 
-* http://book.mixu.net/node/ch2.html
-
-* http://en.wikipedia.org/wiki/Reentrancy_%28computing%29
-
-* http://aaroncrane.co.uk/2009/02/perl_safe_signals/
+* [What is Node.js?](http://book.mixu.net/node/ch2.html)
+* [Reentrancy (computing)](http://en.wikipedia.org/wiki/Reentrancy_%28computing%29)
+* [Perl Safe Signals](https://metacpan.org/pod/Perl::Unsafe::Signals)
 
 
 ## Usage
 ## Usage
 
 
@@ -279,93 +277,103 @@ Here is some more discussion of the issue:
 var ErrVersion = errors.New("version mismatch")
 var ErrVersion = errors.New("version mismatch")
 ```
 ```
 
 
-#### type Error
+### type Error
 
 
 ```go
 ```go
-type Error struct {
-}
+type Error struct {}
 ```
 ```
 
 
-An Error represents a runtime error, e.g. a TypeError, a ReferenceError, etc.
+An Error represents a runtime error, e.g. a `TypeError`, a `ReferenceError`, etc.
 
 
-#### func (Error) Error
+### func (Error) Error
 
 
 ```go
 ```go
 func (err Error) Error() string
 func (err Error) Error() string
 ```
 ```
+
 Error returns a description of the error
 Error returns a description of the error
 
 
+```plaintext
     TypeError: 'def' is not a function
     TypeError: 'def' is not a function
+```
 
 
-#### func (Error) String
+### func (Error) String
 
 
 ```go
 ```go
 func (err Error) String() string
 func (err Error) String() string
 ```
 ```
+
 String returns a description of the error and a trace of where the error
 String returns a description of the error and a trace of where the error
 occurred.
 occurred.
 
 
+```plaintext
     TypeError: 'def' is not a function
     TypeError: 'def' is not a function
         at xyz (<anonymous>:3:9)
         at xyz (<anonymous>:3:9)
         at <anonymous>:7:1/
         at <anonymous>:7:1/
+```
 
 
-#### type FunctionCall
+### type FunctionCall
 
 
 ```go
 ```go
 type FunctionCall struct {
 type FunctionCall struct {
-	This         Value
-	ArgumentList []Value
-	Otto         *Otto
+    This         Value
+    ArgumentList []Value
+    Otto         *Otto
 }
 }
 ```
 ```
 
 
 FunctionCall is an encapsulation of a JavaScript function call.
 FunctionCall is an encapsulation of a JavaScript function call.
 
 
-#### func (FunctionCall) Argument
+### func (FunctionCall) Argument
 
 
 ```go
 ```go
 func (self FunctionCall) Argument(index int) Value
 func (self FunctionCall) Argument(index int) Value
 ```
 ```
+
 Argument will return the value of the argument at the given index.
 Argument will return the value of the argument at the given index.
 
 
 If no such argument exists, undefined is returned.
 If no such argument exists, undefined is returned.
 
 
-#### type Object
+### type Object
 
 
 ```go
 ```go
-type Object struct {
-}
+type Object struct {}
 ```
 ```
 
 
 Object is the representation of a JavaScript object.
 Object is the representation of a JavaScript object.
 
 
-#### func (Object) Call
+### func (Object) Call
 
 
 ```go
 ```go
 func (self Object) Call(name string, argumentList ...interface{}) (Value, error)
 func (self Object) Call(name string, argumentList ...interface{}) (Value, error)
 ```
 ```
+
 Call a method on the object.
 Call a method on the object.
 
 
 It is essentially equivalent to:
 It is essentially equivalent to:
 
 
-    var method, _ := object.Get(name)
-    method.Call(object, argumentList...)
+```go
+var method, _ := object.Get(name)
+method.Call(object, argumentList...)
+```
 
 
 An undefined value and an error will result if:
 An undefined value and an error will result if:
 
 
-    1. There is an error during conversion of the argument list
-    2. The property is not actually a function
-    3. An (uncaught) exception is thrown
+1. There is an error during conversion of the argument list
+2. The property is not actually a function
+3. An (uncaught) exception is thrown
 
 
-#### func (Object) Class
+### func (Object) Class
 
 
 ```go
 ```go
 func (self Object) Class() string
 func (self Object) Class() string
 ```
 ```
+
 Class will return the class string of the object.
 Class will return the class string of the object.
 
 
 The return value will (generally) be one of:
 The return value will (generally) be one of:
 
 
+```plaintext
     Object
     Object
     Function
     Function
     Array
     Array
@@ -374,65 +382,72 @@ The return value will (generally) be one of:
     Boolean
     Boolean
     Date
     Date
     RegExp
     RegExp
+```
 
 
-#### func (Object) Get
+### func (Object) Get
 
 
 ```go
 ```go
 func (self Object) Get(name string) (Value, error)
 func (self Object) Get(name string) (Value, error)
 ```
 ```
+
 Get the value of the property with the given name.
 Get the value of the property with the given name.
 
 
-#### func (Object) Keys
+### func (Object) Keys
 
 
 ```go
 ```go
 func (self Object) Keys() []string
 func (self Object) Keys() []string
 ```
 ```
+
 Get the keys for the object
 Get the keys for the object
 
 
 Equivalent to calling Object.keys on the object
 Equivalent to calling Object.keys on the object
 
 
-#### func (Object) Set
+### func (Object) Set
 
 
 ```go
 ```go
 func (self Object) Set(name string, value interface{}) error
 func (self Object) Set(name string, value interface{}) error
 ```
 ```
+
 Set the property of the given name to the given value.
 Set the property of the given name to the given value.
 
 
 An error will result if the setting the property triggers an exception (i.e.
 An error will result if the setting the property triggers an exception (i.e.
 read-only), or there is an error during conversion of the given value.
 read-only), or there is an error during conversion of the given value.
 
 
-#### func (Object) Value
+### func (Object) Value
 
 
 ```go
 ```go
 func (self Object) Value() Value
 func (self Object) Value() Value
 ```
 ```
+
 Value will return self as a value.
 Value will return self as a value.
 
 
-#### type Otto
+### type Otto
 
 
 ```go
 ```go
 type Otto struct {
 type Otto struct {
-	// Interrupt is a channel for interrupting the runtime. You can use this to halt a long running execution, for example.
-	// See "Halting Problem" for more information.
-	Interrupt chan func()
+    // Interrupt is a channel for interrupting the runtime. You can use this to halt a long running execution, for example.
+    // See "Halting Problem" for more information.
+    Interrupt chan func()
 }
 }
 ```
 ```
 
 
 Otto is the representation of the JavaScript runtime. Each instance of Otto has
 Otto is the representation of the JavaScript runtime. Each instance of Otto has
 a self-contained namespace.
 a self-contained namespace.
 
 
-#### func  New
+### func New
 
 
 ```go
 ```go
 func New() *Otto
 func New() *Otto
 ```
 ```
+
 New will allocate a new JavaScript runtime
 New will allocate a new JavaScript runtime
 
 
-#### func  Run
+### func Run
 
 
 ```go
 ```go
 func Run(src interface{}) (*Otto, Value, error)
 func Run(src interface{}) (*Otto, Value, error)
 ```
 ```
+
 Run will allocate a new JavaScript runtime, run the given source on the
 Run will allocate a new JavaScript runtime, run the given source on the
 allocated runtime, and return the runtime, resulting value, and error (if any).
 allocated runtime, and return the runtime, resulting value, and error (if any).
 
 
@@ -444,11 +459,12 @@ src may also be a Script.
 src may also be a Program, but if the AST has been modified, then runtime
 src may also be a Program, but if the AST has been modified, then runtime
 behavior is undefined.
 behavior is undefined.
 
 
-#### func (Otto) Call
+### func (Otto) Call
 
 
 ```go
 ```go
 func (self Otto) Call(source string, this interface{}, argumentList ...interface{}) (Value, error)
 func (self Otto) Call(source string, this interface{}, argumentList ...interface{}) (Value, error)
 ```
 ```
+
 Call the given JavaScript with a given this and arguments.
 Call the given JavaScript with a given this and arguments.
 
 
 If this is nil, then some special handling takes place to determine the proper
 If this is nil, then some special handling takes place to determine the proper
@@ -471,11 +487,12 @@ value, _ := vm.Call("new Object", nil, "Hello, World.")
 value, _ := vm.Call(`[ 1, 2, 3, undefined, 4 ].concat`, nil, 5, 6, 7, "abc")
 value, _ := vm.Call(`[ 1, 2, 3, undefined, 4 ].concat`, nil, 5, 6, 7, "abc")
 ```
 ```
 
 
-#### func (*Otto) Compile
+### func (*Otto) Compile
 
 
 ```go
 ```go
 func (self *Otto) Compile(filename string, src interface{}) (*Script, error)
 func (self *Otto) Compile(filename string, src interface{}) (*Script, error)
 ```
 ```
+
 Compile will parse the given source and return a Script value or nil and an
 Compile will parse the given source and return a Script value or nil and an
 error if there was a problem during compilation.
 error if there was a problem during compilation.
 
 
@@ -484,11 +501,12 @@ script, err := vm.Compile("", `var abc; if (!abc) abc = 0; abc += 2; abc;`)
 vm.Run(script)
 vm.Run(script)
 ```
 ```
 
 
-#### func (*Otto) Copy
+### func (*Otto) Copy
 
 
 ```go
 ```go
 func (in *Otto) Copy() *Otto
 func (in *Otto) Copy() *Otto
 ```
 ```
+
 Copy will create a copy/clone of the runtime.
 Copy will create a copy/clone of the runtime.
 
 
 Copy is useful for saving some time when creating many similar runtimes.
 Copy is useful for saving some time when creating many similar runtimes.
@@ -498,21 +516,23 @@ scope, stash, etc. into a new runtime.
 
 
 Be on the lookout for memory leaks or inadvertent sharing of resources.
 Be on the lookout for memory leaks or inadvertent sharing of resources.
 
 
-#### func (Otto) Get
+### func (Otto) Get
 
 
 ```go
 ```go
 func (self Otto) Get(name string) (Value, error)
 func (self Otto) Get(name string) (Value, error)
 ```
 ```
+
 Get the value of the top-level binding of the given name.
 Get the value of the top-level binding of the given name.
 
 
 If there is an error (like the binding does not exist), then the value will be
 If there is an error (like the binding does not exist), then the value will be
 undefined.
 undefined.
 
 
-#### func (Otto) Object
+### func (Otto) Object
 
 
 ```go
 ```go
 func (self Otto) Object(source string) (*Object, error)
 func (self Otto) Object(source string) (*Object, error)
 ```
 ```
+
 Object will run the given source and return the result as an object.
 Object will run the given source and return the result as an object.
 
 
 For example, accessing an existing object:
 For example, accessing an existing object:
@@ -537,11 +557,12 @@ object.Set("volume", 11)
 If there is an error (like the source does not result in an object), then nil
 If there is an error (like the source does not result in an object), then nil
 and an error is returned.
 and an error is returned.
 
 
-#### func (Otto) Run
+### func (Otto) Run
 
 
 ```go
 ```go
 func (self Otto) Run(src interface{}) (Value, error)
 func (self Otto) Run(src interface{}) (Value, error)
 ```
 ```
+
 Run will run the given source (parsing it first if necessary), returning the
 Run will run the given source (parsing it first if necessary), returning the
 resulting value and error (if any)
 resulting value and error (if any)
 
 
@@ -556,11 +577,12 @@ src may also be a Script.
 src may also be a Program, but if the AST has been modified, then runtime
 src may also be a Program, but if the AST has been modified, then runtime
 behavior is undefined.
 behavior is undefined.
 
 
-#### func (Otto) Set
+### func (Otto) Set
 
 
 ```go
 ```go
 func (self Otto) Set(name string, value interface{}) error
 func (self Otto) Set(name string, value interface{}) error
 ```
 ```
+
 Set the top-level binding of the given name to the given value.
 Set the top-level binding of the given name to the given value.
 
 
 Set will automatically apply ToValue to the given value in order to convert it
 Set will automatically apply ToValue to the given value in order to convert it
@@ -571,44 +593,44 @@ fails), then an error is returned.
 
 
 If the top-level binding does not exist, it will be created.
 If the top-level binding does not exist, it will be created.
 
 
-#### func (Otto) ToValue
+### func (Otto) ToValue
 
 
 ```go
 ```go
 func (self Otto) ToValue(value interface{}) (Value, error)
 func (self Otto) ToValue(value interface{}) (Value, error)
 ```
 ```
+
 ToValue will convert an interface{} value to a value digestible by
 ToValue will convert an interface{} value to a value digestible by
 otto/JavaScript.
 otto/JavaScript.
 
 
-#### type Script
+### type Script
 
 
 ```go
 ```go
-type Script struct {
-}
+type Script struct {}
 ```
 ```
 
 
 Script is a handle for some (reusable) JavaScript. Passing a Script value to a
 Script is a handle for some (reusable) JavaScript. Passing a Script value to a
 run method will evaluate the JavaScript.
 run method will evaluate the JavaScript.
 
 
-#### func (*Script) String
+### func (*Script) String
 
 
 ```go
 ```go
 func (self *Script) String() string
 func (self *Script) String() string
 ```
 ```
 
 
-#### type Value
+### type Value
 
 
 ```go
 ```go
-type Value struct {
-}
+type Value struct {}
 ```
 ```
 
 
 Value is the representation of a JavaScript value.
 Value is the representation of a JavaScript value.
 
 
-#### func  FalseValue
+### func FalseValue
 
 
 ```go
 ```go
 func FalseValue() Value
 func FalseValue() Value
 ```
 ```
+
 FalseValue will return a value representing false.
 FalseValue will return a value representing false.
 
 
 It is equivalent to:
 It is equivalent to:
@@ -617,11 +639,12 @@ It is equivalent to:
 ToValue(false)
 ToValue(false)
 ```
 ```
 
 
-#### func  NaNValue
+### func  NaNValue
 
 
 ```go
 ```go
 func NaNValue() Value
 func NaNValue() Value
 ```
 ```
+
 NaNValue will return a value representing NaN.
 NaNValue will return a value representing NaN.
 
 
 It is equivalent to:
 It is equivalent to:
@@ -630,29 +653,32 @@ It is equivalent to:
 ToValue(math.NaN())
 ToValue(math.NaN())
 ```
 ```
 
 
-#### func  NullValue
+### func  NullValue
 
 
 ```go
 ```go
 func NullValue() Value
 func NullValue() Value
 ```
 ```
+
 NullValue will return a Value representing null.
 NullValue will return a Value representing null.
 
 
-#### func  ToValue
+### func  ToValue
 
 
 ```go
 ```go
 func ToValue(value interface{}) (Value, error)
 func ToValue(value interface{}) (Value, error)
 ```
 ```
+
 ToValue will convert an interface{} value to a value digestible by
 ToValue will convert an interface{} value to a value digestible by
 otto/JavaScript
 otto/JavaScript
 
 
 This function will not work for advanced types (struct, map, slice/array, etc.)
 This function will not work for advanced types (struct, map, slice/array, etc.)
 and you should use Otto.ToValue instead.
 and you should use Otto.ToValue instead.
 
 
-#### func  TrueValue
+### func  TrueValue
 
 
 ```go
 ```go
 func TrueValue() Value
 func TrueValue() Value
 ```
 ```
+
 TrueValue will return a value representing true.
 TrueValue will return a value representing true.
 
 
 It is equivalent to:
 It is equivalent to:
@@ -661,39 +687,45 @@ It is equivalent to:
 ToValue(true)
 ToValue(true)
 ```
 ```
 
 
-#### func  UndefinedValue
+### func UndefinedValue
 
 
 ```go
 ```go
 func UndefinedValue() Value
 func UndefinedValue() Value
 ```
 ```
+
 UndefinedValue will return a Value representing undefined.
 UndefinedValue will return a Value representing undefined.
 
 
-#### func (Value) Call
+### func (Value) Call
 
 
 ```go
 ```go
 func (value Value) Call(this Value, argumentList ...interface{}) (Value, error)
 func (value Value) Call(this Value, argumentList ...interface{}) (Value, error)
 ```
 ```
+
 Call the value as a function with the given this value and argument list and
 Call the value as a function with the given this value and argument list and
 return the result of invocation. It is essentially equivalent to:
 return the result of invocation. It is essentially equivalent to:
 
 
+```js
     value.apply(thisValue, argumentList)
     value.apply(thisValue, argumentList)
+```
 
 
 An undefined value and an error will result if:
 An undefined value and an error will result if:
 
 
-    1. There is an error during conversion of the argument list
-    2. The value is not actually a function
-    3. An (uncaught) exception is thrown
+1. There is an error during conversion of the argument list
+2. The value is not actually a function
+3. An (uncaught) exception is thrown
 
 
-#### func (Value) Class
+### func (Value) Class
 
 
 ```go
 ```go
 func (value Value) Class() string
 func (value Value) Class() string
 ```
 ```
+
 Class will return the class string of the value or the empty string if value is
 Class will return the class string of the value or the empty string if value is
 not an object.
 not an object.
 
 
 The return value will (generally) be one of:
 The return value will (generally) be one of:
 
 
+```plaintext
     Object
     Object
     Function
     Function
     Array
     Array
@@ -702,12 +734,14 @@ The return value will (generally) be one of:
     Boolean
     Boolean
     Date
     Date
     RegExp
     RegExp
+```
 
 
-#### func (Value) Export
+### func (Value) Export
 
 
 ```go
 ```go
 func (self Value) Export() (interface{}, error)
 func (self Value) Export() (interface{}, error)
 ```
 ```
+
 Export will attempt to convert the value to a Go representation and return it
 Export will attempt to convert the value to a Go representation and return it
 via an interface{} kind.
 via an interface{} kind.
 
 
@@ -716,6 +750,7 @@ compatibility.
 
 
 If a reasonable conversion is not possible, then the original value is returned.
 If a reasonable conversion is not possible, then the original value is returned.
 
 
+```plaintext
     undefined   -> nil (FIXME?: Should be Value{})
     undefined   -> nil (FIXME?: Should be Value{})
     null        -> nil
     null        -> nil
     boolean     -> bool
     boolean     -> bool
@@ -723,155 +758,177 @@ If a reasonable conversion is not possible, then the original value is returned.
     string      -> string
     string      -> string
     Array       -> []interface{}
     Array       -> []interface{}
     Object      -> map[string]interface{}
     Object      -> map[string]interface{}
+```
 
 
-#### func (Value) IsBoolean
+### func (Value) IsBoolean
 
 
 ```go
 ```go
 func (value Value) IsBoolean() bool
 func (value Value) IsBoolean() bool
 ```
 ```
+
 IsBoolean will return true if value is a boolean (primitive).
 IsBoolean will return true if value is a boolean (primitive).
 
 
-#### func (Value) IsDefined
+### func (Value) IsDefined
 
 
 ```go
 ```go
 func (value Value) IsDefined() bool
 func (value Value) IsDefined() bool
 ```
 ```
+
 IsDefined will return false if the value is undefined, and true otherwise.
 IsDefined will return false if the value is undefined, and true otherwise.
 
 
-#### func (Value) IsFunction
+### func (Value) IsFunction
 
 
 ```go
 ```go
 func (value Value) IsFunction() bool
 func (value Value) IsFunction() bool
 ```
 ```
+
 IsFunction will return true if value is a function.
 IsFunction will return true if value is a function.
 
 
-#### func (Value) IsNaN
+### func (Value) IsNaN
 
 
 ```go
 ```go
 func (value Value) IsNaN() bool
 func (value Value) IsNaN() bool
 ```
 ```
+
 IsNaN will return true if value is NaN (or would convert to NaN).
 IsNaN will return true if value is NaN (or would convert to NaN).
 
 
-#### func (Value) IsNull
+### func (Value) IsNull
 
 
 ```go
 ```go
 func (value Value) IsNull() bool
 func (value Value) IsNull() bool
 ```
 ```
+
 IsNull will return true if the value is null, and false otherwise.
 IsNull will return true if the value is null, and false otherwise.
 
 
-#### func (Value) IsNumber
+### func (Value) IsNumber
 
 
 ```go
 ```go
 func (value Value) IsNumber() bool
 func (value Value) IsNumber() bool
 ```
 ```
+
 IsNumber will return true if value is a number (primitive).
 IsNumber will return true if value is a number (primitive).
 
 
-#### func (Value) IsObject
+### func (Value) IsObject
 
 
 ```go
 ```go
 func (value Value) IsObject() bool
 func (value Value) IsObject() bool
 ```
 ```
+
 IsObject will return true if value is an object.
 IsObject will return true if value is an object.
 
 
-#### func (Value) IsPrimitive
+### func (Value) IsPrimitive
 
 
 ```go
 ```go
 func (value Value) IsPrimitive() bool
 func (value Value) IsPrimitive() bool
 ```
 ```
+
 IsPrimitive will return true if value is a primitive (any kind of primitive).
 IsPrimitive will return true if value is a primitive (any kind of primitive).
 
 
-#### func (Value) IsString
+### func (Value) IsString
 
 
 ```go
 ```go
 func (value Value) IsString() bool
 func (value Value) IsString() bool
 ```
 ```
+
 IsString will return true if value is a string (primitive).
 IsString will return true if value is a string (primitive).
 
 
-#### func (Value) IsUndefined
+### func (Value) IsUndefined
 
 
 ```go
 ```go
 func (value Value) IsUndefined() bool
 func (value Value) IsUndefined() bool
 ```
 ```
+
 IsUndefined will return true if the value is undefined, and false otherwise.
 IsUndefined will return true if the value is undefined, and false otherwise.
 
 
-#### func (Value) Object
+### func (Value) Object
 
 
 ```go
 ```go
 func (value Value) Object() *Object
 func (value Value) Object() *Object
 ```
 ```
+
 Object will return the object of the value, or nil if value is not an object.
 Object will return the object of the value, or nil if value is not an object.
 
 
 This method will not do any implicit conversion. For example, calling this
 This method will not do any implicit conversion. For example, calling this
 method on a string primitive value will not return a String object.
 method on a string primitive value will not return a String object.
 
 
-#### func (Value) String
+### func (Value) String
 
 
 ```go
 ```go
 func (value Value) String() string
 func (value Value) String() string
 ```
 ```
+
 String will return the value as a string.
 String will return the value as a string.
 
 
 This method will make return the empty string if there is an error.
 This method will make return the empty string if there is an error.
 
 
-#### func (Value) ToBoolean
+### func (Value) ToBoolean
 
 
 ```go
 ```go
 func (value Value) ToBoolean() (bool, error)
 func (value Value) ToBoolean() (bool, error)
 ```
 ```
+
 ToBoolean will convert the value to a boolean (bool).
 ToBoolean will convert the value to a boolean (bool).
 
 
+```plaintext
     ToValue(0).ToBoolean() => false
     ToValue(0).ToBoolean() => false
     ToValue("").ToBoolean() => false
     ToValue("").ToBoolean() => false
     ToValue(true).ToBoolean() => true
     ToValue(true).ToBoolean() => true
     ToValue(1).ToBoolean() => true
     ToValue(1).ToBoolean() => true
     ToValue("Nothing happens").ToBoolean() => true
     ToValue("Nothing happens").ToBoolean() => true
+```
 
 
 If there is an error during the conversion process (like an uncaught exception),
 If there is an error during the conversion process (like an uncaught exception),
 then the result will be false and an error.
 then the result will be false and an error.
 
 
-#### func (Value) ToFloat
+### func (Value) ToFloat
 
 
 ```go
 ```go
 func (value Value) ToFloat() (float64, error)
 func (value Value) ToFloat() (float64, error)
 ```
 ```
+
 ToFloat will convert the value to a number (float64).
 ToFloat will convert the value to a number (float64).
 
 
+```plaintext
     ToValue(0).ToFloat() => 0.
     ToValue(0).ToFloat() => 0.
     ToValue(1.1).ToFloat() => 1.1
     ToValue(1.1).ToFloat() => 1.1
     ToValue("11").ToFloat() => 11.
     ToValue("11").ToFloat() => 11.
+```
 
 
 If there is an error during the conversion process (like an uncaught exception),
 If there is an error during the conversion process (like an uncaught exception),
 then the result will be 0 and an error.
 then the result will be 0 and an error.
 
 
-#### func (Value) ToInteger
+### func (Value) ToInteger
 
 
 ```go
 ```go
 func (value Value) ToInteger() (int64, error)
 func (value Value) ToInteger() (int64, error)
 ```
 ```
+
 ToInteger will convert the value to a number (int64).
 ToInteger will convert the value to a number (int64).
 
 
+```plaintext
     ToValue(0).ToInteger() => 0
     ToValue(0).ToInteger() => 0
     ToValue(1.1).ToInteger() => 1
     ToValue(1.1).ToInteger() => 1
     ToValue("11").ToInteger() => 11
     ToValue("11").ToInteger() => 11
+```
 
 
 If there is an error during the conversion process (like an uncaught exception),
 If there is an error during the conversion process (like an uncaught exception),
 then the result will be 0 and an error.
 then the result will be 0 and an error.
 
 
-#### func (Value) ToString
+### func (Value) ToString
 
 
 ```go
 ```go
 func (value Value) ToString() (string, error)
 func (value Value) ToString() (string, error)
 ```
 ```
+
 ToString will convert the value to a string (string).
 ToString will convert the value to a string (string).
 
 
+```plaintext
     ToValue(0).ToString() => "0"
     ToValue(0).ToString() => "0"
     ToValue(false).ToString() => "false"
     ToValue(false).ToString() => "false"
     ToValue(1.1).ToString() => "1.1"
     ToValue(1.1).ToString() => "1.1"
     ToValue("11").ToString() => "11"
     ToValue("11").ToString() => "11"
     ToValue('Nothing happens.').ToString() => "Nothing happens."
     ToValue('Nothing happens.').ToString() => "Nothing happens."
+```
 
 
 If there is an error during the conversion process (like an uncaught exception),
 If there is an error during the conversion process (like an uncaught exception),
 then the result will be the empty string ("") and an error.
 then the result will be the empty string ("") and an error.
-
---
-**godocdown** http://github.com/robertkrimen/godocdown

+ 1 - 1
vendor/github.com/robertkrimen/otto/ast/comments.go

@@ -38,8 +38,8 @@ const (
 
 
 // Comment contains the data of the comment.
 // Comment contains the data of the comment.
 type Comment struct {
 type Comment struct {
-	Begin    file.Idx
 	Text     string
 	Text     string
+	Begin    file.Idx
 	Position CommentPosition
 	Position CommentPosition
 }
 }
 
 

+ 46 - 50
vendor/github.com/robertkrimen/otto/ast/node.go

@@ -24,9 +24,9 @@ type Expression interface {
 
 
 // ArrayLiteral represents an array literal.
 // ArrayLiteral represents an array literal.
 type ArrayLiteral struct {
 type ArrayLiteral struct {
+	Value        []Expression
 	LeftBracket  file.Idx
 	LeftBracket  file.Idx
 	RightBracket file.Idx
 	RightBracket file.Idx
-	Value        []Expression
 }
 }
 
 
 // Idx0 implements Node.
 // Idx0 implements Node.
@@ -44,9 +44,9 @@ func (*ArrayLiteral) expression() {}
 
 
 // AssignExpression represents an assignment expression.
 // AssignExpression represents an assignment expression.
 type AssignExpression struct {
 type AssignExpression struct {
-	Operator token.Token
 	Left     Expression
 	Left     Expression
 	Right    Expression
 	Right    Expression
+	Operator token.Token
 }
 }
 
 
 // Idx0 implements Node.
 // Idx0 implements Node.
@@ -83,9 +83,9 @@ func (*BadExpression) expression() {}
 
 
 // BinaryExpression represents a binary expression.
 // BinaryExpression represents a binary expression.
 type BinaryExpression struct {
 type BinaryExpression struct {
-	Operator   token.Token
 	Left       Expression
 	Left       Expression
 	Right      Expression
 	Right      Expression
+	Operator   token.Token
 	Comparison bool
 	Comparison bool
 }
 }
 
 
@@ -104,8 +104,8 @@ func (*BinaryExpression) expression() {}
 
 
 // BooleanLiteral represents a boolean expression.
 // BooleanLiteral represents a boolean expression.
 type BooleanLiteral struct {
 type BooleanLiteral struct {
-	Idx     file.Idx
 	Literal string
 	Literal string
+	Idx     file.Idx
 	Value   bool
 	Value   bool
 }
 }
 
 
@@ -146,8 +146,8 @@ func (*BracketExpression) expression() {}
 // CallExpression represents a call expression.
 // CallExpression represents a call expression.
 type CallExpression struct {
 type CallExpression struct {
 	Callee           Expression
 	Callee           Expression
-	LeftParenthesis  file.Idx
 	ArgumentList     []Expression
 	ArgumentList     []Expression
+	LeftParenthesis  file.Idx
 	RightParenthesis file.Idx
 	RightParenthesis file.Idx
 }
 }
 
 
@@ -224,13 +224,12 @@ func (*EmptyExpression) expression() {}
 
 
 // FunctionLiteral represents a function literal.
 // FunctionLiteral represents a function literal.
 type FunctionLiteral struct {
 type FunctionLiteral struct {
-	Function      file.Idx
-	Name          *Identifier
-	ParameterList *ParameterList
-	Body          Statement
-	Source        string
-
+	Body            Statement
+	Name            *Identifier
+	ParameterList   *ParameterList
+	Source          string
 	DeclarationList []Declaration
 	DeclarationList []Declaration
+	Function        file.Idx
 }
 }
 
 
 // Idx0 implements Node.
 // Idx0 implements Node.
@@ -267,10 +266,10 @@ func (*Identifier) expression() {}
 
 
 // NewExpression represents a new expression.
 // NewExpression represents a new expression.
 type NewExpression struct {
 type NewExpression struct {
-	New              file.Idx
 	Callee           Expression
 	Callee           Expression
-	LeftParenthesis  file.Idx
 	ArgumentList     []Expression
 	ArgumentList     []Expression
+	New              file.Idx
+	LeftParenthesis  file.Idx
 	RightParenthesis file.Idx
 	RightParenthesis file.Idx
 }
 }
 
 
@@ -292,8 +291,8 @@ func (*NewExpression) expression() {}
 
 
 // NullLiteral represents a null literal.
 // NullLiteral represents a null literal.
 type NullLiteral struct {
 type NullLiteral struct {
-	Idx     file.Idx
 	Literal string
 	Literal string
+	Idx     file.Idx
 }
 }
 
 
 // Idx0 implements Node.
 // Idx0 implements Node.
@@ -311,9 +310,9 @@ func (*NullLiteral) expression() {}
 
 
 // NumberLiteral represents a number literal.
 // NumberLiteral represents a number literal.
 type NumberLiteral struct {
 type NumberLiteral struct {
-	Idx     file.Idx
-	Literal string
 	Value   interface{}
 	Value   interface{}
+	Literal string
+	Idx     file.Idx
 }
 }
 
 
 // Idx0 implements Node.
 // Idx0 implements Node.
@@ -331,9 +330,9 @@ func (*NumberLiteral) expression() {}
 
 
 // ObjectLiteral represents an object literal.
 // ObjectLiteral represents an object literal.
 type ObjectLiteral struct {
 type ObjectLiteral struct {
+	Value      []Property
 	LeftBrace  file.Idx
 	LeftBrace  file.Idx
 	RightBrace file.Idx
 	RightBrace file.Idx
-	Value      []Property
 }
 }
 
 
 // Idx0 implements Node.
 // Idx0 implements Node.
@@ -351,25 +350,25 @@ func (*ObjectLiteral) expression() {}
 
 
 // ParameterList represents a parameter list.
 // ParameterList represents a parameter list.
 type ParameterList struct {
 type ParameterList struct {
-	Opening file.Idx
 	List    []*Identifier
 	List    []*Identifier
+	Opening file.Idx
 	Closing file.Idx
 	Closing file.Idx
 }
 }
 
 
 // Property represents a property.
 // Property represents a property.
 type Property struct {
 type Property struct {
+	Value Expression
 	Key   string
 	Key   string
 	Kind  string
 	Kind  string
-	Value Expression
 }
 }
 
 
 // RegExpLiteral represents a regular expression literal.
 // RegExpLiteral represents a regular expression literal.
 type RegExpLiteral struct {
 type RegExpLiteral struct {
-	Idx     file.Idx
 	Literal string
 	Literal string
 	Pattern string
 	Pattern string
 	Flags   string
 	Flags   string
 	Value   string
 	Value   string
+	Idx     file.Idx
 }
 }
 
 
 // Idx0 implements Node.
 // Idx0 implements Node.
@@ -405,9 +404,9 @@ func (*SequenceExpression) expression() {}
 
 
 // StringLiteral represents a string literal.
 // StringLiteral represents a string literal.
 type StringLiteral struct {
 type StringLiteral struct {
-	Idx     file.Idx
 	Literal string
 	Literal string
 	Value   string
 	Value   string
+	Idx     file.Idx
 }
 }
 
 
 // Idx0 implements Node.
 // Idx0 implements Node.
@@ -443,9 +442,9 @@ func (*ThisExpression) expression() {}
 
 
 // UnaryExpression represents a unary expression.
 // UnaryExpression represents a unary expression.
 type UnaryExpression struct {
 type UnaryExpression struct {
-	Operator token.Token
-	Idx      file.Idx // If a prefix operation
 	Operand  Expression
 	Operand  Expression
+	Operator token.Token
+	Idx      file.Idx
 	Postfix  bool
 	Postfix  bool
 }
 }
 
 
@@ -470,9 +469,9 @@ func (*UnaryExpression) expression() {}
 
 
 // VariableExpression represents a variable expression.
 // VariableExpression represents a variable expression.
 type VariableExpression struct {
 type VariableExpression struct {
+	Initializer Expression
 	Name        string
 	Name        string
 	Idx         file.Idx
 	Idx         file.Idx
-	Initializer Expression
 }
 }
 
 
 // Idx0 implements Node.
 // Idx0 implements Node.
@@ -518,8 +517,8 @@ func (*BadStatement) statement() {}
 
 
 // BlockStatement represents a block statement.
 // BlockStatement represents a block statement.
 type BlockStatement struct {
 type BlockStatement struct {
-	LeftBrace  file.Idx
 	List       []Statement
 	List       []Statement
+	LeftBrace  file.Idx
 	RightBrace file.Idx
 	RightBrace file.Idx
 }
 }
 
 
@@ -538,9 +537,9 @@ func (*BlockStatement) statement() {}
 
 
 // BranchStatement represents a branch statement.
 // BranchStatement represents a branch statement.
 type BranchStatement struct {
 type BranchStatement struct {
+	Label *Identifier
 	Idx   file.Idx
 	Idx   file.Idx
 	Token token.Token
 	Token token.Token
-	Label *Identifier
 }
 }
 
 
 // Idx0 implements Node.
 // Idx0 implements Node.
@@ -561,9 +560,9 @@ func (*BranchStatement) statement() {}
 
 
 // CaseStatement represents a case statement.
 // CaseStatement represents a case statement.
 type CaseStatement struct {
 type CaseStatement struct {
-	Case       file.Idx
 	Test       Expression
 	Test       Expression
 	Consequent []Statement
 	Consequent []Statement
+	Case       file.Idx
 }
 }
 
 
 // Idx0 implements Node.
 // Idx0 implements Node.
@@ -581,9 +580,9 @@ func (*CaseStatement) statement() {}
 
 
 // CatchStatement represents a catch statement.
 // CatchStatement represents a catch statement.
 type CatchStatement struct {
 type CatchStatement struct {
-	Catch     file.Idx
-	Parameter *Identifier
 	Body      Statement
 	Body      Statement
+	Parameter *Identifier
+	Catch     file.Idx
 }
 }
 
 
 // Idx0 implements Node.
 // Idx0 implements Node.
@@ -619,9 +618,9 @@ func (*DebuggerStatement) statement() {}
 
 
 // DoWhileStatement represents a do while statement.
 // DoWhileStatement represents a do while statement.
 type DoWhileStatement struct {
 type DoWhileStatement struct {
-	Do               file.Idx
 	Test             Expression
 	Test             Expression
 	Body             Statement
 	Body             Statement
+	Do               file.Idx
 	RightParenthesis file.Idx
 	RightParenthesis file.Idx
 }
 }
 
 
@@ -676,10 +675,10 @@ func (*ExpressionStatement) statement() {}
 
 
 // ForInStatement represents a for in statement.
 // ForInStatement represents a for in statement.
 type ForInStatement struct {
 type ForInStatement struct {
-	For    file.Idx
 	Into   Expression
 	Into   Expression
 	Source Expression
 	Source Expression
 	Body   Statement
 	Body   Statement
+	For    file.Idx
 }
 }
 
 
 // Idx0 implements Node.
 // Idx0 implements Node.
@@ -697,11 +696,11 @@ func (*ForInStatement) statement() {}
 
 
 // ForStatement represents a for statement.
 // ForStatement represents a for statement.
 type ForStatement struct {
 type ForStatement struct {
-	For         file.Idx
 	Initializer Expression
 	Initializer Expression
 	Update      Expression
 	Update      Expression
 	Test        Expression
 	Test        Expression
 	Body        Statement
 	Body        Statement
+	For         file.Idx
 }
 }
 
 
 // Idx0 implements Node.
 // Idx0 implements Node.
@@ -737,10 +736,10 @@ func (*FunctionStatement) statement() {}
 
 
 // IfStatement represents a if statement.
 // IfStatement represents a if statement.
 type IfStatement struct {
 type IfStatement struct {
-	If         file.Idx
 	Test       Expression
 	Test       Expression
 	Consequent Statement
 	Consequent Statement
 	Alternate  Statement
 	Alternate  Statement
+	If         file.Idx
 }
 }
 
 
 // Idx0 implements Node.
 // Idx0 implements Node.
@@ -761,9 +760,9 @@ func (*IfStatement) statement() {}
 
 
 // LabelledStatement represents a labelled statement.
 // LabelledStatement represents a labelled statement.
 type LabelledStatement struct {
 type LabelledStatement struct {
+	Statement Statement
 	Label     *Identifier
 	Label     *Identifier
 	Colon     file.Idx
 	Colon     file.Idx
-	Statement Statement
 }
 }
 
 
 // Idx0 implements Node.
 // Idx0 implements Node.
@@ -781,8 +780,8 @@ func (*LabelledStatement) statement() {}
 
 
 // ReturnStatement represents a return statement.
 // ReturnStatement represents a return statement.
 type ReturnStatement struct {
 type ReturnStatement struct {
-	Return   file.Idx
 	Argument Expression
 	Argument Expression
+	Return   file.Idx
 }
 }
 
 
 // Idx0 implements Node.
 // Idx0 implements Node.
@@ -803,10 +802,10 @@ func (*ReturnStatement) statement() {}
 
 
 // SwitchStatement represents a switch statement.
 // SwitchStatement represents a switch statement.
 type SwitchStatement struct {
 type SwitchStatement struct {
-	Switch       file.Idx
 	Discriminant Expression
 	Discriminant Expression
-	Default      int
 	Body         []*CaseStatement
 	Body         []*CaseStatement
+	Switch       file.Idx
+	Default      int
 	RightBrace   file.Idx
 	RightBrace   file.Idx
 }
 }
 
 
@@ -825,8 +824,8 @@ func (*SwitchStatement) statement() {}
 
 
 // ThrowStatement represents a throw statement.
 // ThrowStatement represents a throw statement.
 type ThrowStatement struct {
 type ThrowStatement struct {
-	Throw    file.Idx
 	Argument Expression
 	Argument Expression
+	Throw    file.Idx
 }
 }
 
 
 // Idx0 implements Node.
 // Idx0 implements Node.
@@ -844,10 +843,10 @@ func (*ThrowStatement) statement() {}
 
 
 // TryStatement represents a try statement.
 // TryStatement represents a try statement.
 type TryStatement struct {
 type TryStatement struct {
-	Try     file.Idx
 	Body    Statement
 	Body    Statement
-	Catch   *CatchStatement
 	Finally Statement
 	Finally Statement
+	Catch   *CatchStatement
+	Try     file.Idx
 }
 }
 
 
 // Idx0 implements Node.
 // Idx0 implements Node.
@@ -868,8 +867,8 @@ func (*TryStatement) statement() {}
 
 
 // VariableStatement represents a variable statement.
 // VariableStatement represents a variable statement.
 type VariableStatement struct {
 type VariableStatement struct {
-	Var  file.Idx
 	List []Expression
 	List []Expression
+	Var  file.Idx
 }
 }
 
 
 // Idx0 implements Node.
 // Idx0 implements Node.
@@ -887,9 +886,9 @@ func (*VariableStatement) statement() {}
 
 
 // WhileStatement represents a while statement.
 // WhileStatement represents a while statement.
 type WhileStatement struct {
 type WhileStatement struct {
-	While file.Idx
 	Test  Expression
 	Test  Expression
 	Body  Statement
 	Body  Statement
+	While file.Idx
 }
 }
 
 
 // Idx0 implements Node.
 // Idx0 implements Node.
@@ -907,9 +906,9 @@ func (*WhileStatement) statement() {}
 
 
 // WithStatement represents a with statement.
 // WithStatement represents a with statement.
 type WithStatement struct {
 type WithStatement struct {
-	With   file.Idx
 	Object Expression
 	Object Expression
 	Body   Statement
 	Body   Statement
+	With   file.Idx
 }
 }
 
 
 // Idx0 implements Node.
 // Idx0 implements Node.
@@ -939,8 +938,8 @@ func (*FunctionDeclaration) declaration() {}
 
 
 // VariableDeclaration represents a variable declaration.
 // VariableDeclaration represents a variable declaration.
 type VariableDeclaration struct {
 type VariableDeclaration struct {
-	Var  file.Idx
 	List []*VariableExpression
 	List []*VariableExpression
+	Var  file.Idx
 }
 }
 
 
 // declaration implements Declaration.
 // declaration implements Declaration.
@@ -948,13 +947,10 @@ func (*VariableDeclaration) declaration() {}
 
 
 // Program represents a full program.
 // Program represents a full program.
 type Program struct {
 type Program struct {
-	Body []Statement
-
+	File            *file.File
+	Comments        CommentMap
+	Body            []Statement
 	DeclarationList []Declaration
 	DeclarationList []Declaration
-
-	File *file.File
-
-	Comments CommentMap
 }
 }
 
 
 // Idx0 implements Node.
 // Idx0 implements Node.

+ 4 - 5
vendor/github.com/robertkrimen/otto/builtin.go

@@ -147,11 +147,11 @@ func builtinGlobalParseFloat(call FunctionCall) Value {
 	value, err := strconv.ParseFloat(input, 64)
 	value, err := strconv.ParseFloat(input, 64)
 	if err != nil {
 	if err != nil {
 		for end := len(input); end > 0; end-- {
 		for end := len(input); end > 0; end-- {
-			input := input[0:end]
-			if !parseFloatMatchValid.MatchString(input) {
+			val := input[0:end]
+			if !parseFloatMatchValid.MatchString(val) {
 				return NaNValue()
 				return NaNValue()
 			}
 			}
-			value, err = strconv.ParseFloat(input, 64)
+			value, err = strconv.ParseFloat(val, 64)
 			if err == nil {
 			if err == nil {
 				break
 				break
 			}
 			}
@@ -200,8 +200,7 @@ func encodeDecodeURI(call FunctionCall, escape *regexp.Regexp) Value {
 		}
 		}
 		index++
 		index++
 		size := utf8.EncodeRune(encode, decode[0])
 		size := utf8.EncodeRune(encode, decode[0])
-		encode := encode[0:size]
-		output = append(output, encode...)
+		output = append(output, encode[0:size]...)
 	}
 	}
 
 
 	bytes := escape.ReplaceAllFunc(output, func(target []byte) []byte {
 	bytes := escape.ReplaceAllFunc(output, func(target []byte) []byte {

+ 13 - 13
vendor/github.com/robertkrimen/otto/builtin_array.go

@@ -43,7 +43,7 @@ func builtinArrayToLocaleString(call FunctionCall) Value {
 		return stringValue("")
 		return stringValue("")
 	}
 	}
 	stringList := make([]string, 0, length)
 	stringList := make([]string, 0, length)
-	for index := int64(0); index < length; index++ {
+	for index := range length {
 		value := thisObject.get(arrayIndexToString(index))
 		value := thisObject.get(arrayIndexToString(index))
 		stringValue := ""
 		stringValue := ""
 		switch value.kind {
 		switch value.kind {
@@ -71,7 +71,7 @@ func builtinArrayConcat(call FunctionCall) Value {
 			obj := item.object()
 			obj := item.object()
 			if isArray(obj) {
 			if isArray(obj) {
 				length := obj.get(propertyLength).number().int64
 				length := obj.get(propertyLength).number().int64
-				for index := int64(0); index < length; index++ {
+				for index := range length {
 					name := strconv.FormatInt(index, 10)
 					name := strconv.FormatInt(index, 10)
 					if obj.hasProperty(name) {
 					if obj.hasProperty(name) {
 						valueArray = append(valueArray, obj.get(name))
 						valueArray = append(valueArray, obj.get(name))
@@ -151,7 +151,7 @@ func builtinArrayJoin(call FunctionCall) Value {
 		return stringValue("")
 		return stringValue("")
 	}
 	}
 	stringList := make([]string, 0, length)
 	stringList := make([]string, 0, length)
-	for index := int64(0); index < length; index++ {
+	for index := range length {
 		value := thisObject.get(arrayIndexToString(index))
 		value := thisObject.get(arrayIndexToString(index))
 		stringValue := ""
 		stringValue := ""
 		switch value.kind {
 		switch value.kind {
@@ -175,7 +175,7 @@ func builtinArraySplice(call FunctionCall) Value {
 	}
 	}
 	valueArray := make([]Value, deleteCount)
 	valueArray := make([]Value, deleteCount)
 
 
-	for index := int64(0); index < deleteCount; index++ {
+	for index := range deleteCount {
 		indexString := arrayIndexToString(start + index)
 		indexString := arrayIndexToString(start + index)
 		if thisObject.hasProperty(indexString) {
 		if thisObject.hasProperty(indexString) {
 			valueArray[index] = thisObject.get(indexString)
 			valueArray[index] = thisObject.get(indexString)
@@ -236,7 +236,7 @@ func builtinArraySplice(call FunctionCall) Value {
 		}
 		}
 	}
 	}
 
 
-	for index := int64(0); index < itemCount; index++ {
+	for index := range itemCount {
 		thisObject.put(arrayIndexToString(index+start), itemList[index], true)
 		thisObject.put(arrayIndexToString(index+start), itemList[index], true)
 	}
 	}
 	thisObject.put(propertyLength, int64Value(length+itemCount-deleteCount), true)
 	thisObject.put(propertyLength, int64Value(length+itemCount-deleteCount), true)
@@ -257,7 +257,7 @@ func builtinArraySlice(call FunctionCall) Value {
 	sliceLength := end - start
 	sliceLength := end - start
 	sliceValueArray := make([]Value, sliceLength)
 	sliceValueArray := make([]Value, sliceLength)
 
 
-	for index := int64(0); index < sliceLength; index++ {
+	for index := range sliceLength {
 		from := arrayIndexToString(index + start)
 		from := arrayIndexToString(index + start)
 		if thisObject.hasProperty(from) {
 		if thisObject.hasProperty(from) {
 			sliceValueArray[index] = thisObject.get(from)
 			sliceValueArray[index] = thisObject.get(from)
@@ -283,7 +283,7 @@ func builtinArrayUnshift(call FunctionCall) Value {
 		}
 		}
 	}
 	}
 
 
-	for index := int64(0); index < itemCount; index++ {
+	for index := range itemCount {
 		thisObject.put(arrayIndexToString(index), itemList[index], true)
 		thisObject.put(arrayIndexToString(index), itemList[index], true)
 	}
 	}
 
 
@@ -339,9 +339,9 @@ func builtinArrayReverse(call FunctionCall) Value {
 func sortCompare(thisObject *object, index0, index1 uint, compare *object) int {
 func sortCompare(thisObject *object, index0, index1 uint, compare *object) int {
 	j := struct {
 	j := struct {
 		name    string
 		name    string
+		value   string
 		exists  bool
 		exists  bool
 		defined bool
 		defined bool
-		value   string
 	}{}
 	}{}
 	k := j
 	k := j
 	j.name = arrayIndexToString(int64(index0))
 	j.name = arrayIndexToString(int64(index0))
@@ -531,7 +531,7 @@ func builtinArrayEvery(call FunctionCall) Value {
 	if iterator := call.Argument(0); iterator.isCallable() {
 	if iterator := call.Argument(0); iterator.isCallable() {
 		length := int64(toUint32(thisObject.get(propertyLength)))
 		length := int64(toUint32(thisObject.get(propertyLength)))
 		callThis := call.Argument(1)
 		callThis := call.Argument(1)
-		for index := int64(0); index < length; index++ {
+		for index := range length {
 			if key := arrayIndexToString(index); thisObject.hasProperty(key) {
 			if key := arrayIndexToString(index); thisObject.hasProperty(key) {
 				if value := thisObject.get(key); iterator.call(call.runtime, callThis, value, int64Value(index), this).bool() {
 				if value := thisObject.get(key); iterator.call(call.runtime, callThis, value, int64Value(index), this).bool() {
 					continue
 					continue
@@ -550,7 +550,7 @@ func builtinArraySome(call FunctionCall) Value {
 	if iterator := call.Argument(0); iterator.isCallable() {
 	if iterator := call.Argument(0); iterator.isCallable() {
 		length := int64(toUint32(thisObject.get(propertyLength)))
 		length := int64(toUint32(thisObject.get(propertyLength)))
 		callThis := call.Argument(1)
 		callThis := call.Argument(1)
-		for index := int64(0); index < length; index++ {
+		for index := range length {
 			if key := arrayIndexToString(index); thisObject.hasProperty(key) {
 			if key := arrayIndexToString(index); thisObject.hasProperty(key) {
 				if value := thisObject.get(key); iterator.call(call.runtime, callThis, value, int64Value(index), this).bool() {
 				if value := thisObject.get(key); iterator.call(call.runtime, callThis, value, int64Value(index), this).bool() {
 					return trueValue
 					return trueValue
@@ -568,7 +568,7 @@ func builtinArrayForEach(call FunctionCall) Value {
 	if iterator := call.Argument(0); iterator.isCallable() {
 	if iterator := call.Argument(0); iterator.isCallable() {
 		length := int64(toUint32(thisObject.get(propertyLength)))
 		length := int64(toUint32(thisObject.get(propertyLength)))
 		callThis := call.Argument(1)
 		callThis := call.Argument(1)
-		for index := int64(0); index < length; index++ {
+		for index := range length {
 			if key := arrayIndexToString(index); thisObject.hasProperty(key) {
 			if key := arrayIndexToString(index); thisObject.hasProperty(key) {
 				iterator.call(call.runtime, callThis, thisObject.get(key), int64Value(index), this)
 				iterator.call(call.runtime, callThis, thisObject.get(key), int64Value(index), this)
 			}
 			}
@@ -585,7 +585,7 @@ func builtinArrayMap(call FunctionCall) Value {
 		length := int64(toUint32(thisObject.get(propertyLength)))
 		length := int64(toUint32(thisObject.get(propertyLength)))
 		callThis := call.Argument(1)
 		callThis := call.Argument(1)
 		values := make([]Value, length)
 		values := make([]Value, length)
-		for index := int64(0); index < length; index++ {
+		for index := range length {
 			if key := arrayIndexToString(index); thisObject.hasProperty(key) {
 			if key := arrayIndexToString(index); thisObject.hasProperty(key) {
 				values[index] = iterator.call(call.runtime, callThis, thisObject.get(key), index, this)
 				values[index] = iterator.call(call.runtime, callThis, thisObject.get(key), index, this)
 			} else {
 			} else {
@@ -604,7 +604,7 @@ func builtinArrayFilter(call FunctionCall) Value {
 		length := int64(toUint32(thisObject.get(propertyLength)))
 		length := int64(toUint32(thisObject.get(propertyLength)))
 		callThis := call.Argument(1)
 		callThis := call.Argument(1)
 		values := make([]Value, 0)
 		values := make([]Value, 0)
-		for index := int64(0); index < length; index++ {
+		for index := range length {
 			if key := arrayIndexToString(index); thisObject.hasProperty(key) {
 			if key := arrayIndexToString(index); thisObject.hasProperty(key) {
 				value := thisObject.get(key)
 				value := thisObject.get(key)
 				if iterator.call(call.runtime, callThis, value, index, this).bool() {
 				if iterator.call(call.runtime, callThis, value, index, this).bool() {

+ 20 - 20
vendor/github.com/robertkrimen/otto/builtin_date.go

@@ -22,12 +22,12 @@ var utcTimeZone = time.FixedZone("GMT", 0)
 
 
 func builtinDate(call FunctionCall) Value {
 func builtinDate(call FunctionCall) Value {
 	date := &dateObject{}
 	date := &dateObject{}
-	date.Set(newDateTime([]Value{}, time.Local)) //nolint: gosmopolitan
+	date.Set(newDateTime([]Value{}, time.Local)) //nolint:gosmopolitan
 	return stringValue(date.Time().Format(builtinDateDateTimeLayout))
 	return stringValue(date.Time().Format(builtinDateDateTimeLayout))
 }
 }
 
 
 func builtinNewDate(obj *object, argumentList []Value) Value {
 func builtinNewDate(obj *object, argumentList []Value) Value {
-	return objectValue(obj.runtime.newDate(newDateTime(argumentList, time.Local))) //nolint: gosmopolitan
+	return objectValue(obj.runtime.newDate(newDateTime(argumentList, time.Local))) //nolint:gosmopolitan
 }
 }
 
 
 func builtinDateToString(call FunctionCall) Value {
 func builtinDateToString(call FunctionCall) Value {
@@ -35,7 +35,7 @@ func builtinDateToString(call FunctionCall) Value {
 	if date.isNaN {
 	if date.isNaN {
 		return stringValue("Invalid Date")
 		return stringValue("Invalid Date")
 	}
 	}
-	return stringValue(date.Time().Local().Format(builtinDateDateTimeLayout)) //nolint: gosmopolitan
+	return stringValue(date.Time().Local().Format(builtinDateDateTimeLayout)) //nolint:gosmopolitan
 }
 }
 
 
 func builtinDateToDateString(call FunctionCall) Value {
 func builtinDateToDateString(call FunctionCall) Value {
@@ -43,7 +43,7 @@ func builtinDateToDateString(call FunctionCall) Value {
 	if date.isNaN {
 	if date.isNaN {
 		return stringValue("Invalid Date")
 		return stringValue("Invalid Date")
 	}
 	}
-	return stringValue(date.Time().Local().Format(builtinDateDateLayout)) //nolint: gosmopolitan
+	return stringValue(date.Time().Local().Format(builtinDateDateLayout)) //nolint:gosmopolitan
 }
 }
 
 
 func builtinDateToTimeString(call FunctionCall) Value {
 func builtinDateToTimeString(call FunctionCall) Value {
@@ -51,7 +51,7 @@ func builtinDateToTimeString(call FunctionCall) Value {
 	if date.isNaN {
 	if date.isNaN {
 		return stringValue("Invalid Date")
 		return stringValue("Invalid Date")
 	}
 	}
-	return stringValue(date.Time().Local().Format(builtinDateTimeLayout)) //nolint: gosmopolitan
+	return stringValue(date.Time().Local().Format(builtinDateTimeLayout)) //nolint:gosmopolitan
 }
 }
 
 
 func builtinDateToUTCString(call FunctionCall) Value {
 func builtinDateToUTCString(call FunctionCall) Value {
@@ -129,7 +129,7 @@ func builtinDateBeforeSet(call FunctionCall, argumentLimit int, timeLocal bool)
 	}
 	}
 
 
 	valueList := make([]int, argumentLimit)
 	valueList := make([]int, argumentLimit)
-	for index := 0; index < argumentLimit; index++ {
+	for index := range argumentLimit {
 		value := call.ArgumentList[index]
 		value := call.ArgumentList[index]
 		nm := value.number()
 		nm := value.number()
 		switch nm.kind {
 		switch nm.kind {
@@ -142,7 +142,7 @@ func builtinDateBeforeSet(call FunctionCall, argumentLimit int, timeLocal bool)
 	}
 	}
 	baseTime := date.Time()
 	baseTime := date.Time()
 	if timeLocal {
 	if timeLocal {
-		baseTime = baseTime.Local() //nolint: gosmopolitan
+		baseTime = baseTime.Local() //nolint:gosmopolitan
 	}
 	}
 	ecmaTime := newEcmaTime(baseTime)
 	ecmaTime := newEcmaTime(baseTime)
 	return obj, &date, &ecmaTime, valueList
 	return obj, &date, &ecmaTime, valueList
@@ -168,7 +168,7 @@ func builtinDateToLocaleString(call FunctionCall) Value {
 	if date.isNaN {
 	if date.isNaN {
 		return stringValue("Invalid Date")
 		return stringValue("Invalid Date")
 	}
 	}
-	return stringValue(date.Time().Local().Format("2006-01-02 15:04:05")) //nolint: gosmopolitan
+	return stringValue(date.Time().Local().Format("2006-01-02 15:04:05")) //nolint:gosmopolitan
 }
 }
 
 
 // This is a placeholder.
 // This is a placeholder.
@@ -177,7 +177,7 @@ func builtinDateToLocaleDateString(call FunctionCall) Value {
 	if date.isNaN {
 	if date.isNaN {
 		return stringValue("Invalid Date")
 		return stringValue("Invalid Date")
 	}
 	}
-	return stringValue(date.Time().Local().Format("2006-01-02")) //nolint: gosmopolitan
+	return stringValue(date.Time().Local().Format("2006-01-02")) //nolint:gosmopolitan
 }
 }
 
 
 // This is a placeholder.
 // This is a placeholder.
@@ -186,7 +186,7 @@ func builtinDateToLocaleTimeString(call FunctionCall) Value {
 	if date.isNaN {
 	if date.isNaN {
 		return stringValue("Invalid Date")
 		return stringValue("Invalid Date")
 	}
 	}
-	return stringValue(date.Time().Local().Format("15:04:05")) //nolint: gosmopolitan
+	return stringValue(date.Time().Local().Format("15:04:05")) //nolint:gosmopolitan
 }
 }
 
 
 func builtinDateValueOf(call FunctionCall) Value {
 func builtinDateValueOf(call FunctionCall) Value {
@@ -204,7 +204,7 @@ func builtinDateGetYear(call FunctionCall) Value {
 	if date.isNaN {
 	if date.isNaN {
 		return NaNValue()
 		return NaNValue()
 	}
 	}
-	return intValue(date.Time().Local().Year() - 1900) //nolint: gosmopolitan
+	return intValue(date.Time().Local().Year() - 1900) //nolint:gosmopolitan
 }
 }
 
 
 func builtinDateGetFullYear(call FunctionCall) Value {
 func builtinDateGetFullYear(call FunctionCall) Value {
@@ -214,7 +214,7 @@ func builtinDateGetFullYear(call FunctionCall) Value {
 	if date.isNaN {
 	if date.isNaN {
 		return NaNValue()
 		return NaNValue()
 	}
 	}
-	return intValue(date.Time().Local().Year()) //nolint: gosmopolitan
+	return intValue(date.Time().Local().Year()) //nolint:gosmopolitan
 }
 }
 
 
 func builtinDateGetUTCFullYear(call FunctionCall) Value {
 func builtinDateGetUTCFullYear(call FunctionCall) Value {
@@ -230,7 +230,7 @@ func builtinDateGetMonth(call FunctionCall) Value {
 	if date.isNaN {
 	if date.isNaN {
 		return NaNValue()
 		return NaNValue()
 	}
 	}
-	return intValue(dateFromGoMonth(date.Time().Local().Month())) //nolint: gosmopolitan
+	return intValue(dateFromGoMonth(date.Time().Local().Month())) //nolint:gosmopolitan
 }
 }
 
 
 func builtinDateGetUTCMonth(call FunctionCall) Value {
 func builtinDateGetUTCMonth(call FunctionCall) Value {
@@ -246,7 +246,7 @@ func builtinDateGetDate(call FunctionCall) Value {
 	if date.isNaN {
 	if date.isNaN {
 		return NaNValue()
 		return NaNValue()
 	}
 	}
-	return intValue(date.Time().Local().Day()) //nolint: gosmopolitan
+	return intValue(date.Time().Local().Day()) //nolint:gosmopolitan
 }
 }
 
 
 func builtinDateGetUTCDate(call FunctionCall) Value {
 func builtinDateGetUTCDate(call FunctionCall) Value {
@@ -263,7 +263,7 @@ func builtinDateGetDay(call FunctionCall) Value {
 	if date.isNaN {
 	if date.isNaN {
 		return NaNValue()
 		return NaNValue()
 	}
 	}
-	return intValue(dateFromGoDay(date.Time().Local().Weekday())) //nolint: gosmopolitan
+	return intValue(dateFromGoDay(date.Time().Local().Weekday())) //nolint:gosmopolitan
 }
 }
 
 
 func builtinDateGetUTCDay(call FunctionCall) Value {
 func builtinDateGetUTCDay(call FunctionCall) Value {
@@ -279,7 +279,7 @@ func builtinDateGetHours(call FunctionCall) Value {
 	if date.isNaN {
 	if date.isNaN {
 		return NaNValue()
 		return NaNValue()
 	}
 	}
-	return intValue(date.Time().Local().Hour()) //nolint: gosmopolitan
+	return intValue(date.Time().Local().Hour()) //nolint:gosmopolitan
 }
 }
 
 
 func builtinDateGetUTCHours(call FunctionCall) Value {
 func builtinDateGetUTCHours(call FunctionCall) Value {
@@ -295,7 +295,7 @@ func builtinDateGetMinutes(call FunctionCall) Value {
 	if date.isNaN {
 	if date.isNaN {
 		return NaNValue()
 		return NaNValue()
 	}
 	}
-	return intValue(date.Time().Local().Minute()) //nolint: gosmopolitan
+	return intValue(date.Time().Local().Minute()) //nolint:gosmopolitan
 }
 }
 
 
 func builtinDateGetUTCMinutes(call FunctionCall) Value {
 func builtinDateGetUTCMinutes(call FunctionCall) Value {
@@ -311,7 +311,7 @@ func builtinDateGetSeconds(call FunctionCall) Value {
 	if date.isNaN {
 	if date.isNaN {
 		return NaNValue()
 		return NaNValue()
 	}
 	}
-	return intValue(date.Time().Local().Second()) //nolint: gosmopolitan
+	return intValue(date.Time().Local().Second()) //nolint:gosmopolitan
 }
 }
 
 
 func builtinDateGetUTCSeconds(call FunctionCall) Value {
 func builtinDateGetUTCSeconds(call FunctionCall) Value {
@@ -327,7 +327,7 @@ func builtinDateGetMilliseconds(call FunctionCall) Value {
 	if date.isNaN {
 	if date.isNaN {
 		return NaNValue()
 		return NaNValue()
 	}
 	}
-	return intValue(date.Time().Local().Nanosecond() / (100 * 100 * 100)) //nolint: gosmopolitan
+	return intValue(date.Time().Local().Nanosecond() / (100 * 100 * 100)) //nolint:gosmopolitan
 }
 }
 
 
 func builtinDateGetUTCMilliseconds(call FunctionCall) Value {
 func builtinDateGetUTCMilliseconds(call FunctionCall) Value {
@@ -343,7 +343,7 @@ func builtinDateGetTimezoneOffset(call FunctionCall) Value {
 	if date.isNaN {
 	if date.isNaN {
 		return NaNValue()
 		return NaNValue()
 	}
 	}
-	timeLocal := date.Time().Local() //nolint: gosmopolitan
+	timeLocal := date.Time().Local() //nolint:gosmopolitan
 	// Is this kosher?
 	// Is this kosher?
 	timeLocalAsUTC := time.Date(
 	timeLocalAsUTC := time.Date(
 		timeLocal.Year(),
 		timeLocal.Year(),

+ 1 - 1
vendor/github.com/robertkrimen/otto/builtin_function.go

@@ -85,7 +85,7 @@ func builtinFunctionApply(call FunctionCall) Value {
 	thisObject := call.thisObject()
 	thisObject := call.thisObject()
 	length := int64(toUint32(arrayObject.get(propertyLength)))
 	length := int64(toUint32(arrayObject.get(propertyLength)))
 	valueArray := make([]Value, length)
 	valueArray := make([]Value, length)
-	for index := int64(0); index < length; index++ {
+	for index := range length {
 		valueArray[index] = arrayObject.get(arrayIndexToString(index))
 		valueArray[index] = arrayObject.get(arrayIndexToString(index))
 	}
 	}
 	return thisObject.call(this, valueArray, false, nativeFrame)
 	return thisObject.call(this, valueArray, false, nativeFrame)

+ 22 - 22
vendor/github.com/robertkrimen/otto/builtin_json.go

@@ -8,8 +8,8 @@ import (
 )
 )
 
 
 type builtinJSONParseContext struct {
 type builtinJSONParseContext struct {
-	call    FunctionCall
 	reviver Value
 	reviver Value
+	call    FunctionCall
 }
 }
 
 
 func builtinJSONParse(call FunctionCall) Value {
 func builtinJSONParse(call FunctionCall) Value {
@@ -44,22 +44,22 @@ func builtinJSONReviveWalk(ctx builtinJSONParseContext, holder *object, name str
 	if obj := value.object(); obj != nil {
 	if obj := value.object(); obj != nil {
 		if isArray(obj) {
 		if isArray(obj) {
 			length := int64(objectLength(obj))
 			length := int64(objectLength(obj))
-			for index := int64(0); index < length; index++ {
-				name := arrayIndexToString(index)
-				value := builtinJSONReviveWalk(ctx, obj, name)
-				if value.IsUndefined() {
-					obj.delete(name, false)
+			for index := range length {
+				idxName := arrayIndexToString(index)
+				idxValue := builtinJSONReviveWalk(ctx, obj, idxName)
+				if idxValue.IsUndefined() {
+					obj.delete(idxName, false)
 				} else {
 				} else {
-					obj.defineProperty(name, value, 0o111, false)
+					obj.defineProperty(idxName, idxValue, 0o111, false)
 				}
 				}
 			}
 			}
 		} else {
 		} else {
 			obj.enumerate(false, func(name string) bool {
 			obj.enumerate(false, func(name string) bool {
-				value := builtinJSONReviveWalk(ctx, obj, name)
-				if value.IsUndefined() {
+				enumVal := builtinJSONReviveWalk(ctx, obj, name)
+				if enumVal.IsUndefined() {
 					obj.delete(name, false)
 					obj.delete(name, false)
 				} else {
 				} else {
-					obj.defineProperty(name, value, 0o111, false)
+					obj.defineProperty(name, enumVal, 0o111, false)
 				}
 				}
 				return true
 				return true
 			})
 			})
@@ -99,11 +99,11 @@ func builtinJSONParseWalk(ctx builtinJSONParseContext, rawValue interface{}) (Va
 }
 }
 
 
 type builtinJSONStringifyContext struct {
 type builtinJSONStringifyContext struct {
-	call             FunctionCall
-	stack            []*object
-	propertyList     []string
 	replacerFunction *Value
 	replacerFunction *Value
 	gap              string
 	gap              string
+	stack            []*object
+	propertyList     []string
+	call             FunctionCall
 }
 }
 
 
 func builtinJSONStringify(call FunctionCall) Value {
 func builtinJSONStringify(call FunctionCall) Value {
@@ -241,19 +241,19 @@ func builtinJSONStringifyWalk(ctx builtinJSONStringifyContext, key string, holde
 	case valueNull:
 	case valueNull:
 		return nil, true
 		return nil, true
 	case valueObject:
 	case valueObject:
-		holder := value.object()
+		objHolder := value.object()
 		if value := value.object(); nil != value {
 		if value := value.object(); nil != value {
 			for _, obj := range ctx.stack {
 			for _, obj := range ctx.stack {
-				if holder == obj {
+				if objHolder == obj {
 					panic(ctx.call.runtime.panicTypeError("Converting circular structure to JSON"))
 					panic(ctx.call.runtime.panicTypeError("Converting circular structure to JSON"))
 				}
 				}
 			}
 			}
 			ctx.stack = append(ctx.stack, value)
 			ctx.stack = append(ctx.stack, value)
 			defer func() { ctx.stack = ctx.stack[:len(ctx.stack)-1] }()
 			defer func() { ctx.stack = ctx.stack[:len(ctx.stack)-1] }()
 		}
 		}
-		if isArray(holder) {
+		if isArray(objHolder) {
 			var length uint32
 			var length uint32
-			switch value := holder.get(propertyLength).value.(type) {
+			switch value := objHolder.get(propertyLength).value.(type) {
 			case uint32:
 			case uint32:
 				length = value
 				length = value
 			case int:
 			case int:
@@ -266,15 +266,15 @@ func builtinJSONStringifyWalk(ctx builtinJSONStringifyContext, key string, holde
 			array := make([]interface{}, length)
 			array := make([]interface{}, length)
 			for index := range array {
 			for index := range array {
 				name := arrayIndexToString(int64(index))
 				name := arrayIndexToString(int64(index))
-				value, _ := builtinJSONStringifyWalk(ctx, name, holder)
+				value, _ := builtinJSONStringifyWalk(ctx, name, objHolder)
 				array[index] = value
 				array[index] = value
 			}
 			}
 			return array, true
 			return array, true
-		} else if holder.class != classFunctionName {
+		} else if objHolder.class != classFunctionName {
 			obj := map[string]interface{}{}
 			obj := map[string]interface{}{}
 			if ctx.propertyList != nil {
 			if ctx.propertyList != nil {
 				for _, name := range ctx.propertyList {
 				for _, name := range ctx.propertyList {
-					value, exists := builtinJSONStringifyWalk(ctx, name, holder)
+					value, exists := builtinJSONStringifyWalk(ctx, name, objHolder)
 					if exists {
 					if exists {
 						obj[name] = value
 						obj[name] = value
 					}
 					}
@@ -282,8 +282,8 @@ func builtinJSONStringifyWalk(ctx builtinJSONStringifyContext, key string, holde
 			} else {
 			} else {
 				// Go maps are without order, so this doesn't conform to the ECMA ordering
 				// Go maps are without order, so this doesn't conform to the ECMA ordering
 				// standard, but oh well...
 				// standard, but oh well...
-				holder.enumerate(false, func(name string) bool {
-					value, exists := builtinJSONStringifyWalk(ctx, name, holder)
+				objHolder.enumerate(false, func(name string) bool {
+					value, exists := builtinJSONStringifyWalk(ctx, name, objHolder)
 					if exists {
 					if exists {
 						obj[name] = value
 						obj[name] = value
 					}
 					}

+ 1 - 1
vendor/github.com/robertkrimen/otto/builtin_math.go

@@ -166,7 +166,7 @@ func builtinMathRandom(call FunctionCall) Value {
 	if call.runtime.random != nil {
 	if call.runtime.random != nil {
 		v = call.runtime.random()
 		v = call.runtime.random()
 	} else {
 	} else {
-		v = rand.Float64() //nolint: gosec
+		v = rand.Float64() //nolint:gosec
 	}
 	}
 	return float64Value(v)
 	return float64Value(v)
 }
 }

+ 11 - 0
vendor/github.com/robertkrimen/otto/builtin_object.go

@@ -273,6 +273,17 @@ func builtinObjectKeys(call FunctionCall) Value {
 	panic(call.runtime.panicTypeError("Object.Keys is nil"))
 	panic(call.runtime.panicTypeError("Object.Keys is nil"))
 }
 }
 
 
+func builtinObjectValues(call FunctionCall) Value {
+	if obj, values := call.Argument(0).object(), []Value(nil); nil != obj {
+		obj.enumerate(false, func(name string) bool {
+			values = append(values, obj.get(name))
+			return true
+		})
+		return objectValue(call.runtime.newArrayOf(values))
+	}
+	panic(call.runtime.panicTypeError("Object.Values is nil"))
+}
+
 func builtinObjectGetOwnPropertyNames(call FunctionCall) Value {
 func builtinObjectGetOwnPropertyNames(call FunctionCall) Value {
 	if obj, propertyNames := call.Argument(0).object(), []Value(nil); nil != obj {
 	if obj, propertyNames := call.Argument(0).object(), []Value(nil); nil != obj {
 		obj.enumerate(true, func(name string) bool {
 		obj.enumerate(true, func(name string) bool {

+ 18 - 6
vendor/github.com/robertkrimen/otto/builtin_string.go

@@ -163,7 +163,7 @@ func builtinStringMatch(call FunctionCall) Value {
 	}
 	}
 	matchCount := len(result)
 	matchCount := len(result)
 	valueArray := make([]Value, matchCount)
 	valueArray := make([]Value, matchCount)
-	for index := 0; index < matchCount; index++ {
+	for index := range matchCount {
 		valueArray[index] = stringValue(target[result[index][0]:result[index][1]])
 		valueArray[index] = stringValue(target[result[index][0]:result[index][1]])
 	}
 	}
 	matcher.put("lastIndex", intValue(result[matchCount-1][1]), true)
 	matcher.put("lastIndex", intValue(result[matchCount-1][1]), true)
@@ -246,7 +246,7 @@ func builtinStringReplace(call FunctionCall) Value {
 			}
 			}
 			matchCount := len(match) / 2
 			matchCount := len(match) / 2
 			argumentList := make([]Value, matchCount+2)
 			argumentList := make([]Value, matchCount+2)
-			for index := 0; index < matchCount; index++ {
+			for index := range matchCount {
 				offset := 2 * index
 				offset := 2 * index
 				if match[offset] != -1 {
 				if match[offset] != -1 {
 					argumentList[index] = stringValue(target[match[offset]:match[offset+1]])
 					argumentList[index] = stringValue(target[match[offset]:match[offset+1]])
@@ -254,7 +254,9 @@ func builtinStringReplace(call FunctionCall) Value {
 					argumentList[index] = Value{}
 					argumentList[index] = Value{}
 				}
 				}
 			}
 			}
-			argumentList[matchCount+0] = intValue(match[0])
+			// Replace expects rune offsets not byte offsets.
+			startIndex := utf8.RuneCountInString(target[0:match[0]])
+			argumentList[matchCount+0] = intValue(startIndex)
 			argumentList[matchCount+1] = stringValue(target)
 			argumentList[matchCount+1] = stringValue(target)
 			replacement := replace.call(Value{}, argumentList, false, nativeFrame).string()
 			replacement := replace.call(Value{}, argumentList, false, nativeFrame).string()
 			result = append(result, []byte(replacement)...)
 			result = append(result, []byte(replacement)...)
@@ -394,16 +396,18 @@ func builtinStringSplit(call FunctionCall) Value {
 	}
 	}
 }
 }
 
 
+// builtinStringSlice returns the string sliced by the given values
+// which are rune not byte offsets, as per String.prototype.slice.
 func builtinStringSlice(call FunctionCall) Value {
 func builtinStringSlice(call FunctionCall) Value {
 	checkObjectCoercible(call.runtime, call.This)
 	checkObjectCoercible(call.runtime, call.This)
-	target := call.This.string()
+	target := []rune(call.This.string())
 
 
 	length := int64(len(target))
 	length := int64(len(target))
 	start, end := rangeStartEnd(call.ArgumentList, length, false)
 	start, end := rangeStartEnd(call.ArgumentList, length, false)
 	if end-start <= 0 {
 	if end-start <= 0 {
 		return stringValue("")
 		return stringValue("")
 	}
 	}
-	return stringValue(target[start:end])
+	return stringValue(string(target[start:end]))
 }
 }
 
 
 func builtinStringSubstring(call FunctionCall) Value {
 func builtinStringSubstring(call FunctionCall) Value {
@@ -473,6 +477,14 @@ func builtinStringTrim(call FunctionCall) Value {
 		builtinStringTrimWhitespace))
 		builtinStringTrimWhitespace))
 }
 }
 
 
+func builtinStringTrimStart(call FunctionCall) Value {
+	return builtinStringTrimLeft(call)
+}
+
+func builtinStringTrimEnd(call FunctionCall) Value {
+	return builtinStringTrimRight(call)
+}
+
 // Mozilla extension, not ECMAScript 5.
 // Mozilla extension, not ECMAScript 5.
 func builtinStringTrimLeft(call FunctionCall) Value {
 func builtinStringTrimLeft(call FunctionCall) Value {
 	checkObjectCoercible(call.runtime, call.This)
 	checkObjectCoercible(call.runtime, call.This)
@@ -489,7 +501,7 @@ func builtinStringTrimRight(call FunctionCall) Value {
 
 
 func builtinStringLocaleCompare(call FunctionCall) Value {
 func builtinStringLocaleCompare(call FunctionCall) Value {
 	checkObjectCoercible(call.runtime, call.This)
 	checkObjectCoercible(call.runtime, call.This)
-	this := call.This.string() //nolint: ifshort
+	this := call.This.string() //nolint:ifshort
 	that := call.Argument(0).string()
 	that := call.Argument(0).string()
 	if this < that {
 	if this < that {
 		return intValue(-1)
 		return intValue(-1)

+ 5 - 5
vendor/github.com/robertkrimen/otto/cmpl_evaluate_statement.go

@@ -134,7 +134,7 @@ func (rt *runtime) cmplEvaluateNodeStatementList(list []nodeStatement) Value {
 }
 }
 
 
 func (rt *runtime) cmplEvaluateNodeDoWhileStatement(node *nodeDoWhileStatement) Value {
 func (rt *runtime) cmplEvaluateNodeDoWhileStatement(node *nodeDoWhileStatement) Value {
-	labels := append(rt.labels, "") //nolint: gocritic
+	labels := append(rt.labels, "") //nolint:gocritic
 	rt.labels = nil
 	rt.labels = nil
 
 
 	test := node.test
 	test := node.test
@@ -169,7 +169,7 @@ resultBreak:
 }
 }
 
 
 func (rt *runtime) cmplEvaluateNodeForInStatement(node *nodeForInStatement) Value {
 func (rt *runtime) cmplEvaluateNodeForInStatement(node *nodeForInStatement) Value {
-	labels := append(rt.labels, "") //nolint: gocritic
+	labels := append(rt.labels, "") //nolint:gocritic
 	rt.labels = nil
 	rt.labels = nil
 
 
 	source := rt.cmplEvaluateNodeExpression(node.source)
 	source := rt.cmplEvaluateNodeExpression(node.source)
@@ -231,7 +231,7 @@ func (rt *runtime) cmplEvaluateNodeForInStatement(node *nodeForInStatement) Valu
 }
 }
 
 
 func (rt *runtime) cmplEvaluateNodeForStatement(node *nodeForStatement) Value {
 func (rt *runtime) cmplEvaluateNodeForStatement(node *nodeForStatement) Value {
-	labels := append(rt.labels, "") //nolint: gocritic
+	labels := append(rt.labels, "") //nolint:gocritic
 	rt.labels = nil
 	rt.labels = nil
 
 
 	initializer := node.initializer
 	initializer := node.initializer
@@ -304,7 +304,7 @@ func (rt *runtime) cmplEvaluateNodeIfStatement(node *nodeIfStatement) Value {
 }
 }
 
 
 func (rt *runtime) cmplEvaluateNodeSwitchStatement(node *nodeSwitchStatement) Value {
 func (rt *runtime) cmplEvaluateNodeSwitchStatement(node *nodeSwitchStatement) Value {
-	labels := append(rt.labels, "") //nolint: gocritic
+	labels := append(rt.labels, "") //nolint:gocritic
 	rt.labels = nil
 	rt.labels = nil
 
 
 	discriminantResult := rt.cmplEvaluateNodeExpression(node.discriminant)
 	discriminantResult := rt.cmplEvaluateNodeExpression(node.discriminant)
@@ -384,7 +384,7 @@ func (rt *runtime) cmplEvaluateNodeTryStatement(node *nodeTryStatement) Value {
 func (rt *runtime) cmplEvaluateModeWhileStatement(node *nodeWhileStatement) Value {
 func (rt *runtime) cmplEvaluateModeWhileStatement(node *nodeWhileStatement) Value {
 	test := node.test
 	test := node.test
 	body := node.body
 	body := node.body
-	labels := append(rt.labels, "") //nolint: gocritic
+	labels := append(rt.labels, "") //nolint:gocritic
 	rt.labels = nil
 	rt.labels = nil
 
 
 	result := emptyValue
 	result := emptyValue

+ 17 - 19
vendor/github.com/robertkrimen/otto/cmpl_parse.go

@@ -391,12 +391,10 @@ func (cmpl *compiler) parse() *nodeProgram {
 }
 }
 
 
 type nodeProgram struct {
 type nodeProgram struct {
-	body []nodeStatement
-
+	file         *file.File
+	body         []nodeStatement
 	varList      []string
 	varList      []string
 	functionList []*nodeFunctionLiteral
 	functionList []*nodeFunctionLiteral
-
-	file *file.File
 }
 }
 
 
 type node interface{}
 type node interface{}
@@ -412,22 +410,22 @@ type (
 	}
 	}
 
 
 	nodeAssignExpression struct {
 	nodeAssignExpression struct {
-		operator token.Token
 		left     nodeExpression
 		left     nodeExpression
 		right    nodeExpression
 		right    nodeExpression
+		operator token.Token
 	}
 	}
 
 
 	nodeBinaryExpression struct {
 	nodeBinaryExpression struct {
-		operator   token.Token
 		left       nodeExpression
 		left       nodeExpression
 		right      nodeExpression
 		right      nodeExpression
+		operator   token.Token
 		comparison bool
 		comparison bool
 	}
 	}
 
 
 	nodeBracketExpression struct {
 	nodeBracketExpression struct {
-		idx    file.Idx
 		left   nodeExpression
 		left   nodeExpression
 		member nodeExpression
 		member nodeExpression
+		idx    file.Idx
 	}
 	}
 
 
 	nodeCallExpression struct {
 	nodeCallExpression struct {
@@ -442,24 +440,24 @@ type (
 	}
 	}
 
 
 	nodeDotExpression struct {
 	nodeDotExpression struct {
-		idx        file.Idx
 		left       nodeExpression
 		left       nodeExpression
 		identifier string
 		identifier string
+		idx        file.Idx
 	}
 	}
 
 
 	nodeFunctionLiteral struct {
 	nodeFunctionLiteral struct {
-		name          string
 		body          nodeStatement
 		body          nodeStatement
+		file          *file.File
+		name          string
 		source        string
 		source        string
 		parameterList []string
 		parameterList []string
 		varList       []string
 		varList       []string
 		functionList  []*nodeFunctionLiteral
 		functionList  []*nodeFunctionLiteral
-		file          *file.File
 	}
 	}
 
 
 	nodeIdentifier struct {
 	nodeIdentifier struct {
-		idx  file.Idx
 		name string
 		name string
+		idx  file.Idx
 	}
 	}
 
 
 	nodeLiteral struct {
 	nodeLiteral struct {
@@ -476,9 +474,9 @@ type (
 	}
 	}
 
 
 	nodeProperty struct {
 	nodeProperty struct {
+		value nodeExpression
 		key   string
 		key   string
 		kind  string
 		kind  string
-		value nodeExpression
 	}
 	}
 
 
 	nodeRegExpLiteral struct {
 	nodeRegExpLiteral struct {
@@ -493,15 +491,15 @@ type (
 	nodeThisExpression struct{}
 	nodeThisExpression struct{}
 
 
 	nodeUnaryExpression struct {
 	nodeUnaryExpression struct {
-		operator token.Token
 		operand  nodeExpression
 		operand  nodeExpression
+		operator token.Token
 		postfix  bool
 		postfix  bool
 	}
 	}
 
 
 	nodeVariableExpression struct {
 	nodeVariableExpression struct {
-		idx         file.Idx
-		name        string
 		initializer nodeExpression
 		initializer nodeExpression
+		name        string
+		idx         file.Idx
 	}
 	}
 )
 )
 
 
@@ -516,8 +514,8 @@ type (
 	}
 	}
 
 
 	nodeBranchStatement struct {
 	nodeBranchStatement struct {
-		branch token.Token
 		label  string
 		label  string
+		branch token.Token
 	}
 	}
 
 
 	nodeCaseStatement struct {
 	nodeCaseStatement struct {
@@ -526,8 +524,8 @@ type (
 	}
 	}
 
 
 	nodeCatchStatement struct {
 	nodeCatchStatement struct {
-		parameter string
 		body      nodeStatement
 		body      nodeStatement
+		parameter string
 	}
 	}
 
 
 	nodeDebuggerStatement struct{}
 	nodeDebuggerStatement struct{}
@@ -563,8 +561,8 @@ type (
 	}
 	}
 
 
 	nodeLabelledStatement struct {
 	nodeLabelledStatement struct {
-		label     string
 		statement nodeStatement
 		statement nodeStatement
+		label     string
 	}
 	}
 
 
 	nodeReturnStatement struct {
 	nodeReturnStatement struct {
@@ -573,8 +571,8 @@ type (
 
 
 	nodeSwitchStatement struct {
 	nodeSwitchStatement struct {
 		discriminant nodeExpression
 		discriminant nodeExpression
-		defaultIdx   int
 		body         []*nodeCaseStatement
 		body         []*nodeCaseStatement
+		defaultIdx   int
 	}
 	}
 
 
 	nodeThrowStatement struct {
 	nodeThrowStatement struct {

+ 2 - 2
vendor/github.com/robertkrimen/otto/console.go

@@ -15,12 +15,12 @@ func formatForConsole(argumentList []Value) string {
 }
 }
 
 
 func builtinConsoleLog(call FunctionCall) Value {
 func builtinConsoleLog(call FunctionCall) Value {
-	fmt.Fprintln(os.Stdout, formatForConsole(call.ArgumentList))
+	fmt.Fprintln(os.Stdout, formatForConsole(call.ArgumentList)) //nolint:errcheck // Nothing we can do if this fails.
 	return Value{}
 	return Value{}
 }
 }
 
 
 func builtinConsoleError(call FunctionCall) Value {
 func builtinConsoleError(call FunctionCall) Value {
-	fmt.Fprintln(os.Stdout, formatForConsole(call.ArgumentList))
+	fmt.Fprintln(os.Stdout, formatForConsole(call.ArgumentList)) //nolint:errcheck // Nothing we can do if this fails.
 	return Value{}
 	return Value{}
 }
 }
 
 

+ 5 - 5
vendor/github.com/robertkrimen/otto/error.go

@@ -50,13 +50,13 @@ func (e ottoError) formatWithStack() string {
 }
 }
 
 
 type frame struct {
 type frame struct {
-	native     bool
+	fn         interface{}
+	file       *file.File
 	nativeFile string
 	nativeFile string
+	callee     string
 	nativeLine int
 	nativeLine int
-	file       *file.File
 	offset     int
 	offset     int
-	callee     string
-	fn         interface{}
+	native     bool
 }
 }
 
 
 var nativeFrame = frame{}
 var nativeFrame = frame{}
@@ -148,7 +148,7 @@ func newError(rt *runtime, name string, stackFramesToPop int, in ...interface{})
 	if rt != nil && rt.scope != nil {
 	if rt != nil && rt.scope != nil {
 		curScope := rt.scope
 		curScope := rt.scope
 
 
-		for i := 0; i < stackFramesToPop; i++ {
+		for range stackFramesToPop {
 			if curScope.outer != nil {
 			if curScope.outer != nil {
 				curScope = curScope.outer
 				curScope = curScope.outer
 			}
 			}

+ 3 - 3
vendor/github.com/robertkrimen/otto/evaluate.go

@@ -8,7 +8,7 @@ import (
 	"github.com/robertkrimen/otto/token"
 	"github.com/robertkrimen/otto/token"
 )
 )
 
 
-func (rt *runtime) evaluateMultiply(left float64, right float64) Value { //nolint: unused
+func (rt *runtime) evaluateMultiply(left float64, right float64) Value { //nolint:unused
 	// TODO 11.5.1
 	// TODO 11.5.1
 	return Value{}
 	return Value{}
 }
 }
@@ -44,7 +44,7 @@ func (rt *runtime) evaluateDivide(left float64, right float64) Value {
 	return float64Value(left / right)
 	return float64Value(left / right)
 }
 }
 
 
-func (rt *runtime) evaluateModulo(left float64, right float64) Value { //nolint: unused
+func (rt *runtime) evaluateModulo(left float64, right float64) Value { //nolint:unused
 	// TODO 11.5.3
 	// TODO 11.5.3
 	return Value{}
 	return Value{}
 }
 }
@@ -255,7 +255,7 @@ func (rt *runtime) calculateComparison(comparator token.Token, left Value, right
 			panic(fmt.Sprintf("unknown types for equal: %v ==? %v", x, y))
 			panic(fmt.Sprintf("unknown types for equal: %v ==? %v", x, y))
 		}
 		}
 	default:
 	default:
-		panic(fmt.Sprintf("unknown comparator %s", comparator.String()))
+		panic("unknown comparator " + comparator.String())
 	}
 	}
 
 
 	if kindEqualKind {
 	if kindEqualKind {

+ 4 - 4
vendor/github.com/robertkrimen/otto/file/file.go

@@ -49,9 +49,9 @@ func (p *Position) String() string {
 }
 }
 
 
 // A FileSet represents a set of source files.
 // A FileSet represents a set of source files.
-type FileSet struct { //nolint: golint
-	files []*File
+type FileSet struct {
 	last  *File
 	last  *File
+	files []*File
 }
 }
 
 
 // AddFile adds a new file with the given filename and src.
 // AddFile adds a new file with the given filename and src.
@@ -99,10 +99,10 @@ func (fs *FileSet) Position(idx Idx) *Position {
 
 
 // File represents a file to parse.
 // File represents a file to parse.
 type File struct {
 type File struct {
+	sm   *sourcemap.Consumer
 	name string
 	name string
 	src  string
 	src  string
-	base int // This will always be 1 or greater
-	sm   *sourcemap.Consumer
+	base int
 }
 }
 
 
 // NewFile returns a new file with the given filename, src and base.
 // NewFile returns a new file with the given filename, src and base.

+ 1 - 1
vendor/github.com/robertkrimen/otto/global.go

@@ -79,7 +79,7 @@ func (o *object) primitiveValue() Value {
 	return Value{}
 	return Value{}
 }
 }
 
 
-func (o *object) hasPrimitive() bool { //nolint: unused
+func (o *object) hasPrimitive() bool { //nolint:unused
 	switch o.value.(type) {
 	switch o.value.(type) {
 	case Value, stringObjecter:
 	case Value, stringObjecter:
 		return true
 		return true

+ 114 - 0
vendor/github.com/robertkrimen/otto/inline.go

@@ -902,6 +902,43 @@ func (rt *runtime) newContext() {
 					},
 					},
 				},
 				},
 			},
 			},
+			"values": {
+				mode: 0o101,
+				value: Value{
+					kind: valueObject,
+					value: &object{
+						runtime:     rt,
+						class:       classFunctionName,
+						objectClass: classObject,
+						prototype:   rt.global.FunctionPrototype,
+						extensible:  true,
+						property: map[string]property{
+							propertyLength: {
+								mode: 0,
+								value: Value{
+									kind:  valueNumber,
+									value: 1,
+								},
+							},
+							propertyName: {
+								mode: 0,
+								value: Value{
+									kind:  valueString,
+									value: "values",
+								},
+							},
+						},
+						propertyOrder: []string{
+							propertyLength,
+							propertyName,
+						},
+						value: nativeFunctionObject{
+							name: "values",
+							call: builtinObjectValues,
+						},
+					},
+				},
+			},
 			"getOwnPropertyNames": {
 			"getOwnPropertyNames": {
 				mode: 0o101,
 				mode: 0o101,
 				value: Value{
 				value: Value{
@@ -955,6 +992,7 @@ func (rt *runtime) newContext() {
 			"isFrozen",
 			"isFrozen",
 			"freeze",
 			"freeze",
 			"keys",
 			"keys",
+			"values",
 			"getOwnPropertyNames",
 			"getOwnPropertyNames",
 		},
 		},
 	}
 	}
@@ -2595,6 +2633,80 @@ func (rt *runtime) newContext() {
 					},
 					},
 				},
 				},
 			},
 			},
+			"trimStart": {
+				mode: 0o101,
+				value: Value{
+					kind: valueObject,
+					value: &object{
+						runtime:     rt,
+						class:       classFunctionName,
+						objectClass: classObject,
+						prototype:   rt.global.FunctionPrototype,
+						extensible:  true,
+						property: map[string]property{
+							propertyLength: {
+								mode: 0,
+								value: Value{
+									kind:  valueNumber,
+									value: 0,
+								},
+							},
+							propertyName: {
+								mode: 0,
+								value: Value{
+									kind:  valueString,
+									value: "trimStart",
+								},
+							},
+						},
+						propertyOrder: []string{
+							propertyLength,
+							propertyName,
+						},
+						value: nativeFunctionObject{
+							name: "trimStart",
+							call: builtinStringTrimStart,
+						},
+					},
+				},
+			},
+			"trimEnd": {
+				mode: 0o101,
+				value: Value{
+					kind: valueObject,
+					value: &object{
+						runtime:     rt,
+						class:       classFunctionName,
+						objectClass: classObject,
+						prototype:   rt.global.FunctionPrototype,
+						extensible:  true,
+						property: map[string]property{
+							propertyLength: {
+								mode: 0,
+								value: Value{
+									kind:  valueNumber,
+									value: 0,
+								},
+							},
+							propertyName: {
+								mode: 0,
+								value: Value{
+									kind:  valueString,
+									value: "trimEnd",
+								},
+							},
+						},
+						propertyOrder: []string{
+							propertyLength,
+							propertyName,
+						},
+						value: nativeFunctionObject{
+							name: "trimEnd",
+							call: builtinStringTrimEnd,
+						},
+					},
+				},
+			},
 			"toLocaleLowerCase": {
 			"toLocaleLowerCase": {
 				mode: 0o101,
 				mode: 0o101,
 				value: Value{
 				value: Value{
@@ -2802,6 +2914,8 @@ func (rt *runtime) newContext() {
 			"trim",
 			"trim",
 			"trimLeft",
 			"trimLeft",
 			"trimRight",
 			"trimRight",
+			"trimStart",
+			"trimEnd",
 			"toLocaleLowerCase",
 			"toLocaleLowerCase",
 			"toLocaleUpperCase",
 			"toLocaleUpperCase",
 			"toLowerCase",
 			"toLowerCase",

+ 7 - 10
vendor/github.com/robertkrimen/otto/object.go

@@ -1,17 +1,14 @@
 package otto
 package otto
 
 
 type object struct {
 type object struct {
-	runtime *runtime
-
-	class       string
-	objectClass *objectClass
-	value       interface{}
-
-	prototype  *object
-	extensible bool
-
+	value         interface{}
+	runtime       *runtime
+	objectClass   *objectClass
+	prototype     *object
 	property      map[string]property
 	property      map[string]property
+	class         string
 	propertyOrder []string
 	propertyOrder []string
+	extensible    bool
 }
 }
 
 
 func newObject(rt *runtime, class string) *object {
 func newObject(rt *runtime, class string) *object {
@@ -101,7 +98,7 @@ func (o *object) String() string {
 	return o.DefaultValue(defaultValueHintString).string()
 	return o.DefaultValue(defaultValueHintString).string()
 }
 }
 
 
-func (o *object) defineProperty(name string, value Value, mode propertyMode, throw bool) bool { //nolint: unparam
+func (o *object) defineProperty(name string, value Value, mode propertyMode, throw bool) bool { //nolint:unparam
 	return o.defineOwnProperty(name, property{value, mode}, throw)
 	return o.defineOwnProperty(name, property{value, mode}, throw)
 }
 }
 
 

+ 1 - 1
vendor/github.com/robertkrimen/otto/object_class.go

@@ -198,7 +198,7 @@ func objectCanPut(obj *object, name string) bool {
 	return canPut
 	return canPut
 }
 }
 
 
-func objectCanPutDetails(obj *object, name string) (canPut bool, prop *property, setter *object) { //nolint: nonamedreturns
+func objectCanPutDetails(obj *object, name string) (canPut bool, prop *property, setter *object) { //nolint:nonamedreturns
 	prop = obj.getOwnProperty(name)
 	prop = obj.getOwnProperty(name)
 	if prop != nil {
 	if prop != nil {
 		switch propertyValue := prop.value.(type) {
 		switch propertyValue := prop.value.(type) {

+ 12 - 13
vendor/github.com/robertkrimen/otto/otto.go

@@ -221,7 +221,7 @@ package otto
 
 
 import (
 import (
 	"encoding/json"
 	"encoding/json"
-	"fmt"
+	"errors"
 	"strings"
 	"strings"
 
 
 	"github.com/robertkrimen/otto/file"
 	"github.com/robertkrimen/otto/file"
@@ -417,13 +417,13 @@ func (o Otto) MakeTypeError(message string) Value {
 // Context is a structure that contains information about the current execution
 // Context is a structure that contains information about the current execution
 // context.
 // context.
 type Context struct {
 type Context struct {
+	This       Value
+	Symbols    map[string]Value
 	Filename   string
 	Filename   string
-	Line       int
-	Column     int
 	Callee     string
 	Callee     string
-	Symbols    map[string]Value
-	This       Value
 	Stacktrace []string
 	Stacktrace []string
+	Line       int
+	Column     int
 }
 }
 
 
 // Context returns the current execution context of the vm, traversing up to
 // Context returns the current execution context of the vm, traversing up to
@@ -552,12 +552,11 @@ func (o Otto) Call(source string, this interface{}, argumentList ...interface{})
 		program, err := o.runtime.cmplParse("", source+"()", nil)
 		program, err := o.runtime.cmplParse("", source+"()", nil)
 		if err == nil {
 		if err == nil {
 			if node, ok := program.body[0].(*nodeExpressionStatement); ok {
 			if node, ok := program.body[0].(*nodeExpressionStatement); ok {
-				if node, ok := node.expression.(*nodeCallExpression); ok {
+				if node, ok2 := node.expression.(*nodeCallExpression); ok2 {
 					var value Value
 					var value Value
-					err := catchPanic(func() {
+					if err = catchPanic(func() {
 						value = o.runtime.cmplEvaluateNodeCallExpression(node, argumentList)
 						value = o.runtime.cmplEvaluateNodeCallExpression(node, argumentList)
-					})
-					if err != nil {
+					}); err != nil {
 						return Value{}, err
 						return Value{}, err
 					}
 					}
 					return value, nil
 					return value, nil
@@ -579,9 +578,9 @@ func (o Otto) Call(source string, this interface{}, argumentList ...interface{})
 	}
 	}
 
 
 	if construct {
 	if construct {
-		result, err := fn.constructSafe(o.runtime, val, argumentList...)
-		if err != nil {
-			return Value{}, err
+		result, err2 := fn.constructSafe(o.runtime, val, argumentList...)
+		if err2 != nil {
+			return Value{}, err2
 		}
 		}
 		return result, nil
 		return result, nil
 	}
 	}
@@ -618,7 +617,7 @@ func (o Otto) Object(source string) (*Object, error) {
 	if value.IsObject() {
 	if value.IsObject() {
 		return value.Object(), nil
 		return value.Object(), nil
 	}
 	}
-	return nil, fmt.Errorf("value is not an object")
+	return nil, errors.New("value is not an object")
 }
 }
 
 
 // ToValue will convert an interface{} value to a value digestible by otto/JavaScript.
 // ToValue will convert an interface{} value to a value digestible by otto/JavaScript.

+ 4 - 4
vendor/github.com/robertkrimen/otto/otto_.go

@@ -95,7 +95,7 @@ func valueToRangeIndex(indexValue Value, length int64, negativeIsZero bool) int6
 	return index
 	return index
 }
 }
 
 
-func rangeStartEnd(array []Value, size int64, negativeIsZero bool) (start, end int64) { //nolint: nonamedreturns
+func rangeStartEnd(array []Value, size int64, negativeIsZero bool) (start, end int64) { //nolint:nonamedreturns
 	start = valueToRangeIndex(valueOfArrayIndex(array, 0), size, negativeIsZero)
 	start = valueToRangeIndex(valueOfArrayIndex(array, 0), size, negativeIsZero)
 	if len(array) == 1 {
 	if len(array) == 1 {
 		// If there is only the start argument, then end = size
 		// If there is only the start argument, then end = size
@@ -113,7 +113,7 @@ func rangeStartEnd(array []Value, size int64, negativeIsZero bool) (start, end i
 	return
 	return
 }
 }
 
 
-func rangeStartLength(source []Value, size int64) (start, length int64) { //nolint: nonamedreturns
+func rangeStartLength(source []Value, size int64) (start, length int64) { //nolint:nonamedreturns
 	start = valueToRangeIndex(valueOfArrayIndex(source, 0), size, false)
 	start = valueToRangeIndex(valueOfArrayIndex(source, 0), size, false)
 
 
 	// Assume the second argument is missing or undefined
 	// Assume the second argument is missing or undefined
@@ -132,9 +132,9 @@ func rangeStartLength(source []Value, size int64) (start, length int64) { //noli
 }
 }
 
 
 func hereBeDragons(arguments ...interface{}) string {
 func hereBeDragons(arguments ...interface{}) string {
-	pc, _, _, _ := goruntime.Caller(1) //nolint: dogsled
+	pc, _, _, _ := goruntime.Caller(1) //nolint:dogsled
 	name := goruntime.FuncForPC(pc).Name()
 	name := goruntime.FuncForPC(pc).Name()
-	message := fmt.Sprintf("Here be dragons -- %s", name)
+	message := "Here be dragons -- " + name
 	if len(arguments) > 0 {
 	if len(arguments) > 0 {
 		message += ": "
 		message += ": "
 		argument0 := fmt.Sprintf("%s", arguments[0])
 		argument0 := fmt.Sprintf("%s", arguments[0])

+ 3 - 3
vendor/github.com/robertkrimen/otto/parser/error.go

@@ -49,8 +49,8 @@ const (
 
 
 // An Error represents a parsing error. It includes the position where the error occurred and a message/description.
 // An Error represents a parsing error. It includes the position where the error occurred and a message/description.
 type Error struct {
 type Error struct {
-	Position file.Position
 	Message  string
 	Message  string
+	Position file.Position
 }
 }
 
 
 // FIXME Should this be "SyntaxError"?
 // FIXME Should this be "SyntaxError"?
@@ -120,11 +120,11 @@ func (p *parser) errorUnexpectedToken(tkn token.Token) {
 }
 }
 
 
 // ErrorList is a list of *Errors.
 // ErrorList is a list of *Errors.
-type ErrorList []*Error //nolint: errname
+type ErrorList []*Error //nolint:errname
 
 
 // Add adds an Error with given position and message to an ErrorList.
 // Add adds an Error with given position and message to an ErrorList.
 func (el *ErrorList) Add(position file.Position, msg string) {
 func (el *ErrorList) Add(position file.Position, msg string) {
-	*el = append(*el, &Error{position, msg})
+	*el = append(*el, &Error{Position: position, Message: msg})
 }
 }
 
 
 // Reset resets an ErrorList to no errors.
 // Reset resets an ErrorList to no errors.

+ 16 - 18
vendor/github.com/robertkrimen/otto/parser/expression.go

@@ -136,8 +136,8 @@ func (p *parser) parseRegExpLiteral() *ast.RegExpLiteral {
 	flags := ""
 	flags := ""
 	if p.token == token.IDENTIFIER { // gim
 	if p.token == token.IDENTIFIER { // gim
 		flags = p.literal
 		flags = p.literal
+		endOffset = p.chrOffset
 		p.next()
 		p.next()
-		endOffset = p.chrOffset - 1
 	}
 	}
 
 
 	var value string
 	var value string
@@ -268,7 +268,7 @@ func (p *parser) parseObjectProperty() ast.Property {
 	literal, value := p.parseObjectPropertyKey()
 	literal, value := p.parseObjectPropertyKey()
 	if literal == "get" && p.token != token.COLON {
 	if literal == "get" && p.token != token.COLON {
 		idx := p.idx
 		idx := p.idx
-		_, value := p.parseObjectPropertyKey()
+		_, value = p.parseObjectPropertyKey()
 		parameterList := p.parseFunctionParameterList()
 		parameterList := p.parseFunctionParameterList()
 
 
 		node := &ast.FunctionLiteral{
 		node := &ast.FunctionLiteral{
@@ -283,7 +283,7 @@ func (p *parser) parseObjectProperty() ast.Property {
 		}
 		}
 	} else if literal == "set" && p.token != token.COLON {
 	} else if literal == "set" && p.token != token.COLON {
 		idx := p.idx
 		idx := p.idx
-		_, value := p.parseObjectPropertyKey()
+		_, value = p.parseObjectPropertyKey()
 		parameterList := p.parseFunctionParameterList()
 		parameterList := p.parseFunctionParameterList()
 
 
 		node := &ast.FunctionLiteral{
 		node := &ast.FunctionLiteral{
@@ -379,26 +379,24 @@ func (p *parser) parseArrayLiteral() ast.Expression {
 	}
 	}
 }
 }
 
 
-func (p *parser) parseArgumentList() (argumentList []ast.Expression, idx0, idx1 file.Idx) { //nolint: nonamedreturns
+func (p *parser) parseArgumentList() (argumentList []ast.Expression, idx0, idx1 file.Idx) { //nolint:nonamedreturns
 	if p.mode&StoreComments != 0 {
 	if p.mode&StoreComments != 0 {
 		p.comments.Unset()
 		p.comments.Unset()
 	}
 	}
 	idx0 = p.expect(token.LEFT_PARENTHESIS)
 	idx0 = p.expect(token.LEFT_PARENTHESIS)
-	if p.token != token.RIGHT_PARENTHESIS {
-		for {
-			exp := p.parseAssignmentExpression()
-			if p.mode&StoreComments != 0 {
-				p.comments.SetExpression(exp)
-			}
-			argumentList = append(argumentList, exp)
-			if p.token != token.COMMA {
-				break
-			}
-			if p.mode&StoreComments != 0 {
-				p.comments.Unset()
-			}
-			p.next()
+	for p.token != token.RIGHT_PARENTHESIS {
+		exp := p.parseAssignmentExpression()
+		if p.mode&StoreComments != 0 {
+			p.comments.SetExpression(exp)
+		}
+		argumentList = append(argumentList, exp)
+		if p.token != token.COMMA {
+			break
 		}
 		}
+		if p.mode&StoreComments != 0 {
+			p.comments.Unset()
+		}
+		p.next()
 	}
 	}
 	if p.mode&StoreComments != 0 {
 	if p.mode&StoreComments != 0 {
 		p.comments.Unset()
 		p.comments.Unset()

+ 66 - 19
vendor/github.com/robertkrimen/otto/parser/lexer.go

@@ -15,7 +15,7 @@ import (
 	"github.com/robertkrimen/otto/token"
 	"github.com/robertkrimen/otto/token"
 )
 )
 
 
-type chr struct { //nolint: unused
+type chr struct { //nolint:unused
 	value rune
 	value rune
 	width int
 	width int
 }
 }
@@ -38,6 +38,53 @@ func digitValue(chr rune) int {
 	return 16 // Larger than any legal digit value
 	return 16 // Larger than any legal digit value
 }
 }
 
 
+// See https://www.unicode.org/reports/tr31/ for reference on ID_Start and ID_Continue.
+var includeIDStart = []*unicode.RangeTable{
+	unicode.Lu,
+	unicode.Ll,
+	unicode.Lt,
+	unicode.Lm,
+	unicode.Lo,
+	unicode.Nl,
+	unicode.Other_ID_Start,
+}
+
+var includeIDContinue = []*unicode.RangeTable{
+	unicode.Lu,
+	unicode.Ll,
+	unicode.Lt,
+	unicode.Lm,
+	unicode.Lo,
+	unicode.Nl,
+	unicode.Other_ID_Start,
+	unicode.Mn,
+	unicode.Mc,
+	unicode.Nd,
+	unicode.Pc,
+	unicode.Other_ID_Continue,
+}
+
+var exclude = []*unicode.RangeTable{
+	unicode.Pattern_Syntax,
+	unicode.Pattern_White_Space,
+}
+
+func unicodeIDStart(r rune) bool {
+	if unicode.In(r, exclude...) {
+		return false
+	}
+
+	return unicode.In(r, includeIDStart...)
+}
+
+func unicodeIDContinue(r rune) bool {
+	if unicode.In(r, exclude...) {
+		return false
+	}
+
+	return unicode.In(r, includeIDContinue...)
+}
+
 func isDigit(chr rune, base int) bool {
 func isDigit(chr rune, base int) bool {
 	return digitValue(chr) < base
 	return digitValue(chr) < base
 }
 }
@@ -45,14 +92,14 @@ func isDigit(chr rune, base int) bool {
 func isIdentifierStart(chr rune) bool {
 func isIdentifierStart(chr rune) bool {
 	return chr == '$' || chr == '_' || chr == '\\' ||
 	return chr == '$' || chr == '_' || chr == '\\' ||
 		'a' <= chr && chr <= 'z' || 'A' <= chr && chr <= 'Z' ||
 		'a' <= chr && chr <= 'z' || 'A' <= chr && chr <= 'Z' ||
-		chr >= utf8.RuneSelf && unicode.IsLetter(chr)
+		chr >= utf8.RuneSelf && unicodeIDStart(chr)
 }
 }
 
 
 func isIdentifierPart(chr rune) bool {
 func isIdentifierPart(chr rune) bool {
 	return chr == '$' || chr == '_' || chr == '\\' ||
 	return chr == '$' || chr == '_' || chr == '\\' ||
 		'a' <= chr && chr <= 'z' || 'A' <= chr && chr <= 'Z' ||
 		'a' <= chr && chr <= 'z' || 'A' <= chr && chr <= 'Z' ||
 		'0' <= chr && chr <= '9' ||
 		'0' <= chr && chr <= '9' ||
-		chr >= utf8.RuneSelf && (unicode.IsLetter(chr) || unicode.IsDigit(chr))
+		chr >= utf8.RuneSelf && unicodeIDContinue(chr)
 }
 }
 
 
 func (p *parser) scanIdentifier() (string, error) {
 func (p *parser) scanIdentifier() (string, error) {
@@ -67,7 +114,7 @@ func (p *parser) scanIdentifier() (string, error) {
 			}
 			}
 			parse = true
 			parse = true
 			var value rune
 			var value rune
-			for j := 0; j < 4; j++ {
+			for range 4 {
 				p.read()
 				p.read()
 				decimal, ok := hex2decimal(byte(p.chr))
 				decimal, ok := hex2decimal(byte(p.chr))
 				if !ok {
 				if !ok {
@@ -98,7 +145,7 @@ func (p *parser) scanIdentifier() (string, error) {
 }
 }
 
 
 // 7.2.
 // 7.2.
-func isLineWhiteSpace(chr rune) bool { //nolint: unused, deadcode
+func isLineWhiteSpace(chr rune) bool { //nolint:unused, deadcode
 	switch chr {
 	switch chr {
 	case '\u0009', '\u000b', '\u000c', '\u0020', '\u00a0', '\ufeff':
 	case '\u0009', '\u000b', '\u000c', '\u0020', '\u00a0', '\ufeff':
 		return true
 		return true
@@ -119,7 +166,7 @@ func isLineTerminator(chr rune) bool {
 	return false
 	return false
 }
 }
 
 
-func (p *parser) scan() (tkn token.Token, literal string, idx file.Idx) { //nolint: nonamedreturns
+func (p *parser) scan() (tkn token.Token, literal string, idx file.Idx) { //nolint:nonamedreturns
 	p.implicitSemicolon = false
 	p.implicitSemicolon = false
 
 
 	for {
 	for {
@@ -236,16 +283,16 @@ func (p *parser) scan() (tkn token.Token, literal string, idx file.Idx) { //noli
 				switch p.chr {
 				switch p.chr {
 				case '/':
 				case '/':
 					if p.mode&StoreComments != 0 {
 					if p.mode&StoreComments != 0 {
-						literal := string(p.readSingleLineComment())
-						p.comments.AddComment(ast.NewComment(literal, idx))
+						comment := string(p.readSingleLineComment())
+						p.comments.AddComment(ast.NewComment(comment, idx))
 						continue
 						continue
 					}
 					}
 					p.skipSingleLineComment()
 					p.skipSingleLineComment()
 					continue
 					continue
 				case '*':
 				case '*':
 					if p.mode&StoreComments != 0 {
 					if p.mode&StoreComments != 0 {
-						literal = string(p.readMultiLineComment())
-						p.comments.AddComment(ast.NewComment(literal, idx))
+						comment := string(p.readMultiLineComment())
+						p.comments.AddComment(ast.NewComment(comment, idx))
 						continue
 						continue
 					}
 					}
 					p.skipMultiLineComment()
 					p.skipMultiLineComment()
@@ -366,7 +413,7 @@ func (p *parser) switch6(tkn0, tkn1 token.Token, chr2 rune, tkn2, tkn3 token.Tok
 	return tkn0
 	return tkn0
 }
 }
 
 
-func (p *parser) chrAt(index int) chr { //nolint: unused
+func (p *parser) chrAt(index int) chr { //nolint:unused
 	value, width := utf8.DecodeRuneInString(p.str[index:])
 	value, width := utf8.DecodeRuneInString(p.str[index:])
 	return chr{
 	return chr{
 		value: value,
 		value: value,
@@ -611,7 +658,7 @@ func hex2decimal(chr byte) (rune, bool) {
 	}
 	}
 }
 }
 
 
-func parseNumberLiteral(literal string) (value interface{}, err error) { //nolint: nonamedreturns
+func parseNumberLiteral(literal string) (value interface{}, err error) { //nolint:nonamedreturns
 	// TODO Is Uint okay? What about -MAX_UINT
 	// TODO Is Uint okay? What about -MAX_UINT
 	value, err = strconv.ParseInt(literal, 0, 64)
 	value, err = strconv.ParseInt(literal, 0, 64)
 	if err == nil {
 	if err == nil {
@@ -717,7 +764,7 @@ func parseStringLiteral(literal string) (string, error) {
 				if len(str) < size {
 				if len(str) < size {
 					return "", fmt.Errorf("invalid escape: \\%s: len(%q) != %d", string(chr), str, size)
 					return "", fmt.Errorf("invalid escape: \\%s: len(%q) != %d", string(chr), str, size)
 				}
 				}
-				for j := 0; j < size; j++ {
+				for j := range size {
 					decimal, ok := hex2decimal(str[j])
 					decimal, ok := hex2decimal(str[j])
 					if !ok {
 					if !ok {
 						return "", fmt.Errorf("invalid escape: \\%s: %q", string(chr), str[:size])
 						return "", fmt.Errorf("invalid escape: \\%s: %q", string(chr), str[:size])
@@ -745,8 +792,8 @@ func parseStringLiteral(literal string) (string, error) {
 					if len(str) < j+1 {
 					if len(str) < j+1 {
 						break
 						break
 					}
 					}
-					chr := str[j]
-					if '0' > chr || chr > '7' {
+
+					if ch := str[j]; '0' > ch || ch > '7' {
 						break
 						break
 					}
 					}
 					decimal := rune(str[j]) - '0'
 					decimal := rune(str[j]) - '0'
@@ -787,7 +834,7 @@ func (p *parser) scanNumericLiteral(decimalPoint bool) (token.Token, string) {
 	}
 	}
 
 
 	if p.chr == '0' {
 	if p.chr == '0' {
-		offset := p.chrOffset
+		chrOffset := p.chrOffset
 		p.read()
 		p.read()
 		switch p.chr {
 		switch p.chr {
 		case 'x', 'X':
 		case 'x', 'X':
@@ -796,11 +843,11 @@ func (p *parser) scanNumericLiteral(decimalPoint bool) (token.Token, string) {
 			if isDigit(p.chr, 16) {
 			if isDigit(p.chr, 16) {
 				p.read()
 				p.read()
 			} else {
 			} else {
-				return token.ILLEGAL, p.str[offset:p.chrOffset]
+				return token.ILLEGAL, p.str[chrOffset:p.chrOffset]
 			}
 			}
 			p.scanMantissa(16)
 			p.scanMantissa(16)
 
 
-			if p.chrOffset-offset <= 2 {
+			if p.chrOffset-chrOffset <= 2 {
 				// Only "0x" or "0X"
 				// Only "0x" or "0X"
 				p.error(0, "Illegal hexadecimal number")
 				p.error(0, "Illegal hexadecimal number")
 			}
 			}
@@ -816,7 +863,7 @@ func (p *parser) scanNumericLiteral(decimalPoint bool) (token.Token, string) {
 			}
 			}
 			p.scanMantissa(8)
 			p.scanMantissa(8)
 			if p.chr == '8' || p.chr == '9' {
 			if p.chr == '8' || p.chr == '9' {
-				return token.ILLEGAL, p.str[offset:p.chrOffset]
+				return token.ILLEGAL, p.str[chrOffset:p.chrOffset]
 			}
 			}
 			goto octal
 			goto octal
 		}
 		}

+ 21 - 30
vendor/github.com/robertkrimen/otto/parser/parser.go

@@ -56,36 +56,27 @@ const (
 	StoreComments
 	StoreComments
 )
 )
 
 
-type parser struct { //nolint: maligned
-	str    string
-	length int
-	base   int
-
-	chr       rune // The current character
-	chrOffset int  // The offset of current character
-	offset    int  // The offset after current character (may be greater than 1)
-
-	idx     file.Idx    // The index of token
-	token   token.Token // The token
-	literal string      // The literal of the token, if any
-
-	scope             *scope
-	insertSemicolon   bool // If we see a newline, then insert an implicit semicolon
-	implicitSemicolon bool // An implicit semicolon exists
-
-	errors ErrorList
-
-	recover struct {
-		// Scratch when trying to seek to the next statement, etc.
+type parser struct {
+	comments *ast.Comments
+	file     *file.File
+	scope    *scope
+	literal  string
+	str      string
+	errors   ErrorList
+	recover  struct {
 		idx   file.Idx
 		idx   file.Idx
 		count int
 		count int
 	}
 	}
-
-	mode Mode
-
-	file *file.File
-
-	comments *ast.Comments
+	idx               file.Idx
+	token             token.Token
+	offset            int
+	chrOffset         int
+	mode              Mode
+	base              int
+	length            int
+	chr               rune
+	insertSemicolon   bool
+	implicitSemicolon bool // Scratch when trying to seek to the next statement, etc.
 }
 }
 
 
 // Parser is implemented by types which can parse JavaScript Code.
 // Parser is implemented by types which can parse JavaScript Code.
@@ -131,13 +122,13 @@ func ReadSource(filename string, src interface{}) ([]byte, error) {
 			return nil, fmt.Errorf("invalid src type %T", src)
 			return nil, fmt.Errorf("invalid src type %T", src)
 		}
 		}
 	}
 	}
-	return os.ReadFile(filename) //nolint: gosec
+	return os.ReadFile(filename) //nolint:gosec
 }
 }
 
 
 // ReadSourceMap reads the source map from src if not nil, otherwise is a noop.
 // ReadSourceMap reads the source map from src if not nil, otherwise is a noop.
 func ReadSourceMap(filename string, src interface{}) (*sourcemap.Consumer, error) {
 func ReadSourceMap(filename string, src interface{}) (*sourcemap.Consumer, error) {
 	if src == nil {
 	if src == nil {
-		return nil, nil //nolint: nilnil
+		return nil, nil //nolint:nilnil
 	}
 	}
 
 
 	switch src := src.(type) {
 	switch src := src.(type) {
@@ -173,7 +164,7 @@ func ParseFileWithSourceMap(fileSet *file.FileSet, filename string, javascriptSo
 		if bytes.HasPrefix(lastLine, []byte("//# sourceMappingURL=data:application/json")) {
 		if bytes.HasPrefix(lastLine, []byte("//# sourceMappingURL=data:application/json")) {
 			bits := bytes.SplitN(lastLine, []byte(","), 2)
 			bits := bytes.SplitN(lastLine, []byte(","), 2)
 			if len(bits) == 2 {
 			if len(bits) == 2 {
-				if d, err := base64.StdEncoding.DecodeString(string(bits[1])); err == nil {
+				if d, errDecode := base64.StdEncoding.DecodeString(string(bits[1])); errDecode == nil {
 					sourcemapSource = d
 					sourcemapSource = d
 				}
 				}
 			}
 			}

+ 11 - 14
vendor/github.com/robertkrimen/otto/parser/regexp.go

@@ -6,18 +6,15 @@ import (
 	"strconv"
 	"strconv"
 )
 )
 
 
-type regExpParser struct { //nolint: maligned
-	str    string
-	length int
-
-	chr       rune // The current character
-	chrOffset int  // The offset of current character
-	offset    int  // The offset after current character (may be greater than 1)
-
-	errors  []error
-	invalid bool // The input is an invalid JavaScript RegExp
-
-	goRegexp *bytes.Buffer
+type regExpParser struct {
+	goRegexp  *bytes.Buffer
+	str       string
+	errors    []error
+	length    int
+	chrOffset int
+	offset    int
+	chr       rune
+	invalid   bool
 }
 }
 
 
 // TransformRegExp transforms a JavaScript pattern into  a Go "regexp" pattern.
 // TransformRegExp transforms a JavaScript pattern into  a Go "regexp" pattern.
@@ -276,7 +273,7 @@ func (p *regExpParser) scanEscape(inClass bool) {
 			if err != nil {
 			if err != nil {
 				p.errors = append(p.errors, err)
 				p.errors = append(p.errors, err)
 			}
 			}
-		} else { //nolint: staticcheck
+		} else { //nolint:staticcheck
 			// Unescape the character for re2
 			// Unescape the character for re2
 		}
 		}
 		p.pass()
 		p.pass()
@@ -346,7 +343,7 @@ func (p *regExpParser) pass() {
 }
 }
 
 
 // TODO Better error reporting, use the offset, etc.
 // TODO Better error reporting, use the offset, etc.
-func (p *regExpParser) error(offset int, msg string, msgValues ...interface{}) { //nolint: unparam
+func (p *regExpParser) error(offset int, msg string, msgValues ...interface{}) { //nolint:unparam
 	err := fmt.Errorf(msg, msgValues...)
 	err := fmt.Errorf(msg, msgValues...)
 	p.errors = append(p.errors, err)
 	p.errors = append(p.errors, err)
 }
 }

+ 2 - 3
vendor/github.com/robertkrimen/otto/parser/scope.go

@@ -6,13 +6,12 @@ import (
 
 
 type scope struct {
 type scope struct {
 	outer           *scope
 	outer           *scope
+	declarationList []ast.Declaration
+	labels          []string
 	allowIn         bool
 	allowIn         bool
 	inIteration     bool
 	inIteration     bool
 	inSwitch        bool
 	inSwitch        bool
 	inFunction      bool
 	inFunction      bool
-	declarationList []ast.Declaration
-
-	labels []string
 }
 }
 
 
 func (p *parser) openScope() {
 func (p *parser) openScope() {

+ 3 - 3
vendor/github.com/robertkrimen/otto/parser/statement.go

@@ -39,7 +39,7 @@ func (p *parser) parseEmptyStatement() ast.Statement {
 	return &ast.EmptyStatement{Semicolon: idx}
 	return &ast.EmptyStatement{Semicolon: idx}
 }
 }
 
 
-func (p *parser) parseStatementList() (list []ast.Statement) { //nolint: nonamedreturns
+func (p *parser) parseStatementList() (list []ast.Statement) { //nolint:nonamedreturns
 	for p.token != token.RIGHT_BRACE && p.token != token.EOF {
 	for p.token != token.RIGHT_BRACE && p.token != token.EOF {
 		statement := p.parseStatement()
 		statement := p.parseStatement()
 		list = append(list, statement)
 		list = append(list, statement)
@@ -564,14 +564,14 @@ func (p *parser) parseForOrForInStatement() ast.Statement {
 		allowIn := p.scope.allowIn
 		allowIn := p.scope.allowIn
 		p.scope.allowIn = false
 		p.scope.allowIn = false
 		if p.token == token.VAR {
 		if p.token == token.VAR {
-			idx := p.idx
+			tokenIdx := p.idx
 			var varComments []*ast.Comment
 			var varComments []*ast.Comment
 			if p.mode&StoreComments != 0 {
 			if p.mode&StoreComments != 0 {
 				varComments = p.comments.FetchAll()
 				varComments = p.comments.FetchAll()
 				p.comments.Unset()
 				p.comments.Unset()
 			}
 			}
 			p.next()
 			p.next()
-			list := p.parseVariableDeclarationList(idx)
+			list := p.parseVariableDeclarationList(tokenIdx)
 			if len(list) == 1 && p.token == token.IN {
 			if len(list) == 1 && p.token == token.IN {
 				if p.mode&StoreComments != 0 {
 				if p.mode&StoreComments != 0 {
 					p.comments.Unset()
 					p.comments.Unset()

+ 10 - 10
vendor/github.com/robertkrimen/otto/property.go

@@ -69,11 +69,11 @@ func (p *property) configureOff() {
 	p.mode &= ^modeConfigureMask
 	p.mode &= ^modeConfigureMask
 }
 }
 
 
-func (p property) configureSet() bool { //nolint: unused
+func (p property) configureSet() bool { //nolint:unused
 	return p.mode&modeConfigureMask&modeSetMask == 0
 	return p.mode&modeConfigureMask&modeSetMask == 0
 }
 }
 
 
-func (p property) copy() *property { //nolint: unused
+func (p property) copy() *property { //nolint:unused
 	cpy := p
 	cpy := p
 	return &cpy
 	return &cpy
 }
 }
@@ -150,12 +150,12 @@ func toPropertyDescriptor(rt *runtime, value Value) property {
 	getterSetter := false
 	getterSetter := false
 
 
 	if objectDescriptor.hasProperty("get") {
 	if objectDescriptor.hasProperty("get") {
-		value := objectDescriptor.get("get")
-		if value.IsDefined() {
-			if !value.isCallable() {
+		val := objectDescriptor.get("get")
+		if val.IsDefined() {
+			if !val.isCallable() {
 				panic(rt.panicTypeError("toPropertyDescriptor get not callable"))
 				panic(rt.panicTypeError("toPropertyDescriptor get not callable"))
 			}
 			}
-			getter = value.object()
+			getter = val.object()
 			getterSetter = true
 			getterSetter = true
 		} else {
 		} else {
 			getter = &nilGetSetObject
 			getter = &nilGetSetObject
@@ -164,12 +164,12 @@ func toPropertyDescriptor(rt *runtime, value Value) property {
 	}
 	}
 
 
 	if objectDescriptor.hasProperty("set") {
 	if objectDescriptor.hasProperty("set") {
-		value := objectDescriptor.get("set")
-		if value.IsDefined() {
-			if !value.isCallable() {
+		val := objectDescriptor.get("set")
+		if val.IsDefined() {
+			if !val.isCallable() {
 				panic(rt.panicTypeError("toPropertyDescriptor set not callable"))
 				panic(rt.panicTypeError("toPropertyDescriptor set not callable"))
 			}
 			}
-			setter = value.object()
+			setter = val.object()
 			getterSetter = true
 			getterSetter = true
 		} else {
 		} else {
 			setter = &nilGetSetObject
 			setter = &nilGetSetObject

+ 1 - 1
vendor/github.com/robertkrimen/otto/registry/registry.go

@@ -7,8 +7,8 @@ var registry []*Entry = make([]*Entry, 0)
 
 
 // Entry represents a registry entry.
 // Entry represents a registry entry.
 type Entry struct {
 type Entry struct {
-	active bool
 	source func() string
 	source func() string
+	active bool
 }
 }
 
 
 // newEntry returns a new Entry for source.
 // newEntry returns a new Entry for source.

+ 4 - 4
vendor/github.com/robertkrimen/otto/result.go

@@ -10,19 +10,19 @@ const (
 )
 )
 
 
 type result struct {
 type result struct {
-	kind   resultKind
 	value  Value
 	value  Value
 	target string
 	target string
+	kind   resultKind
 }
 }
 
 
 func newReturnResult(value Value) result {
 func newReturnResult(value Value) result {
-	return result{resultReturn, value, ""}
+	return result{kind: resultReturn, value: value, target: ""}
 }
 }
 
 
 func newContinueResult(target string) result {
 func newContinueResult(target string) result {
-	return result{resultContinue, emptyValue, target}
+	return result{kind: resultContinue, value: emptyValue, target: target}
 }
 }
 
 
 func newBreakResult(target string) result {
 func newBreakResult(target string) result {
-	return result{resultBreak, emptyValue, target}
+	return result{kind: resultBreak, value: emptyValue, target: target}
 }
 }

+ 10 - 11
vendor/github.com/robertkrimen/otto/runtime.go

@@ -59,14 +59,13 @@ type runtime struct {
 	globalStash  *objectStash
 	globalStash  *objectStash
 	scope        *scope
 	scope        *scope
 	otto         *Otto
 	otto         *Otto
-	eval         *object // The builtin eval, for determine indirect versus direct invocation
+	eval         *object
 	debugger     func(*Otto)
 	debugger     func(*Otto)
 	random       func() float64
 	random       func() float64
+	labels       []string
 	stackLimit   int
 	stackLimit   int
 	traceLimit   int
 	traceLimit   int
-
-	labels []string // FIXME
-	lck    sync.Mutex
+	lck          sync.Mutex
 }
 }
 
 
 func (rt *runtime) enterScope(scop *scope) {
 func (rt *runtime) enterScope(scop *scope) {
@@ -116,7 +115,7 @@ func (rt *runtime) putValue(reference referencer, value Value) {
 	}
 	}
 }
 }
 
 
-func (rt *runtime) tryCatchEvaluate(inner func() Value) (tryValue Value, isException bool) { //nolint: nonamedreturns
+func (rt *runtime) tryCatchEvaluate(inner func() Value) (tryValue Value, isException bool) { //nolint:nonamedreturns
 	// resultValue = The value of the block (e.g. the last statement)
 	// resultValue = The value of the block (e.g. the last statement)
 	// throw = Something was thrown
 	// throw = Something was thrown
 	// throwValue = The value of what was thrown
 	// throwValue = The value of what was thrown
@@ -188,7 +187,7 @@ func checkObjectCoercible(rt *runtime, value Value) {
 }
 }
 
 
 // testObjectCoercible.
 // testObjectCoercible.
-func testObjectCoercible(value Value) (isObject, mustCoerce bool) { //nolint: nonamedreturns
+func testObjectCoercible(value Value) (isObject, mustCoerce bool) { //nolint:nonamedreturns
 	switch value.kind {
 	switch value.kind {
 	case valueReference, valueEmpty, valueNull, valueUndefined:
 	case valueReference, valueEmpty, valueNull, valueUndefined:
 		return false, false
 		return false, false
@@ -294,7 +293,7 @@ func fieldIndexByName(t reflect.Type, name string) []int {
 		t = t.Elem()
 		t = t.Elem()
 	}
 	}
 
 
-	for i := 0; i < t.NumField(); i++ {
+	for i := range t.NumField() {
 		f := t.Field(i)
 		f := t.Field(i)
 
 
 		if !validGoStructName(f.Name) {
 		if !validGoStructName(f.Name) {
@@ -431,7 +430,7 @@ func (rt *runtime) convertCallParameter(v Value, t reflect.Type) (reflect.Value,
 
 
 				switch o.class {
 				switch o.class {
 				case classArrayName:
 				case classArrayName:
-					for i := int64(0); i < l; i++ {
+					for i := range l {
 						p, ok := o.property[strconv.FormatInt(i, 10)]
 						p, ok := o.property[strconv.FormatInt(i, 10)]
 						if !ok {
 						if !ok {
 							continue
 							continue
@@ -458,7 +457,7 @@ func (rt *runtime) convertCallParameter(v Value, t reflect.Type) (reflect.Value,
 						gslice = false
 						gslice = false
 					}
 					}
 
 
-					for i := int64(0); i < l; i++ {
+					for i := range l {
 						var p *property
 						var p *property
 						if gslice {
 						if gslice {
 							p = goSliceGetOwnProperty(o, strconv.FormatInt(i, 10))
 							p = goSliceGetOwnProperty(o, strconv.FormatInt(i, 10))
@@ -510,7 +509,7 @@ func (rt *runtime) convertCallParameter(v Value, t reflect.Type) (reflect.Value,
 		}
 		}
 	case reflect.Func:
 	case reflect.Func:
 		if t.NumOut() > 1 {
 		if t.NumOut() > 1 {
-			return reflect.Zero(t), fmt.Errorf("converting JavaScript values to Go functions with more than one return value is currently not supported")
+			return reflect.Zero(t), errors.New("converting JavaScript values to Go functions with more than one return value is currently not supported")
 		}
 		}
 
 
 		if o := v.object(); o != nil && o.class == classFunctionName {
 		if o := v.object(); o != nil && o.class == classFunctionName {
@@ -602,7 +601,7 @@ func (rt *runtime) convertCallParameter(v Value, t reflect.Type) (reflect.Value,
 	if v.kind == valueString {
 	if v.kind == valueString {
 		var s encoding.TextUnmarshaler
 		var s encoding.TextUnmarshaler
 
 
-		if reflect.PtrTo(t).Implements(reflect.TypeOf(&s).Elem()) {
+		if reflect.PointerTo(t).Implements(reflect.TypeOf(&s).Elem()) {
 			r := reflect.New(t)
 			r := reflect.New(t)
 
 
 			if err := r.Interface().(encoding.TextUnmarshaler).UnmarshalText([]byte(v.string())); err != nil {
 			if err := r.Interface().(encoding.TextUnmarshaler).UnmarshalText([]byte(v.string())); err != nil {

+ 2 - 3
vendor/github.com/robertkrimen/otto/scope.go

@@ -5,11 +5,10 @@ type scope struct {
 	lexical  stasher
 	lexical  stasher
 	variable stasher
 	variable stasher
 	this     *object
 	this     *object
-	eval     bool // Replace this with kind?
 	outer    *scope
 	outer    *scope
+	frame    frame
 	depth    int
 	depth    int
-
-	frame frame
+	eval     bool
 }
 }
 
 
 func newScope(lexical stasher, variable stasher, this *object) *scope {
 func newScope(lexical stasher, variable stasher, this *object) *scope {

+ 1 - 1
vendor/github.com/robertkrimen/otto/script.go

@@ -83,7 +83,7 @@ func (s *Script) marshalBinary() ([]byte, error) {
 // will return an error.
 // will return an error.
 //
 //
 // The binary format can change at any time and should be considered unspecified and opaque.
 // The binary format can change at any time and should be considered unspecified and opaque.
-func (s *Script) unmarshalBinary(data []byte) (err error) { //nolint: nonamedreturns
+func (s *Script) unmarshalBinary(data []byte) (err error) { //nolint:nonamedreturns
 	decoder := gob.NewDecoder(bytes.NewReader(data))
 	decoder := gob.NewDecoder(bytes.NewReader(data))
 	defer func() {
 	defer func() {
 		if err != nil {
 		if err != nil {

+ 8 - 8
vendor/github.com/robertkrimen/otto/stash.go

@@ -6,19 +6,19 @@ import (
 
 
 // stasher is implemented by types which can stash data.
 // stasher is implemented by types which can stash data.
 type stasher interface {
 type stasher interface {
-	hasBinding(string) bool            //
-	createBinding(string, bool, Value) // CreateMutableBinding
-	setBinding(string, Value, bool)    // SetMutableBinding
-	getBinding(string, bool) Value     // GetBindingValue
-	deleteBinding(string) bool         //
-	setValue(string, Value, bool)      // createBinding + setBinding
+	hasBinding(name string) bool                            //
+	createBinding(name string, deletable bool, value Value) // CreateMutableBinding
+	setBinding(name string, value Value, strict bool)       // SetMutableBinding
+	getBinding(name string, throw bool) Value               // GetBindingValue
+	deleteBinding(name string) bool                         //
+	setValue(name string, value Value, throw bool)          // createBinding + setBinding
 
 
 	outer() stasher
 	outer() stasher
 	runtime() *runtime
 	runtime() *runtime
 
 
-	newReference(string, bool, at) referencer
+	newReference(name string, strict bool, atv at) referencer
 
 
-	clone(*cloner) stasher
+	clone(cloner *cloner) stasher
 }
 }
 
 
 type objectStash struct {
 type objectStash struct {

+ 4 - 4
vendor/github.com/robertkrimen/otto/token/token.go

@@ -57,11 +57,11 @@ type keyword struct {
 //	public
 //	public
 //	static
 //	static
 func IsKeyword(literal string) (Token, bool) {
 func IsKeyword(literal string) (Token, bool) {
-	if keyword, exists := keywordTable[literal]; exists {
-		if keyword.futureKeyword {
-			return KEYWORD, keyword.strict
+	if kw, exists := keywordTable[literal]; exists {
+		if kw.futureKeyword {
+			return KEYWORD, kw.strict
 		}
 		}
-		return keyword.token, false
+		return kw.token, false
 	}
 	}
 	return 0, false
 	return 0, false
 }
 }

+ 4 - 10
vendor/github.com/robertkrimen/otto/type_arguments.go

@@ -26,29 +26,23 @@ func (rt *runtime) newArgumentsObject(indexOfParameterName []string, stash stash
 }
 }
 
 
 type argumentsObject struct {
 type argumentsObject struct {
+	stash                stasher
 	indexOfParameterName []string
 	indexOfParameterName []string
-	// function(abc, def, ghi)
-	// indexOfParameterName[0] = "abc"
-	// indexOfParameterName[1] = "def"
-	// indexOfParameterName[2] = "ghi"
-	// ...
-	stash stasher
 }
 }
 
 
 func (o argumentsObject) clone(c *cloner) argumentsObject {
 func (o argumentsObject) clone(c *cloner) argumentsObject {
 	indexOfParameterName := make([]string, len(o.indexOfParameterName))
 	indexOfParameterName := make([]string, len(o.indexOfParameterName))
 	copy(indexOfParameterName, o.indexOfParameterName)
 	copy(indexOfParameterName, o.indexOfParameterName)
 	return argumentsObject{
 	return argumentsObject{
-		indexOfParameterName,
-		c.stash(o.stash),
+		indexOfParameterName: indexOfParameterName,
+		stash:                c.stash(o.stash),
 	}
 	}
 }
 }
 
 
 func (o argumentsObject) get(name string) (Value, bool) {
 func (o argumentsObject) get(name string) (Value, bool) {
 	index := stringToArrayIndex(name)
 	index := stringToArrayIndex(name)
 	if index >= 0 && index < int64(len(o.indexOfParameterName)) {
 	if index >= 0 && index < int64(len(o.indexOfParameterName)) {
-		name := o.indexOfParameterName[index]
-		if name == "" {
+		if name = o.indexOfParameterName[index]; name == "" {
 			return Value{}, false
 			return Value{}, false
 		}
 		}
 		return o.stash.getBinding(name, false), true
 		return o.stash.getBinding(name, false), true

+ 11 - 11
vendor/github.com/robertkrimen/otto/type_date.go

@@ -8,9 +8,9 @@ import (
 )
 )
 
 
 type dateObject struct {
 type dateObject struct {
-	time  Time.Time // Time from the "time" package, a cached version of time
-	epoch int64
+	time  Time.Time
 	value Value
 	value Value
+	epoch int64
 	isNaN bool
 	isNaN bool
 }
 }
 
 
@@ -22,6 +22,7 @@ var invalidDateObject = dateObject{
 }
 }
 
 
 type ecmaTime struct {
 type ecmaTime struct {
+	location    *Time.Location
 	year        int
 	year        int
 	month       int
 	month       int
 	day         int
 	day         int
@@ -29,19 +30,18 @@ type ecmaTime struct {
 	minute      int
 	minute      int
 	second      int
 	second      int
 	millisecond int
 	millisecond int
-	location    *Time.Location // Basically, either local or UTC
 }
 }
 
 
 func newEcmaTime(goTime Time.Time) ecmaTime {
 func newEcmaTime(goTime Time.Time) ecmaTime {
 	return ecmaTime{
 	return ecmaTime{
-		goTime.Year(),
-		dateFromGoMonth(goTime.Month()),
-		goTime.Day(),
-		goTime.Hour(),
-		goTime.Minute(),
-		goTime.Second(),
-		goTime.Nanosecond() / (100 * 100 * 100),
-		goTime.Location(),
+		year:        goTime.Year(),
+		month:       dateFromGoMonth(goTime.Month()),
+		day:         goTime.Day(),
+		hour:        goTime.Hour(),
+		minute:      goTime.Minute(),
+		second:      goTime.Second(),
+		millisecond: goTime.Nanosecond() / (100 * 100 * 100),
+		location:    goTime.Location(),
 	}
 	}
 }
 }
 
 

+ 7 - 8
vendor/github.com/robertkrimen/otto/type_function.go

@@ -27,11 +27,11 @@ type nativeFunction func(FunctionCall) Value
 
 
 // nativeFunctionObject.
 // nativeFunctionObject.
 type nativeFunctionObject struct {
 type nativeFunctionObject struct {
+	call      nativeFunction
+	construct constructFunction
 	name      string
 	name      string
 	file      string
 	file      string
 	line      int
 	line      int
-	call      nativeFunction    // [[Call]]
-	construct constructFunction // [[Construct]]
 }
 }
 
 
 func (rt *runtime) newNativeFunctionProperty(name, file string, line int, native nativeFunction, length int) *object {
 func (rt *runtime) newNativeFunctionProperty(name, file string, line int, native nativeFunction, length int) *object {
@@ -162,7 +162,7 @@ func (o *object) isCall() bool {
 	}
 	}
 }
 }
 
 
-func (o *object) call(this Value, argumentList []Value, eval bool, frm frame) Value { //nolint: unparam // Isn't currently used except in recursive self.
+func (o *object) call(this Value, argumentList []Value, eval bool, frm frame) Value { //nolint:unparam // Isn't currently used except in recursive self.
 	switch fn := o.value.(type) {
 	switch fn := o.value.(type) {
 	case nativeFunctionObject:
 	case nativeFunctionObject:
 		// Since eval is a native function, we only have to check for it here
 		// Since eval is a native function, we only have to check for it here
@@ -270,13 +270,12 @@ func (o *object) hasInstance(of Value) bool {
 
 
 // FunctionCall is an encapsulation of a JavaScript function call.
 // FunctionCall is an encapsulation of a JavaScript function call.
 type FunctionCall struct {
 type FunctionCall struct {
-	runtime *runtime
-	thisObj *object
-	eval    bool // This call is a direct call to eval
-
 	This         Value
 	This         Value
-	ArgumentList []Value
+	runtime      *runtime
+	thisObj      *object
 	Otto         *Otto
 	Otto         *Otto
+	ArgumentList []Value
+	eval         bool
 }
 }
 
 
 // Argument will return the value of the argument at the given index.
 // Argument will return the value of the argument at the given index.

+ 3 - 3
vendor/github.com/robertkrimen/otto/type_go_array.go

@@ -33,7 +33,7 @@ func newGoArrayObject(value reflect.Value) *goArrayObject {
 	}
 	}
 }
 }
 
 
-func (o goArrayObject) getValue(name string) (reflect.Value, bool) { //nolint: unused
+func (o goArrayObject) getValue(name string) (reflect.Value, bool) { //nolint:unused
 	if index, err := strconv.ParseInt(name, 10, 64); err != nil {
 	if index, err := strconv.ParseInt(name, 10, 64); err != nil {
 		v, ok := o.getValueIndex(index)
 		v, ok := o.getValueIndex(index)
 		if ok {
 		if ok {
@@ -41,7 +41,7 @@ func (o goArrayObject) getValue(name string) (reflect.Value, bool) { //nolint: u
 		}
 		}
 	}
 	}
 
 
-	if m := o.value.MethodByName(name); m != (reflect.Value{}) {
+	if m := o.value.MethodByName(name); m.IsValid() {
 		return m, true
 		return m, true
 	}
 	}
 
 
@@ -93,7 +93,7 @@ func goArrayGetOwnProperty(obj *object, name string) *property {
 		}
 		}
 	}
 	}
 
 
-	if method := obj.value.(*goArrayObject).value.MethodByName(name); method != (reflect.Value{}) {
+	if method := obj.value.(*goArrayObject).value.MethodByName(name); method.IsValid() {
 		return &property{
 		return &property{
 			obj.runtime.toValue(method.Interface()),
 			obj.runtime.toValue(method.Interface()),
 			0o110,
 			0o110,

+ 1 - 1
vendor/github.com/robertkrimen/otto/type_go_map.go

@@ -13,9 +13,9 @@ func (rt *runtime) newGoMapObject(value reflect.Value) *object {
 }
 }
 
 
 type goMapObject struct {
 type goMapObject struct {
-	value     reflect.Value
 	keyType   reflect.Type
 	keyType   reflect.Type
 	valueType reflect.Type
 	valueType reflect.Type
+	value     reflect.Value
 }
 }
 
 
 func newGoMapObject(value reflect.Value) *goMapObject {
 func newGoMapObject(value reflect.Value) *goMapObject {

+ 4 - 4
vendor/github.com/robertkrimen/otto/type_go_struct.go

@@ -53,11 +53,11 @@ func (o goStructObject) getValue(name string) reflect.Value {
 	return reflect.Value{}
 	return reflect.Value{}
 }
 }
 
 
-func (o goStructObject) fieldIndex(name string) []int { //nolint: unused
+func (o goStructObject) fieldIndex(name string) []int { //nolint:unused
 	return fieldIndexByName(reflect.Indirect(o.value).Type(), name)
 	return fieldIndexByName(reflect.Indirect(o.value).Type(), name)
 }
 }
 
 
-func (o goStructObject) method(name string) (reflect.Method, bool) { //nolint: unused
+func (o goStructObject) method(name string) (reflect.Method, bool) { //nolint:unused
 	return reflect.Indirect(o.value).Type().MethodByName(name)
 	return reflect.Indirect(o.value).Type().MethodByName(name)
 }
 }
 
 
@@ -97,7 +97,7 @@ func goStructEnumerate(obj *object, all bool, each func(string) bool) {
 	goObj := obj.value.(*goStructObject)
 	goObj := obj.value.(*goStructObject)
 
 
 	// Enumerate fields
 	// Enumerate fields
-	for index := 0; index < reflect.Indirect(goObj.value).NumField(); index++ {
+	for index := range reflect.Indirect(goObj.value).NumField() {
 		name := reflect.Indirect(goObj.value).Type().Field(index).Name
 		name := reflect.Indirect(goObj.value).Type().Field(index).Name
 		if validGoStructName(name) {
 		if validGoStructName(name) {
 			if !each(name) {
 			if !each(name) {
@@ -107,7 +107,7 @@ func goStructEnumerate(obj *object, all bool, each func(string) bool) {
 	}
 	}
 
 
 	// Enumerate methods
 	// Enumerate methods
-	for index := 0; index < goObj.value.NumMethod(); index++ {
+	for index := range goObj.value.NumMethod() {
 		name := goObj.value.Type().Method(index).Name
 		name := goObj.value.Type().Method(index).Name
 		if validGoStructName(name) {
 		if validGoStructName(name) {
 			if !each(name) {
 			if !each(name) {

+ 6 - 6
vendor/github.com/robertkrimen/otto/type_reference.go

@@ -1,20 +1,20 @@
 package otto
 package otto
 
 
 type referencer interface {
 type referencer interface {
-	invalid() bool         // IsUnresolvableReference
-	getValue() Value       // getValue
-	putValue(Value) string // PutValue
+	invalid() bool               // IsUnresolvableReference
+	getValue() Value             // getValue
+	putValue(value Value) string // PutValue
 	delete() bool
 	delete() bool
 }
 }
 
 
 // PropertyReference
 // PropertyReference
 
 
 type propertyReference struct {
 type propertyReference struct {
-	name    string
-	strict  bool
 	base    *object
 	base    *object
 	runtime *runtime
 	runtime *runtime
+	name    string
 	at      at
 	at      at
+	strict  bool
 }
 }
 
 
 func newPropertyReference(rt *runtime, base *object, name string, strict bool, atv at) *propertyReference {
 func newPropertyReference(rt *runtime, base *object, name string, strict bool, atv at) *propertyReference {
@@ -55,9 +55,9 @@ func (pr *propertyReference) delete() bool {
 }
 }
 
 
 type stashReference struct {
 type stashReference struct {
+	base   stasher
 	name   string
 	name   string
 	strict bool
 	strict bool
-	base   stasher
 }
 }
 
 
 func (sr *stashReference) invalid() bool {
 func (sr *stashReference) invalid() bool {

+ 3 - 3
vendor/github.com/robertkrimen/otto/type_regexp.go

@@ -9,11 +9,11 @@ import (
 
 
 type regExpObject struct {
 type regExpObject struct {
 	regularExpression *regexp.Regexp
 	regularExpression *regexp.Regexp
+	source            string
+	flags             string
 	global            bool
 	global            bool
 	ignoreCase        bool
 	ignoreCase        bool
 	multiline         bool
 	multiline         bool
-	source            string
-	flags             string
 }
 }
 
 
 func (rt *runtime) newRegExpObject(pattern string, flags string) *object {
 func (rt *runtime) newRegExpObject(pattern string, flags string) *object {
@@ -124,7 +124,7 @@ func execRegExp(this *object, target string) (bool, []int) {
 func execResultToArray(rt *runtime, target string, result []int) *object {
 func execResultToArray(rt *runtime, target string, result []int) *object {
 	captureCount := len(result) / 2
 	captureCount := len(result) / 2
 	valueArray := make([]Value, captureCount)
 	valueArray := make([]Value, captureCount)
-	for index := 0; index < captureCount; index++ {
+	for index := range captureCount {
 		offset := 2 * index
 		offset := 2 * index
 		if result[offset] != -1 {
 		if result[offset] != -1 {
 			valueArray[index] = stringValue(target[result[offset]:result[offset+1]])
 			valueArray[index] = stringValue(target[result[offset]:result[offset+1]])

+ 3 - 3
vendor/github.com/robertkrimen/otto/type_string.go

@@ -8,7 +8,7 @@ import (
 
 
 type stringObjecter interface {
 type stringObjecter interface {
 	Length() int
 	Length() int
-	At(int) rune
+	At(at int) rune
 	String() string
 	String() string
 }
 }
 
 
@@ -50,7 +50,7 @@ func (str stringWide) String() string {
 }
 }
 
 
 func newStringObject(str string) stringObjecter {
 func newStringObject(str string) stringObjecter {
-	for i := 0; i < len(str); i++ {
+	for i := range len(str) {
 		if str[i] >= utf8.RuneSelf {
 		if str[i] >= utf8.RuneSelf {
 			goto wide
 			goto wide
 		}
 		}
@@ -91,7 +91,7 @@ func (o *object) stringValue() stringObjecter {
 func stringEnumerate(obj *object, all bool, each func(string) bool) {
 func stringEnumerate(obj *object, all bool, each func(string) bool) {
 	if str := obj.stringValue(); str != nil {
 	if str := obj.stringValue(); str != nil {
 		length := str.Length()
 		length := str.Length()
-		for index := 0; index < length; index++ {
+		for index := range length {
 			if !each(strconv.FormatInt(int64(index), 10)) {
 			if !each(strconv.FormatInt(int64(index), 10)) {
 				return
 				return
 			}
 			}

+ 52 - 52
vendor/github.com/robertkrimen/otto/value.go

@@ -27,8 +27,8 @@ const (
 
 
 // Value is the representation of a JavaScript value.
 // Value is the representation of a JavaScript value.
 type Value struct {
 type Value struct {
-	kind  valueKind
 	value interface{}
 	value interface{}
+	kind  valueKind
 }
 }
 
 
 func (v Value) safe() bool {
 func (v Value) safe() bool {
@@ -129,7 +129,7 @@ func (v Value) constructSafe(rt *runtime, this Value, argumentList ...interface{
 	return result, err
 	return result, err
 }
 }
 
 
-func (v Value) construct(rt *runtime, this Value, argumentList ...interface{}) Value { //nolint: unparam
+func (v Value) construct(rt *runtime, this Value, argumentList ...interface{}) Value { //nolint:unparam
 	if fn, ok := v.value.(*object); ok {
 	if fn, ok := v.value.(*object); ok {
 		return fn.construct(fn.runtime.toValueArray(argumentList...))
 		return fn.construct(fn.runtime.toValueArray(argumentList...))
 	}
 	}
@@ -204,35 +204,35 @@ func (v Value) Class() string {
 	return v.value.(*object).class
 	return v.value.(*object).class
 }
 }
 
 
-func (v Value) isArray() bool { //nolint: unused
+func (v Value) isArray() bool { //nolint:unused
 	if v.kind != valueObject {
 	if v.kind != valueObject {
 		return false
 		return false
 	}
 	}
 	return isArray(v.value.(*object))
 	return isArray(v.value.(*object))
 }
 }
 
 
-func (v Value) isStringObject() bool { //nolint: unused
+func (v Value) isStringObject() bool { //nolint:unused
 	if v.kind != valueObject {
 	if v.kind != valueObject {
 		return false
 		return false
 	}
 	}
 	return v.value.(*object).class == classStringName
 	return v.value.(*object).class == classStringName
 }
 }
 
 
-func (v Value) isBooleanObject() bool { //nolint: unused
+func (v Value) isBooleanObject() bool { //nolint:unused
 	if v.kind != valueObject {
 	if v.kind != valueObject {
 		return false
 		return false
 	}
 	}
 	return v.value.(*object).class == classBooleanName
 	return v.value.(*object).class == classBooleanName
 }
 }
 
 
-func (v Value) isNumberObject() bool { //nolint: unused
+func (v Value) isNumberObject() bool { //nolint:unused
 	if v.kind != valueObject {
 	if v.kind != valueObject {
 		return false
 		return false
 	}
 	}
 	return v.value.(*object).class == classNumberName
 	return v.value.(*object).class == classNumberName
 }
 }
 
 
-func (v Value) isDate() bool { //nolint: unused
+func (v Value) isDate() bool { //nolint:unused
 	if v.kind != valueObject {
 	if v.kind != valueObject {
 		return false
 		return false
 	}
 	}
@@ -246,7 +246,7 @@ func (v Value) isRegExp() bool {
 	return v.value.(*object).class == classRegExpName
 	return v.value.(*object).class == classRegExpName
 }
 }
 
 
-func (v Value) isError() bool { //nolint: unused
+func (v Value) isError() bool { //nolint:unused
 	if v.kind != valueObject {
 	if v.kind != valueObject {
 		return false
 		return false
 	}
 	}
@@ -272,46 +272,46 @@ func toValue(value interface{}) Value {
 	case Value:
 	case Value:
 		return value
 		return value
 	case bool:
 	case bool:
-		return Value{valueBoolean, value}
+		return Value{kind: valueBoolean, value: value}
 	case int:
 	case int:
-		return Value{valueNumber, value}
+		return Value{kind: valueNumber, value: value}
 	case int8:
 	case int8:
-		return Value{valueNumber, value}
+		return Value{kind: valueNumber, value: value}
 	case int16:
 	case int16:
-		return Value{valueNumber, value}
+		return Value{kind: valueNumber, value: value}
 	case int32:
 	case int32:
-		return Value{valueNumber, value}
+		return Value{kind: valueNumber, value: value}
 	case int64:
 	case int64:
-		return Value{valueNumber, value}
+		return Value{kind: valueNumber, value: value}
 	case uint:
 	case uint:
-		return Value{valueNumber, value}
+		return Value{kind: valueNumber, value: value}
 	case uint8:
 	case uint8:
-		return Value{valueNumber, value}
+		return Value{kind: valueNumber, value: value}
 	case uint16:
 	case uint16:
-		return Value{valueNumber, value}
+		return Value{kind: valueNumber, value: value}
 	case uint32:
 	case uint32:
-		return Value{valueNumber, value}
+		return Value{kind: valueNumber, value: value}
 	case uint64:
 	case uint64:
-		return Value{valueNumber, value}
+		return Value{kind: valueNumber, value: value}
 	case float32:
 	case float32:
-		return Value{valueNumber, float64(value)}
+		return Value{kind: valueNumber, value: float64(value)}
 	case float64:
 	case float64:
-		return Value{valueNumber, value}
+		return Value{kind: valueNumber, value: value}
 	case []uint16:
 	case []uint16:
-		return Value{valueString, value}
+		return Value{kind: valueString, value: value}
 	case string:
 	case string:
-		return Value{valueString, value}
+		return Value{kind: valueString, value: value}
 	// A rune is actually an int32, which is handled above
 	// A rune is actually an int32, which is handled above
 	case *object:
 	case *object:
-		return Value{valueObject, value}
+		return Value{kind: valueObject, value: value}
 	case *Object:
 	case *Object:
-		return Value{valueObject, value.object}
+		return Value{kind: valueObject, value: value.object}
 	case Object:
 	case Object:
-		return Value{valueObject, value.object}
+		return Value{kind: valueObject, value: value.object}
 	case referencer: // reference is an interface (already a pointer)
 	case referencer: // reference is an interface (already a pointer)
-		return Value{valueReference, value}
+		return Value{kind: valueReference, value: value}
 	case result:
 	case result:
-		return Value{valueResult, value}
+		return Value{kind: valueResult, value: value}
 	case nil:
 	case nil:
 		// TODO Ugh.
 		// TODO Ugh.
 		return Value{}
 		return Value{}
@@ -329,33 +329,33 @@ func toValue(value interface{}) Value {
 		}
 		}
 		switch value.Kind() {
 		switch value.Kind() {
 		case reflect.Bool:
 		case reflect.Bool:
-			return Value{valueBoolean, value.Bool()}
+			return Value{kind: valueBoolean, value: value.Bool()}
 		case reflect.Int:
 		case reflect.Int:
-			return Value{valueNumber, int(value.Int())}
+			return Value{kind: valueNumber, value: int(value.Int())}
 		case reflect.Int8:
 		case reflect.Int8:
-			return Value{valueNumber, int8(value.Int())}
+			return Value{kind: valueNumber, value: int8(value.Int())}
 		case reflect.Int16:
 		case reflect.Int16:
-			return Value{valueNumber, int16(value.Int())}
+			return Value{kind: valueNumber, value: int16(value.Int())}
 		case reflect.Int32:
 		case reflect.Int32:
-			return Value{valueNumber, int32(value.Int())}
+			return Value{kind: valueNumber, value: int32(value.Int())}
 		case reflect.Int64:
 		case reflect.Int64:
-			return Value{valueNumber, value.Int()}
+			return Value{kind: valueNumber, value: value.Int()}
 		case reflect.Uint:
 		case reflect.Uint:
-			return Value{valueNumber, uint(value.Uint())}
+			return Value{kind: valueNumber, value: uint(value.Uint())}
 		case reflect.Uint8:
 		case reflect.Uint8:
-			return Value{valueNumber, uint8(value.Uint())}
+			return Value{kind: valueNumber, value: uint8(value.Uint())}
 		case reflect.Uint16:
 		case reflect.Uint16:
-			return Value{valueNumber, uint16(value.Uint())}
+			return Value{kind: valueNumber, value: uint16(value.Uint())}
 		case reflect.Uint32:
 		case reflect.Uint32:
-			return Value{valueNumber, uint32(value.Uint())}
+			return Value{kind: valueNumber, value: uint32(value.Uint())}
 		case reflect.Uint64:
 		case reflect.Uint64:
-			return Value{valueNumber, value.Uint()}
+			return Value{kind: valueNumber, value: value.Uint()}
 		case reflect.Float32:
 		case reflect.Float32:
-			return Value{valueNumber, float32(value.Float())}
+			return Value{kind: valueNumber, value: float32(value.Float())}
 		case reflect.Float64:
 		case reflect.Float64:
-			return Value{valueNumber, value.Float()}
+			return Value{kind: valueNumber, value: value.Float()}
 		case reflect.String:
 		case reflect.String:
-			return Value{valueString, value.String()}
+			return Value{kind: valueString, value: value.String()}
 		default:
 		default:
 			reflectValuePanic(value.Interface(), value.Kind())
 			reflectValuePanic(value.Interface(), value.Kind())
 		}
 		}
@@ -371,7 +371,7 @@ func toValue(value interface{}) Value {
 // This method will make return the empty string if there is an error.
 // This method will make return the empty string if there is an error.
 func (v Value) String() string {
 func (v Value) String() string {
 	var result string
 	var result string
-	catchPanic(func() { //nolint: errcheck, gosec
+	catchPanic(func() { //nolint:errcheck, gosec
 		result = v.string()
 		result = v.string()
 	})
 	})
 	return result
 	return result
@@ -398,7 +398,7 @@ func (v Value) numberValue() Value {
 	if v.kind == valueNumber {
 	if v.kind == valueNumber {
 		return v
 		return v
 	}
 	}
-	return Value{valueNumber, v.float64()}
+	return Value{kind: valueNumber, value: v.float64()}
 }
 }
 
 
 // ToFloat will convert the value to a number (float64).
 // ToFloat will convert the value to a number (float64).
@@ -494,23 +494,23 @@ var (
 //
 //
 //	ToValue(math.NaN())
 //	ToValue(math.NaN())
 func NaNValue() Value {
 func NaNValue() Value {
-	return Value{valueNumber, nan}
+	return Value{kind: valueNumber, value: nan}
 }
 }
 
 
 func positiveInfinityValue() Value {
 func positiveInfinityValue() Value {
-	return Value{valueNumber, positiveInfinity}
+	return Value{kind: valueNumber, value: positiveInfinity}
 }
 }
 
 
 func negativeInfinityValue() Value {
 func negativeInfinityValue() Value {
-	return Value{valueNumber, negativeInfinity}
+	return Value{kind: valueNumber, value: negativeInfinity}
 }
 }
 
 
 func positiveZeroValue() Value {
 func positiveZeroValue() Value {
-	return Value{valueNumber, positiveZero}
+	return Value{kind: valueNumber, value: positiveZero}
 }
 }
 
 
 func negativeZeroValue() Value {
 func negativeZeroValue() Value {
-	return Value{valueNumber, negativeZero}
+	return Value{kind: valueNumber, value: negativeZero}
 }
 }
 
 
 // TrueValue will return a value representing true.
 // TrueValue will return a value representing true.
@@ -519,7 +519,7 @@ func negativeZeroValue() Value {
 //
 //
 //	ToValue(true)
 //	ToValue(true)
 func TrueValue() Value {
 func TrueValue() Value {
-	return Value{valueBoolean, true}
+	return Value{kind: valueBoolean, value: true}
 }
 }
 
 
 // FalseValue will return a value representing false.
 // FalseValue will return a value representing false.
@@ -528,7 +528,7 @@ func TrueValue() Value {
 //
 //
 //	ToValue(false)
 //	ToValue(false)
 func FalseValue() Value {
 func FalseValue() Value {
-	return Value{valueBoolean, false}
+	return Value{kind: valueBoolean, value: false}
 }
 }
 
 
 func sameValue(x Value, y Value) bool {
 func sameValue(x Value, y Value) bool {
@@ -647,7 +647,7 @@ func (v Value) export() interface{} {
 			elemKind := reflect.Invalid
 			elemKind := reflect.Invalid
 			state := 0
 			state := 0
 			var t reflect.Type
 			var t reflect.Type
-			for index := uint32(0); index < length; index++ {
+			for index := range length {
 				name := strconv.FormatInt(int64(index), 10)
 				name := strconv.FormatInt(int64(index), 10)
 				if !obj.hasProperty(name) {
 				if !obj.hasProperty(name) {
 					continue
 					continue

+ 2 - 2
vendor/modules.txt

@@ -480,8 +480,8 @@ github.com/prometheus/procfs/internal/util
 # github.com/rivo/uniseg v0.4.4
 # github.com/rivo/uniseg v0.4.4
 ## explicit; go 1.18
 ## explicit; go 1.18
 github.com/rivo/uniseg
 github.com/rivo/uniseg
-# github.com/robertkrimen/otto v0.3.0
-## explicit; go 1.18
+# github.com/robertkrimen/otto v0.5.1
+## explicit; go 1.22
 github.com/robertkrimen/otto
 github.com/robertkrimen/otto
 github.com/robertkrimen/otto/ast
 github.com/robertkrimen/otto/ast
 github.com/robertkrimen/otto/dbg
 github.com/robertkrimen/otto/dbg