Full Code of robertkrimen/otto for AI

master 3ca729876b89 cached
167 files
1.2 MB
374.0k tokens
2249 symbols
1 requests
Download .txt
Showing preview only (1,309K chars total). Download the full file or copy to clipboard to get everything.
Repository: robertkrimen/otto
Branch: master
Commit: 3ca729876b89
Files: 167
Total size: 1.2 MB

Directory structure:
gitextract_6msnb3d6/

├── .clog.toml
├── .github/
│   └── workflows/
│       ├── release-build.yml
│       └── test-lint.yml
├── .gitignore
├── .golangci.yml
├── .goreleaser.yaml
├── DESIGN.markdown
├── LICENSE
├── README.md
├── array_test.go
├── ast/
│   ├── comments.go
│   ├── comments_test.go
│   ├── node.go
│   ├── walk.go
│   ├── walk_example_test.go
│   └── walk_test.go
├── builtin.go
├── builtin_array.go
├── builtin_boolean.go
├── builtin_date.go
├── builtin_error.go
├── builtin_function.go
├── builtin_json.go
├── builtin_math.go
├── builtin_number.go
├── builtin_object.go
├── builtin_regexp.go
├── builtin_string.go
├── builtin_test.go
├── call_test.go
├── clone.go
├── clone_test.go
├── cmpl.go
├── cmpl_evaluate.go
├── cmpl_evaluate_expression.go
├── cmpl_evaluate_statement.go
├── cmpl_parse.go
├── cmpl_test.go
├── console.go
├── consts.go
├── date_test.go
├── dbg/
│   └── dbg.go
├── dbg.go
├── documentation_test.go
├── error.go
├── error_native_test.go
├── error_test.go
├── evaluate.go
├── file/
│   └── file.go
├── function_stack_test.go
├── function_test.go
├── functional_benchmark_test.go
├── generate.go
├── global.go
├── global_test.go
├── go.mod
├── go.sum
├── inline.go
├── inline_test.go
├── issue_test.go
├── json_test.go
├── locale.go
├── math_test.go
├── native_stack_test.go
├── number_test.go
├── object.go
├── object_class.go
├── object_test.go
├── otto/
│   └── main.go
├── otto.go
├── otto_.go
├── otto_error_test.go
├── otto_test.go
├── panic_test.go
├── parser/
│   ├── comments_test.go
│   ├── error.go
│   ├── expression.go
│   ├── lexer.go
│   ├── lexer_test.go
│   ├── marshal_test.go
│   ├── parser.go
│   ├── parser_test.go
│   ├── regexp.go
│   ├── regexp_test.go
│   ├── scope.go
│   └── statement.go
├── parser_test.go
├── property.go
├── reflect_test.go
├── regexp_test.go
├── registry/
│   └── registry.go
├── repl/
│   ├── autocompleter.go
│   └── repl.go
├── result.go
├── runtime.go
├── runtime_test.go
├── scope.go
├── script.go
├── script_test.go
├── sourcemap_test.go
├── stash.go
├── string_test.go
├── terst/
│   └── terst.go
├── testing_test.go
├── token/
│   ├── generate.go
│   ├── token.go
│   └── token_const.go
├── tools/
│   ├── gen-jscore/
│   │   ├── .gen-jscore.yaml
│   │   ├── helpers.go
│   │   ├── main.go
│   │   └── templates/
│   │       ├── constructor.tmpl
│   │       ├── core-prototype-property.tmpl
│   │       ├── definition.tmpl
│   │       ├── function.tmpl
│   │       ├── global.tmpl
│   │       ├── name.tmpl
│   │       ├── property-entry.tmpl
│   │       ├── property-fields.tmpl
│   │       ├── property-order.tmpl
│   │       ├── property-value.tmpl
│   │       ├── property.tmpl
│   │       ├── prototype.tmpl
│   │       ├── root.tmpl
│   │       ├── type.tmpl
│   │       └── value.tmpl
│   ├── gen-tokens/
│   │   ├── .gen-tokens.yaml
│   │   ├── main.go
│   │   └── templates/
│   │       └── root.tmpl
│   └── tester/
│       └── main.go
├── type_arguments.go
├── type_array.go
├── type_boolean.go
├── type_date.go
├── type_error.go
├── type_function.go
├── type_go_array.go
├── type_go_map.go
├── type_go_map_test.go
├── type_go_slice.go
├── type_go_slice_test.go
├── type_go_struct.go
├── type_go_struct_test.go
├── type_number.go
├── type_reference.go
├── type_regexp.go
├── type_string.go
├── underscore/
│   ├── LICENSE.underscorejs
│   ├── README.md
│   ├── download.go
│   ├── generate.go
│   ├── testify
│   ├── underscore-min.js
│   └── underscore.go
├── underscore_arrays_test.go
├── underscore_chaining_test.go
├── underscore_collections_test.go
├── underscore_functions_test.go
├── underscore_objects_test.go
├── underscore_test.go
├── underscore_utility_test.go
├── value.go
├── value_boolean.go
├── value_kind.gen.go
├── value_number.go
├── value_primitive.go
├── value_string.go
└── value_test.go

================================================
FILE CONTENTS
================================================

================================================
FILE: .clog.toml
================================================
[clog]
repository = "https://github.com/robertkrimen/otto"
subtitle = "Release Notes"

[sections]
"Refactors" = ["refactor"]
"Chores" = ["chore"]
"Continuous Integration" = ["ci"]
"Improvements" = ["imp", "improvement"]
"Features" = ["feat", "feature"]
"Legacy" = ["legacy"]
"QA" = ["qa", "test", "tests"]
"Documentation" = ["doc", "docs"]


================================================
FILE: .github/workflows/release-build.yml
================================================
name: Build Release

on:
  push:
    tags:
      - 'v[0-9]+.[0-9]+.[0-9]+*'

jobs:
  goreleaser:
    name: Release Go Binary
    runs-on: [ubuntu-latest]
    steps:
      - name: Checkout
        uses: actions/checkout@v4
        with:
          fetch-depth: 0
      - name: Set up Go
        uses: actions/setup-go@v5
        with:
          go-version: 1.23
          cache: true
      - name: Run GoReleaser
        uses: goreleaser/goreleaser-action@v6
        with:
          # either 'goreleaser' (default) or 'goreleaser-pro'
          distribution: goreleaser
          version: latest
          args: release --clean
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          # Your GoReleaser Pro key, if you are using the 'goreleaser-pro' distribution
          # GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}


================================================
FILE: .github/workflows/test-lint.yml
================================================
name: Go test and lint

on:
  pull_request:
    branches: 'master'

jobs:
  go-test-lint:
    strategy:
      matrix:
        go: [1.22, 1.23]
        golangcli: [v1.61.0]
        os: [ubuntu-latest]
    runs-on: ${{ matrix.os }}
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Set up Go
        uses: actions/setup-go@v5
        with:
          go-version: ${{ matrix.go }}
          cache: true

      - name: Validate go mod / generate
        run: |
          go mod tidy
          go install golang.org/x/tools/cmd/stringer@latest
          go generate ./...
          git --no-pager diff && [[ 0 -eq $(git status --porcelain | wc -l) ]]

      - name: Go Lint
        uses: golangci/golangci-lint-action@v4
        with:
          version: ${{ matrix.golangcli }}
          args: --out-format=colored-line-number
          skip-pkg-cache: true
          skip-build-cache: true

      - name: Go Build
        run: go build ./...

      - name: Go Test
        run: go test -race -v ./...


================================================
FILE: .gitignore
================================================
.test
otto/otto
otto/otto-*
tools/tester/testdata/
tools/tester/tester
tools/gen-jscore/gen-jscore
tools/gen-tokens/gen-tokens
.idea
dist/
.vscode/


================================================
FILE: .golangci.yml
================================================
run:
  timeout: 6m

linters-settings:
  govet:
    settings:
      shadow:
        strict: true
    enable-all: true
  goconst:
    min-len: 2
    min-occurrences: 4
  revive:
    enable-all-rules: false
    rules:
    - name: var-naming
      disabled: true
  gosec:
    excludes:
      - G115 # Too many false positives.

linters:
  enable-all: true
  disable:
    - dupl
    - lll
    - gochecknoglobals
    - gochecknoinits
    - funlen
    - godox
    - err113
    - wsl
    - nlreturn
    - gomnd
    - mnd
    - paralleltest
    - wrapcheck
    - testpackage
    - gocognit
    - nestif
    - exhaustive
    - forcetypeassert
    - gocyclo
    - cyclop
    - varnamelen
    - maintidx
    - ireturn
    - exhaustruct
    - dupword
    # Just causes noise
    - depguard
    # Deprecated
    - execinquery
    # Not needed in go 1.22+
    - exportloopref

issues:
  exclude-use-default: false
  max-same-issues: 0
  exclude:
    - 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



================================================
FILE: .goreleaser.yaml
================================================
# When adding options check the documentation at https://goreleaser.com
before:
  hooks:
    - go mod tidy
builds:
  - env:
      - CGO_ENABLED=0
    goos:
      - linux
      - darwin
    goarch:
      - amd64
      - arm64
    main: ./otto
    id: otto
    binary: otto
universal_binaries:
  - replace: true
    id: otto
checksum:
  name_template: 'checksums.txt'
snapshot:
  name_template: "{{ incpatch .Version }}-next"
archives:
  - id: otto
    name_template: "{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}"
release:
  header: |
    <a name="{{.Tag}}"></a>
    ### {{.Tag}} Release Notes ({{.Date}})
  footer: |
    [Full Changelog](https://{{ .ModulePath }}/compare/{{ .PreviousTag }}...{{ .Tag }})
changelog:
  use: github
  sort: asc
  filters:
    exclude:
    - Merge pull request
    - Merge remote-tracking branch
    - Merge branch

  # Group commits messages by given regex and title.
  # Order value defines the order of the groups.
  # Proving no regex means all commits will be grouped under the default group.
  # Groups are disabled when using github-native, as it already groups things by itself.
  # Matches are performed against strings of the form: "<abbrev-commit> <title-commit>".
  # Regex use RE2 syntax as defined here: https://github.com/google/re2/wiki/Syntax.
  #
  # Default is no groups.
  groups:
    - title: Features
      regexp: '^.*?(feat|feature)(\([[:word:]]+\))??!?:.+$'
      order: 0
    - title: 'Bug fixes'
      regexp: '^.*?fix(\([[:word:]]+\))??!?:.+$'
      order: 1
    - title: 'Chores'
      regexp: '^.*?chore(\([[:word:]]+\))??!?:.+$'
      order: 2
    - title: 'Quality'
      regexp: '^.*?(qa|test|tests)(\([[:word:]]+\))??!?:.+$'
      order: 3
    - title: 'Documentation'
      regexp: '^.*?(doc|docs)(\([[:word:]]+\))??!?:.+$'
      order: 4
    - title: 'Continuous Integration'
      regexp: '^.*?ci(\([[:word:]]+\))??!?:.+$'
      order: 5
    - title: Other
      order: 999


================================================
FILE: DESIGN.markdown
================================================
* Designate the filename of "anonymous" source code by the hash (md5/sha1, etc.)


================================================
FILE: LICENSE
================================================
Copyright (c) 2012 Robert Krimen

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


================================================
FILE: README.md
================================================
# 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.

To use import it with the following:

```go
import (
   "github.com/robertkrimen/otto"
)
```

Run something in the VM

```go
vm := otto.New()
vm.Run(`
    abc = 2 + 2;
    console.log("The value of abc is " + abc); // 4
`)
```

Get a value out of the VM

```go
if value, err := vm.Get("abc"); err == nil {
    if value_int, err := value.ToInteger(); err == nil {
        fmt.Println(value_int)
    } else {
        fmt.Printf("Error during conversion: %v\n", err)
    }
} else {
    fmt.Printf("Error getting value: %v\n", err)
}
```

Set a number

```go
vm.Set("def", 11)
vm.Run(`
    console.log("The value of def is " + def);
    // The value of def is 11
`)
```

Set a string

```go
vm.Set("xyzzy", "Nothing happens.")
vm.Run(`
    console.log(xyzzy.length); // 16
`)
```

Get the value of an expression

```go
value, _ = vm.Run("xyzzy.length")
{
    // value is an int64 with a value of 16
    value, _ := value.ToInteger()
}
```

An error happens

```go
_, err = vm.Run("abcdefghijlmnopqrstuvwxyz.length")
if err != nil {
    // err = ReferenceError: abcdefghijlmnopqrstuvwxyz is not defined
    // If there is an error, then value.IsUndefined() is true
    ...
}
```

Set a Go function

```go
vm.Set("sayHello", func(call otto.FunctionCall) otto.Value {
    fmt.Printf("Hello, %s.\n", call.Argument(0).String())
    return otto.Value{}
})
```

Set a Go function that returns something useful

```go
vm.Set("twoPlus", func(call otto.FunctionCall) otto.Value {
    right, _ := call.Argument(0).ToInteger()
    result, _ := vm.ToValue(2 + right)
    return result
})
```

Use the functions in JavaScript

```go
result, _ = vm.Run(`
    sayHello("Xyzzy");      // Hello, Xyzzy.
    sayHello();             // Hello, undefined

    result = twoPlus(2.0); // 4
`)
```

## Parser

A separate parser is available in the parser package if you're interested
in only building an AST.

[![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

```go
filename := "" // A filename is optional
src := `
    // Sample xyzzy example
    (function(){
        if (3.14159 > 0) {
            console.log("Hello, World.");
            return;
        }

        var xyzzy = NaN;
        console.log("Nothing happens.");
        return xyzzy;
    })();
`

// Parse some JavaScript, yielding a *ast.Program and/or an ErrorList
program, err := parser.ParseFile(nil, filename, src, 0)
```

## Setup

You can run (Go) JavaScript from the command line with
[otto](http://github.com/robertkrimen/otto/tree/master/otto).

```shell
go install github.com/robertkrimen/otto/otto@latest
```

Run JavaScript by entering some source on stdin or by giving otto a filename:

```shell
otto example.js
```

## Underscore

Optionally include the JavaScript utility-belt library, underscore, with this
import:

```go
import (
    "github.com/robertkrimen/otto"
    _ "github.com/robertkrimen/otto/underscore"
)

// Now every otto runtime will be initialized with Underscore.
```

For more information: [underscore](http://github.com/robertkrimen/otto/tree/master/underscore)

## Caveat Emptor

The following are some limitations with otto:

* `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. Pull requests to add functionality are always welcome.

### Regular Expression Incompatibility

Go translates JavaScript-style regular expressions into something that is
"regexp" compatible via `parser.TransformRegExp`. Unfortunately, RegExp requires
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:

```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)

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
"Separator, Space", etc.

### Halting Problem

If you want to stop long running executions (like third-party code), you can use
the interrupt channel to do this:

```go
package main

import (
    "errors"
    "fmt"
    "os"
    "time"

    "github.com/robertkrimen/otto"
)

var halt = errors.New("Stahp")

func main() {
    runUnsafe(`var abc = [];`)
    runUnsafe(`
    while (true) {
        // Loop forever
    }`)
}

func runUnsafe(unsafe string) {
    start := time.Now()
    defer func() {
        duration := time.Since(start)
        if caught := recover(); caught != nil {
            if caught == halt {
                fmt.Fprintf(os.Stderr, "Some code took too long! Stopping after: %v\n", duration)
                return
            }
            panic(caught) // Something else happened, repanic!
        }
        fmt.Fprintf(os.Stderr, "Ran code successfully: %v\n", duration)
    }()

    vm := otto.New()
    vm.Interrupt = make(chan func(), 1) // The buffer prevents blocking
    watchdogCleanup := make(chan struct{})
    defer close(watchdogCleanup)

    go func() {
        select {
        case <-time.After(2 * time.Second): // Stop after two seconds
            vm.Interrupt <- func() {
                panic(halt)
            }
        case <-watchdogCleanup:
        }
        close(vm.Interrupt)
    }()

    vm.Run(unsafe) // Here be dragons (risky code)
}
```

Where is `setTimeout` / `setInterval`?

These timing functions are not part of the [ECMA-262 specification](https://ecma-international.org/publications-and-standards/standards/ecma-262/).
They typically belong to the window object in a browser environment. While it is
possible to implement similar functionality in Go, it generally requires wrapping
Otto in an event loop.

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:

* [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

```go
var ErrVersion = errors.New("version mismatch")
```

### type Error

```go
type Error struct {}
```

An Error represents a runtime error, e.g. a `TypeError`, a `ReferenceError`, etc.

### func (Error) Error

```go
func (err Error) Error() string
```

Error returns a string representation of the error

```plaintext
    TypeError: 'def' is not a function
```

### func (Error) String

```go
func (err Error) String() string
```

String returns a description of the error and a trace of where the error
occurred.

```plaintext
    TypeError: 'def' is not a function
        at xyz (<anonymous>:3:9)
        at <anonymous>:7:1/
```

### type FunctionCall

```go
type FunctionCall struct {
    This         Value
    ArgumentList []Value
    Otto         *Otto
}
```

FunctionCall is an encapsulation of a JavaScript function call.

### func (FunctionCall) Argument

```go
func (self FunctionCall) Argument(index int) Value
```

Argument will return the value of the argument at the given index.

If no such argument exists, undefined is returned.

### type Object

```go
type Object struct {}
```

Object is the representation of a JavaScript object.

### func (Object) Call

```go
func (self Object) Call(name string, argumentList ...interface{}) (Value, error)
```

Call a method on the object.

It is essentially equivalent to:

```go
var method, _ := object.Get(name)
method.Call(object, argumentList...)
```

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

### func (Object) Class

```go
func (self Object) Class() string
```

Class will return the class string of the object.

The return value will (generally) be one of:

```plaintext
    Object
    Function
    Array
    String
    Number
    Boolean
    Date
    RegExp
```

### func (Object) Get

```go
func (self Object) Get(name string) (Value, error)
```

Get the value of the property with the given name.

### func (Object) Keys

```go
func (self Object) Keys() []string
```

Get the keys for the object

This is equivalent to calling Object.keys on the object.

### func (Object) Set

```go
func (self Object) Set(name string, value interface{}) error
```

Set the property of the given name to the given value.

An error will result if setting the property triggers an exception (e.g.
read-only) or if there is an error during conversion of the given value.

### func (Object) Value

```go
func (self Object) Value() Value
```

Value will return self as a value.

### type Otto

```go
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()
}
```

Otto is the representation of the JavaScript runtime. Each instance of Otto has
a self-contained namespace.

### func New

```go
func New() *Otto
```

New will allocate a new JavaScript runtime

### func Run

```go
func Run(src interface{}) (*Otto, Value, error)
```

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).

src may be a string, a byte slice, a bytes.Buffer, or an io.Reader, but it MUST
always be in UTF-8.

src may also be a Script.

src may also be a Program, but if the AST has been modified, then runtime
behavior is undefined.

### func (Otto) Call

```go
func (self Otto) Call(source string, this interface{}, argumentList ...interface{}) (Value, error)
```

Call the given JavaScript with a given this and arguments.

If this is nil, then some special handling takes place to determine the proper
this value, falling back to a "standard" invocation if necessary (where this is
undefined).

If source begins with "new " (A lowercase new followed by a space), then Call
will invoke the function constructor rather than performing a function call. In
this case, the this argument has no effect.

```go
// value is a String object
value, _ := vm.Call("Object", nil, "Hello, World.")

// Likewise...
value, _ := vm.Call("new Object", nil, "Hello, World.")

// This will perform a concat on the given array and return the result
// value is [ 1, 2, 3, undefined, 4, 5, 6, 7, "abc" ]
value, _ := vm.Call(`[ 1, 2, 3, undefined, 4 ].concat`, nil, 5, 6, 7, "abc")
```

### func (*Otto) Compile

```go
func (self *Otto) Compile(filename string, src interface{}) (*Script, error)
```

Compile will parse the given source and return a Script value. If there is an error during compilation, it will return nil and an error.

```go
script, err := vm.Compile("", `var abc; if (!abc) abc = 0; abc += 2; abc;`)
vm.Run(script)
```

### func (*Otto) Copy

```go
func (in *Otto) Copy() *Otto
```

Copy will create a copy/clone of the runtime.

Copy is useful for saving some time when creating many similar runtimes.

This method works by walking the original runtime and cloning each object,
scope, stash, etc. into a new runtime.

Be on the lookout for memory leaks or inadvertent sharing of resources.

### func (Otto) Get

```go
func (self Otto) Get(name string) (Value, error)
```

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
undefined.

### func (Otto) Object

```go
func (self Otto) Object(source string) (*Object, error)
```

Object will run the given source and return the result as an object.

For example, accessing an existing object:

```go
object, _ := vm.Object(`Number`)
```

Or, creating a new object:

```go
object, _ := vm.Object(`({ xyzzy: "Nothing happens." })`)
```

Or, creating and assigning an object:

```go
object, _ := vm.Object(`xyzzy = {}`)
object.Set("volume", 11)
```

If there is an error (like the source does not result in an object), then nil
and an error is returned.

### func (Otto) Run

```go
func (self Otto) Run(src interface{}) (Value, error)
```

Run will run the given source (parsing it first if necessary), returning the
resulting value and error (if any)

src may be a string, a byte slice, a bytes.Buffer, or an io.Reader, but it MUST
always be in UTF-8.

If the runtime is unable to parse source, then this function will return
undefined and the parse error (nothing will be evaluated in this case).

src may also be a Script.

src may also be a Program, but if the AST has been modified, then runtime
behavior is undefined.

### func (Otto) Set

```go
func (self Otto) Set(name string, value interface{}) error
```

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
to a JavaScript value (type Value).

If there is an error (like the binding is read-only, or the ToValue conversion
fails), then an error is returned.

If the top-level binding does not exist, it will be created.

### func (Otto) ToValue

```go
func (self Otto) ToValue(value interface{}) (Value, error)
```

ToValue will convert an interface{} value to a value digestible by
otto/JavaScript.

### type Script

```go
type Script struct {}
```

Script is a handle for some (reusable) JavaScript. Passing a Script value to a
run method will evaluate the JavaScript.

### func (*Script) String

```go
func (self *Script) String() string
```

### type Value

```go
type Value struct {}
```

Value is the representation of a JavaScript value.

### func FalseValue

```go
func FalseValue() Value
```

FalseValue will return a Value representing the bool value false.

It is equivalent to:

```go
ToValue(false)
```

### func  NaNValue

```go
func NaNValue() Value
```

NaNValue will return a value representing NaN.

It is equivalent to:

```go
ToValue(math.NaN())
```

### func  NullValue

```go
func NullValue() Value
```

NullValue will return a Value representing null.

### func  ToValue

```go
func ToValue(value interface{}) (Value, error)
```

ToValue will convert an interface{} value to a value digestible by
otto/JavaScript

This function will not work for advanced types (struct, map, slice/array, etc.)
and you should use Otto.ToValue instead.

### func  TrueValue

```go
func TrueValue() Value
```

TrueValue will return a value representing true.

It is equivalent to:

```go
ToValue(true)
```

### func UndefinedValue

```go
func UndefinedValue() Value
```

UndefinedValue will return a Value representing undefined.

### func (Value) Call

```go
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
return the result of invocation. It is essentially equivalent to:

```js
    value.apply(thisValue, argumentList)
```

A value of undefined 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

### func (Value) Class

```go
func (value Value) Class() string
```

Class will return the class string of the value or the empty string if value is
not an object.

The return value will (generally) be one of:

```plaintext
    Object
    Function
    Array
    String
    Number
    Boolean
    Date
    RegExp
```

### func (Value) Export

```go
func (self Value) Export() (interface{}, error)
```

Export will attempt to convert the value to a Go representation and return it
via an interface{} kind.

Export returns an error, which will always be nil. It is included for backwards
compatibility.

If a reasonable conversion is not possible, then the original value is returned.

```plaintext
    undefined   -> nil (FIXME?: Should be Value{})
    null        -> nil
    boolean     -> bool
    number      -> A number type (int, float32, uint64, ...)
    string      -> string
    Array       -> []interface{}
    Object      -> map[string]interface{}
```

### func (Value) IsBoolean

```go
func (value Value) IsBoolean() bool
```

IsBoolean will return true if value is a boolean (primitive).

### func (Value) IsDefined

```go
func (value Value) IsDefined() bool
```

IsDefined will return false if the value is undefined, and true otherwise.

### func (Value) IsFunction

```go
func (value Value) IsFunction() bool
```

IsFunction will return true if value is a function.

### func (Value) IsNaN

```go
func (value Value) IsNaN() bool
```

IsNaN will return true if value is NaN (or would convert to NaN).

### func (Value) IsNull

```go
func (value Value) IsNull() bool
```

IsNull will return true if the value is null, and false otherwise.

### func (Value) IsNumber

```go
func (value Value) IsNumber() bool
```

IsNumber will return true if value is a number (primitive).

### func (Value) IsObject

```go
func (value Value) IsObject() bool
```

IsObject will return true if value is an object.

### func (Value) IsPrimitive

```go
func (value Value) IsPrimitive() bool
```

IsPrimitive will return true if value is a primitive.

### func (Value) IsString

```go
func (value Value) IsString() bool
```

IsString will return true if value is a string (primitive).

### func (Value) IsUndefined

```go
func (value Value) IsUndefined() bool
```

IsUndefined will return true if the value is undefined, and false otherwise.

### func (Value) Object

```go
func (value Value) Object() *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
method on a string primitive value will not return a String object.

### func (Value) String

```go
func (value Value) String() string
```

String will return the value as a string.

This method will return the empty string if there is an error.

### func (Value) ToBoolean

```go
func (value Value) ToBoolean() (bool, error)
```

ToBoolean will convert the value to a boolean (bool).

```plaintext
    ToValue(0).ToBoolean() => false
    ToValue("").ToBoolean() => false
    ToValue(true).ToBoolean() => true
    ToValue(1).ToBoolean() => true
    ToValue("Nothing happens").ToBoolean() => true
```

If there is an error during the conversion process (like an uncaught exception),
then the result will be false and an error.

### func (Value) ToFloat

```go
func (value Value) ToFloat() (float64, error)
```

ToFloat will convert the value to a number (float64).

```plaintext
    ToValue(0).ToFloat() => 0.
    ToValue(1.1).ToFloat() => 1.1
    ToValue("11").ToFloat() => 11.
```

If there is an error during the conversion process (like an uncaught exception),
then the result will be 0 and an error.

### func (Value) ToInteger

```go
func (value Value) ToInteger() (int64, error)
```

ToInteger will convert the value to a number (int64).

```plaintext
    ToValue(0).ToInteger() => 0
    ToValue(1.1).ToInteger() => 1
    ToValue("11").ToInteger() => 11
```

If there is an error during the conversion process (like an uncaught exception),
then the result will be 0 and an error.

### func (Value) ToString

```go
func (value Value) ToString() (string, error)
```

ToString will convert the value to a string (string).

```plaintext
    ToValue(0).ToString() => "0"
    ToValue(false).ToString() => "false"
    ToValue(1.1).ToString() => "1.1"
    ToValue("11").ToString() => "11"
    ToValue('Nothing happens.').ToString() => "Nothing happens."
```

If there is an error during the conversion process (like an uncaught exception),
then the result will be the empty string ("") and an error.


================================================
FILE: array_test.go
================================================
package otto

import (
	"testing"
)

func TestArray(t *testing.T) {
	tt(t, func() {
		test, _ := test()

		test(`
            var abc = [ undefined, "Nothing happens." ];
            abc.length;
        `, 2)

		test(`
            abc = ""+[0, 1, 2, 3];
            def = [].toString();
            ghi = [null, 4, "null"].toString();
            [ abc, def, ghi ];
        `, "0,1,2,3,,,4,null")

		test(`new Array(0).length`, 0)

		test(`new Array(11).length`, 11)

		test(`new Array(11, 1).length`, 2)

		test(`
            abc = [0, 1, 2, 3];
            abc.xyzzy = "Nothing happens.";
            delete abc[1];
            var xyzzy = delete abc.xyzzy;
            [ abc, xyzzy, abc.xyzzy ];
        `, "0,,2,3,true,")

		test(`
            var abc = [0, 1, 2, 3, 4];
            abc.length = 2;
            abc;
        `, "0,1")

		test(`raise:
            [].length = 3.14159;
        `, "RangeError")

		test(`raise:
            new Array(3.14159);
        `, "RangeError")

		test(`
            Object.defineProperty(Array.prototype, "0", {
                value: 100,
                writable: false,
                configurable: true
            });
            abc = [101];
            abc.hasOwnProperty("0") && abc[0] === 101;
        `, true)

		test(`
            abc = [,,undefined];
            [ abc.hasOwnProperty(0), abc.hasOwnProperty(1), abc.hasOwnProperty(2) ];
        `, "false,false,true")

		test(`
            abc = Object.getOwnPropertyDescriptor(Array, "prototype");
            [   [ typeof Array.prototype ],
                [ abc.writable, abc.enumerable, abc.configurable ] ];
        `, "object,false,false,false")
	})
}

func TestArray_toString(t *testing.T) {
	tt(t, func() {
		{
			test(`
                Array.prototype.toString = function() {
                    return "Nothing happens.";
                }
                abc = Array.prototype.toString();
                def = [].toString();
                ghi = [null, 4, "null"].toString();

                [ abc, def, ghi ].join(",");
            `, "Nothing happens.,Nothing happens.,Nothing happens.")
		}

		{
			test(`
                Array.prototype.join = undefined
                abc = Array.prototype.toString()
                def = [].toString()
                ghi = [null, 4, "null"].toString()

                abc + "," + def + "," + ghi;
            `, "[object Array],[object Array],[object Array]")
		}
	})
}

func TestArray_toLocaleString(t *testing.T) {
	tt(t, func() {
		test, _ := test()

		defer mockUTC()()

		test(`
            [ 3.14159, "abc", undefined, new Date(0) ].toLocaleString();
        `, "3.142,abc,,1970-01-01 00:00:00")

		test(`raise:
            [ { toLocaleString: undefined } ].toLocaleString();
        `, `TypeError: Array.toLocaleString index[0] "undefined" is not callable`)
	})
}

func TestArray_concat(t *testing.T) {
	tt(t, func() {
		test, _ := test()

		test(`
            abc = [0, 1, 2];
            def = [-1, -2, -3];
            ghi = abc.concat(def);
            jkl = abc.concat(def, 3, 4, 5);
            mno = def.concat(-4, -5, abc);

            [ ghi, jkl, mno ].join(";");
        `, "0,1,2,-1,-2,-3;0,1,2,-1,-2,-3,3,4,5;-1,-2,-3,-4,-5,0,1,2")

		test(`
            var abc = [,1];
            var def = abc.concat([], [,]);

            def.getClass = Object.prototype.toString;

            [ def.getClass(), typeof def[0], def[1], typeof def[2], def.length ];
        `, "[object Array],undefined,1,undefined,3")

		test(`
            Object.defineProperty(Array.prototype, "0", {
                value: 100,
                writable: false,
                configurable: true
            });

            var abc = Array.prototype.concat.call(101);

            var hasProperty = abc.hasOwnProperty("0");
            var instanceOfVerify = typeof abc[0] === "object";
            var verifyValue = false;
            verifyValue = abc[0] == 101;

            var verifyEnumerable = false;
            for (var property in abc) {
                if (property === "0" && abc.hasOwnProperty("0")) {
                    verifyEnumerable = true;
                }
            }

            var verifyWritable = false;
            abc[0] = 12;
            verifyWritable = abc[0] === 12;

            var verifyConfigurable = false;
            delete abc[0];
            verifyConfigurable = abc.hasOwnProperty("0");

            [ hasProperty, instanceOfVerify, verifyValue, !verifyConfigurable, verifyEnumerable, verifyWritable ];
        `, "true,true,true,true,true,true")
	})
}

func TestArray_splice(t *testing.T) {
	tt(t, func() {
		test, _ := test()

		test(`
            abc = [0, 1, 2];
            def = abc.splice(1, 2, 3, 4, 5);
            ghi = [].concat(abc);
            jkl = ghi.splice(17, 21, 7, 8, 9);
            mno = [].concat(abc);
            pqr = mno.splice(2);
            [ abc, def, ghi, jkl, mno, pqr ].join(";");
        `, "0,3,4,5;1,2;0,3,4,5,7,8,9;;0,3;4,5")
	})
}

func TestArray_shift(t *testing.T) {
	tt(t, func() {
		test, _ := test()

		test(`
            abc = [0, 1, 2];
            def = abc.shift();
            ghi = [].concat(abc);
            jkl = abc.shift();
            mno = [].concat(abc);
            pqr = abc.shift();
            stu = [].concat(abc);
            vwx = abc.shift();

            [ abc, def, ghi, jkl, mno, pqr, stu, vwx ].join(";");
        `, ";0;1,2;1;2;2;;")
	})
}

func TestArray_push(t *testing.T) {
	tt(t, func() {
		test, _ := test()

		test(`
            abc = [0];
            def = abc.push(1);
            ghi = [].concat(abc);
            jkl = abc.push(2,3,4);

            [ abc, def, ghi, jkl ].join(";");
        `, "0,1,2,3,4;2;0,1;5")
	})
}

func TestArray_pop(t *testing.T) {
	tt(t, func() {
		test, _ := test()

		test(`
            abc = [0,1];
            def = abc.pop();
            ghi = [].concat(abc);
            jkl = abc.pop();
            mno = [].concat(abc);
            pqr = abc.pop();

            [ abc, def, ghi, jkl, mno, pqr ].join(";");
        `, ";1;0;0;;")
	})
}

func TestArray_slice(t *testing.T) {
	tt(t, func() {
		test, _ := test()

		test(`
            abc = [0,1,2,3];
            def = abc.slice();
            ghi = abc.slice(1);
            jkl = abc.slice(3,-1);
            mno = abc.slice(2,-1);
            pqr = abc.slice(-1, -10);

            [ abc, def, ghi, jkl, mno, pqr ].join(";");
        `, "0,1,2,3;0,1,2,3;1,2,3;;2;")

		// Array.protoype.slice is generic
		test(`
            abc = { 0: 0, 1: 1, 2: 2, 3: 3 };
            abc.length = 4;
            def = Array.prototype.slice.call(abc);
            ghi = Array.prototype.slice.call(abc,1);
            jkl = Array.prototype.slice.call(abc,3,-1);
            mno = Array.prototype.slice.call(abc,2,-1);
            pqr = Array.prototype.slice.call(abc,-1,-10);

            [ abc, def, ghi, jkl, pqr ].join(";");
        `, "[object Object];0,1,2,3;1,2,3;;")
	})
}

func TestArray_sliceArguments(t *testing.T) {
	tt(t, func() {
		test, _ := test()

		test(`
            (function(){
                return Array.prototype.slice.call(arguments, 1)
            })({}, 1, 2, 3);
        `, "1,2,3")
	})
}

func TestArray_unshift(t *testing.T) {
	tt(t, func() {
		test, _ := test()

		test(`
            abc = [];
            def = abc.unshift(0);
            ghi = [].concat(abc);
            jkl = abc.unshift(1,2,3,4);

            [ abc, def, ghi, jkl ].join(";");
        `, "1,2,3,4,0;1;0;5")
	})
}

func TestArray_reverse(t *testing.T) {
	tt(t, func() {
		test, _ := test()

		test(`
            abc = [0,1,2,3].reverse();
            def = [0,1,2].reverse();

            [ abc, def ];
        `, "3,2,1,0,2,1,0")
	})
}

func TestArray_sort(t *testing.T) {
	tt(t, func() {
		test, _ := test()

		test(`
            abc = [0,1,2,3].sort();
            def = [3,2,1,0].sort();
            ghi = [].sort();
            jkl = [0].sort();
            mno = [1,0].sort();
            pqr = [1,5,-10, 100, 8, 72, 401, 0.05].sort();
            stu = [1,5,-10, 100, 8, 72, 401, 0.05].sort(function(x, y){
                return x == y ? 0 : x < y ? -1 : 1
            });
            vwx = [1,2,3,1,2,3].sort();
            yza = [1,2,3,1,0,1,-1,0].sort();

            [ abc, def, ghi, jkl, mno, pqr, stu, vwx, yza ].join(";");
        `, "0,1,2,3;0,1,2,3;;0;0,1;-10,0.05,1,100,401,5,72,8;-10,0.05,1,5,8,72,100,401;1,1,2,2,3,3;-1,0,0,1,1,1,2,3")

		test(`Array.prototype.sort.length`, 1)
	})
}

func TestArray_isArray(t *testing.T) {
	tt(t, func() {
		test, _ := test()

		test(`
        [ Array.isArray.length, Array.isArray(), Array.isArray([]), Array.isArray({}) ];
        `, "1,false,true,false")

		test(`Array.isArray(Math)`, false)
	})
}

func TestArray_indexOf(t *testing.T) {
	tt(t, func() {
		test, _ := test()

		test(`['a', 'b', 'c', 'b'].indexOf('b')`, 1)

		test(`['a', 'b', 'c', 'b'].indexOf('b', 2)`, 3)

		test(`['a', 'b', 'c', 'b'].indexOf('b', -2)`, 3)

		test(`
            Object.prototype.indexOf = Array.prototype.indexOf;
            var abc = {0: 'a', 1: 'b', 2: 'c', length: 3};
            abc.indexOf('c');
        `, 2)

		test(`[true].indexOf(true, "-Infinity")`, 0)

		test(`
            var target = {};
            Math[3] = target;
            Math.length = 5;
            Array.prototype.indexOf.call(Math, target) === 3;
        `, true)

		test(`
            var _NaN = NaN;
            var abc = new Array("NaN", undefined, 0, false, null, {toString:function(){return NaN}}, "false", _NaN, NaN);
            abc.indexOf(NaN);
        `, -1)

		test(`
            var abc = {toString:function (){return 0}};
            var def = 1;
            var ghi = -(4/3);
            var jkl = new Array(false, undefined, null, "0", abc, -1.3333333333333, "string", -0, true, +0, def, 1, 0, false, ghi, -(4/3));
            [ jkl.indexOf(-(4/3)), jkl.indexOf(0), jkl.indexOf(-0), jkl.indexOf(1) ];
        `, "14,7,7,10")
	})
}

func TestArray_lastIndexOf(t *testing.T) {
	tt(t, func() {
		test, _ := test()

		test(`['a', 'b', 'c', 'b'].lastIndexOf('b')`, 3)

		test(`['a', 'b', 'c', 'b'].lastIndexOf('b', 2)`, 1)

		test(`['a', 'b', 'c', 'b'].lastIndexOf('b', -2)`, 1)

		test(`
            Object.prototype.lastIndexOf = Array.prototype.lastIndexOf;
            var abc = {0: 'a', 1: 'b', 2: 'c', 3: 'b', length: 4};
            abc.lastIndexOf('b');
        `, 3)

		test(`
            var target = {};
            Math[3] = target;
            Math.length = 5;
            [ Array.prototype.lastIndexOf.call(Math, target) === 3 ];
        `, "true")

		test(`
            var _NaN = NaN;
            var abc = new Array("NaN", undefined, 0, false, null, {toString:function(){return NaN}}, "false", _NaN, NaN);
            abc.lastIndexOf(NaN);
        `, -1)

		test(`
            var abc = {toString:function (){return 0}};
            var def = 1;
            var ghi = -(4/3);
            var jkl = new Array(false, undefined, null, "0", abc, -1.3333333333333, "string", -0, true, +0, def, 1, 0, false, ghi, -(4/3));
            [ jkl.lastIndexOf(-(4/3)), jkl.indexOf(0), jkl.indexOf(-0), jkl.indexOf(1) ];
        `, "15,7,7,10")
	})
}

func TestArray_every(t *testing.T) {
	tt(t, func() {
		test, _ := test()

		test(`raise: [].every()`, `TypeError: Array.every argument "undefined" is not callable`)

		test(`raise: [].every("abc")`, `TypeError: Array.every argument "abc" is not callable`)

		test(`[].every(function() { return false })`, true)

		test(`[1,2,3].every(function() { return false })`, false)

		test(`[1,2,3].every(function() { return true })`, true)

		test(`[1,2,3].every(function(_, index) { if (index === 1) return true })`, false)

		test(`
            var abc = function(value, index, object) {
                return ('[object Math]' !== Object.prototype.toString.call(object));
            };

            Math.length = 1;
            Math[0] = 1;
            !Array.prototype.every.call(Math, abc);
        `, true)

		test(`
            var def = false;

            var abc = function(value, index, object) {
                def = true;
                return this === Math;
            };

            [11].every(abc, Math) && def;
        `, true)

		test(`
            var def = false;

            var abc = function(value, index, object) {
                def = true;
                return Math;
            };

            [11].every(abc) && def;
        `, true)
	})
}

func TestArray_some(t *testing.T) {
	tt(t, func() {
		test, _ := test()

		test(`raise: [].some("abc")`, `TypeError: Array.some "abc" if not callable`)

		test(`[].some(function() { return true })`, false)

		test(`[1,2,3].some(function() { return false })`, false)

		test(`[1,2,3].some(function() { return true })`, true)

		test(`[1,2,3].some(function(_, index) { if (index === 1) return true })`, true)

		test(`
            var abc = function(value, index, object) {
                return ('[object Math]' !== Object.prototype.toString.call(object));
            };

            Math.length = 1;
            Math[0] = 1;
            !Array.prototype.some.call(Math, abc);
        `, true)

		test(`
            var abc = function(value, index, object) {
                return this === Math;
            };

            [11].some(abc, Math);
        `, true)

		test(`
            var abc = function(value, index, object) {
                return Math;
            };

            [11].some(abc);
        `, true)
	})
}

func TestArray_forEach(t *testing.T) {
	tt(t, func() {
		test, _ := test()

		test(`raise: [].forEach("abc")`, `TypeError: Array.foreach "abc" if not callable`)

		test(`
            var abc = 0;
            [].forEach(function(value) {
                abc += value;
            });
            abc;
        `, 0)

		test(`
            abc = 0;
            var def = [];
            [1,2,3].forEach(function(value, index) {
                abc += value;
                def.push(index);
            });
            [ abc, def ];
        `, "6,0,1,2")

		test(`
            var def = false;
            var abc = function(value, index, object) {
                def = ('[object Math]' === Object.prototype.toString.call(object));
            };

            Math.length = 1;
            Math[0] = 1;
            Array.prototype.forEach.call(Math, abc);
            def;
        `, true)

		test(`
            var def = false;
            var abc = function(value, index, object) {
                def = this === Math;
            };

            [11].forEach(abc, Math);
            def;
        `, true)
	})
}

func TestArray_indexing(t *testing.T) {
	tt(t, func() {
		test, _ := test()

		test(`
            var abc = new Array(0, 1);
            var def = abc.length;
            abc[4294967296] = 10; // 2^32 => 0
            abc[4294967297] = 11; // 2^32+1 => 1
            [ def, abc.length, abc[0], abc[1], abc[4294967296] ];
        `, "2,2,0,1,10")

		test(`
            abc = new Array(0, 1);
            def = abc.length;
            abc[4294967295] = 10;
            var ghi = abc.length;
            abc[4294967299] = 12;
            var jkl = abc.length;
            abc[4294967294] = 11;
            [ def, ghi, jkl, abc.length, abc[4294967295], abc[4294967299] ];
        `, "2,2,2,4294967295,10,12")
	})
}

func TestArray_map(t *testing.T) {
	tt(t, func() {
		test, _ := test()

		test(`raise: [].map("abc")`, `TypeError: Array.foreach "abc" if not callable`)

		test(`[].map(function() { return 1 }).length`, 0)

		test(`[1,2,3].map(function(value) { return value * value })`, "1,4,9")

		test(`[1,2,3].map(function(value) { return 1 })`, "1,1,1")

		test(`
            var abc = function(value, index, object) {
                return ('[object Math]' === Object.prototype.toString.call(object));
            };

            Math.length = 1;
            Math[0] = 1;
            Array.prototype.map.call(Math, abc)[0];
        `, true)

		test(`
            var abc = function(value, index, object) {
                return this === Math;
            };

            [11].map(abc, Math)[0];
        `, true)
	})
}

func TestArray_filter(t *testing.T) {
	tt(t, func() {
		test, _ := test()

		test(`raise: [].filter("abc")`, `TypeError: Array.filter "abc" if not callable`)

		test(`[].filter(function() { return 1 }).length`, 0)

		test(`[1,2,3].filter(function() { return false }).length`, 0)

		test(`[1,2,3].filter(function() { return true })`, "1,2,3")
	})
}

func TestArray_reduce(t *testing.T) {
	tt(t, func() {
		test, _ := test()

		test(`raise: [].reduce("abc")`, `TypeError: Array.reduce "abc" if not callable`)

		test(`raise: [].reduce(function() {})`, `TypeError: Array.reduce "function() {}" if not callable`)

		test(`[].reduce(function() {}, 0)`, 0)

		test(`[].reduce(function() {}, undefined)`, "undefined")

		test(`['a','b','c'].reduce(function(result, value) { return result+', '+value })`, "a, b, c")

		test(`[1,2,3].reduce(function(result, value) { return result + value }, 4)`, 10)

		test(`[1,2,3].reduce(function(result, value) { return result + value })`, 6)
	})
}

func TestArray_reduceRight(t *testing.T) {
	tt(t, func() {
		test, _ := test()

		test(`raise: [].reduceRight("abc")`, `TypeError: Array.reduceRight "abc" if not callable`)

		test(`raise: [].reduceRight(function() {})`, `TypeError: Array.reduceRight "function() {}" if not callable`)

		test(`[].reduceRight(function() {}, 0)`, 0)

		test(`[].reduceRight(function() {}, undefined)`, "undefined")

		test(`['a','b','c'].reduceRight(function(result, value) { return result+', '+value })`, "c, b, a")

		test(`[1,2,3].reduceRight(function(result, value) { return result + value }, 4)`, 10)

		test(`[1,2,3].reduceRight(function(result, value) { return result + value })`, 6)
	})
}

func TestArray_defineOwnProperty(t *testing.T) {
	tt(t, func() {
		test, _ := test()

		test(`
            var abc = [];
            Object.defineProperty(abc, "length", {
                writable: false
            });
            abc.length;
        `, 0)

		test(`raise:
            var abc = [];
            var exception;
            Object.defineProperty(abc, "length", {
                writable: false
            });
            Object.defineProperty(abc, "length", {
                writable: true
            });
        `, `TypeError: Object.DefineOwnProperty: property not configurable or writeable and descriptor not writeable`)
	})
}

func TestArray_new(t *testing.T) {
	tt(t, func() {
		test, _ := test()

		test(`
            var abc = new Array(null);
            var def = new Array(undefined);
            [ abc.length, abc[0] === null, def.length, def[0] === undefined ]
        `, "1,true,1,true")

		test(`
            var abc = new Array(new Number(0));
            var def = new Array(new Number(4294967295));
            [ abc.length, typeof abc[0], abc[0] == 0, def.length, typeof def[0], def[0] == 4294967295 ]
        `, "1,object,true,1,object,true")
	})
}


================================================
FILE: ast/comments.go
================================================
package ast

import (
	"fmt"

	"github.com/robertkrimen/otto/file"
)

// CommentPosition determines where the comment is in a given context.
type CommentPosition int

// Available comment positions.
const (
	_ CommentPosition = iota
	// LEADING is before the pertinent expression.
	LEADING
	// TRAILING is after the pertinent expression.
	TRAILING
	// KEY is before a key in an object.
	KEY
	// COLON is after a colon in a field declaration.
	COLON
	// FINAL is the final comments in a block, not belonging to a specific expression or the comment after a trailing , in an array or object literal.
	FINAL
	// IF is after an if keyword.
	IF
	// WHILE is after a while keyword.
	WHILE
	// DO is after do keyword.
	DO
	// FOR is after a for keyword.
	FOR
	// WITH is after a with keyword.
	WITH
	// TBD is unknown.
	TBD
)

// Comment contains the data of the comment.
type Comment struct {
	Text     string
	Begin    file.Idx
	Position CommentPosition
}

// NewComment creates a new comment.
func NewComment(text string, idx file.Idx) *Comment {
	comment := &Comment{
		Begin:    idx,
		Text:     text,
		Position: TBD,
	}

	return comment
}

// String returns a stringified version of the position.
func (cp CommentPosition) String() string {
	switch cp {
	case LEADING:
		return "Leading"
	case TRAILING:
		return "Trailing"
	case KEY:
		return "Key"
	case COLON:
		return "Colon"
	case FINAL:
		return "Final"
	case IF:
		return "If"
	case WHILE:
		return "While"
	case DO:
		return "Do"
	case FOR:
		return "For"
	case WITH:
		return "With"
	default:
		return "???"
	}
}

// String returns a stringified version of the comment.
func (c Comment) String() string {
	return fmt.Sprintf("Comment: %v", c.Text)
}

// Comments defines the current view of comments from the parser.
type Comments struct {
	// CommentMap is a reference to the parser comment map
	CommentMap CommentMap
	// Comments lists the comments scanned, not linked to a node yet
	Comments []*Comment
	// Current is node for which comments are linked to
	Current Expression

	// future lists the comments after a line break during a sequence of comments
	future []*Comment
	// wasLineBreak determines if a line break occurred while scanning for comments
	wasLineBreak bool
	// primary determines whether or not processing a primary expression
	primary bool
	// afterBlock determines whether or not being after a block statement
	afterBlock bool
}

// NewComments returns a new Comments.
func NewComments() *Comments {
	comments := &Comments{
		CommentMap: CommentMap{},
	}

	return comments
}

func (c *Comments) String() string {
	return fmt.Sprintf("NODE: %v, Comments: %v, Future: %v(LINEBREAK:%v)", c.Current, len(c.Comments), len(c.future), c.wasLineBreak)
}

// FetchAll returns all the currently scanned comments,
// including those from the next line.
func (c *Comments) FetchAll() []*Comment {
	defer func() {
		c.Comments = nil
		c.future = nil
	}()

	return append(c.Comments, c.future...)
}

// Fetch returns all the currently scanned comments.
func (c *Comments) Fetch() []*Comment {
	defer func() {
		c.Comments = nil
	}()

	return c.Comments
}

// ResetLineBreak marks the beginning of a new statement.
func (c *Comments) ResetLineBreak() {
	c.wasLineBreak = false
}

// MarkPrimary will mark the context as processing a primary expression.
func (c *Comments) MarkPrimary() {
	c.primary = true
	c.wasLineBreak = false
}

// AfterBlock will mark the context as being after a block.
func (c *Comments) AfterBlock() {
	c.afterBlock = true
}

// AddComment adds a comment to the view.
// Depending on the context, comments are added normally or as post line break.
func (c *Comments) AddComment(comment *Comment) {
	if c.primary {
		if !c.wasLineBreak {
			c.Comments = append(c.Comments, comment)
		} else {
			c.future = append(c.future, comment)
		}
	} else {
		if !c.wasLineBreak || (c.Current == nil && !c.afterBlock) {
			c.Comments = append(c.Comments, comment)
		} else {
			c.future = append(c.future, comment)
		}
	}
}

// MarkComments will mark the found comments as the given position.
func (c *Comments) MarkComments(position CommentPosition) {
	for _, comment := range c.Comments {
		if comment.Position == TBD {
			comment.Position = position
		}
	}
	for _, c := range c.future {
		if c.Position == TBD {
			c.Position = position
		}
	}
}

// Unset the current node and apply the comments to the current expression.
// Resets context variables.
func (c *Comments) Unset() {
	if c.Current != nil {
		c.applyComments(c.Current, c.Current, TRAILING)
		c.Current = nil
	}
	c.wasLineBreak = false
	c.primary = false
	c.afterBlock = false
}

// SetExpression sets the current expression.
// It is applied the found comments, unless the previous expression has not been unset.
// It is skipped if the node is already set or if it is a part of the previous node.
func (c *Comments) SetExpression(node Expression) {
	// Skipping same node
	if c.Current == node {
		return
	}
	if c.Current != nil && c.Current.Idx1() == node.Idx1() {
		c.Current = node
		return
	}
	previous := c.Current
	c.Current = node

	// Apply the found comments and futures to the node and the previous.
	c.applyComments(node, previous, TRAILING)
}

// PostProcessNode applies all found comments to the given node.
func (c *Comments) PostProcessNode(node Node) {
	c.applyComments(node, nil, TRAILING)
}

// applyComments applies both the comments and the future comments to the given node and the previous one,
// based on the context.
func (c *Comments) applyComments(node, previous Node, position CommentPosition) {
	if previous != nil {
		c.CommentMap.AddComments(previous, c.Comments, position)
		c.Comments = nil
	} else {
		c.CommentMap.AddComments(node, c.Comments, position)
		c.Comments = nil
	}
	// Only apply the future comments to the node if the previous is set.
	// This is for detecting end of line comments and which node comments on the following lines belongs to
	if previous != nil {
		c.CommentMap.AddComments(node, c.future, position)
		c.future = nil
	}
}

// AtLineBreak will mark a line break.
func (c *Comments) AtLineBreak() {
	c.wasLineBreak = true
}

// CommentMap is the data structure where all found comments are stored.
type CommentMap map[Node][]*Comment

// AddComment adds a single comment to the map.
func (cm CommentMap) AddComment(node Node, comment *Comment) {
	list := cm[node]
	list = append(list, comment)

	cm[node] = list
}

// AddComments adds a slice of comments, given a node and an updated position.
func (cm CommentMap) AddComments(node Node, comments []*Comment, position CommentPosition) {
	for _, comment := range comments {
		if comment.Position == TBD {
			comment.Position = position
		}
		cm.AddComment(node, comment)
	}
}

// Size returns the size of the map.
func (cm CommentMap) Size() int {
	size := 0
	for _, comments := range cm {
		size += len(comments)
	}

	return size
}

// MoveComments moves comments with a given position from a node to another.
func (cm CommentMap) MoveComments(from, to Node, position CommentPosition) {
	for i, c := range cm[from] {
		if c.Position == position {
			cm.AddComment(to, c)

			// Remove the comment from the "from" slice
			cm[from][i] = cm[from][len(cm[from])-1]
			cm[from][len(cm[from])-1] = nil
			cm[from] = cm[from][:len(cm[from])-1]
		}
	}
}


================================================
FILE: ast/comments_test.go
================================================
package ast

import (
	"testing"

	"github.com/robertkrimen/otto/file"
)

func TestCommentMap(t *testing.T) {
	statement := &EmptyStatement{file.Idx(1)}
	comment := &Comment{Begin: 1, Text: "test", Position: LEADING}

	cm := CommentMap{}
	cm.AddComment(statement, comment)

	if cm.Size() != 1 {
		t.Errorf("the number of comments is %v, not 1", cm.Size())
	}

	if len(cm[statement]) != 1 {
		t.Errorf("the number of comments is %v, not 1", cm.Size())
	}

	if cm[statement][0].Text != "test" {
		t.Errorf("the text is %v, not \"test\"", cm[statement][0].Text)
	}
}

func TestCommentMap_move(t *testing.T) {
	statement1 := &EmptyStatement{file.Idx(1)}
	statement2 := &EmptyStatement{file.Idx(2)}
	comment := &Comment{Begin: 1, Text: "test", Position: LEADING}

	cm := CommentMap{}
	cm.AddComment(statement1, comment)

	if cm.Size() != 1 {
		t.Errorf("the number of comments is %v, not 1", cm.Size())
	}

	if len(cm[statement1]) != 1 {
		t.Errorf("the number of comments is %v, not 1", cm.Size())
	}

	if len(cm[statement2]) != 0 {
		t.Errorf("the number of comments is %v, not 0", cm.Size())
	}

	cm.MoveComments(statement1, statement2, LEADING)

	if cm.Size() != 1 {
		t.Errorf("the number of comments is %v, not 1", cm.Size())
	}

	if len(cm[statement2]) != 1 {
		t.Errorf("the number of comments is %v, not 1", cm.Size())
	}

	if len(cm[statement1]) != 0 {
		t.Errorf("the number of comments is %v, not 0", cm.Size())
	}
}


================================================
FILE: ast/node.go
================================================
// Package ast declares types representing a JavaScript AST.
//
// # Warning
// The parser and AST interfaces are still works-in-progress (particularly where
// node types are concerned) and may change in the future.
package ast

import (
	"github.com/robertkrimen/otto/file"
	"github.com/robertkrimen/otto/token"
)

// Node is implemented by types that represent a node.
type Node interface {
	Idx0() file.Idx // The index of the first character belonging to the node
	Idx1() file.Idx // The index of the first character immediately after the node
}

// Expression is implemented by types that represent an Expression.
type Expression interface {
	Node
	expression()
}

// ArrayLiteral represents an array literal.
type ArrayLiteral struct {
	Value        []Expression
	LeftBracket  file.Idx
	RightBracket file.Idx
}

// Idx0 implements Node.
func (al *ArrayLiteral) Idx0() file.Idx {
	return al.LeftBracket
}

// Idx1 implements Node.
func (al *ArrayLiteral) Idx1() file.Idx {
	return al.RightBracket + 1
}

// expression implements Expression.
func (*ArrayLiteral) expression() {}

// AssignExpression represents an assignment expression.
type AssignExpression struct {
	Left     Expression
	Right    Expression
	Operator token.Token
}

// Idx0 implements Node.
func (ae *AssignExpression) Idx0() file.Idx {
	return ae.Left.Idx0()
}

// Idx1 implements Node.
func (ae *AssignExpression) Idx1() file.Idx {
	return ae.Right.Idx1()
}

// expression implements Expression.
func (*AssignExpression) expression() {}

// BadExpression represents a bad expression.
type BadExpression struct {
	From file.Idx
	To   file.Idx
}

// Idx0 implements Node.
func (be *BadExpression) Idx0() file.Idx {
	return be.From
}

// Idx1 implements Node.
func (be *BadExpression) Idx1() file.Idx {
	return be.To
}

// expression implements Expression.
func (*BadExpression) expression() {}

// BinaryExpression represents a binary expression.
type BinaryExpression struct {
	Left       Expression
	Right      Expression
	Operator   token.Token
	Comparison bool
}

// Idx0 implements Node.
func (be *BinaryExpression) Idx0() file.Idx {
	return be.Left.Idx0()
}

// Idx1 implements Node.
func (be *BinaryExpression) Idx1() file.Idx {
	return be.Right.Idx1()
}

// expression implements Expression.
func (*BinaryExpression) expression() {}

// BooleanLiteral represents a boolean expression.
type BooleanLiteral struct {
	Literal string
	Idx     file.Idx
	Value   bool
}

// Idx0 implements Node.
func (bl *BooleanLiteral) Idx0() file.Idx {
	return bl.Idx
}

// Idx1 implements Node.
func (bl *BooleanLiteral) Idx1() file.Idx {
	return file.Idx(int(bl.Idx) + len(bl.Literal))
}

// expression implements Expression.
func (*BooleanLiteral) expression() {}

// BracketExpression represents a bracketed expression.
type BracketExpression struct {
	Left         Expression
	Member       Expression
	LeftBracket  file.Idx
	RightBracket file.Idx
}

// Idx0 implements Node.
func (be *BracketExpression) Idx0() file.Idx {
	return be.Left.Idx0()
}

// Idx1 implements Node.
func (be *BracketExpression) Idx1() file.Idx {
	return be.RightBracket + 1
}

// expression implements Expression.
func (*BracketExpression) expression() {}

// CallExpression represents a call expression.
type CallExpression struct {
	Callee           Expression
	ArgumentList     []Expression
	LeftParenthesis  file.Idx
	RightParenthesis file.Idx
}

// Idx0 implements Node.
func (ce *CallExpression) Idx0() file.Idx {
	return ce.Callee.Idx0()
}

// Idx1 implements Node.
func (ce *CallExpression) Idx1() file.Idx {
	return ce.RightParenthesis + 1
}

// expression implements Expression.
func (*CallExpression) expression() {}

// ConditionalExpression represents a conditional expression.
type ConditionalExpression struct {
	Test       Expression
	Consequent Expression
	Alternate  Expression
}

// Idx0 implements Node.
func (ce *ConditionalExpression) Idx0() file.Idx {
	return ce.Test.Idx0()
}

// Idx1 implements Node.
func (ce *ConditionalExpression) Idx1() file.Idx {
	return ce.Alternate.Idx1()
}

// expression implements Expression.
func (*ConditionalExpression) expression() {}

// DotExpression represents a dot expression.
type DotExpression struct {
	Left       Expression
	Identifier *Identifier
}

// Idx0 implements Node.
func (de *DotExpression) Idx0() file.Idx {
	return de.Left.Idx0()
}

// Idx1 implements Node.
func (de *DotExpression) Idx1() file.Idx {
	return de.Identifier.Idx1()
}

// expression implements Expression.
func (*DotExpression) expression() {}

// EmptyExpression represents an empty expression.
type EmptyExpression struct {
	Begin file.Idx
	End   file.Idx
}

// Idx0 implements Node.
func (ee *EmptyExpression) Idx0() file.Idx {
	return ee.Begin
}

// Idx1 implements Node.
func (ee *EmptyExpression) Idx1() file.Idx {
	return ee.End
}

// expression implements Expression.
func (*EmptyExpression) expression() {}

// FunctionLiteral represents a function literal.
type FunctionLiteral struct {
	Body            Statement
	Name            *Identifier
	ParameterList   *ParameterList
	Source          string
	DeclarationList []Declaration
	Function        file.Idx
}

// Idx0 implements Node.
func (fl *FunctionLiteral) Idx0() file.Idx {
	return fl.Function
}

// Idx1 implements Node.
func (fl *FunctionLiteral) Idx1() file.Idx {
	return fl.Body.Idx1()
}

// expression implements Expression.
func (*FunctionLiteral) expression() {}

// Identifier represents an identifier.
type Identifier struct {
	Name string
	Idx  file.Idx
}

// Idx0 implements Node.
func (i *Identifier) Idx0() file.Idx {
	return i.Idx
}

// Idx1 implements Node.
func (i *Identifier) Idx1() file.Idx {
	return file.Idx(int(i.Idx) + len(i.Name))
}

// expression implements Expression.
func (*Identifier) expression() {}

// NewExpression represents a new expression.
type NewExpression struct {
	Callee           Expression
	ArgumentList     []Expression
	New              file.Idx
	LeftParenthesis  file.Idx
	RightParenthesis file.Idx
}

// Idx0 implements Node.
func (ne *NewExpression) Idx0() file.Idx {
	return ne.New
}

// Idx1 implements Node.
func (ne *NewExpression) Idx1() file.Idx {
	if ne.RightParenthesis > 0 {
		return ne.RightParenthesis + 1
	}
	return ne.Callee.Idx1()
}

// expression implements Expression.
func (*NewExpression) expression() {}

// NullLiteral represents a null literal.
type NullLiteral struct {
	Literal string
	Idx     file.Idx
}

// Idx0 implements Node.
func (nl *NullLiteral) Idx0() file.Idx {
	return nl.Idx
}

// Idx1 implements Node.
func (nl *NullLiteral) Idx1() file.Idx {
	return file.Idx(int(nl.Idx) + 4)
}

// expression implements Expression.
func (*NullLiteral) expression() {}

// NumberLiteral represents a number literal.
type NumberLiteral struct {
	Value   interface{}
	Literal string
	Idx     file.Idx
}

// Idx0 implements Node.
func (nl *NumberLiteral) Idx0() file.Idx {
	return nl.Idx
}

// Idx1 implements Node.
func (nl *NumberLiteral) Idx1() file.Idx {
	return file.Idx(int(nl.Idx) + len(nl.Literal))
}

// expression implements Expression.
func (*NumberLiteral) expression() {}

// ObjectLiteral represents an object literal.
type ObjectLiteral struct {
	Value      []Property
	LeftBrace  file.Idx
	RightBrace file.Idx
}

// Idx0 implements Node.
func (ol *ObjectLiteral) Idx0() file.Idx {
	return ol.LeftBrace
}

// Idx1 implements Node.
func (ol *ObjectLiteral) Idx1() file.Idx {
	return ol.RightBrace + 1
}

// expression implements Expression.
func (*ObjectLiteral) expression() {}

// ParameterList represents a parameter list.
type ParameterList struct {
	List    []*Identifier
	Opening file.Idx
	Closing file.Idx
}

// Property represents a property.
type Property struct {
	Value Expression
	Key   string
	Kind  string
}

// RegExpLiteral represents a regular expression literal.
type RegExpLiteral struct {
	Literal string
	Pattern string
	Flags   string
	Value   string
	Idx     file.Idx
}

// Idx0 implements Node.
func (rl *RegExpLiteral) Idx0() file.Idx {
	return rl.Idx
}

// Idx1 implements Node.
func (rl *RegExpLiteral) Idx1() file.Idx {
	return file.Idx(int(rl.Idx) + len(rl.Literal))
}

// expression implements Expression.
func (*RegExpLiteral) expression() {}

// SequenceExpression represents a sequence literal.
type SequenceExpression struct {
	Sequence []Expression
}

// Idx0 implements Node.
func (se *SequenceExpression) Idx0() file.Idx {
	return se.Sequence[0].Idx0()
}

// Idx1 implements Node.
func (se *SequenceExpression) Idx1() file.Idx {
	return se.Sequence[len(se.Sequence)-1].Idx1()
}

// expression implements Expression.
func (*SequenceExpression) expression() {}

// StringLiteral represents a string literal.
type StringLiteral struct {
	Literal string
	Value   string
	Idx     file.Idx
}

// Idx0 implements Node.
func (sl *StringLiteral) Idx0() file.Idx {
	return sl.Idx
}

// Idx1 implements Node.
func (sl *StringLiteral) Idx1() file.Idx {
	return file.Idx(int(sl.Idx) + len(sl.Literal))
}

// expression implements Expression.
func (*StringLiteral) expression() {}

// ThisExpression represents a this expression.
type ThisExpression struct {
	Idx file.Idx
}

// Idx0 implements Node.
func (te *ThisExpression) Idx0() file.Idx {
	return te.Idx
}

// Idx1 implements Node.
func (te *ThisExpression) Idx1() file.Idx {
	return te.Idx + 4
}

// expression implements Expression.
func (*ThisExpression) expression() {}

// UnaryExpression represents a unary expression.
type UnaryExpression struct {
	Operand  Expression
	Operator token.Token
	Idx      file.Idx
	Postfix  bool
}

// Idx0 implements Node.
func (ue *UnaryExpression) Idx0() file.Idx {
	if ue.Postfix {
		return ue.Operand.Idx0()
	}
	return ue.Idx
}

// Idx1 implements Node.
func (ue *UnaryExpression) Idx1() file.Idx {
	if ue.Postfix {
		return ue.Operand.Idx1() + 2 // ++ --
	}
	return ue.Operand.Idx1()
}

// expression implements Expression.
func (*UnaryExpression) expression() {}

// VariableExpression represents a variable expression.
type VariableExpression struct {
	Initializer Expression
	Name        string
	Idx         file.Idx
}

// Idx0 implements Node.
func (ve *VariableExpression) Idx0() file.Idx {
	return ve.Idx
}

// Idx1 implements Node.
func (ve *VariableExpression) Idx1() file.Idx {
	if ve.Initializer == nil {
		return file.Idx(int(ve.Idx) + len(ve.Name))
	}
	return ve.Initializer.Idx1()
}

// expression implements Expression.
func (*VariableExpression) expression() {}

// Statement is implemented by types which represent a statement.
type Statement interface {
	Node
	statement()
}

// BadStatement represents a bad statement.
type BadStatement struct {
	From file.Idx
	To   file.Idx
}

// Idx0 implements Node.
func (bs *BadStatement) Idx0() file.Idx {
	return bs.From
}

// Idx1 implements Node.
func (bs *BadStatement) Idx1() file.Idx {
	return bs.To
}

// expression implements Statement.
func (*BadStatement) statement() {}

// BlockStatement represents a block statement.
type BlockStatement struct {
	List       []Statement
	LeftBrace  file.Idx
	RightBrace file.Idx
}

// Idx0 implements Node.
func (bs *BlockStatement) Idx0() file.Idx {
	return bs.LeftBrace
}

// Idx1 implements Node.
func (bs *BlockStatement) Idx1() file.Idx {
	return bs.RightBrace + 1
}

// expression implements Statement.
func (*BlockStatement) statement() {}

// BranchStatement represents a branch statement.
type BranchStatement struct {
	Label *Identifier
	Idx   file.Idx
	Token token.Token
}

// Idx0 implements Node.
func (bs *BranchStatement) Idx0() file.Idx {
	return bs.Idx
}

// Idx1 implements Node.
func (bs *BranchStatement) Idx1() file.Idx {
	if bs.Label == nil {
		return file.Idx(int(bs.Idx) + len(bs.Token.String()))
	}
	return bs.Label.Idx1()
}

// expression implements Statement.
func (*BranchStatement) statement() {}

// CaseStatement represents a case statement.
type CaseStatement struct {
	Test       Expression
	Consequent []Statement
	Case       file.Idx
}

// Idx0 implements Node.
func (cs *CaseStatement) Idx0() file.Idx {
	return cs.Case
}

// Idx1 implements Node.
func (cs *CaseStatement) Idx1() file.Idx {
	return cs.Consequent[len(cs.Consequent)-1].Idx1()
}

// expression implements Statement.
func (*CaseStatement) statement() {}

// CatchStatement represents a catch statement.
type CatchStatement struct {
	Body      Statement
	Parameter *Identifier
	Catch     file.Idx
}

// Idx0 implements Node.
func (cs *CatchStatement) Idx0() file.Idx {
	return cs.Catch
}

// Idx1 implements Node.
func (cs *CatchStatement) Idx1() file.Idx {
	return cs.Body.Idx1()
}

// expression implements Statement.
func (*CatchStatement) statement() {}

// DebuggerStatement represents a debugger statement.
type DebuggerStatement struct {
	Debugger file.Idx
}

// Idx0 implements Node.
func (ds *DebuggerStatement) Idx0() file.Idx {
	return ds.Debugger
}

// Idx1 implements Node.
func (ds *DebuggerStatement) Idx1() file.Idx {
	return ds.Debugger + 8
}

// expression implements Statement.
func (*DebuggerStatement) statement() {}

// DoWhileStatement represents a do while statement.
type DoWhileStatement struct {
	Test             Expression
	Body             Statement
	Do               file.Idx
	RightParenthesis file.Idx
}

// Idx0 implements Node.
func (dws *DoWhileStatement) Idx0() file.Idx {
	return dws.Do
}

// Idx1 implements Node.
func (dws *DoWhileStatement) Idx1() file.Idx {
	return dws.RightParenthesis + 1
}

// expression implements Statement.
func (*DoWhileStatement) statement() {}

// EmptyStatement represents a empty statement.
type EmptyStatement struct {
	Semicolon file.Idx
}

// Idx0 implements Node.
func (es *EmptyStatement) Idx0() file.Idx {
	return es.Semicolon
}

// Idx1 implements Node.
func (es *EmptyStatement) Idx1() file.Idx {
	return es.Semicolon + 1
}

// expression implements Statement.
func (*EmptyStatement) statement() {}

// ExpressionStatement represents a expression statement.
type ExpressionStatement struct {
	Expression Expression
}

// Idx0 implements Node.
func (es *ExpressionStatement) Idx0() file.Idx {
	return es.Expression.Idx0()
}

// Idx1 implements Node.
func (es *ExpressionStatement) Idx1() file.Idx {
	return es.Expression.Idx1()
}

// expression implements Statement.
func (*ExpressionStatement) statement() {}

// ForInStatement represents a for in statement.
type ForInStatement struct {
	Into   Expression
	Source Expression
	Body   Statement
	For    file.Idx
}

// Idx0 implements Node.
func (fis *ForInStatement) Idx0() file.Idx {
	return fis.For
}

// Idx1 implements Node.
func (fis *ForInStatement) Idx1() file.Idx {
	return fis.Body.Idx1()
}

// expression implements Statement.
func (*ForInStatement) statement() {}

// ForStatement represents a for statement.
type ForStatement struct {
	Initializer Expression
	Update      Expression
	Test        Expression
	Body        Statement
	For         file.Idx
}

// Idx0 implements Node.
func (fs *ForStatement) Idx0() file.Idx {
	return fs.For
}

// Idx1 implements Node.
func (fs *ForStatement) Idx1() file.Idx {
	return fs.Body.Idx1()
}

// expression implements Statement.
func (*ForStatement) statement() {}

// FunctionStatement represents a function statement.
type FunctionStatement struct {
	Function *FunctionLiteral
}

// Idx0 implements Node.
func (fs *FunctionStatement) Idx0() file.Idx {
	return fs.Function.Idx0()
}

// Idx1 implements Node.
func (fs *FunctionStatement) Idx1() file.Idx {
	return fs.Function.Idx1()
}

// expression implements Statement.
func (*FunctionStatement) statement() {}

// IfStatement represents a if statement.
type IfStatement struct {
	Test       Expression
	Consequent Statement
	Alternate  Statement
	If         file.Idx
}

// Idx0 implements Node.
func (is *IfStatement) Idx0() file.Idx {
	return is.If
}

// Idx1 implements Node.
func (is *IfStatement) Idx1() file.Idx {
	if is.Alternate != nil {
		return is.Alternate.Idx1()
	}
	return is.Consequent.Idx1()
}

// expression implements Statement.
func (*IfStatement) statement() {}

// LabelledStatement represents a labelled statement.
type LabelledStatement struct {
	Statement Statement
	Label     *Identifier
	Colon     file.Idx
}

// Idx0 implements Node.
func (ls *LabelledStatement) Idx0() file.Idx {
	return ls.Label.Idx0()
}

// Idx1 implements Node.
func (ls *LabelledStatement) Idx1() file.Idx {
	return ls.Statement.Idx1()
}

// expression implements Statement.
func (*LabelledStatement) statement() {}

// ReturnStatement represents a return statement.
type ReturnStatement struct {
	Argument Expression
	Return   file.Idx
}

// Idx0 implements Node.
func (rs *ReturnStatement) Idx0() file.Idx {
	return rs.Return
}

// Idx1 implements Node.
func (rs *ReturnStatement) Idx1() file.Idx {
	if rs.Argument != nil {
		return rs.Argument.Idx1()
	}
	return rs.Return + 6
}

// expression implements Statement.
func (*ReturnStatement) statement() {}

// SwitchStatement represents a switch statement.
type SwitchStatement struct {
	Discriminant Expression
	Body         []*CaseStatement
	Switch       file.Idx
	Default      int
	RightBrace   file.Idx
}

// Idx0 implements Node.
func (ss *SwitchStatement) Idx0() file.Idx {
	return ss.Switch
}

// Idx1 implements Node.
func (ss *SwitchStatement) Idx1() file.Idx {
	return ss.RightBrace + 1
}

// expression implements Statement.
func (*SwitchStatement) statement() {}

// ThrowStatement represents a throw statement.
type ThrowStatement struct {
	Argument Expression
	Throw    file.Idx
}

// Idx0 implements Node.
func (ts *ThrowStatement) Idx0() file.Idx {
	return ts.Throw
}

// Idx1 implements Node.
func (ts *ThrowStatement) Idx1() file.Idx {
	return ts.Argument.Idx1()
}

// expression implements Statement.
func (*ThrowStatement) statement() {}

// TryStatement represents a try statement.
type TryStatement struct {
	Body    Statement
	Finally Statement
	Catch   *CatchStatement
	Try     file.Idx
}

// Idx0 implements Node.
func (ts *TryStatement) Idx0() file.Idx {
	return ts.Try
}

// Idx1 implements Node.
func (ts *TryStatement) Idx1() file.Idx {
	if ts.Finally != nil {
		return ts.Finally.Idx1()
	}
	return ts.Catch.Idx1()
}

// expression implements Statement.
func (*TryStatement) statement() {}

// VariableStatement represents a variable statement.
type VariableStatement struct {
	List []Expression
	Var  file.Idx
}

// Idx0 implements Node.
func (vs *VariableStatement) Idx0() file.Idx {
	return vs.Var
}

// Idx1 implements Node.
func (vs *VariableStatement) Idx1() file.Idx {
	return vs.List[len(vs.List)-1].Idx1()
}

// expression implements Statement.
func (*VariableStatement) statement() {}

// WhileStatement represents a while statement.
type WhileStatement struct {
	Test  Expression
	Body  Statement
	While file.Idx
}

// Idx0 implements Node.
func (ws *WhileStatement) Idx0() file.Idx {
	return ws.While
}

// Idx1 implements Node.
func (ws *WhileStatement) Idx1() file.Idx {
	return ws.Body.Idx1()
}

// expression implements Statement.
func (*WhileStatement) statement() {}

// WithStatement represents a with statement.
type WithStatement struct {
	Object Expression
	Body   Statement
	With   file.Idx
}

// Idx0 implements Node.
func (ws *WithStatement) Idx0() file.Idx {
	return ws.With
}

// Idx1 implements Node.
func (ws *WithStatement) Idx1() file.Idx {
	return ws.Body.Idx1()
}

// expression implements Statement.
func (*WithStatement) statement() {}

// Declaration is implemented by type which represent declarations.
type Declaration interface {
	declaration()
}

// FunctionDeclaration represents a function declaration.
type FunctionDeclaration struct {
	Function *FunctionLiteral
}

func (*FunctionDeclaration) declaration() {}

// VariableDeclaration represents a variable declaration.
type VariableDeclaration struct {
	List []*VariableExpression
	Var  file.Idx
}

// declaration implements Declaration.
func (*VariableDeclaration) declaration() {}

// Program represents a full program.
type Program struct {
	File            *file.File
	Comments        CommentMap
	Body            []Statement
	DeclarationList []Declaration
}

// Idx0 implements Node.
func (p *Program) Idx0() file.Idx {
	return p.Body[0].Idx0()
}

// Idx1 implements Node.
func (p *Program) Idx1() file.Idx {
	return p.Body[len(p.Body)-1].Idx1()
}


================================================
FILE: ast/walk.go
================================================
package ast

import "fmt"

// Visitor Enter method is invoked for each node encountered by Walk.
// If the result visitor w is not nil, Walk visits each of the children
// of node with the visitor v, followed by a call of the Exit method.
type Visitor interface {
	Enter(n Node) (v Visitor)
	Exit(n Node)
}

// Walk traverses an AST in depth-first order: It starts by calling
// v.Enter(node); node must not be nil. If the visitor v returned by
// v.Enter(node) is not nil, Walk is invoked recursively with visitor
// v for each of the non-nil children of node, followed by a call
// of v.Exit(node).
func Walk(v Visitor, n Node) {
	if n == nil {
		return
	}
	if v = v.Enter(n); v == nil {
		return
	}

	defer v.Exit(n)

	switch n := n.(type) {
	case *ArrayLiteral:
		if n != nil {
			for _, ex := range n.Value {
				Walk(v, ex)
			}
		}
	case *AssignExpression:
		if n != nil {
			Walk(v, n.Left)
			Walk(v, n.Right)
		}
	case *BadExpression:
	case *BadStatement:
	case *BinaryExpression:
		if n != nil {
			Walk(v, n.Left)
			Walk(v, n.Right)
		}
	case *BlockStatement:
		if n != nil {
			for _, s := range n.List {
				Walk(v, s)
			}
		}
	case *BooleanLiteral:
	case *BracketExpression:
		if n != nil {
			Walk(v, n.Left)
			Walk(v, n.Member)
		}
	case *BranchStatement:
		if n != nil {
			Walk(v, n.Label)
		}
	case *CallExpression:
		if n != nil {
			Walk(v, n.Callee)
			for _, a := range n.ArgumentList {
				Walk(v, a)
			}
		}
	case *CaseStatement:
		if n != nil {
			Walk(v, n.Test)
			for _, c := range n.Consequent {
				Walk(v, c)
			}
		}
	case *CatchStatement:
		if n != nil {
			Walk(v, n.Parameter)
			Walk(v, n.Body)
		}
	case *ConditionalExpression:
		if n != nil {
			Walk(v, n.Test)
			Walk(v, n.Consequent)
			Walk(v, n.Alternate)
		}
	case *DebuggerStatement:
	case *DoWhileStatement:
		if n != nil {
			Walk(v, n.Test)
			Walk(v, n.Body)
		}
	case *DotExpression:
		if n != nil {
			Walk(v, n.Left)
			Walk(v, n.Identifier)
		}
	case *EmptyExpression:
	case *EmptyStatement:
	case *ExpressionStatement:
		if n != nil {
			Walk(v, n.Expression)
		}
	case *ForInStatement:
		if n != nil {
			Walk(v, n.Into)
			Walk(v, n.Source)
			Walk(v, n.Body)
		}
	case *ForStatement:
		if n != nil {
			Walk(v, n.Initializer)
			Walk(v, n.Update)
			Walk(v, n.Test)
			Walk(v, n.Body)
		}
	case *FunctionLiteral:
		if n != nil {
			Walk(v, n.Name)
			for _, p := range n.ParameterList.List {
				Walk(v, p)
			}
			Walk(v, n.Body)
		}
	case *FunctionStatement:
		if n != nil {
			Walk(v, n.Function)
		}
	case *Identifier:
	case *IfStatement:
		if n != nil {
			Walk(v, n.Test)
			Walk(v, n.Consequent)
			Walk(v, n.Alternate)
		}
	case *LabelledStatement:
		if n != nil {
			Walk(v, n.Label)
			Walk(v, n.Statement)
		}
	case *NewExpression:
		if n != nil {
			Walk(v, n.Callee)
			for _, a := range n.ArgumentList {
				Walk(v, a)
			}
		}
	case *NullLiteral:
	case *NumberLiteral:
	case *ObjectLiteral:
		if n != nil {
			for _, p := range n.Value {
				Walk(v, p.Value)
			}
		}
	case *Program:
		if n != nil {
			for _, b := range n.Body {
				Walk(v, b)
			}
		}
	case *RegExpLiteral:
	case *ReturnStatement:
		if n != nil {
			Walk(v, n.Argument)
		}
	case *SequenceExpression:
		if n != nil {
			for _, e := range n.Sequence {
				Walk(v, e)
			}
		}
	case *StringLiteral:
	case *SwitchStatement:
		if n != nil {
			Walk(v, n.Discriminant)
			for _, c := range n.Body {
				Walk(v, c)
			}
		}
	case *ThisExpression:
	case *ThrowStatement:
		if n != nil {
			Walk(v, n.Argument)
		}
	case *TryStatement:
		if n != nil {
			Walk(v, n.Body)
			Walk(v, n.Catch)
			Walk(v, n.Finally)
		}
	case *UnaryExpression:
		if n != nil {
			Walk(v, n.Operand)
		}
	case *VariableExpression:
		if n != nil {
			Walk(v, n.Initializer)
		}
	case *VariableStatement:
		if n != nil {
			for _, e := range n.List {
				Walk(v, e)
			}
		}
	case *WhileStatement:
		if n != nil {
			Walk(v, n.Test)
			Walk(v, n.Body)
		}
	case *WithStatement:
		if n != nil {
			Walk(v, n.Object)
			Walk(v, n.Body)
		}
	default:
		panic(fmt.Sprintf("Walk: unexpected node type %T", n))
	}
}


================================================
FILE: ast/walk_example_test.go
================================================
package ast_test

import (
	"fmt"
	"log"

	"github.com/robertkrimen/otto/ast"
	"github.com/robertkrimen/otto/file"
	"github.com/robertkrimen/otto/parser"
)

type walkExample struct {
	source string
	shift  file.Idx
}

func (w *walkExample) Enter(n ast.Node) ast.Visitor {
	if id, ok := n.(*ast.Identifier); ok && id != nil {
		idx := n.Idx0() + w.shift - 1
		s := w.source[:idx] + "new_" + w.source[idx:]
		w.source = s
		w.shift += 4
	}
	if v, ok := n.(*ast.VariableExpression); ok && v != nil {
		idx := n.Idx0() + w.shift - 1
		s := w.source[:idx] + "varnew_" + w.source[idx:]
		w.source = s
		w.shift += 7
	}

	return w
}

func (w *walkExample) Exit(n ast.Node) {
	// AST node n has had all its children walked. Pop it out of your
	// stack, or do whatever processing you need to do, if any.
}

func ExampleVisitor_codeRewrite() {
	source := `var b = function() {test(); try {} catch(e) {} var test = "test(); var test = 1"} // test`
	program, err := parser.ParseFile(nil, "", source, 0)
	if err != nil {
		log.Fatal(err)
	}

	w := &walkExample{source: source}

	ast.Walk(w, program)

	fmt.Println(w.source)
	// Output: var varnew_b = function() {new_test(); try {} catch(new_e) {} var varnew_test = "test(); var test = 1"} // test
}


================================================
FILE: ast/walk_test.go
================================================
package ast_test

import (
	"testing"

	"github.com/robertkrimen/otto/ast"
	"github.com/robertkrimen/otto/file"
	"github.com/robertkrimen/otto/parser"
	"github.com/stretchr/testify/require"
)

type walker struct {
	seen              map[ast.Node]struct{}
	source            string
	stack             []ast.Node
	shift             file.Idx
	duplicate         int
	newExpressionIdx1 file.Idx
}

// push and pop below are to prove the symmetry of Enter/Exit calls

func (w *walker) push(n ast.Node) {
	w.stack = append(w.stack, n)
}

func (w *walker) pop(n ast.Node) {
	size := len(w.stack)
	if size <= 0 {
		panic("pop of empty stack")
	}

	if toPop := w.stack[size-1]; toPop != n {
		panic("pop: nodes do not equal")
	}

	w.stack[size-1] = nil
	w.stack = w.stack[:size-1]
}

func (w *walker) Enter(n ast.Node) ast.Visitor {
	w.push(n)
	if _, ok := w.seen[n]; ok {
		// Skip items we've already seen which occurs due to declarations.
		w.duplicate++
		return w
	}

	w.seen[n] = struct{}{}

	switch t := n.(type) {
	case *ast.Identifier:
		if t != nil {
			idx := n.Idx0() + w.shift - 1
			s := w.source[:idx] + "IDENT_" + w.source[idx:]
			w.source = s
			w.shift += 6
		}
	case *ast.VariableExpression:
		if t != nil {
			idx := n.Idx0() + w.shift - 1
			s := w.source[:idx] + "VAR_" + w.source[idx:]
			w.source = s
			w.shift += 4
		}
	case *ast.NewExpression:
		w.newExpressionIdx1 = n.Idx1()
	}

	return w
}

func (w *walker) Exit(n ast.Node) {
	w.pop(n)
}

func TestVisitorRewrite(t *testing.T) {
	source := `var b = function() {
		test();
		try {} catch(e) {}
		var test = "test(); var test = 1"
	} // test`
	program, err := parser.ParseFile(nil, "", source, 0)
	require.NoError(t, err)

	w := &walker{
		source: source,
		seen:   make(map[ast.Node]struct{}),
	}
	ast.Walk(w, program)

	xformed := `var VAR_b = function() {
		IDENT_test();
		try {} catch(IDENT_e) {}
		var VAR_test = "test(); var test = 1"
	} // test`

	require.Equal(t, xformed, w.source)
	require.Empty(t, w.stack)
	require.Zero(t, w.duplicate)
}

func Test_issue261(t *testing.T) {
	tests := map[string]struct {
		code string
		want file.Idx
	}{
		"no-parenthesis": {
			code: `var i = new Image;`,
			want: 18,
		},
		"no-args": {
			code: `var i = new Image();`,
			want: 20,
		},
		"two-args": {
			code: `var i = new Image(1, 2);`,
			want: 24,
		},
	}

	for name, tt := range tests {
		t.Run(name, func(t *testing.T) {
			prog, err := parser.ParseFile(nil, "", tt.code, 0)
			require.NoError(t, err)

			w := &walker{
				source: tt.code,
				seen:   make(map[ast.Node]struct{}),
			}
			ast.Walk(w, prog)

			require.Equal(t, tt.want, w.newExpressionIdx1)
			require.Empty(t, w.stack)
			require.Zero(t, w.duplicate)
		})
	}
}

func TestBadStatement(t *testing.T) {
	source := `
	var abc;
	break; do {
	} while(true);
`
	program, err := parser.ParseFile(nil, "", source, 0)
	require.ErrorContains(t, err, "Illegal break statement")

	w := &walker{
		source: source,
		seen:   make(map[ast.Node]struct{}),
	}

	require.NotPanics(t, func() {
		ast.Walk(w, program)
	})
}


================================================
FILE: builtin.go
================================================
package otto

import (
	"encoding/hex"
	"errors"
	"math"
	"net/url"
	"regexp"
	"strconv"
	"strings"
	"unicode/utf16"
	"unicode/utf8"
)

// Global.
func builtinGlobalEval(call FunctionCall) Value {
	src := call.Argument(0)
	if !src.IsString() {
		return src
	}
	rt := call.runtime
	program := rt.cmplParseOrThrow(src.string(), nil)
	if !call.eval {
		// Not a direct call to eval, so we enter the global ExecutionContext
		rt.enterGlobalScope()
		defer rt.leaveScope()
	}
	returnValue := rt.cmplEvaluateNodeProgram(program, true)
	if returnValue.isEmpty() {
		return Value{}
	}
	return returnValue
}

func builtinGlobalIsNaN(call FunctionCall) Value {
	value := call.Argument(0).float64()
	return boolValue(math.IsNaN(value))
}

func builtinGlobalIsFinite(call FunctionCall) Value {
	value := call.Argument(0).float64()
	return boolValue(!math.IsNaN(value) && !math.IsInf(value, 0))
}

func digitValue(chr rune) int {
	switch {
	case '0' <= chr && chr <= '9':
		return int(chr - '0')
	case 'a' <= chr && chr <= 'z':
		return int(chr - 'a' + 10)
	case 'A' <= chr && chr <= 'Z':
		return int(chr - 'A' + 10)
	}
	return 36 // Larger than any legal digit value
}

func builtinGlobalParseInt(call FunctionCall) Value {
	input := strings.Trim(call.Argument(0).string(), builtinStringTrimWhitespace)
	if len(input) == 0 {
		return NaNValue()
	}

	radix := int(toInt32(call.Argument(1)))

	negative := false
	switch input[0] {
	case '+':
		input = input[1:]
	case '-':
		negative = true
		input = input[1:]
	}

	strip := true
	if radix == 0 {
		radix = 10
	} else {
		if radix < 2 || radix > 36 {
			return NaNValue()
		} else if radix != 16 {
			strip = false
		}
	}

	switch len(input) {
	case 0:
		return NaNValue()
	case 1:
	default:
		if strip {
			if input[0] == '0' && (input[1] == 'x' || input[1] == 'X') {
				input = input[2:]
				radix = 16
			}
		}
	}

	base := radix
	index := 0
	for ; index < len(input); index++ {
		digit := digitValue(rune(input[index])) // If not ASCII, then an error anyway
		if digit >= base {
			break
		}
	}
	input = input[0:index]

	value, err := strconv.ParseInt(input, radix, 64)
	if err != nil {
		if errors.Is(err, strconv.ErrRange) {
			base := float64(base)
			// Could just be a very large number (e.g. 0x8000000000000000)
			var value float64
			for _, chr := range input {
				digit := float64(digitValue(chr))
				if digit >= base {
					return NaNValue()
				}
				value = value*base + digit
			}
			if negative {
				value *= -1
			}
			return float64Value(value)
		}
		return NaNValue()
	}
	if negative {
		value *= -1
	}

	return int64Value(value)
}

var (
	parseFloatMatchBadSpecial = regexp.MustCompile(`[\+\-]?(?:[Ii]nf$|infinity)`)
	parseFloatMatchValid      = regexp.MustCompile(`[0-9eE\+\-\.]|Infinity`)
)

func builtinGlobalParseFloat(call FunctionCall) Value {
	// Caveat emptor: This implementation does NOT match the specification
	input := strings.Trim(call.Argument(0).string(), builtinStringTrimWhitespace)

	if parseFloatMatchBadSpecial.MatchString(input) {
		return NaNValue()
	}
	value, err := strconv.ParseFloat(input, 64)
	if err != nil {
		for end := len(input); end > 0; end-- {
			val := input[0:end]
			if !parseFloatMatchValid.MatchString(val) {
				return NaNValue()
			}
			value, err = strconv.ParseFloat(val, 64)
			if err == nil {
				break
			}
		}
		if err != nil {
			return NaNValue()
		}
	}
	return float64Value(value)
}

// encodeURI/decodeURI

func encodeDecodeURI(call FunctionCall, escape *regexp.Regexp) Value {
	value := call.Argument(0)
	var input []uint16
	switch vl := value.value.(type) {
	case []uint16:
		input = vl
	default:
		input = utf16.Encode([]rune(value.string()))
	}
	if len(input) == 0 {
		return stringValue("")
	}
	output := []byte{}
	length := len(input)
	encode := make([]byte, 4)
	for index := 0; index < length; {
		value := input[index]
		decode := utf16.Decode(input[index : index+1])
		if value >= 0xDC00 && value <= 0xDFFF {
			panic(call.runtime.panicURIError("URI malformed"))
		}
		if value >= 0xD800 && value <= 0xDBFF {
			index++
			if index >= length {
				panic(call.runtime.panicURIError("URI malformed"))
			}
			// input = ..., value, value1, ...
			value1 := input[index]
			if value1 < 0xDC00 || value1 > 0xDFFF {
				panic(call.runtime.panicURIError("URI malformed"))
			}
			decode = []rune{((rune(value) - 0xD800) * 0x400) + (rune(value1) - 0xDC00) + 0x10000}
		}
		index++
		size := utf8.EncodeRune(encode, decode[0])
		output = append(output, encode[0:size]...)
	}

	bytes := escape.ReplaceAllFunc(output, func(target []byte) []byte {
		// Probably a better way of doing this
		if target[0] == ' ' {
			return []byte("%20")
		}
		return []byte(url.QueryEscape(string(target)))
	})
	return stringValue(string(bytes))
}

var encodeURIRegexp = regexp.MustCompile(`([^~!@#$&*()=:/,;?+'])`)

func builtinGlobalEncodeURI(call FunctionCall) Value {
	return encodeDecodeURI(call, encodeURIRegexp)
}

var encodeURIComponentRegexp = regexp.MustCompile(`([^~!*()'])`)

func builtinGlobalEncodeURIComponent(call FunctionCall) Value {
	return encodeDecodeURI(call, encodeURIComponentRegexp)
}

// 3B/2F/3F/3A/40/26/3D/2B/24/2C/23.
var decodeURIGuard = regexp.MustCompile(`(?i)(?:%)(3B|2F|3F|3A|40|26|3D|2B|24|2C|23)`)

func decodeURI(input string, reserve bool) (string, bool) {
	if reserve {
		input = decodeURIGuard.ReplaceAllString(input, "%25$1")
	}
	input = strings.ReplaceAll(input, "+", "%2B") // Ugly hack to make QueryUnescape work with our use case
	output, err := url.QueryUnescape(input)
	if err != nil || !utf8.ValidString(output) {
		return "", true
	}
	return output, false
}

func builtinGlobalDecodeURI(call FunctionCall) Value {
	output, err := decodeURI(call.Argument(0).string(), true)
	if err {
		panic(call.runtime.panicURIError("URI malformed"))
	}
	return stringValue(output)
}

func builtinGlobalDecodeURIComponent(call FunctionCall) Value {
	output, err := decodeURI(call.Argument(0).string(), false)
	if err {
		panic(call.runtime.panicURIError("URI malformed"))
	}
	return stringValue(output)
}

// escape/unescape

func builtinShouldEscape(chr byte) bool {
	if 'A' <= chr && chr <= 'Z' || 'a' <= chr && chr <= 'z' || '0' <= chr && chr <= '9' {
		return false
	}
	return !strings.ContainsRune("*_+-./", rune(chr))
}

const escapeBase16 = "0123456789ABCDEF"

func builtinEscape(input string) string {
	output := make([]byte, 0, len(input))
	length := len(input)
	for index := 0; index < length; {
		if builtinShouldEscape(input[index]) {
			chr, width := utf8.DecodeRuneInString(input[index:])
			chr16 := utf16.Encode([]rune{chr})[0]
			if 256 > chr16 {
				output = append(output, '%',
					escapeBase16[chr16>>4],
					escapeBase16[chr16&15],
				)
			} else {
				output = append(output, '%', 'u',
					escapeBase16[chr16>>12],
					escapeBase16[(chr16>>8)&15],
					escapeBase16[(chr16>>4)&15],
					escapeBase16[chr16&15],
				)
			}
			index += width
		} else {
			output = append(output, input[index])
			index++
		}
	}
	return string(output)
}

func builtinUnescape(input string) string {
	output := make([]rune, 0, len(input))
	length := len(input)
	for index := 0; index < length; {
		if input[index] == '%' {
			if index <= length-6 && input[index+1] == 'u' {
				byte16, err := hex.DecodeString(input[index+2 : index+6])
				if err == nil {
					value := uint16(byte16[0])<<8 + uint16(byte16[1])
					chr := utf16.Decode([]uint16{value})[0]
					output = append(output, chr)
					index += 6
					continue
				}
			}
			if index <= length-3 {
				byte8, err := hex.DecodeString(input[index+1 : index+3])
				if err == nil {
					value := uint16(byte8[0])
					chr := utf16.Decode([]uint16{value})[0]
					output = append(output, chr)
					index += 3
					continue
				}
			}
		}
		output = append(output, rune(input[index]))
		index++
	}
	return string(output)
}

func builtinGlobalEscape(call FunctionCall) Value {
	return stringValue(builtinEscape(call.Argument(0).string()))
}

func builtinGlobalUnescape(call FunctionCall) Value {
	return stringValue(builtinUnescape(call.Argument(0).string()))
}


================================================
FILE: builtin_array.go
================================================
package otto

import (
	"strconv"
	"strings"
)

// Array

func builtinArray(call FunctionCall) Value {
	return objectValue(builtinNewArrayNative(call.runtime, call.ArgumentList))
}

func builtinNewArray(obj *object, argumentList []Value) Value {
	return objectValue(builtinNewArrayNative(obj.runtime, argumentList))
}

func builtinNewArrayNative(rt *runtime, argumentList []Value) *object {
	if len(argumentList) == 1 {
		firstArgument := argumentList[0]
		if firstArgument.IsNumber() {
			return rt.newArray(arrayUint32(rt, firstArgument))
		}
	}
	return rt.newArrayOf(argumentList)
}

func builtinArrayToString(call FunctionCall) Value {
	thisObject := call.thisObject()
	join := thisObject.get("join")
	if join.isCallable() {
		join := join.object()
		return join.call(call.This, call.ArgumentList, false, nativeFrame)
	}
	return builtinObjectToString(call)
}

func builtinArrayToLocaleString(call FunctionCall) Value {
	separator := ","
	thisObject := call.thisObject()
	length := int64(toUint32(thisObject.get(propertyLength)))
	if length == 0 {
		return stringValue("")
	}
	stringList := make([]string, 0, length)
	for index := range length {
		value := thisObject.get(arrayIndexToString(index))
		stringValue := ""
		switch value.kind {
		case valueEmpty, valueUndefined, valueNull:
		default:
			obj := call.runtime.toObject(value)
			toLocaleString := obj.get("toLocaleString")
			if !toLocaleString.isCallable() {
				panic(call.runtime.panicTypeError("Array.toLocaleString index[%d] %q is not callable", index, toLocaleString))
			}
			stringValue = toLocaleString.call(call.runtime, objectValue(obj)).string()
		}
		stringList = append(stringList, stringValue)
	}
	return stringValue(strings.Join(stringList, separator))
}

func builtinArrayConcat(call FunctionCall) Value {
	thisObject := call.thisObject()
	valueArray := []Value{}
	source := append([]Value{objectValue(thisObject)}, call.ArgumentList...)
	for _, item := range source {
		switch item.kind {
		case valueObject:
			obj := item.object()
			if isArray(obj) {
				length := obj.get(propertyLength).number().int64
				for index := range length {
					name := strconv.FormatInt(index, 10)
					if obj.hasProperty(name) {
						valueArray = append(valueArray, obj.get(name))
					} else {
						valueArray = append(valueArray, Value{})
					}
				}
				continue
			}

			fallthrough
		default:
			valueArray = append(valueArray, item)
		}
	}
	return objectValue(call.runtime.newArrayOf(valueArray))
}

func builtinArrayShift(call FunctionCall) Value {
	thisObject := call.thisObject()
	length := int64(toUint32(thisObject.get(propertyLength)))
	if length == 0 {
		thisObject.put(propertyLength, int64Value(0), true)
		return Value{}
	}
	first := thisObject.get("0")
	for index := int64(1); index < length; index++ {
		from := arrayIndexToString(index)
		to := arrayIndexToString(index - 1)
		if thisObject.hasProperty(from) {
			thisObject.put(to, thisObject.get(from), true)
		} else {
			thisObject.delete(to, true)
		}
	}
	thisObject.delete(arrayIndexToString(length-1), true)
	thisObject.put(propertyLength, int64Value(length-1), true)
	return first
}

func builtinArrayPush(call FunctionCall) Value {
	thisObject := call.thisObject()
	itemList := call.ArgumentList
	index := int64(toUint32(thisObject.get(propertyLength)))
	for len(itemList) > 0 {
		thisObject.put(arrayIndexToString(index), itemList[0], true)
		itemList = itemList[1:]
		index++
	}
	length := int64Value(index)
	thisObject.put(propertyLength, length, true)
	return length
}

func builtinArrayPop(call FunctionCall) Value {
	thisObject := call.thisObject()
	length := int64(toUint32(thisObject.get(propertyLength)))
	if length == 0 {
		thisObject.put(propertyLength, uint32Value(0), true)
		return Value{}
	}
	last := thisObject.get(arrayIndexToString(length - 1))
	thisObject.delete(arrayIndexToString(length-1), true)
	thisObject.put(propertyLength, int64Value(length-1), true)
	return last
}

func builtinArrayJoin(call FunctionCall) Value {
	separator := ","
	argument := call.Argument(0)
	if argument.IsDefined() {
		separator = argument.string()
	}
	thisObject := call.thisObject()
	length := int64(toUint32(thisObject.get(propertyLength)))
	if length == 0 {
		return stringValue("")
	}
	stringList := make([]string, 0, length)
	for index := range length {
		value := thisObject.get(arrayIndexToString(index))
		stringValue := ""
		switch value.kind {
		case valueEmpty, valueUndefined, valueNull:
		default:
			stringValue = value.string()
		}
		stringList = append(stringList, stringValue)
	}
	return stringValue(strings.Join(stringList, separator))
}

func builtinArraySplice(call FunctionCall) Value {
	thisObject := call.thisObject()
	length := int64(toUint32(thisObject.get(propertyLength)))

	start := valueToRangeIndex(call.Argument(0), length, false)
	deleteCount := length - start
	if arg, ok := call.getArgument(1); ok {
		deleteCount = valueToRangeIndex(arg, length-start, true)
	}
	valueArray := make([]Value, deleteCount)

	for index := range deleteCount {
		indexString := arrayIndexToString(start + index)
		if thisObject.hasProperty(indexString) {
			valueArray[index] = thisObject.get(indexString)
		}
	}

	// 0, <1, 2, 3, 4>, 5, 6, 7
	// a, b
	// length 8 - delete 4 @ start 1

	itemList := []Value{}
	itemCount := int64(len(call.ArgumentList))
	if itemCount > 2 {
		itemCount -= 2 // Less the first two arguments
		itemList = call.ArgumentList[2:]
	} else {
		itemCount = 0
	}
	if itemCount < deleteCount {
		// The Object/Array is shrinking
		stop := length - deleteCount
		// The new length of the Object/Array before
		// appending the itemList remainder
		// Stopping at the lower bound of the insertion:
		// Move an item from the after the deleted portion
		// to a position after the inserted portion
		for index := start; index < stop; index++ {
			from := arrayIndexToString(index + deleteCount) // Position just after deletion
			to := arrayIndexToString(index + itemCount)     // Position just after splice (insertion)
			if thisObject.hasProperty(from) {
				thisObject.put(to, thisObject.get(from), true)
			} else {
				thisObject.delete(to, true)
			}
		}
		// Delete off the end
		// We don't bother to delete below <stop + itemCount> (if any) since those
		// will be overwritten anyway
		for index := length; index > (stop + itemCount); index-- {
			thisObject.delete(arrayIndexToString(index-1), true)
		}
	} else if itemCount > deleteCount {
		// The Object/Array is growing
		// The itemCount is greater than the deleteCount, so we do
		// not have to worry about overwriting what we should be moving
		// ---
		// Starting from the upper bound of the deletion:
		// Move an item from the after the deleted portion
		// to a position after the inserted portion
		for index := length - deleteCount; index > start; index-- {
			from := arrayIndexToString(index + deleteCount - 1)
			to := arrayIndexToString(index + itemCount - 1)
			if thisObject.hasProperty(from) {
				thisObject.put(to, thisObject.get(from), true)
			} else {
				thisObject.delete(to, true)
			}
		}
	}

	for index := range itemCount {
		thisObject.put(arrayIndexToString(index+start), itemList[index], true)
	}
	thisObject.put(propertyLength, int64Value(length+itemCount-deleteCount), true)

	return objectValue(call.runtime.newArrayOf(valueArray))
}

func builtinArraySlice(call FunctionCall) Value {
	thisObject := call.thisObject()

	length := int64(toUint32(thisObject.get(propertyLength)))
	start, end := rangeStartEnd(call.ArgumentList, length, false)

	if start >= end {
		// Always an empty array
		return objectValue(call.runtime.newArray(0))
	}
	sliceLength := end - start
	sliceValueArray := make([]Value, sliceLength)

	for index := range sliceLength {
		from := arrayIndexToString(index + start)
		if thisObject.hasProperty(from) {
			sliceValueArray[index] = thisObject.get(from)
		}
	}

	return objectValue(call.runtime.newArrayOf(sliceValueArray))
}

func builtinArrayUnshift(call FunctionCall) Value {
	thisObject := call.thisObject()
	length := int64(toUint32(thisObject.get(propertyLength)))
	itemList := call.ArgumentList
	itemCount := int64(len(itemList))

	for index := length; index > 0; index-- {
		from := arrayIndexToString(index - 1)
		to := arrayIndexToString(index + itemCount - 1)
		if thisObject.hasProperty(from) {
			thisObject.put(to, thisObject.get(from), true)
		} else {
			thisObject.delete(to, true)
		}
	}

	for index := range itemCount {
		thisObject.put(arrayIndexToString(index), itemList[index], true)
	}

	newLength := int64Value(length + itemCount)
	thisObject.put(propertyLength, newLength, true)
	return newLength
}

func builtinArrayReverse(call FunctionCall) Value {
	thisObject := call.thisObject()
	length := int64(toUint32(thisObject.get(propertyLength)))

	lower := struct {
		name   string
		index  int64
		exists bool
	}{}
	upper := lower

	lower.index = 0
	middle := length / 2 // Division will floor

	for lower.index != middle {
		lower.name = arrayIndexToString(lower.index)
		upper.index = length - lower.index - 1
		upper.name = arrayIndexToString(upper.index)

		lower.exists = thisObject.hasProperty(lower.name)
		upper.exists = thisObject.hasProperty(upper.name)

		switch {
		case lower.exists && upper.exists:
			lowerValue := thisObject.get(lower.name)
			upperValue := thisObject.get(upper.name)
			thisObject.put(lower.name, upperValue, true)
			thisObject.put(upper.name, lowerValue, true)
		case !lower.exists && upper.exists:
			value := thisObject.get(upper.name)
			thisObject.delete(upper.name, true)
			thisObject.put(lower.name, value, true)
		case lower.exists && !upper.exists:
			value := thisObject.get(lower.name)
			thisObject.delete(lower.name, true)
			thisObject.put(upper.name, value, true)
		}

		lower.index++
	}

	return call.This
}

func sortCompare(thisObject *object, index0, index1 uint, compare *object) int {
	j := struct {
		name    string
		value   string
		exists  bool
		defined bool
	}{}
	k := j
	j.name = arrayIndexToString(int64(index0))
	j.exists = thisObject.hasProperty(j.name)
	k.name = arrayIndexToString(int64(index1))
	k.exists = thisObject.hasProperty(k.name)

	switch {
	case !j.exists && !k.exists:
		return 0
	case !j.exists:
		return 1
	case !k.exists:
		return -1
	}

	x := thisObject.get(j.name)
	y := thisObject.get(k.name)
	j.defined = x.IsDefined()
	k.defined = y.IsDefined()

	switch {
	case !j.defined && !k.defined:
		return 0
	case !j.defined:
		return 1
	case !k.defined:
		return -1
	}

	if compare == nil {
		j.value = x.string()
		k.value = y.string()

		if j.value == k.value {
			return 0
		} else if j.value < k.value {
			return -1
		}

		return 1
	}

	return toIntSign(compare.call(Value{}, []Value{x, y}, false, nativeFrame))
}

func arraySortSwap(thisObject *object, index0, index1 uint) {
	j := struct {
		name   string
		exists bool
	}{}
	k := j

	j.name = arrayIndexToString(int64(index0))
	j.exists = thisObject.hasProperty(j.name)
	k.name = arrayIndexToString(int64(index1))
	k.exists = thisObject.hasProperty(k.name)

	switch {
	case j.exists && k.exists:
		jv := thisObject.get(j.name)
		kv := thisObject.get(k.name)
		thisObject.put(j.name, kv, true)
		thisObject.put(k.name, jv, true)
	case !j.exists && k.exists:
		value := thisObject.get(k.name)
		thisObject.delete(k.name, true)
		thisObject.put(j.name, value, true)
	case j.exists && !k.exists:
		value := thisObject.get(j.name)
		thisObject.delete(j.name, true)
		thisObject.put(k.name, value, true)
	}
}

func arraySortQuickPartition(thisObject *object, left, right, pivot uint, compare *object) (uint, uint) {
	arraySortSwap(thisObject, pivot, right) // Right is now the pivot value
	cursor := left
	cursor2 := left
	for index := left; index < right; index++ {
		comparison := sortCompare(thisObject, index, right, compare) // Compare to the pivot value
		if comparison < 0 {
			arraySortSwap(thisObject, index, cursor)
			if cursor < cursor2 {
				arraySortSwap(thisObject, index, cursor2)
			}
			cursor++
			cursor2++
		} else if comparison == 0 {
			arraySortSwap(thisObject, index, cursor2)
			cursor2++
		}
	}
	arraySortSwap(thisObject, cursor2, right)
	return cursor, cursor2
}

func arraySortQuickSort(thisObject *object, left, right uint, compare *object) {
	if left < right {
		middle := left + (right-left)/2
		pivot, pivot2 := arraySortQuickPartition(thisObject, left, right, middle, compare)
		if pivot > 0 {
			arraySortQuickSort(thisObject, left, pivot-1, compare)
		}
		arraySortQuickSort(thisObject, pivot2+1, right, compare)
	}
}

func builtinArraySort(call FunctionCall) Value {
	thisObject := call.thisObject()
	length := uint(toUint32(thisObject.get(propertyLength)))
	compareValue := call.Argument(0)
	compare := compareValue.object()
	if compareValue.IsUndefined() {
	} else if !compareValue.isCallable() {
		panic(call.runtime.panicTypeError("Array.sort value %q is not callable", compareValue))
	}
	if length > 1 {
		arraySortQuickSort(thisObject, 0, length-1, compare)
	}
	return call.This
}

func builtinArrayIsArray(call FunctionCall) Value {
	return boolValue(isArray(call.Argument(0).object()))
}

func builtinArrayIndexOf(call FunctionCall) Value {
	thisObject, matchValue := call.thisObject(), call.Argument(0)
	if length := int64(toUint32(thisObject.get(propertyLength))); length > 0 {
		index := int64(0)
		if len(call.ArgumentList) > 1 {
			index = call.Argument(1).number().int64
		}
		if index < 0 {
			if index += length; index < 0 {
				index = 0
			}
		} else if index >= length {
			index = -1
		}
		for ; index >= 0 && index < length; index++ {
			name := arrayIndexToString(index)
			if !thisObject.hasProperty(name) {
				continue
			}
			value := thisObject.get(name)
			if strictEqualityComparison(matchValue, value) {
				return uint32Value(uint32(index))
			}
		}
	}
	return intValue(-1)
}

func builtinArrayLastIndexOf(call FunctionCall) Value {
	thisObject, matchValue := call.thisObject(), call.Argument(0)
	length := int64(toUint32(thisObject.get(propertyLength)))
	index := length - 1
	if len(call.ArgumentList) > 1 {
		index = call.Argument(1).number().int64
	}
	if 0 > index {
		index += length
	}
	if index > length {
		index = length - 1
	} else if 0 > index {
		return intValue(-1)
	}
	for ; index >= 0; index-- {
		name := arrayIndexToString(index)
		if !thisObject.hasProperty(name) {
			continue
		}
		value := thisObject.get(name)
		if strictEqualityComparison(matchValue, value) {
			return uint32Value(uint32(index))
		}
	}
	return intValue(-1)
}

func builtinArrayEvery(call FunctionCall) Value {
	thisObject := call.thisObject()
	this := objectValue(thisObject)
	if iterator := call.Argument(0); iterator.isCallable() {
		length := int64(toUint32(thisObject.get(propertyLength)))
		callThis := call.Argument(1)
		for index := range length {
			if key := arrayIndexToString(index); thisObject.hasProperty(key) {
				if value := thisObject.get(key); iterator.call(call.runtime, callThis, value, int64Value(index), this).bool() {
					continue
				}
				return falseValue
			}
		}
		return trueValue
	}
	panic(call.runtime.panicTypeError("Array.every argument %q is not callable", call.Argument(0)))
}

func builtinArraySome(call FunctionCall) Value {
	thisObject := call.thisObject()
	this := objectValue(thisObject)
	if iterator := call.Argument(0); iterator.isCallable() {
		length := int64(toUint32(thisObject.get(propertyLength)))
		callThis := call.Argument(1)
		for index := range length {
			if key := arrayIndexToString(index); thisObject.hasProperty(key) {
				if value := thisObject.get(key); iterator.call(call.runtime, callThis, value, int64Value(index), this).bool() {
					return trueValue
				}
			}
		}
		return falseValue
	}
	panic(call.runtime.panicTypeError("Array.some %q if not callable", call.Argument(0)))
}

func builtinArrayForEach(call FunctionCall) Value {
	thisObject := call.thisObject()
	this := objectValue(thisObject)
	if iterator := call.Argument(0); iterator.isCallable() {
		length := int64(toUint32(thisObject.get(propertyLength)))
		callThis := call.Argument(1)
		for index := range length {
			if key := arrayIndexToString(index); thisObject.hasProperty(key) {
				iterator.call(call.runtime, callThis, thisObject.get(key), int64Value(index), this)
			}
		}
		return Value{}
	}
	panic(call.runtime.panicTypeError("Array.foreach %q if not callable", call.Argument(0)))
}

func builtinArrayMap(call FunctionCall) Value {
	thisObject := call.thisObject()
	this := objectValue(thisObject)
	if iterator := call.Argument(0); iterator.isCallable() {
		length := int64(toUint32(thisObject.get(propertyLength)))
		callThis := call.Argument(1)
		values := make([]Value, length)
		for index := range length {
			if key := arrayIndexToString(index); thisObject.hasProperty(key) {
				values[index] = iterator.call(call.runtime, callThis, thisObject.get(key), index, this)
			} else {
				values[index] = Value{}
			}
		}
		return objectValue(call.runtime.newArrayOf(values))
	}
	panic(call.runtime.panicTypeError("Array.foreach %q if not callable", call.Argument(0)))
}

func builtinArrayFilter(call FunctionCall) Value {
	thisObject := call.thisObject()
	this := objectValue(thisObject)
	if iterator := call.Argument(0); iterator.isCallable() {
		length := int64(toUint32(thisObject.get(propertyLength)))
		callThis := call.Argument(1)
		values := make([]Value, 0)
		for index := range length {
			if key := arrayIndexToString(index); thisObject.hasProperty(key) {
				value := thisObject.get(key)
				if iterator.call(call.runtime, callThis, value, index, this).bool() {
					values = append(values, value)
				}
			}
		}
		return objectValue(call.runtime.newArrayOf(values))
	}
	panic(call.runtime.panicTypeError("Array.filter %q if not callable", call.Argument(0)))
}

func builtinArrayReduce(call FunctionCall) Value {
	thisObject := call.thisObject()
	this := objectValue(thisObject)
	if iterator := call.Argument(0); iterator.isCallable() {
		initial := len(call.ArgumentList) > 1
		start := call.Argument(1)
		length := int64(toUint32(thisObject.get(propertyLength)))
		index := int64(0)
		if length > 0 || initial {
			var accumulator Value
			if !initial {
				for ; index < length; index++ {
					if key := arrayIndexToString(index); thisObject.hasProperty(key) {
						accumulator = thisObject.get(key)
						index++

						break
					}
				}
			} else {
				accumulator = start
			}
			for ; index < length; index++ {
				if key := arrayIndexToString(index); thisObject.hasProperty(key) {
					accumulator = iterator.call(call.runtime, Value{}, accumulator, thisObject.get(key), index, this)
				}
			}
			return accumulator
		}
	}
	panic(call.runtime.panicTypeError("Array.reduce %q if not callable", call.Argument(0)))
}

func builtinArrayReduceRight(call FunctionCall) Value {
	thisObject := call.thisObject()
	this := objectValue(thisObject)
	if iterator := call.Argument(0); iterator.isCallable() {
		initial := len(call.ArgumentList) > 1
		start := call.Argument(1)
		length := int64(toUint32(thisObject.get(propertyLength)))
		if length > 0 || initial {
			index := length - 1
			var accumulator Value
			if !initial {
				for ; index >= 0; index-- {
					if key := arrayIndexToString(index); thisObject.hasProperty(key) {
						accumulator = thisObject.get(key)
						index--
						break
					}
				}
			} else {
				accumulator = start
			}
			for ; index >= 0; index-- {
				if key := arrayIndexToString(index); thisObject.hasProperty(key) {
					accumulator = iterator.call(call.runtime, Value{}, accumulator, thisObject.get(key), key, this)
				}
			}
			return accumulator
		}
	}
	panic(call.runtime.panicTypeError("Array.reduceRight %q if not callable", call.Argument(0)))
}


================================================
FILE: builtin_boolean.go
================================================
package otto

// Boolean

func builtinBoolean(call FunctionCall) Value {
	return boolValue(call.Argument(0).bool())
}

func builtinNewBoolean(obj *object, argumentList []Value) Value {
	return objectValue(obj.runtime.newBoolean(valueOfArrayIndex(argumentList, 0)))
}

func builtinBooleanToString(call FunctionCall) Value {
	value := call.This
	if !value.IsBoolean() {
		// Will throw a TypeError if ThisObject is not a Boolean
		value = call.thisClassObject(classBooleanName).primitiveValue()
	}
	return stringValue(value.string())
}

func builtinBooleanValueOf(call FunctionCall) Value {
	value := call.This
	if !value.IsBoolean() {
		value = call.thisClassObject(classBooleanName).primitiveValue()
	}
	return value
}


================================================
FILE: builtin_date.go
================================================
package otto

import (
	"math"
	"time"
)

// Date

const (
	// TODO Be like V8?
	// builtinDateDateTimeLayout = "Mon Jan 2 2006 15:04:05 GMT-0700 (MST)".
	builtinDateDateTimeLayout = time.RFC1123 // "Mon, 02 Jan 2006 15:04:05 MST"
	builtinDateDateLayout     = "Mon, 02 Jan 2006"
	builtinDateTimeLayout     = "15:04:05 MST"
)

// utcTimeZone is the time zone used for UTC calculations.
// It is GMT not UTC as that's what Javascript does because toUTCString is
// actually an alias to toGMTString.
var utcTimeZone = time.FixedZone("GMT", 0)

func builtinDate(call FunctionCall) Value {
	date := &dateObject{}
	date.Set(newDateTime([]Value{}, time.Local)) //nolint:gosmopolitan
	return stringValue(date.Time().Format(builtinDateDateTimeLayout))
}

func builtinNewDate(obj *object, argumentList []Value) Value {
	return objectValue(obj.runtime.newDate(newDateTime(argumentList, time.Local))) //nolint:gosmopolitan
}

func builtinDateToString(call FunctionCall) Value {
	date := dateObjectOf(call.runtime, call.thisObject())
	if date.isNaN {
		return stringValue("Invalid Date")
	}
	return stringValue(date.Time().Local().Format(builtinDateDateTimeLayout)) //nolint:gosmopolitan
}

func builtinDateToDateString(call FunctionCall) Value {
	date := dateObjectOf(call.runtime, call.thisObject())
	if date.isNaN {
		return stringValue("Invalid Date")
	}
	return stringValue(date.Time().Local().Format(builtinDateDateLayout)) //nolint:gosmopolitan
}

func builtinDateToTimeString(call FunctionCall) Value {
	date := dateObjectOf(call.runtime, call.thisObject())
	if date.isNaN {
		return stringValue("Invalid Date")
	}
	return stringValue(date.Time().Local().Format(builtinDateTimeLayout)) //nolint:gosmopolitan
}

func builtinDateToUTCString(call FunctionCall) Value {
	date := dateObjectOf(call.runtime, call.thisObject())
	if date.isNaN {
		return stringValue("Invalid Date")
	}
	return stringValue(date.Time().In(utcTimeZone).Format(builtinDateDateTimeLayout))
}

func builtinDateToISOString(call FunctionCall) Value {
	date := dateObjectOf(call.runtime, call.thisObject())
	if date.isNaN {
		return stringValue("Invalid Date")
	}
	return stringValue(date.Time().Format("2006-01-02T15:04:05.000Z"))
}

func builtinDateToJSON(call FunctionCall) Value {
	obj := call.thisObject()
	value := obj.DefaultValue(defaultValueHintNumber) // FIXME object.primitiveNumberValue
	// FIXME fv.isFinite
	if fv := value.float64(); math.IsNaN(fv) || math.IsInf(fv, 0) {
		return nullValue
	}

	toISOString := obj.get("toISOString")
	if !toISOString.isCallable() {
		// FIXME
		panic(call.runtime.panicTypeError("Date.toJSON toISOString %q is not callable", toISOString))
	}
	return toISOString.call(call.runtime, objectValue(obj), []Value{})
}

func builtinDateToGMTString(call FunctionCall) Value {
	date := dateObjectOf(call.runtime, call.thisObject())
	if date.isNaN {
		return stringValue("Invalid Date")
	}
	return stringValue(date.Time().Format("Mon, 02 Jan 2006 15:04:05 GMT"))
}

func builtinDateGetTime(call FunctionCall) Value {
	date := dateObjectOf(call.runtime, call.thisObject())
	if date.isNaN {
		return NaNValue()
	}
	// We do this (convert away from a float) so the user
	// does not get something back in exponential notation
	return int64Value(date.Epoch())
}

func builtinDateSetTime(call FunctionCall) Value {
	obj := call.thisObject()
	date := dateObjectOf(call.runtime, call.thisObject())
	date.Set(call.Argument(0).float64())
	obj.value = date
	return date.Value()
}

func builtinDateBeforeSet(call FunctionCall, argumentLimit int, timeLocal bool) (*object, *dateObject, *ecmaTime, []int) {
	obj := call.thisObject()
	date := dateObjectOf(call.runtime, call.thisObject())
	if date.isNaN {
		return nil, nil, nil, nil
	}

	if argumentLimit > len(call.ArgumentList) {
		argumentLimit = len(call.ArgumentList)
	}

	if argumentLimit == 0 {
		obj.value = invalidDateObject
		return nil, nil, nil, nil
	}

	valueList := make([]int, argumentLimit)
	for index := range argumentLimit {
		value := call.ArgumentList[index]
		nm := value.number()
		switch nm.kind {
		case numberInteger, numberFloat:
		default:
			obj.value = invalidDateObject
			return nil, nil, nil, nil
		}
		valueList[index] = int(nm.int64)
	}
	baseTime := date.Time()
	if timeLocal {
		baseTime = baseTime.Local() //nolint:gosmopolitan
	}
	ecmaTime := newEcmaTime(baseTime)
	return obj, &date, &ecmaTime, valueList
}

func builtinDateParse(call FunctionCall) Value {
	date := call.Argument(0).string()
	return float64Value(dateParse(date))
}

func builtinDateUTC(call FunctionCall) Value {
	return float64Value(newDateTime(call.ArgumentList, time.UTC))
}

func builtinDateNow(call FunctionCall) Value {
	call.ArgumentList = []Value(nil)
	return builtinDateUTC(call)
}

// This is a placeholder.
func builtinDateToLocaleString(call FunctionCall) Value {
	date := dateObjectOf(call.runtime, call.thisObject())
	if date.isNaN {
		return stringValue("Invalid Date")
	}
	return stringValue(date.Time().Local().Format("2006-01-02 15:04:05")) //nolint:gosmopolitan
}

// This is a placeholder.
func builtinDateToLocaleDateString(call FunctionCall) Value {
	date := dateObjectOf(call.runtime, call.thisObject())
	if date.isNaN {
		return stringValue("Invalid Date")
	}
	return stringValue(date.Time().Local().Format("2006-01-02")) //nolint:gosmopolitan
}

// This is a placeholder.
func builtinDateToLocaleTimeString(call FunctionCall) Value {
	date := dateObjectOf(call.runtime, call.thisObject())
	if date.isNaN {
		return stringValue("Invalid Date")
	}
	return stringValue(date.Time().Local().Format("15:04:05")) //nolint:gosmopolitan
}

func builtinDateValueOf(call FunctionCall) Value {
	date := dateObjectOf(call.runtime, call.thisObject())
	if date.isNaN {
		return NaNValue()
	}
	return date.Value()
}

func builtinDateGetYear(call FunctionCall) Value {
	// Will throw a TypeError is ThisObject is nil or
	// does not have Class of "Date"
	date := dateObjectOf(call.runtime, call.thisObject())
	if date.isNaN {
		return NaNValue()
	}
	return intValue(date.Time().Local().Year() - 1900) //nolint:gosmopolitan
}

func builtinDateGetFullYear(call FunctionCall) Value {
	// Will throw a TypeError is ThisObject is nil or
	// does not have Class of "Date"
	date := dateObjectOf(call.runtime, call.thisObject())
	if date.isNaN {
		return NaNValue()
	}
	return intValue(date.Time().Local().Year()) //nolint:gosmopolitan
}

func builtinDateGetUTCFullYear(call FunctionCall) Value {
	date := dateObjectOf(call.runtime, call.thisObject())
	if date.isNaN {
		return NaNValue()
	}
	return intValue(date.Time().Year())
}

func builtinDateGetMonth(call FunctionCall) Value {
	date := dateObjectOf(call.runtime, call.thisObject())
	if date.isNaN {
		return NaNValue()
	}
	return intValue(dateFromGoMonth(date.Time().Local().Month())) //nolint:gosmopolitan
}

func builtinDateGetUTCMonth(call FunctionCall) Value {
	date := dateObjectOf(call.runtime, call.thisObject())
	if date.isNaN {
		return NaNValue()
	}
	return intValue(dateFromGoMonth(date.Time().Month()))
}

func builtinDateGetDate(call FunctionCall) Value {
	date := dateObjectOf(call.runtime, call.thisObject())
	if date.isNaN {
		return NaNValue()
	}
	return intValue(date.Time().Local().Day()) //nolint:gosmopolitan
}

func builtinDateGetUTCDate(call FunctionCall) Value {
	date := dateObjectOf(call.runtime, call.thisObject())
	if date.isNaN {
		return NaNValue()
	}
	return intValue(date.Time().Day())
}

func builtinDateGetDay(call FunctionCall) Value {
	// Actually day of the week
	date := dateObjectOf(call.runtime, call.thisObject())
	if date.isNaN {
		return NaNValue()
	}
	return intValue(dateFromGoDay(date.Time().Local().Weekday())) //nolint:gosmopolitan
}

func builtinDateGetUTCDay(call FunctionCall) Value {
	date := dateObjectOf(call.runtime, call.thisObject())
	if date.isNaN {
		return NaNValue()
	}
	return intValue(dateFromGoDay(date.Time().Weekday()))
}

func builtinDateGetHours(call FunctionCall) Value {
	date := dateObjectOf(call.runtime, call.thisObject())
	if date.isNaN {
		return NaNValue()
	}
	return intValue(date.Time().Local().Hour()) //nolint:gosmopolitan
}

func builtinDateGetUTCHours(call FunctionCall) Value {
	date := dateObjectOf(call.runtime, call.thisObject())
	if date.isNaN {
		return NaNValue()
	}
	return intValue(date.Time().Hour())
}

func builtinDateGetMinutes(call FunctionCall) Value {
	date := dateObjectOf(call.runtime, call.thisObject())
	if date.isNaN {
		return NaNValue()
	}
	return intValue(date.Time().Local().Minute()) //nolint:gosmopolitan
}

func builtinDateGetUTCMinutes(call FunctionCall) Value {
	date := dateObjectOf(call.runtime, call.thisObject())
	if date.isNaN {
		return NaNValue()
	}
	return intValue(date.Time().Minute())
}

func builtinDateGetSeconds(call FunctionCall) Value {
	date := dateObjectOf(call.runtime, call.thisObject())
	if date.isNaN {
		return NaNValue()
	}
	return intValue(date.Time().Local().Second()) //nolint:gosmopolitan
}

func builtinDateGetUTCSeconds(call FunctionCall) Value {
	date := dateObjectOf(call.runtime, call.thisObject())
	if date.isNaN {
		return NaNValue()
	}
	return intValue(date.Time().Second())
}

func builtinDateGetMilliseconds(call FunctionCall) Value {
	date := dateObjectOf(call.runtime, call.thisObject())
	if date.isNaN {
		return NaNValue()
	}
	return intValue(date.Time().Local().Nanosecond() / (100 * 100 * 100)) //nolint:gosmopolitan
}

func builtinDateGetUTCMilliseconds(call FunctionCall) Value {
	date := dateObjectOf(call.runtime, call.thisObject())
	if date.isNaN {
		return NaNValue()
	}
	return intValue(date.Time().Nanosecond() / (100 * 100 * 100))
}

func builtinDateGetTimezoneOffset(call FunctionCall) Value {
	date := dateObjectOf(call.runtime, call.thisObject())
	if date.isNaN {
		return NaNValue()
	}
	timeLocal := date.Time().Local() //nolint:gosmopolitan
	// Is this kosher?
	timeLocalAsUTC := time.Date(
		timeLocal.Year(),
		timeLocal.Month(),
		timeLocal.Day(),
		timeLocal.Hour(),
		timeLocal.Minute(),
		timeLocal.Second(),
		timeLocal.Nanosecond(),
		time.UTC,
	)
	return float64Value(date.Time().Sub(timeLocalAsUTC).Seconds() / 60)
}

func builtinDateSetMilliseconds(call FunctionCall) Value {
	obj, date, ecmaTime, value := builtinDateBeforeSet(call, 1, true)
	if ecmaTime == nil {
		return NaNValue()
	}

	ecmaTime.millisecond = value[0]

	date.SetTime(ecmaTime.goTime())
	obj.value = *date
	return date.Value()
}

func builtinDateSetUTCMilliseconds(call FunctionCall) Value {
	obj, date, ecmaTime, value := builtinDateBeforeSet(call, 1, false)
	if ecmaTime == nil {
		return NaNValue()
	}

	ecmaTime.millisecond = value[0]

	date.SetTime(ecmaTime.goTime())
	obj.value = *date
	return date.Value()
}

func builtinDateSetSeconds(call FunctionCall) Value {
	obj, date, ecmaTime, value := builtinDateBeforeSet(call, 2, true)
	if ecmaTime == nil {
		return NaNValue()
	}

	if len(value) > 1 {
		ecmaTime.millisecond = value[1]
	}
	ecmaTime.second = value[0]

	date.SetTime(ecmaTime.goTime())
	obj.value = *date
	return date.Value()
}

func builtinDateSetUTCSeconds(call FunctionCall) Value {
	obj, date, ecmaTime, value := builtinDateBeforeSet(call, 2, false)
	if ecmaTime == nil {
		return NaNValue()
	}

	if len(value) > 1 {
		ecmaTime.millisecond = value[1]
	}
	ecmaTime.second = value[0]

	date.SetTime(ecmaTime.goTime())
	obj.value = *date
	return date.Value()
}

func builtinDateSetMinutes(call FunctionCall) Value {
	obj, date, ecmaTime, value := builtinDateBeforeSet(call, 3, true)
	if ecmaTime == nil {
		return NaNValue()
	}

	if len(value) > 2 {
		ecmaTime.millisecond = value[2]
		ecmaTime.second = value[1]
	} else if len(value) > 1 {
		ecmaTime.second = value[1]
	}
	ecmaTime.minute = value[0]

	date.SetTime(ecmaTime.goTime())
	obj.value = *date
	return date.Value()
}

func builtinDateSetUTCMinutes(call FunctionCall) Value {
	obj, date, ecmaTime, value := builtinDateBeforeSet(call, 3, false)
	if ecmaTime == nil {
		return NaNValue()
	}

	if len(value) > 2 {
		ecmaTime.millisecond = value[2]
		ecmaTime.second = value[1]
	} else if len(value) > 1 {
		ecmaTime.second = value[1]
	}
	ecmaTime.minute = value[0]

	date.SetTime(ecmaTime.goTime())
	obj.value = *date
	return date.Value()
}

func builtinDateSetHours(call FunctionCall) Value {
	obj, date, ecmaTime, value := builtinDateBeforeSet(call, 4, true)
	if ecmaTime == nil {
		return NaNValue()
	}

	switch {
	case len(value) > 3:
		ecmaTime.millisecond = value[3]
		fallthrough
	case len(value) > 2:
		ecmaTime.second = value[2]
		fallthrough
	case len(value) > 1:
		ecmaTime.minute = value[1]
	}
	ecmaTime.hour = value[0]

	date.SetTime(ecmaTime.goTime())
	obj.value = *date
	return date.Value()
}

func builtinDateSetUTCHours(call FunctionCall) Value {
	obj, date, ecmaTime, value := builtinDateBeforeSet(call, 4, false)
	if ecmaTime == nil {
		return NaNValue()
	}

	switch {
	case len(value) > 3:
		ecmaTime.millisecond = value[3]
		fallthrough
	case len(value) > 2:
		ecmaTime.second = value[2]
		fallthrough
	case len(value) > 1:
		ecmaTime.minute = value[1]
	}
	ecmaTime.hour = value[0]

	date.SetTime(ecmaTime.goTime())
	obj.value = *date
	return date.Value()
}

func builtinDateSetDate(call FunctionCall) Value {
	obj, date, ecmaTime, value := builtinDateBeforeSet(call, 1, true)
	if ecmaTime == nil {
		return NaNValue()
	}

	ecmaTime.day = value[0]

	date.SetTime(ecmaTime.goTime())
	obj.value = *date
	return date.Value()
}

func builtinDateSetUTCDate(call FunctionCall) Value {
	obj, date, ecmaTime, value := builtinDateBeforeSet(call, 1, false)
	if ecmaTime == nil {
		return NaNValue()
	}

	ecmaTime.day = value[0]

	date.SetTime(ecmaTime.goTime())
	obj.value = *date
	return date.Value()
}

func builtinDateSetMonth(call FunctionCall) Value {
	obj, date, ecmaTime, value := builtinDateBeforeSet(call, 2, true)
	if ecmaTime == nil {
		return NaNValue()
	}

	if len(value) > 1 {
		ecmaTime.day = value[1]
	}
	ecmaTime.month = value[0]

	date.SetTime(ecmaTime.goTime())
	obj.value = *date
	return date.Value()
}

func builtinDateSetUTCMonth(call FunctionCall) Value {
	obj, date, ecmaTime, value := builtinDateBeforeSet(call, 2, false)
	if ecmaTime == nil {
		return NaNValue()
	}

	if len(value) > 1 {
		ecmaTime.day = value[1]
	}
	ecmaTime.month = value[0]

	date.SetTime(ecmaTime.goTime())
	obj.value = *date
	return date.Value()
}

func builtinDateSetYear(call FunctionCall) Value {
	obj, date, ecmaTime, value := builtinDateBeforeSet(call, 1, true)
	if ecmaTime == nil {
		return NaNValue()
	}

	year := value[0]
	if 0 <= year && year <= 99 {
		year += 1900
	}
	ecmaTime.year = year

	date.SetTime(ecmaTime.goTime())
	obj.value = *date
	return date.Value()
}

func builtinDateSetFullYear(call FunctionCall) Value {
	obj, date, ecmaTime, value := builtinDateBeforeSet(call, 3, true)
	if ecmaTime == nil {
		return NaNValue()
	}

	if len(value) > 2 {
		ecmaTime.day = value[2]
		ecmaTime.month = value[1]
	} else if len(value) > 1 {
		ecmaTime.month = value[1]
	}
	ecmaTime.year = value[0]

	date.SetTime(ecmaTime.goTime())
	obj.value = *date
	return date.Value()
}

func builtinDateSetUTCFullYear(call FunctionCall) Value {
	obj, date, ecmaTime, value := builtinDateBeforeSet(call, 3, false)
	if ecmaTime == nil {
		return NaNValue()
	}

	if len(value) > 2 {
		ecmaTime.day = value[2]
		ecmaTime.month = value[1]
	} else if len(value) > 1 {
		ecmaTime.month = value[1]
	}
	ecmaTime.year = value[0]

	date.SetTime(ecmaTime.goTime())
	obj.value = *date
	return date.Value()
}

// toUTCString
// toISOString
// toJSONString
// toJSON


================================================
FILE: builtin_error.go
================================================
package otto

import (
	"fmt"
)

func builtinError(call FunctionCall) Value {
	return objectValue(call.runtime.newError(classErrorName, call.Argument(0), 1))
}

func builtinNewError(obj *object, argumentList []Value) Value {
	return objectValue(obj.runtime.newError(classErrorName, valueOfArrayIndex(argumentList, 0), 0))
}

func builtinErrorToString(call FunctionCall) Value {
	thisObject := call.thisObject()
	if thisObject == nil {
		panic(call.runtime.panicTypeError("Error.toString is nil"))
	}

	name := classErrorName
	nameValue := thisObject.get("name")
	if nameValue.IsDefined() {
		name = nameValue.string()
	}

	message := ""
	messageValue := thisObject.get("message")
	if messageValue.IsDefined() {
		message = messageValue.string()
	}

	if len(name) == 0 {
		return stringValue(message)
	}

	if len(message) == 0 {
		return stringValue(name)
	}

	return stringValue(fmt.Sprintf("%s: %s", name, message))
}

func (rt *runtime) newEvalError(message Value) *object {
	o := rt.newErrorObject("EvalError", message, 0)
	o.prototype = rt.global.EvalErrorPrototype
	return o
}

func builtinEvalError(call FunctionCall) Value {
	return objectValue(call.runtime.newEvalError(call.Argument(0)))
}

func builtinNewEvalError(obj *object, argumentList []Value) Value {
	return objectValue(obj.runtime.newEvalError(valueOfArrayIndex(argumentList, 0)))
}

func (rt *runtime) newTypeError(message Value) *object {
	o := rt.newErrorObject("TypeError", message, 0)
	o.prototype = rt.global.TypeErrorPrototype
	return o
}

func builtinTypeError(call FunctionCall) Value {
	return objectValue(call.runtime.newTypeError(call.Argument(0)))
}

func builtinNewTypeError(obj *object, argumentList []Value) Value {
	return objectValue(obj.runtime.newTypeError(valueOfArrayIndex(argumentList, 0)))
}

func (rt *runtime) newRangeError(message Value) *object {
	o := rt.newErrorObject("RangeError", message, 0)
	o.prototype = rt.global.RangeErrorPrototype
	return o
}

func builtinRangeError(call FunctionCall) Value {
	return objectValue(call.runtime.newRangeError(call.Argument(0)))
}

func builtinNewRangeError(obj *object, argumentList []Value) Value {
	return objectValue(obj.runtime.newRangeError(valueOfArrayIndex(argumentList, 0)))
}

func (rt *runtime) newURIError(message Value) *object {
	o := rt.newErrorObject("URIError", message, 0)
	o.prototype = rt.global.URIErrorPrototype
	return o
}

func (rt *runtime) newReferenceError(message Value) *object {
	o := rt.newErrorObject("ReferenceError", message, 0)
	o.prototype = rt.global.ReferenceErrorPrototype
	return o
}

func builtinReferenceError(call FunctionCall) Value {
	return objectValue(call.runtime.newReferenceError(call.Argument(0)))
}

func builtinNewReferenceError(obj *object, argumentList []Value) Value {
	return objectValue(obj.runtime.newReferenceError(valueOfArrayIndex(argumentList, 0)))
}

func (rt *runtime) newSyntaxError(message Value) *object {
	o := rt.newErrorObject("SyntaxError", message, 0)
	o.prototype = rt.global.SyntaxErrorPrototype
	return o
}

func builtinSyntaxError(call FunctionCall) Value {
	return objectValue(call.runtime.newSyntaxError(call.Argument(0)))
}

func builtinNewSyntaxError(obj *object, argumentList []Value) Value {
	return objectValue(obj.runtime.newSyntaxError(valueOfArrayIndex(argumentList, 0)))
}

func builtinURIError(call FunctionCall) Value {
	return objectValue(call.runtime.newURIError(call.Argument(0)))
}

func builtinNewURIError(obj *object, argumentList []Value) Value {
	return objectValue(obj.runtime.newURIError(valueOfArrayIndex(argumentList, 0)))
}


================================================
FILE: builtin_function.go
================================================
package otto

import (
	"fmt"
	"strings"
	"unicode"

	"github.com/robertkrimen/otto/parser"
)

// Function

func builtinFunction(call FunctionCall) Value {
	return objectValue(builtinNewFunctionNative(call.runtime, call.ArgumentList))
}

func builtinNewFunction(obj *object, argumentList []Value) Value {
	return objectValue(builtinNewFunctionNative(obj.runtime, argumentList))
}

func argumentList2parameterList(argumentList []Value) []string {
	parameterList := make([]string, 0, len(argumentList))
	for _, value := range argumentList {
		tmp := strings.FieldsFunc(value.string(), func(chr rune) bool {
			return chr == ',' || unicode.IsSpace(chr)
		})
		parameterList = append(parameterList, tmp...)
	}
	return parameterList
}

func builtinNewFunctionNative(rt *runtime, argumentList []Value) *object {
	var parameterList, body string
	if count := len(argumentList); count > 0 {
		tmp := make([]string, 0, count-1)
		for _, value := range argumentList[0 : count-1] {
			tmp = append(tmp, value.string())
		}
		parameterList = strings.Join(tmp, ",")
		body = argumentList[count-1].string()
	}

	// FIXME
	function, err := parser.ParseFunction(parameterList, body)
	rt.parseThrow(err) // Will panic/throw appropriately
	cmpl := compiler{}
	cmplFunction := cmpl.parseExpression(function)

	return rt.newNodeFunction(cmplFunction.(*nodeFunctionLiteral), rt.globalStash)
}

func builtinFunctionToString(call FunctionCall) Value {
	obj := call.thisClassObject(classFunctionName) // Should throw a TypeError unless Function
	switch fn := obj.value.(type) {
	case nativeFunctionObject:
		return stringValue(fmt.Sprintf("function %s() { [native code] }", fn.name))
	case nodeFunctionObject:
		return stringValue(fn.node.source)
	case bindFunctionObject:
		return stringValue("function () { [native code] }")
	default:
		panic(call.runtime.panicTypeError("Function.toString unknown type %T", obj.value))
	}
}

func builtinFunctionApply(call FunctionCall) Value {
	if !call.This.isCallable() {
		panic(call.runtime.panicTypeError("Function.apply %q is not callable", call.This))
	}
	this := call.Argument(0)
	if this.IsUndefined() {
		// FIXME Not ECMA5
		this = objectValue(call.runtime.globalObject)
	}
	argumentList := call.Argument(1)
	switch argumentList.kind {
	case valueUndefined, valueNull:
		return call.thisObject().call(this, nil, false, nativeFrame)
	case valueObject:
	default:
		panic(call.runtime.panicTypeError("Function.apply unknown type %T for second argument"))
	}

	arrayObject := argumentList.object()
	thisObject := call.thisObject()
	length := int64(toUint32(arrayObject.get(propertyLength)))
	valueArray := make([]Value, length)
	for index := range length {
		valueArray[index] = arrayObject.get(arrayIndexToString(index))
	}
	return thisObject.call(this, valueArray, false, nativeFrame)
}

func builtinFunctionCall(call FunctionCall) Value {
	if !call.This.isCallable() {
		panic(call.runtime.panicTypeError("Function.call %q is not callable", call.This))
	}
	thisObject := call.thisObject()
	this := call.Argument(0)
	if this.IsUndefined() {
		// FIXME Not ECMA5
		this = objectValue(call.runtime.globalObject)
	}
	if len(call.ArgumentList) >= 1 {
		return thisObject.call(this, call.ArgumentList[1:], false, nativeFrame)
	}
	return thisObject.call(this, nil, false, nativeFrame)
}

func builtinFunctionBind(call FunctionCall) Value {
	target := call.This
	if !target.isCallable() {
		panic(call.runtime.panicTypeError("Function.bind %q is not callable", call.This))
	}
	targetObject := target.object()

	this := call.Argument(0)
	argumentList := call.slice(1)
	if this.IsUndefined() {
		// FIXME Do this elsewhere?
		this = objectValue(call.runtime.globalObject)
	}

	return objectValue(call.runtime.newBoundFunction(targetObject, this, argumentList))
}


================================================
FILE: builtin_json.go
================================================
package otto

import (
	"bytes"
	"encoding/json"
	"fmt"
	"strings"
)

type builtinJSONParseContext struct {
	reviver Value
	call    FunctionCall
}

func builtinJSONParse(call FunctionCall) Value {
	ctx := builtinJSONParseContext{
		call: call,
	}
	revive := false
	if reviver := call.Argument(1); reviver.isCallable() {
		revive = true
		ctx.reviver = reviver
	}

	var root interface{}
	err := json.Unmarshal([]byte(call.Argument(0).string()), &root)
	if err != nil {
		panic(call.runtime.panicSyntaxError(err.Error()))
	}
	value, exists := builtinJSONParseWalk(ctx, root)
	if !exists {
		value = Value{}
	}
	if revive {
		root := ctx.call.runtime.newObject()
		root.put("", value, false)
		return builtinJSONReviveWalk(ctx, root, "")
	}
	return value
}

func builtinJSONReviveWalk(ctx builtinJSONParseContext, holder *object, name string) Value {
	value := holder.get(name)
	if obj := value.object(); obj != nil {
		if isArray(obj) {
			length := int64(objectLength(obj))
			for index := range length {
				idxName := arrayIndexToString(index)
				idxValue := builtinJSONReviveWalk(ctx, obj, idxName)
				if idxValue.IsUndefined() {
					obj.delete(idxName, false)
				} else {
					obj.defineProperty(idxName, idxValue, 0o111, false)
				}
			}
		} else {
			obj.enumerate(false, func(name string) bool {
				enumVal := builtinJSONReviveWalk(ctx, obj, name)
				if enumVal.IsUndefined() {
					obj.delete(name, false)
				} else {
					obj.defineProperty(name, enumVal, 0o111, false)
				}
				return true
			})
		}
	}
	return ctx.reviver.call(ctx.call.runtime, objectValue(holder), name, value)
}

func builtinJSONParseWalk(ctx builtinJSONParseContext, rawValue interface{}) (Value, bool) {
	switch value := rawValue.(type) {
	case nil:
		return nullValue, true
	case bool:
		return boolValue(value), true
	case string:
		return stringValue(value), true
	case float64:
		return float64Value(value), true
	case []interface{}:
		arrayValue := make([]Value, len(value))
		for index, rawValue := range value {
			if value, exists := builtinJSONParseWalk(ctx, rawValue); exists {
				arrayValue[index] = value
			}
		}
		return objectValue(ctx.call.runtime.newArrayOf(arrayValue)), true
	case map[string]interface{}:
		obj := ctx.call.runtime.newObject()
		for name, rawValue := range value {
			if value, exists := builtinJSONParseWalk(ctx, rawValue); exists {
				obj.put(name, value, false)
			}
		}
		return objectValue(obj), true
	}
	return Value{}, false
}

type builtinJSONStringifyContext struct {
	replacerFunction *Value
	gap              string
	stack            []*object
	propertyList     []string
	call             FunctionCall
}

func builtinJSONStringify(call FunctionCall) Value {
	ctx := builtinJSONStringifyContext{
		call:  call,
		stack: []*object{nil},
	}
	replacer := call.Argument(1).object()
	if replacer != nil {
		if isArray(replacer) {
			length := objectLength(replacer)
			seen := map[string]bool{}
			propertyList := make([]string, length)
			length = 0
			for index := range propertyList {
				value := replacer.get(arrayIndexToString(int64(index)))
				switch value.kind {
				case valueObject:
					switch value.value.(*object).class {
					case classStringName, classNumberName:
					default:
						continue
					}
				case valueString, valueNumber:
				default:
					continue
				}
				name := value.string()
				if seen[name] {
					continue
				}
				seen[name] = true
				length++
				propertyList[index] = name
			}
			ctx.propertyList = propertyList[0:length]
		} else if replacer.class == classFunctionName {
			value := objectValue(replacer)
			ctx.replacerFunction = &value
		}
	}
	if spaceValue, exists := call.getArgument(2); exists {
		if spaceValue.kind == valueObject {
			switch spaceValue.value.(*object).class {
			case classStringName:
				spaceValue = stringValue(spaceValue.string())
			case classNumberName:
				spaceValue = spaceValue.numberValue()
			}
		}
		switch spaceValue.kind {
		case valueString:
			value := spaceValue.string()
			if len(value) > 10 {
				ctx.gap = value[0:10]
			} else {
				ctx.gap = value
			}
		case valueNumber:
			value := spaceValue.number().int64
			if value > 10 {
				value = 10
			} else if value < 0 {
				value = 0
			}
			ctx.gap = strings.Repeat(" ", int(value))
		}
	}
	holder := call.runtime.newObject()
	holder.put("", call.Argument(0), false)
	value, exists := builtinJSONStringifyWalk(ctx, "", holder)
	if !exists {
		return Value{}
	}
	valueJSON, err := json.Marshal(value)
	if err != nil {
		panic(call.runtime.panicTypeError("JSON.stringify marshal: %s", err))
	}
	if ctx.gap != "" {
		valueJSON1 := bytes.Buffer{}
		if err = json.Indent(&valueJSON1, valueJSON, "", ctx.gap); err != nil {
			panic(call.runtime.panicTypeError("JSON.stringify indent: %s", err))
		}
		valueJSON = valueJSON1.Bytes()
	}
	return stringValue(string(valueJSON))
}

func builtinJSONStringifyWalk(ctx builtinJSONStringifyContext, key string, holder *object) (interface{}, bool) {
	value := holder.get(key)

	if value.IsObject() {
		obj := value.object()
		if toJSON := obj.get("toJSON"); toJSON.IsFunction() {
			value = toJSON.call(ctx.call.runtime, value, key)
		} else if obj.objectClass.marshalJSON != nil {
			// If the object is a GoStruct or something that implements json.Marshaler
			marshaler := obj.objectClass.marshalJSON(obj)
			if marshaler != nil {
				return marshaler, true
			}
		}
	}

	if ctx.replacerFunction != nil {
		value = ctx.replacerFunction.call(ctx.call.runtime, objectValue(holder), key, value)
	}

	if value.kind == valueObject {
		switch value.value.(*object).class {
		case classBooleanName:
			value = value.object().value.(Value)
		case classStringName:
			value = stringValue(value.string())
		case classNumberName:
			value = value.numberValue()
		}
	}

	switch value.kind {
	case valueBoolean:
		return value.bool(), true
	case valueString:
		return value.string(), true
	case valueNumber:
		integer := value.number()
		switch integer.kind {
		case numberInteger:
			return integer.int64, true
		case numberFloat:
			return integer.float64, true
		default:
			return nil, true
		}
	case valueNull:
		return nil, true
	case valueObject:
		objHolder := value.object()
		if value := value.object(); nil != value {
			for _, obj := range ctx.stack {
				if objHolder == obj {
					panic(ctx.call.runtime.panicTypeError("Converting circular structure to JSON"))
				}
			}
			ctx.stack = append(ctx.stack, value)
			defer func() { ctx.stack = ctx.stack[:len(ctx.stack)-1] }()
		}
		if isArray(objHolder) {
			var length uint32
			switch value := objHolder.get(propertyLength).value.(type) {
			case uint32:
				length = value
			case int:
				if value >= 0 {
					length = uint32(value)
				}
			default:
				panic(ctx.call.runtime.panicTypeError(fmt.Sprintf("JSON.stringify: invalid length: %v (%[1]T)", value)))
			}
			array := make([]interface{}, length)
			for index := range array {
				name := arrayIndexToString(int64(index))
				value, _ := builtinJSONStringifyWalk(ctx, name, objHolder)
				array[index] = value
			}
			return array, true
		} else if objHolder.class != classFunctionName {
			obj := map[string]interface{}{}
			if ctx.propertyList != nil {
				for _, name := range ctx.propertyList {
					value, exists := builtinJSONStringifyWalk(ctx, name, objHolder)
					if exists {
						obj[name] = value
					}
				}
			} else {
				// Go maps are without order, so this doesn't conform to the ECMA ordering
				// standard, but oh well...
				objHolder.enumerate(false, func(name string) bool {
					value, exists := builtinJSONStringifyWalk(ctx, name, objHolder)
					if exists {
						obj[name] = value
					}
					return true
				})
			}
			return obj, true
		}
	}
	return nil, false
}


================================================
FILE: builtin_math.go
================================================
package otto

import (
	"math"
	"math/rand"
)

// Math

func builtinMathAbs(call FunctionCall) Value {
	number := call.Argument(0).float64()
	return float64Value(math.Abs(number))
}

func builtinMathAcos(call FunctionCall) Value {
	number := call.Argument(0).float64()
	return float64Value(math.Acos(number))
}

func builtinMathAcosh(call FunctionCall) Value {
	number := call.Argument(0).float64()
	return float64Value(math.Acosh(number))
}

func builtinMathAsin(call FunctionCall) Value {
	number := call.Argument(0).float64()
	return float64Value(math.Asin(number))
}

func builtinMathAsinh(call FunctionCall) Value {
	number := call.Argument(0).float64()
	return float64Value(math.Asinh(number))
}

func builtinMathAtan(call FunctionCall) Value {
	number := call.Argument(0).float64()
	return float64Value(math.Atan(number))
}

func builtinMathAtan2(call FunctionCall) Value {
	y := call.Argument(0).float64()
	if math.IsNaN(y) {
		return NaNValue()
	}
	x := call.Argument(1).float64()
	if math.IsNaN(x) {
		return NaNValue()
	}
	return float64Value(math.Atan2(y, x))
}

func builtinMathAtanh(call FunctionCall) Value {
	number := call.Argument(0).float64()
	return float64Value(math.Atanh(number))
}

func builtinMathCbrt(call FunctionCall) Value {
	number := call.Argument(0).float64()
	return float64Value(math.Cbrt(number))
}

func builtinMathCos(call FunctionCall) Value {
	number := call.Argument(0).float64()
	return float64Value(math.Cos(number))
}

func builtinMathCeil(call FunctionCall) Value {
	number := call.Argument(0).float64()
	return float64Value(math.Ceil(number))
}

func builtinMathCosh(call FunctionCall) Value {
	number := call.Argument(0).float64()
	return float64Value(math.Cosh(number))
}

func builtinMathExp(call FunctionCall) Value {
	number := call.Argument(0).float64()
	return float64Value(math.Exp(number))
}

func builtinMathExpm1(call FunctionCall) Value {
	number := call.Argument(0).float64()
	return float64Value(math.Expm1(number))
}

func builtinMathFloor(call FunctionCall) Value {
	number := call.Argument(0).float64()
	return float64Value(math.Floor(number))
}

func builtinMathLog(call FunctionCall) Value {
	number := call.Argument(0).float64()
	return float64Value(math.Log(number))
}

func builtinMathLog10(call FunctionCall) Value {
	number := call.Argument(0).float64()
	return float64Value(math.Log10(number))
}

func builtinMathLog1p(call FunctionCall) Value {
	number := call.Argument(0).float64()
	return float64Value(math.Log1p(number))
}

func builtinMathLog2(call FunctionCall) Value {
	number := call.Argument(0).float64()
	return float64Value(math.Log2(number))
}

func builtinMathMax(call FunctionCall) Value {
	switch len(call.ArgumentList) {
	case 0:
		return negativeInfinityValue()
	case 1:
		return float64Value(call.ArgumentList[0].float64())
	}
	result := call.ArgumentList[0].float64()
	if math.IsNaN(result) {
		return NaNValue()
	}
	for _, value := range call.ArgumentList[1:] {
		value := value.float64()
		if math.IsNaN(value) {
			return NaNValue()
		}
		result = math.Max(result, value)
	}
	return float64Value(result)
}

func builtinMathMin(call FunctionCall) Value {
	switch len(call.ArgumentList) {
	case 0:
		return positiveInfinityValue()
	case 1:
		return float64Value(call.ArgumentList[0].float64())
	}
	result := call.ArgumentList[0].float64()
	if math.IsNaN(result) {
		return NaNValue()
	}
	for _, value := range call.ArgumentList[1:] {
		value := value.float64()
		if math.IsNaN(value) {
			return NaNValue()
		}
		result = math.Min(result, value)
	}
	return float64Value(result)
}

func builtinMathPow(call FunctionCall) Value {
	// TODO Make sure this works according to the specification (15.8.2.13)
	x := call.Argument(0).float64()
	y := call.Argument(1).float64()
	if math.Abs(x) == 1 && math.IsInf(y, 0) {
		return NaNValue()
	}
	return float64Value(math.Pow(x, y))
}

func builtinMathRandom(call FunctionCall) Value {
	var v float64
	if call.runtime.random != nil {
		v = call.runtime.random()
	} else {
		v = rand.Float64() //nolint:gosec
	}
	return float64Value(v)
}

func builtinMathRound(call FunctionCall) Value {
	number := call.Argument(0).float64()
	value := math.Floor(number + 0.5)
	if value == 0 {
		value = math.Copysign(0, number)
	}
	return float64Value(value)
}

func builtinMathSin(call FunctionCall) Value {
	number := call.Argument(0).float64()
	return float64Value(math.Sin(number))
}

func builtinMathSinh(call FunctionCall) Value {
	number := call.Argument(0).float64()
	return float64Value(math.Sinh(number))
}

func builtinMathSqrt(call FunctionCall) Value {
	number := call.Argument(0).float64()
	return float64Value(math.Sqrt(number))
}

func builtinMathTan(call FunctionCall) Value {
	number := call.Argument(0).float64()
	return float64Value(math.Tan(number))
}

func builtinMathTanh(call FunctionCall) Value {
	number := call.Argument(0).float64()
	return float64Value(math.Tanh(number))
}

func builtinMathTrunc(call FunctionCall) Value {
	number := call.Argument(0).float64()
	return float64Value(math.Trunc(number))
}


================================================
FILE: builtin_number.go
================================================
package otto

import (
	"math"
	"strconv"

	"golang.org/x/text/language"
	"golang.org/x/text/message"
	"golang.org/x/text/number"
)

// Number

func numberValueFromNumberArgumentList(argumentList []Value) Value {
	if len(argumentList) > 0 {
		return argumentList[0].numberValue()
	}
	return intValue(0)
}

func builtinNumber(call FunctionCall) Value {
	return numberValueFromNumberArgumentList(call.ArgumentList)
}

func builtinNewNumber(obj *object, argumentList []Value) Value {
	return objectValue(obj.runtime.newNumber(numberValueFromNumberArgumentList(argumentList)))
}

func builtinNumberToString(call FunctionCall) Value {
	// Will throw a TypeError if ThisObject is not a Number
	value := call.thisClassObject(classNumberName).primitiveValue()
	radix := 10
	radixArgument := call.Argument(0)
	if radixArgument.IsDefined() {
		integer := toIntegerFloat(radixArgument)
		if integer < 2 || integer > 36 {
			panic(call.runtime.panicRangeError("toString() radix must be between 2 and 36"))
		}
		radix = int(integer)
	}
	if radix == 10 {
		return stringValue(value.string())
	}
	return stringValue(numberToStringRadix(value, radix))
}

func builtinNumberValueOf(call FunctionCall) Value {
	return call.thisClassObject(classNumberName).primitiveValue()
}

func builtinNumberToFixed(call FunctionCall) Value {
	precision := toIntegerFloat(call.Argument(0))
	if 20 < precision || 0 > precision {
		panic(call.runtime.panicRangeError("toFixed() precision must be between 0 and 20"))
	}
	if call.This.IsNaN() {
		return stringValue("NaN")
	}
	if value := call.This.float64(); math.Abs(value) >= 1e21 {
		return stringValue(floatToString(value, 64))
	}
	return stringValue(strconv.FormatFloat(call.This.float64(), 'f', int(precision), 64))
}

func builtinNumberToExponential(call FunctionCall) Value {
	if call.This.IsNaN() {
		return stringValue("NaN")
	}
	precision := float64(-1)
	if value := call.Argument(0); value.IsDefined() {
		precision = toIntegerFloat(value)
		if 0 > precision {
			panic(call.runtime.panicRangeError("toString() radix must be between 2 and 36"))
		}
	}
	return stringValue(strconv.FormatFloat(call.This.float64(), 'e', int(precision), 64))
}

func builtinNumberToPrecision(call FunctionCall) Value {
	if call.This.IsNaN() {
		return stringValue("NaN")
	}
	value := call.Argument(0)
	if value.IsUndefined() {
		return stringValue(call.This.string())
	}
	precision := toIntegerFloat(value)
	if 1 > precision {
		panic(call.runtime.panicRangeError("toPrecision() precision must be greater than 1"))
	}
	return stringValue(strconv.FormatFloat(call.This.float64(), 'g', int(precision), 64))
}

func builtinNumberIsNaN(call FunctionCall) Value {
	if len(call.ArgumentList) < 1 {
		return boolValue(false)
	}
	return boolValue(call.Argument(0).IsNaN())
}

func builtinNumberToLocaleString(call FunctionCall) Value {
	value := call.thisClassObject(classNumberName).primitiveValue()
	locale := call.Argument(0)
	lang := defaultLanguage
	if locale.IsDefined() {
		lang = language.MustParse(locale.string())
	}

	p := message.NewPrinter(lang)
	return stringValue(p.Sprintf("%v", number.Decimal(value.value)))
}


================================================
FILE: builtin_object.go
================================================
package otto

import (
	"fmt"
	"strconv"
)

// Object

func builtinObject(call FunctionCall) Value {
	value := call.Argument(0)
	switch value.kind {
	case valueUndefined, valueNull:
		return objectValue(call.runtime.newObject())
	}

	return objectValue(call.runtime.toObject(value))
}

func builtinNewObject(obj *object, argumentList []Value) Value {
	value := valueOfArrayIndex(argumentList, 0)
	switch value.kind {
	case valueNull, valueUndefined:
	case valueNumber, valueString, valueBoolean:
		return objectValue(obj.runtime.toObject(value))
	case valueObject:
		return value
	default:
	}
	return objectValue(obj.runtime.newObject())
}

func builtinObjectValueOf(call FunctionCall) Value {
	return objectValue(call.thisObject())
}

func builtinObjectHasOwnProperty(call FunctionCall) Value {
	propertyName := call.Argument(0).string()
	thisObject := call.thisObject()
	return boolValue(thisObject.hasOwnProperty(propertyName))
}

func builtinObjectIsPrototypeOf(call FunctionCall) Value {
	value := call.Argument(0)
	if !value.IsObject() {
		return falseValue
	}
	prototype := call.toObject(value).prototype
	thisObject := call.thisObject()
	for prototype != nil {
		if thisObject == prototype {
			return trueValue
		}
		prototype = prototype.prototype
	}
	return falseValue
}

func builtinObjectPropertyIsEnumerable(call FunctionCall) Value {
	propertyName := call.Argument(0).string()
	thisObject := call.thisObject()
	prop := thisObject.getOwnProperty(propertyName)
	if prop != nil && prop.enumerable() {
		return trueValue
	}
	return falseValue
}

func builtinObjectToString(call FunctionCall) Value {
	var result string
	switch {
	case call.This.IsUndefined():
		result = "[object Undefined]"
	case call.This.IsNull():
		result = "[object Null]"
	default:
		result = fmt.Sprintf("[object %s]", call.thisObject().class)
	}
	return stringValue(result)
}

func builtinObjectToLocaleString(call FunctionCall) Value {
	toString := call.thisObject().get("toString")
	if !toString.isCallable() {
		panic(call.runtime.panicTypeError("Object.toLocaleString %q is not callable", toString))
	}
	return toString.call(call.runtime, call.This)
}

func builtinObjectGetPrototypeOf(call FunctionCall) Value {
	val := call.Argument(0)
	obj := val.object()
	if obj == nil {
		panic(call.runtime.panicTypeError("Object.GetPrototypeOf is nil"))
	}

	if obj.prototype == nil {
		return nullValue
	}

	return objectValue(obj.prototype)
}

func builtinObjectGetOwnPropertyDescriptor(call FunctionCall) Value {
	val := call.Argument(0)
	obj := val.object()
	if obj == nil {
		panic(call.runtime.panicTypeError("Object.GetOwnPropertyDescriptor is nil"))
	}

	name := call.Argument(1).string()
	descriptor := obj.getOwnProperty(name)
	if descriptor == nil {
		return Value{}
	}
	return objectValue(call.runtime.fromPropertyDescriptor(*descriptor))
}

func builtinObjectDefineProperty(call FunctionCall) Value {
	val := call.Argument(0)
	obj := val.object()
	if obj == nil {
		panic(call.runtime.panicTypeError("Object.DefineProperty is nil"))
	}
	name := call.Argument(1).string()
	descriptor := toPropertyDescriptor(call.runtime, call.Argument(2))
	obj.defineOwnProperty(name, descriptor, true)
	return val
}

func builtinObjectDefineProperties(call FunctionCall) Value {
	val := call.Argument(0)
	obj := val.object()
	if obj == nil {
		panic(call.runtime.panicTypeError("Object.DefineProperties is nil"))
	}

	properties := call.runtime.toObject(call.Argument(1))
	properties.enumerate(false, func(name string) bool {
		descriptor := toPropertyDescriptor(call.runtime, properties.get(name))
		obj.defineOwnProperty(name, descriptor, true)
		return true
	})

	return val
}

func builtinObjectCreate(call FunctionCall) Value {
	prototypeValue := call.Argument(0)
	if !prototypeValue.IsNull() && !prototypeValue.IsObject() {
		panic(call.runtime.panicTypeError("Object.Create is nil"))
	}

	obj := call.runtime.newObject()
	obj.prototype = prototypeValue.object()

	propertiesValue := call.Argument(1)
	if propertiesValue.IsDefined() {
		properties := call.runtime.toObject(propertiesValue)
		properties.enumerate(false, func(name string) bool {
			descriptor := toPropertyDescriptor(call.runtime, properties.get(name))
			obj.defineOwnProperty(name, descriptor, true)
			return true
		})
	}

	return objectValue(obj)
}

func builtinObjectIsExtensible(call FunctionCall) Value {
	val := call.Argument(0)
	if obj := val.object(); obj != nil {
		return boolValue(obj.extensible)
	}
	panic(call.runtime.panicTypeError("Object.IsExtensible is nil"))
}

func builtinObjectPreventExtensions(call FunctionCall) Value {
	val := call.Argument(0)
	if obj := val.object(); obj != nil {
		obj.extensible = false
		return val
	}
	panic(call.runtime.panicTypeError("Object.PreventExtensions is nil"))
}

func builtinObjectAssign(call FunctionCall) Value {
	if len(call.ArgumentList) < 1 {
		panic(call.runtime.panicTypeError("Object.assign TypeError: Cannot convert undefined or null to object"))
	}

	target := call.ArgumentList[0]
	targetObj := target.object()
	if !target.IsObject() && target.IsNull() && target.IsUndefined() {
		panic(call.runtime.panicTypeError("Object.assign TypeError: Cannot convert undefined or null to object"))
	}

	for _, source := range call.ArgumentList[1:] {
		if source.IsString() {
			sourceStr := source.string()
			for i, r := range sourceStr {
				targetObj.put(strconv.Itoa(i), stringValue(string(r)), true)
			}
		} else if source.IsObject() {
			sourceObj := source.object()
			sourceObj.enumerate(false, func(name string) bool {
				descriptor := sourceObj.getOwnProperty(name)
				ok := targetObj.defineOwnProperty(name, *descriptor, true)
				if !ok {
					panic(call.runtime.panicTypeError("Object.assign TypeError: Cannot convert undefined or null to object"))
				}
				return true
			})
		}
	}

	return objectValue(targetObj)
}

func builtinObjectIsSealed(call FunctionCall) Value {
	val := call.Argument(0)
	if obj := val.object(); obj != nil {
		if obj.extensible {
			return boolValue(false)
		}
		result := true
		obj.enumerate(true, func(name string) bool {
			prop := obj.getProperty(name)
			if prop.configurable() {
				result = false
			}
			return true
		})
		return boolValue(result)
	}
	panic(call.runtime.panicTypeError("Object.IsSealed is nil"))
}

func builtinObjectSeal(call FunctionCall) Value {
	val := call.Argument(0)
	if obj := val.object(); obj != nil {
		obj.enumerate(true, func(name string) bool {
			if prop := obj.getOwnProperty(name); nil != prop && prop.configurable() {
				prop.configureOff()
				obj.defineOwnProperty(name, *prop, true)
			}
			return true
		})
		obj.extensible = false
		return val
	}
	panic(call.runtime.panicTypeError("Object.Seal is nil"))
}

func builtinObjectIsFrozen(call FunctionCall) Value {
	val := call.Argument(0)
	if obj := val.object(); obj != nil {
		if obj.extensible {
			return boolValue(false)
		}
		result := true
		obj.enumerate(true, func(name string) bool {
			prop := obj.getProperty(name)
			if prop.configurable() || prop.writable() {
				result = false
			}
			return true
		})
		return boolValue(result)
	}
	panic(call.runtime.panicTypeError("Object.IsFrozen is nil"))
}

func builtinObjectFreeze(call FunctionCall) Value {
	val := call.Argument(0)
	if obj := val.object(); obj != nil {
		obj.enumerate(true, func(name string) bool {
			if prop, update := obj.getOwnProperty(name), false; nil != prop {
				if prop.isDataDescriptor() && prop.writable() {
					prop.writeOff()
					update = true
				}
				if prop.configurable() {
					prop.configureOff()
					update = true
				}
				if update {
					obj.defineOwnProperty(name, *prop, true)
				}
			}
			return true
		})
		obj.extensible = false
		return val
	}
	panic(call.runtime.panicTypeError("Object.Freeze is nil"))
}

func builtinObjectKeys(call FunctionCall) Value {
	if obj, keys := call.Argument(0).object(), []Value(nil); nil != obj {
		obj.enumerate(false, func(name string) bool {
			keys = append(keys, stringValue(name))
			return true
		})
		return objectValue(call.runtime.newArrayOf(keys))
	}
	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 {
	if obj, propertyNames := call.Argument(0).object(), []Value(nil); nil != obj {
		obj.enumerate(true, func(name string) bool {
			if obj.hasOwnProperty(name) {
				propertyNames = append(propertyNames, stringValue(name))
			}
			return true
		})
		return objectValue(call.runtime.newArrayOf(propertyNames))
	}

	// Default to empty array for non object types.
	return objectValue(call.runtime.newArray(0))
}


================================================
FILE: builtin_regexp.go
================================================
package otto

import (
	"fmt"
)

// RegExp

func builtinRegExp(call FunctionCall) Value {
	pattern := call.Argument(0)
	flags := call.Argument(1)
	if obj := pattern.object(); obj != nil {
		if obj.class == classRegExpName && flags.IsUndefined() {
			return pattern
		}
	}
	return objectValue(call.runtime.newRegExp(pattern, flags))
}

func builtinNewRegExp(obj *object, argumentList []Value) Value {
	return objectValue(obj.runtime.newRegExp(
		valueOfArrayIndex(argumentList, 0),
		valueOfArrayIndex(argumentList, 1),
	))
}

func builtinRegExpToString(call FunctionCall) Value {
	thisObject := call.thisObject()
	source := thisObject.get("source").string()
	flags := []byte{}
	if thisObject.get("global").bool() {
		flags = append(flags, 'g')
	}
	if thisObject.get("ignoreCase").bool() {
		flags = append(flags, 'i')
	}
	if thisObject.get("multiline").bool() {
		flags = append(flags, 'm')
	}
	return stringValue(fmt.Sprintf("/%s/%s", source, flags))
}

func builtinRegExpExec(call FunctionCall) Value {
	thisObject := call.thisObject()
	target := call.Argument(0).string()
	match, result := execRegExp(thisObject, target)
	if !match {
		return nullValue
	}
	return objectValue(execResultToArray(call.runtime, target, result))
}

func builtinRegExpTest(call FunctionCall) Value {
	thisObject := call.thisObject()
	target := call.Argument(0).string()
	match, result := execRegExp(thisObject, target)

	if !match {
		return boolValue(match)
	}

	// Match extract and assign input, $_ and $1 -> $9 on global RegExp.
	input := stringValue(target)
	call.runtime.global.RegExp.defineProperty("$_", input, 0o100, false)
	call.runtime.global.RegExp.defineProperty("input", input, 0o100, false)

	var start int
	n := 1
	re := call.runtime.global.RegExp
	empty := stringValue("")
	for i, v := range result[2:] {
		if i%2 == 0 {
			start = v
		} else {
			if v == -1 {
				// No match for this part.
				re.defineProperty(fmt.Sprintf("$%d", n), empty, 0o100, false)
			} else {
				re.defineProperty(fmt.Sprintf("$%d", n), stringValue(target[start:v]), 0o100, false)
			}
			n++
			if n == 10 {
				break
			}
		}
	}

	if n <= 9 {
		// Erase remaining.
		for i := n; i <= 9; i++ {
			re.defineProperty(fmt.Sprintf("$%d", i), empty, 0o100, false)
		}
	}

	return boolValue(match)
}

func builtinRegExpCompile(call FunctionCall) Value {
	// This (useless) function is deprecated, but is here to provide some
	// semblance of compatibility.
	// Caveat emptor: it may not be around for long.
	return Value{}
}


================================================
FILE: builtin_string.go
================================================
package otto

import (
	"bytes"
	"regexp"
	"strconv"
	"strings"
	"unicode/utf16"
	"unicode/utf8"
)

// String

func stringValueFromStringArgumentList(argumentList []Value) Value {
	if len(argumentList) > 0 {
		return stringValue(argumentList[0].string())
	}
	return stringValue("")
}

func builtinString(call FunctionCall) Value {
	return stringValueFromStringArgumentList(call.ArgumentList)
}

func builtinNewString(obj *object, argumentList []Value) Value {
	return objectValue(obj.runtime.newString(stringValueFromStringArgumentList(argumentList)))
}

func builtinStringToString(call FunctionCall) Value {
	return call.thisClassObject(classStringName).primitiveValue()
}

func builtinStringValueOf(call FunctionCall) Value {
	return call.thisClassObject(classStringName).primitiveValue()
}

func builtinStringFromCharCode(call FunctionCall) Value {
	chrList := make([]uint16, len(call.ArgumentList))
	for index, value := range call.ArgumentList {
		chrList[index] = toUint16(value)
	}
	return string16Value(chrList)
}

func builtinStringCharAt(call FunctionCall) Value {
	checkObjectCoercible(call.runtime, call.This)
	idx := int(call.Argument(0).number().int64)
	chr := stringAt(call.This.object().stringValue(), idx)
	if chr == utf8.RuneError {
		return stringValue("")
	}
	return stringValue(string(chr))
}

func builtinStringCharCodeAt(call FunctionCall) Value {
	checkObjectCoercible(call.runtime, call.This)
	idx := int(call.Argument(0).number().int64)
	chr := stringAt(call.This.object().stringValue(), idx)
	if chr == utf8.RuneError {
		return NaNValue()
	}
	return uint16Value(uint16(chr))
}

func builtinStringConcat(call FunctionCall) Value {
	checkObjectCoercible(call.runtime, call.This)
	var value bytes.Buffer
	value.WriteString(call.This.string())
	for _, item := range call.ArgumentList {
		value.WriteString(item.string())
	}
	return stringValue(value.String())
}

func lastIndexRune(s, substr string) int {
	if i := strings.LastIndex(s, substr); i >= 0 {
		return utf16Length(s[:i])
	}
	return -1
}

func indexRune(s, substr string) int {
	if i := strings.Index(s, substr); i >= 0 {
		return utf16Length(s[:i])
	}
	return -1
}

func utf16Length(s string) int {
	return len(utf16.Encode([]rune(s)))
}

func builtinStringIndexOf(call FunctionCall) Value {
	checkObjectCoercible(call.runtime, call.This)
	value := call.This.string()
	target := call.Argument(0).string()
	if 2 > len(call.ArgumentList) {
		return intValue(indexRune(value, target))
	}
	start := toIntegerFloat(call.Argument(1))
	if 0 > start {
		start = 0
	} else if start >= float64(len(value)) {
		if target == "" {
			return intValue(len(value))
		}
		return intValue(-1)
	}
	index := indexRune(value[int(start):], target)
	if index >= 0 {
		index += int(start)
	}
	return intValue(index)
}

func builtinStringLastIndexOf(call FunctionCall) Value {
	checkObjectCoercible(call.runtime, call.This)
	value := call.This.string()
	target := call.Argument(0).string()
	if 2 > len(call.ArgumentList) || call.ArgumentList[1].IsUndefined() {
		return intValue(lastIndexRune(value, target))
	}
	length := len(value)
	if length == 0 {
		return intValue(lastIndexRune(value, target))
	}
	start := call.ArgumentList[1].number()
	if start.kind == numberInfinity { // FIXME
		// startNumber is infinity, so start is the end of string (start = length)
		return intValue(lastIndexRune(value, target))
	}
	if 0 > start.int64 {
		start.int64 = 0
	}
	end := int(start.int64) + len(target)
	if end > length {
		end = length
	}
	return intValue(lastIndexRune(value[:end], target))
}

func builtinStringMatch(call FunctionCall) Value {
	checkObjectCoercible(call.runtime, call.This)
	target := call.This.string()
	matcherValue := call.Argument(0)
	matcher := matcherValue.object()
	if !matcherValue.IsObject() || matcher.class != classRegExpName {
		matcher = call.runtime.newRegExp(matcherValue, Value{})
	}
	global := matcher.get("global").bool()
	if !global {
		match, result := execRegExp(matcher, target)
		if !match {
			return nullValue
		}
		return objectValue(execResultToArray(call.runtime, target, result))
	}

	result := matcher.regExpValue().regularExpression.FindAllStringIndex(target, -1)
	if result == nil {
		matcher.put("lastIndex", intValue(0), true)
		return Value{} // !match
	}
	matchCount := len(result)
	valueArray := make([]Value, matchCount)
	for index := range matchCount {
		valueArray[index] = stringValue(target[result[index][0]:result[index][1]])
	}
	matcher.put("lastIndex", intValue(result[matchCount-1][1]), true)
	return objectValue(call.runtime.newArrayOf(valueArray))
}

var builtinStringReplaceRegexp = regexp.MustCompile("\\$(?:[\\$\\&\\'\\`1-9]|0[1-9]|[1-9][0-9])")

func builtinStringFindAndReplaceString(input []byte, lastIndex int, match []int, target []byte, replaceValue []byte) []byte {
	matchCount := len(match) / 2
	output := input
	if match[0] != lastIndex {
		output = append(output, target[lastIndex:match[0]]...)
	}
	replacement := builtinStringReplaceRegexp.ReplaceAllFunc(replaceValue, func(part []byte) []byte {
		// TODO Check if match[0] or match[1] can be -1 in this scenario
		switch part[1] {
		case '$':
			return []byte{'$'}
		case '&':
			return target[match[0]:match[1]]
		case '`':
			return target[:match[0]]
		case '\'':
			return target[match[1]:]
		}
		matchNumberParse, err := strconv.ParseInt(string(part[1:]), 10, 64)
		if err != nil {
			return nil
		}
		matchNumber := int(matchNumberParse)
		if matchNumber >= matchCount {
			return nil
		}
		offset := 2 * matchNumber
		if match[offset] != -1 {
			return target[match[offset]:match[offset+1]]
		}
		return nil // The empty string
	})

	return append(output, replacement...)
}

func builtinStringReplace(call FunctionCall) Value {
	checkObjectCoercible(call.runtime, call.This)
	target := []byte(call.This.string())
	searchValue := call.Argument(0)
	searchObject := searchValue.object()

	// TODO If a capture is -1?
	var search *regexp.Regexp
	global := false
	find := 1
	if searchValue.IsObject() && searchObject.class == classRegExpName {
		regExp := searchObject.regExpValue()
		search = regExp.regularExpression
		if regExp.global {
			find = -1
			global = true
		}
	} else {
		search = regexp.MustCompile(regexp.QuoteMeta(searchValue.string()))
	}

	found := search.FindAllSubmatchIndex(target, find)
	if found == nil {
		return stringValue(string(target)) // !match
	}

	lastIndex := 0
	result := []byte{}
	replaceValue := call.Argument(1)
	if replaceValue.isCallable() {
		target := string(target)
		replace := replaceValue.object()
		for _, match := range found {
			if match[0] != lastIndex {
				result = append(result, target[lastIndex:match[0]]...)
			}
			matchCount := len(match) / 2
			argumentList := make([]Value, matchCount+2)
			for index := range matchCount {
				offset := 2 * index
				if match[offset] != -1 {
					argumentList[index] = stringValue(target[match[offset]:match[offset+1]])
				} else {
					argumentList[index] = Value{}
				}
			}
			// Replace expects rune offsets not byte offsets.
			startIndex := utf8.RuneCountInString(target[0:match[0]])
			argumentList[matchCount+0] = intValue(startIndex)
			argumentList[matchCount+1] = stringValue(target)
			replacement := replace.call(Value{}, argumentList, false, nativeFrame).string()
			result = append(result, []byte(replacement)...)
			lastIndex = match[1]
		}
	} else {
		replace := []byte(replaceValue.string())
		for _, match := range found {
			result = builtinStringFindAndReplaceString(result, lastIndex, match, target, replace)
			lastIndex = match[1]
		}
	}

	if lastIndex != len(target) {
		result = append(result, target[lastIndex:]...)
	}

	if global && searchObject != nil {
		searchObject.put("lastIndex", intValue(lastIndex), true)
	}

	return stringValue(string(result))
}

func builtinStringSearch(call FunctionCall) Value {
	checkObjectCoercible(call.runtime, call.This)
	target := call.This.string()
	searchValue := call.Argument(0)
	search := searchValue.object()
	if !searchValue.IsObject() || search.class != classRegExpName {
		search = call.runtime.newRegExp(searchValue, Value{})
	}
	result := search.regExpValue().regularExpression.FindStringIndex(target)
	if result == nil {
		return intValue(-1)
	}
	return intValue(result[0])
}

func builtinStringSplit(call FunctionCall) Value {
	checkObjectCoercible(call.runtime, call.This)
	target := call.This.string()

	separatorValue := call.Argument(0)
	limitValue := call.Argument(1)
	limit := -1
	if limitValue.IsDefined() {
		limit = int(toUint32(limitValue))
	}

	if limit == 0 {
		return objectValue(call.runtime.newArray(0))
	}

	if separatorValue.IsUndefined() {
		return objectValue(call.runtime.newArrayOf([]Value{stringValue(target)}))
	}

	if separatorValue.isRegExp() {
		targetLength := len(target)
		search := separatorValue.object().regExpValue().regularExpression
		valueArray := []Value{}
		result := search.FindAllStringSubmatchIndex(target, -1)
		lastIndex := 0
		found := 0

		for _, match := range result {
			if match[0] == match[1] {
				// FIXME Ugh, this is a hack
				if match[0] == 0 || match[0] == targetLength {
					continue
				}
			}

			if lastIndex != match[0] {
				valueArray = append(valueArray, stringValue(target[lastIndex:match[0]]))
				found++
			} else if lastIndex == match[0] {
				if lastIndex != -1 {
					valueArray = append(valueArray, stringValue(""))
					found++
				}
			}

			lastIndex = match[1]
			if found == limit {
				goto RETURN
			}

			captureCount := len(match) / 2
			for index := 1; index < captureCount; index++ {
				offset := index * 2
				value := Value{}
				if match[offset] != -1 {
					value = stringValue(target[match[offset]:match[offset+1]])
				}
				valueArray = append(valueArray, value)
				found++
				if found == limit {
					goto RETURN
				}
			}
		}

		if found != limit {
			if lastIndex != targetLength {
				valueArray = append(valueArray, stringValue(target[lastIndex:targetLength]))
			} else {
				valueArray = append(valueArray, stringValue(""))
			}
		}

	RETURN:
		return objectValue(call.runtime.newArrayOf(valueArray))
	} else {
		separator := separatorValue.string()

		splitLimit := limit
		excess := false
		if limit > 0 {
			splitLimit = limit + 1
			excess = true
		}

		split := strings.SplitN(target, separator, splitLimit)

		if excess && len(split) > limit {
			split = split[:limit]
		}

		valueArray := make([]Value, len(split))
		for index, value := range split {
			valueArray[index] = stringValue(value)
		}

		return objectValue(call.runtime.newArrayOf(valueArray))
	}
}

// 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 {
	checkObjectCoercible(call.runtime, call.This)
	target := []rune(call.This.string())

	length := int64(len(target))
	start, end := rangeStartEnd(call.ArgumentList, length, false)
	if end-start <= 0 {
		return stringValue("")
	}
	return stringValue(string(target[start:end]))
}

func builtinStringSubstring(call FunctionCall) Value {
	checkObjectCoercible(call.runtime, call.This)
	target := []rune(call.This.string())

	length := int64(len(target))
	start, end := rangeStartEnd(call.ArgumentList, length, true)
	if start > end {
		start, end = end, start
	}
	return stringValue(string(target[start:end]))
}

func builtinStringSubstr(call FunctionCall) Value {
	target := []rune(call.This.string())

	size := int64(len(target))
	start, length := rangeStartLength(call.ArgumentList, size)

	if start >= size {
		return stringValue("")
	}

	if length <= 0 {
		return stringValue("")
	}

	if start+length >= size {
		// Cap length to be to the end of the string
		// start = 3, length = 5, size = 4 [0, 1, 2, 3]
		// 4 - 3 = 1
		// target[3:4]
		length = size - start
	}

	return stringValue(string(target[start : start+length]))
}

func builtinStringStartsWith(call FunctionCall) Value {
	checkObjectCoercible(call.runtime, call.This)
	target := call.This.string()
	search := call.Argument(0).string()
	length := len(search)
	if length > len(target) {
		return boolValue(false)
	}
	return boolValue(target[:length] == search)
}

func builtinStringToLowerCase(call FunctionCall) Value {
	checkObjectCoercible(call.runtime, call.This)
	return stringValue(strings.ToLower(call.This.string()))
}

func builtinStringToUpperCase(call FunctionCall) Value {
	checkObjectCoercible(call.runtime, call.This)
	return stringValue(strings.ToUpper(call.This.string()))
}

// 7.2 Table 2 — Whitespace Characters & 7.3 Table 3 - Line Terminator Characters.
const builtinStringTrimWhitespace = "\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF"

func builtinStringTrim(call FunctionCall) Value {
	checkObjectCoercible(call.runtime, call.This)
	return toValue(strings.Trim(call.This.string(),
		builtinStringTrimWhitespace))
}

func builtinStringTrimStart(call FunctionCall) Value {
	return builtinStringTrimLeft(call)
}

func builtinStringTrimEnd(call FunctionCall) Value {
	return builtinStringTrimRight(call)
}

// Mozilla extension, not ECMAScript 5.
func builtinStringTrimLeft(call FunctionCall) Value {
	checkObjectCoercible(call.runtime, call.This)
	return toValue(strings.TrimLeft(call.This.string(),
		builtinStringTrimWhitespace))
}

// Mozilla extension, not ECMAScript 5.
func builtinStringTrimRight(call FunctionCall) Value {
	checkObjectCoercible(call.runtime, call.This)
	return toValue(strings.TrimRight(call.This.string(),
		builtinStringTrimWhitespace))
}

func builtinStringLocaleCompare(call FunctionCall) Value {
	checkObjectCoercible(call.runtime, call.This)
	this := call.This.string() //nolint:ifshort
	that := call.Argument(0).string()
	if this < that {
		return intValue(-1)
	} else if this == that {
		return intValue(0)
	}
	return intValue(1)
}

func builtinStringToLocaleLowerCase(call FunctionCall) Value {
	return builtinStringToLowerCase(call)
}

func builtinStringToLocaleUpperCase(call FunctionCall) Value {
	return builtinStringToUpperCase(call)
}


================================================
FILE: builtin_test.go
================================================
package otto

import (
	"testing"
)

func TestString_substr(t *testing.T) {
	tt(t, func() {
		test, _ := test()

		test(`
            [
                "uñiçode".substr(0,1), // "u"
                "uñiçode".substr(0,2), // "uñ"
                "uñiçode".substr(0,3), // "uñi"
                "uñiçode".substr(0,4), // "uñiç"
                "uñiçode".substr(0,9), // "uñiçode"
            ];
        `, "u,uñ,uñi,uñiç,uñiçode")

		test(`
            [
                "abc".substr(0,1), // "a"
                "abc".substr(0,2), // "ab"
                "abc".substr(0,3), // "abc"
                "abc".substr(0,4), // "abc"
                "abc".substr(0,9), // "abc"
            ];
        `, "a,ab,abc,abc,abc")

		test(`
            [
                "abc".substr(1,1), // "b"
                "abc".substr(1,2), // "bc"
                "abc".substr(1,3), // "bc"
                "abc".substr(1,4), // "bc"
                "abc".substr(1,9), // "bc"
            ];
        `, "b,bc,bc,bc,bc")

		test(`
            [
                "abc".substr(2,1), // "c"
                "abc".substr(2,2), // "c"
                "abc".substr(2,3), // "c"
                "abc".substr(2,4), // "c"
                "abc".substr(2,9), // "c"
            ];
        `, "c,c,c,c,c")

		test(`
            [
                "abc".substr(3,1), // ""
                "abc".substr(3,2), // ""
                "abc".substr(3,3), // ""
                "abc".substr(3,4), // ""
                "abc".substr(3,9), // ""
            ];
        `, ",,,,")

		test(`
            [
                "abc".substr(0), // "abc"
                "abc".substr(1), // "bc"
                "abc".substr(2), // "c"
                "abc".substr(3), // ""
                "abc".substr(9), // ""
            ];
        `, "abc,bc,c,,")

		test(`
            [
                "abc".substr(-9), // "abc"
                "abc".substr(-3), // "abc"
                "abc".substr(-2), // "bc"
                "abc".substr(-1), // "c"
            ];
        `, "abc,abc,bc,c")

		test(`
            [
                "abc".substr(-9, 1), // "a"
                "abc".substr(-3, 1), // "a"
                "abc".substr(-2, 1), // "b"
                "abc".substr(-1, 1), // "c"
                "abc".substr(-1, 2), // "c"
            ];
        `, "a,a,b,c,c")

		test(`"abcd".substr(3, 5)`, "d")
	})
}

func Test_builtin_escape(t *testing.T) {
	tt(t, func() {
		is(builtinEscape("abc"), "abc")

		is(builtinEscape("="), "%3D")

		is(builtinEscape("abc=%+32"), "abc%3D%25+32")

		is(builtinEscape("世界"), "%u4E16%u754C")
	})
}

func Test_builtin_unescape(t *testing.T) {
	tt(t, func() {
		is(builtinUnescape("abc"), "abc")

		is(builtinUnescape("=%3D"), "==")

		is(builtinUnescape("abc%3D%25+32"), "abc=%+32")

		is(builtinUnescape("%u4E16%u754C"), "世界")
	})
}

func TestGlobal_escape(t *testing.T) {
	tt(t, func() {
		test, _ := test()

		test(`
            [
                escape("abc"),          // "abc"
                escape("="),            // "%3D"
                escape("abc=%+32"),     // "abc%3D%25+32"
                escape("\u4e16\u754c"), // "%u4E16%u754C"
            ];
        `, "abc,%3D,abc%3D%25+32,%u4E16%u754C")
	})
}

func TestGlobal_unescape(t *testing.T) {
	tt(t, func() {
		test, _ := test()

		test(`
            [
                unescape("abc"),          // "abc"
                unescape("=%3D"),         // "=="
                unescape("abc%3D%25+32"), // "abc=%+32"
                unescape("%u4E16%u754C"), // "世界"
            ];
        `, "abc,==,abc=%+32,世界")
	})
}

func TestNumber_isNaN(t *testing.T) {
	tt(t, func() {
		test, _ := test()
		test(`Number.isNaN(1)`, false)
		test(`Number.isNaN(null)`, false)
		test(`Number.isNaN()`, false)
		test(`Number.isNaN(Number.NaN)`, true)
		test(`Number.isNaN(0+undefined)`, true)
	})
}


================================================
FILE: call_test.go
================================================
package otto

import (
	"reflect"
	"testing"

	"github.com/stretchr/testify/require"
)

const (
	testAb = "ab"
)

func BenchmarkNativeCallWithString(b *testing.B) {
	vm := New()
	err := vm.Set("x", func(a1 string) {})
	require.NoError(b, err)

	s, err := vm.Compile("test.js", `x("zzz")`)
	require.NoError(b, err)

	for i := 0; i < b.N; i++ {
		_, err = vm.Run(s)
		require.NoError(b, err)
	}
}

func BenchmarkNativeCallWithFloat32(b *testing.B) {
	vm := New()
	err := vm.Set("x", func(a1 float32) {})
	require.NoError(b, err)

	s, err := vm.Compile("test.js", `x(1.1)`)
	require.NoError(b, err)

	for i := 0; i < b.N; i++ {
		_, err = vm.Run(s)
		require.NoError(b, err)
	}
}

func BenchmarkNativeCallWithFloat64(b *testing.B) {
	vm := New()
	err := vm.Set("x", func(a1 float64) {})
	require.NoError(b, err)

	s, err := vm.Compile("test.js", `x(1.1)`)
	require.NoError(b, err)

	for i := 0; i < b.N; i++ {
		_, err = vm.Run(s)
		require.NoError(b, err)
	}
}

func BenchmarkNativeCallWithInt(b *testing.B) {
	vm := New()
	err := vm.Set("x", func(a1 int) {})
	require.NoError(b, err)

	s, err := vm.Compile("test.js", `x(1)`)
	require.NoError(b, err)

	for i := 0; i < b.N; i++ {
		_, err = vm.Run(s)
		require.NoError(b, err)
	}
}

func BenchmarkNativeCallWithUint(b *testing.B) {
	vm := New()
	err := vm.Set("x", func(a1 uint) {})
	require.NoError(b, err)

	s, err := vm.Compile("test.js", `x(1)`)
	require.NoError(b, err)

	for i := 0; i < b.N; i++ {
		_, err = vm.Run(s)
		require.NoError(b, err)
	}
}

func BenchmarkNativeCallWithInt8(b *testing.B) {
	vm := New()
	err := vm.Set("x", func(a1 int8) {})
	require.NoError(b, err)

	s, err := vm.Compile("test.js", `x(1)`)
	require.NoError(b, err)

	for i := 0; i < b.N; i++ {
		_, err = vm.Run(s)
		require.NoError(b, err)
	}
}

func BenchmarkNativeCallWithUint8(b *testing.B) {
	vm := New()
	err := vm.Set("x", func(a1 uint8) {})
	require.NoError(b, err)

	s, err := vm.Compile("test.js", `x(1)`)
	require.NoError(b, err)

	for i := 0; i < b.N; i++ {
		_, err = vm.Run(s)
		require.NoError(b, err)
	}
}

func BenchmarkNativeCallWithInt16(b *testing.B) {
	vm := New()
	err := vm.Set("x", func(a1 int16) {})
	require.NoError(b, err)

	s, err := vm.Compile("test.js", `x(1)`)
	require.NoError(b, err)

	for i := 0; i < b.N; i++ {
		_, err = vm.Run(s)
		require.NoError(b, err)
	}
}

func BenchmarkNativeCallWithUint16(b *testing.B) {
	vm := New()
	err := vm.Set("x", func(a1 uint16) {})
	require.NoError(b, err)

	s, err := vm.Compile("test.js", `x(1)`)
	require.NoError(b, err)

	for i := 0; i < b.N; i++ {
		_, err = vm.Run(s)
		require.NoError(b, err)
	}
}

func BenchmarkNativeCallWithInt32(b *testing.B) {
	vm := New()
	err := vm.Set("x", func(a1 int32) {})
	require.NoError(b, err)

	s, err := vm.Compile("test.js", `x(1)`)
	require.NoError(b, err)

	for i := 0; i < b.N; i++ {
		_, err = vm.Run(s)
		require.NoError(b, err)
	}
}

func BenchmarkNativeCallWithUint32(b *testing.B) {
	vm := New()
	err := vm.Set("x", func(a1 uint32) {})
	require.NoError(b, err)

	s, err := vm.Compile("test.js", `x(1)`)
	require.NoError(b, err)

	for i := 0; i < b.N; i++ {
		_, err = vm.Run(s)
		require.NoError(b, err)
	}
}

func BenchmarkNativeCallWithInt64(b *testing.B) {
	vm := New()
	err := vm.Set("x", func(a1 int64) {})
	require.NoError(b, err)

	s, err := vm.Compile("test.js", `x(1)`)
	require.NoError(b, err)

	for i := 0; i < b.N; i++ {
		_, err = vm.Run(s)
		require.NoError(b, err)
	}
}

func BenchmarkNativeCallWithUint64(b *testing.B) {
	vm := New()
	err := vm.Set("x", func(a1 uint64) {})
	require.NoError(b, err)

	s, err := vm.Compile("test.js", `x(1)`)
	require.NoError(b, err)

	for i := 0; i < b.N; i++ {
		_, err = vm.Run(s)
		require.NoError(b, err)
	}
}

func BenchmarkNativeCallWithStringInt(b *testing.B) {
	vm := New()
	err := vm.Set("x", func(a1 string, a2 int) {})
	require.NoError(b, err)

	s, err := vm.Compile("test.js", `x("zzz", 1)`)
	require.NoError(b, err)

	for i := 0; i < b.N; i++ {
		_, err = vm.Run(s)
		require.NoError(b, err)
	}
}

func BenchmarkNativeCallWithIntVariadic0(b *testing.B) {
	vm := New()
	err := vm.Set("x", func(a ...int) {})
	require.NoError(b, err)

	s, err := vm.Compile("test.js", `x()`)
	require.NoError(b, err)

	for i := 0; i < b.N; i++ {
		_, err = vm.Run(s)
		require.NoError(b, err)
	}
}

func BenchmarkNativeCallWithIntVariadic1(b *testing.B) {
	vm := New()
	err := vm.Set("x", func(a ...int) {})
	require.NoError(b, err)

	s, err := vm.Compile("test.js", `x(1)`)
	require.NoError(b, err)

	for i := 0; i < b.N; i++ {
		_, err = vm.Run(s)
		require.NoError(b, err)
	}
}

func BenchmarkNativeCallWithIntVariadic3(b *testing.B) {
	vm := New()
	err := vm.Set("x", func(a ...int) {})
	require.NoError(b, err)

	s, err := vm.Compile("test.js", `x(1, 2, 3)`)
	require.NoError(b, err)

	for i := 0; i < b.N; i++ {
		_, err = vm.Run(s)
		require.NoError(b, err)
	}
}

func BenchmarkNativeCallWithIntVariadic10(b *testing.B) {
	vm := New()
	err := vm.Set("x", func(a ...int) {})
	require.NoError(b, err)

	s, err := vm.Compile("test.js", `x(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)`)
	require.NoError(b, err)

	for i := 0; i < b.N; i++ {
		_, err = vm.Run(s)
		require.NoError(b, err)
	}
}

func BenchmarkNativeCallWithIntArray0(b *testing.B) {
	vm := New()
	err := vm.Set("x", func(a []int) {})
	require.NoError(b, err)

	s, err := vm.Compile("test.js", `x([])`)
	require.NoError(b, err)

	for i := 0; i < b.N; i++ {
		_, err = vm.Run(s)
		require.NoError(b, err)
	}
}

func BenchmarkNativeCallWithIntArray1(b *testing.B) {
	vm := New()
	err := vm.Set("x", func(a []int) {})
	require.NoError(b, err)

	s, err := vm.Compile("test.js", `x([1])`)
	require.NoError(b, err)

	for i := 0; i < b.N; i++ {
		_, err = vm.Run(s)
		require.NoError(b, err)
	}
}

func BenchmarkNativeCallWithIntArray3(b *testing.B) {
	vm := New()
	err := vm.Set("x", func(a []int) {})
	require.NoError(b, err)

	s, err := vm.Compile("test.js", `x([1, 2, 3])`)
	require.NoError(b, err)

	for i := 0; i < b.N; i++ {
		_, err = vm.Run(s)
		require.NoError(b, err)
	}
}

func BenchmarkNativeCallWithIntArray10(b *testing.B) {
	vm := New()
	err := vm.Set("x", func(a []int) {})
	require.NoError(b, err)

	s, err := vm.Compile("test.js", `x([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])`)
	require.NoError(b, err)

	for i := 0; i < b.N; i++ {
		_, err = vm.Run(s)
		require.NoError(b, err)
	}
}

func BenchmarkNativeCallWithIntVariadicArray0(b *testing.B) {
	vm := New()
	err := vm.Set("x", func(a ...int) {})
	require.NoError(b, err)

	s, err := vm.Compile("test.js", `x([])`)
	require.NoError(b, err)

	for i := 0; i < b.N; i++ {
		_, err = vm.Run(s)
		require.NoError(b, err)
	}
}

func BenchmarkNativeCallWithIntVariadicArray1(b *testing.B) {
	vm := New()
	err := vm.Set("x", func(a ...int) {})
	require.NoError(b, err)

	s, err := vm.Compile("test.js", `x([1])`)
	require.NoError(b, err)

	for i := 0; i < b.N; i++ {
		_, err = vm.Run(s)
		require.NoError(b, err)
	}
}

func BenchmarkNativeCallWithIntVariadicArray3(b *testing.B) {
	vm := New()
	err := vm.Set("x", func(a ...int) {})
	require.NoError(b, err)

	s, err := vm.Compile("test.js", `x([1, 2, 3])`)
	require.NoError(b, err)

	for i := 0; i < b.N; i++ {
		_, err = vm.Run(s)
		require.NoError(b, err)
	}
}

func BenchmarkNativeCallWithIntVariadicArray10(b *testing.B) {
	vm := New()
	err := vm.Set("x", func(a ...int) {})
	require.NoError(b, err)

	s, err := vm.Compile("test.js", `x([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])`)
	require.NoError(b, err)

	for i := 0; i < b.N; i++ {
		_, err = vm.Run(s)
		require.NoError(b, err)
	}
}

func BenchmarkNativeCallWithStringIntVariadic0(b *testing.B) {
	vm := New()
	err := vm.Set("x", func(a1 string, a2 ...int) {})
	require.NoError(b, err)

	s, err := vm.Compile("test.js", `x("a")`)
	require.NoError(b, err)

	for i := 0; i < b.N; i++ {
		_, err = vm.Run(s)
		require.NoError(b, err)
	}
}

func BenchmarkNativeCallWithStringIntVariadic1(b *testing.B) {
	vm := New()
	err := vm.Set("x", func(a1 string, a2 ...int) {})
	require.NoError(b, err)

	s, err := vm.Compile("test.js", `x("a", 1)`)
	require.NoError(b, err)

	for i := 0; i < b.N; i++ {
		_, err = vm.Run(s)
		require.NoError(b, err)
	}
}

func BenchmarkNativeCallWithStringIntVariadic3(b *testing.B) {
	vm := New()
	err := vm.Set("x", func(a1 string, a2 ...int) {})
	require.NoError(b, err)

	s, err := vm.Compile("test.js", `x("a", 1, 2, 3)`)
	require.NoError(b, err)

	for i := 0; i < b.N; i++ {
		_, err = vm.Run(s)
		require.NoError(b, err)
	}
}

func BenchmarkNativeCallWithStringIntVariadic10(b *testing.B) {
	vm := New()
	err := vm.Set("x", func(a1 string, a2 ...int) {})
	require.NoError(b, err)

	s, err := vm.Compile("test.js", `x("a", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10)`)
	require.NoError(b, err)

	for i := 0; i < b.N; i++ {
		_, err = vm.Run(s)
		require.NoError(b, err)
	}
}

func BenchmarkNativeCallWithStringIntVariadicArray0(b *testing.B) {
	vm := New()
	err := vm.Set("x", func(a1 string, a2 ...int) {})
	require.NoError(b, err)

	s, err := vm.Compile("test.js", `x("a", [])`)
	require.NoError(b, err)

	for i := 0; i < b.N; i++ {
		_, err = vm.Run(s)
		require.NoError(b, err)
	}
}

func BenchmarkNativeCallWithStringIntVariadicArray1(b *testing.B) {
	vm := New()
	err := vm.Set("x", func(a1 string, a2 ...int) {})
	require.NoError(b, err)

	s, err := vm.Compile("test.js", `x("a", [1])`)
	require.NoError(b, err)

	for i := 0; i < b.N; i++ {
		_, err = vm.Run(s)
		require.NoError(b, err)
	}
}

func BenchmarkNativeCallWithStringIntVariadicArray3(b *testing.B) {
	vm := New()
	err := vm.Set("x", func(a1 string, a2 ...int) {})
	require.NoError(b, err)

	s, err := vm.Compile("test.js", `x("a", [1, 2, 3])`)
	require.NoError(b, err)

	for i := 0; i < b.N; i++ {
		_, err = vm.Run(s)
		require.NoError(b, err)
	}
}

func BenchmarkNativeCallWithStringIntVariadicArray10(b *testing.B) {
	vm := New()
	err := vm.Set("x", func(a1 string, a2 ...int) {})
	require.NoError(b, err)

	s, err := vm.Compile("test.js", `x("a", [1, 2, 3, 4, 5, 6, 7, 8, 9, 10])`)
	require.NoError(b, err)

	for i := 0; i < b.N; i++ {
		_, err = vm.Run(s)
		require.NoError(b, err)
	}
}

func BenchmarkNativeCallWithMap(b *testing.B) {
	vm := New()
	err := vm.Set("x", func(a map[string]string) {})
	require.NoError(b, err)

	s, err := vm.Compile("test.js", `x({a: "b", c: "d"})`)
	require.NoError(b, err)

	for i := 0; i < b.N; i++ {
		_, err = vm.Run(s)
		require.NoError(b, err)
	}
}

func BenchmarkNativeCallWithMapVariadic(b *testing.B) {
	vm := New()
	err := vm.Set("x", func(a ...map[string]string) {})
	require.NoError(b, err)

	s, err := vm.Compile("test.js", `x({a: "b", c: "d"}, {w: "x", y: "z"})`)
	require.NoError(b, err)

	for i := 0; i < b.N; i++ {
		_, err = vm.Run(s)
		require.NoError(b, err)
	}
}

func BenchmarkNativeCallWithMapVariadicArray(b *testing.B) {
	vm := New()
	err := vm.Set("x", func(a ...map[string]string) {})
	require.NoError(b, err)

	s, err := vm.Compile("test.js", `x([{a: "b", c: "d"}, {w: "x", y: "z"}])`)
	require.NoError(b, err)

	for i := 0; i < b.N; i++ {
		_, err = vm.Run(s)
		require.NoError(b, err)
	}
}

func BenchmarkNativeCallWithFunction(b *testing.B) {
	vm := New()
	err := vm.Set("x", func(a func()) {})
	require.NoError(b, err)

	s, err := vm.Compile("test.js", `x(function() {})`)
	require.NoError(b, err)

	for i := 0; i < b.N; i++ {
		_, err = vm.Run(s)
		require.NoError(b, err)
	}
}

func BenchmarkNativeCallWithFunctionInt(b *testing.B) {
	vm := New()
	err := vm.Set("x", func(a func(int)) {})
	require.NoError(b, err)

	s, err := vm.Compile("test.js", `x(function(n) {})`)
	require.NoError(b, err)

	for i := 0; i < b.N; i++ {
		_, err = vm.Run(s)
		require.NoError(b, err)
	}
}

func BenchmarkNativeCallWithFunctionString(b *testing.B) {
	vm := New()
	err := vm.Set("x", func(a func(string)) {})
	require.NoError(b, err)

	s, err := vm.Compile("test.js", `x(function(n) {})`)
	require.NoError(b, err)

	for i := 0; i < b.N; i++ {
		_, err = vm.Run(s)
		require.NoError(b, err)
	}
}

func TestNativeCallWithString(t *testing.T) {
	vm := New()

	called := false

	err := vm.Set("x", func(a1 string) {
		if a1 != "zzz" {
			t.Fail()
		}

		called = true
	})
	require.NoError(t, err)

	s, err := vm.Compile("test.js", `x("zzz")`)
	require.NoError(t, err)

	if _, err = vm.Run(s); err != nil {
		t.Logf("err should have been nil; was %s\n", err.Error())
		t.Fail()
	}

	if !called {
		t.Fail()
	}
}

func TestNativeCallWithFloat32(t *testing.T) {
	vm := New()

	called := false

	err := vm.Set("x", func(a1 float32) {
		if a1 != 1.1 {
			t.Fail()
		}

		called = true
	})
	require.NoError(t, err)

	s, err := vm.Compile("test.js", `x(1.1)`)
	require.NoError(t, err)

	if _, err = vm.Run(s); err != nil {
		t.Logf("err should have been nil; was %s\n", err.Error())
		t.Fail()
	}

	if !called {
		t.Fail()
	}
}

func TestNativeCallWithFloat64(t *testing.T) {
	vm := New()

	called := false

	err := vm.Set("x", func(a1 float64) {
		if a1 != 1.1 {
			t.Fail()
		}

		called = true
	})
	require.NoError(t, err)

	s, err := vm.Compile("test.js", `x(1.1)`)
	require.NoError(t, err)

	if _, err = vm.Run(s); err != nil {
		t.Logf("err should have been nil; was %s\n", err.Error())
		t.Fail()
	}

	if !called {
		t.Fail()
	}
}

func TestNativeCallWithInt(t *testing.T) {
	vm := New()

	called := false

	err := vm.Set("x", func(a1 int) {
		if a1 != 1 {
			t.Fail()
		}

		called = true
	})
	require.NoError(t, err)

	s, err := vm.Compile("test.js", `x(1)`)
	require.NoError(t, err)

	if _, err = vm.Run(s); err != nil {
		t.Logf("err should have been nil; was %s\n", err.Error())
		t.Fail()
	}

	if !called {
		t.Fail()
	}
}

func TestNativeCallWithUint(t *testing.T) {
	vm := New()

	called := false

	err := vm.Set("x", func(a1 uint) {
		if a1 != 1 {
			t.Fail()
		}

		called = true
	})
	require.NoError(t, err)

	s, err := vm.Compile("test.js", `x(1)`)
	require.NoError(t, err)

	if _, err = vm.Run(s); err != nil {
		t.Logf("err should have been nil; was %s\n", err.Error())
		t.Fail()
	}

	if !called {
		t.Fail()
	}
}

func TestNativeCallWithInt8(t *testing.T) {
	vm := New()

	called := false

	err := vm.Set("x", func(a1 int8) {
		if a1 != 1 {
			t.Fail()
		}

		called = true
	})
	require.NoError(t, err)

	s, err := vm.Compile("test.js", `x(1)`)
	require.NoError(t, err)

	if _, err = vm.Run(s); err != nil {
		t.Logf("err should have been nil; was %s\n", err.Error())
		t.Fail()
	}

	if !called {
		t.Fail()
	}
}

func TestNativeCallWithUint8(t *testing.T) {
	vm := New()

	called := false

	err := vm.Set("x", func(a1 uint8) {
		if a1 != 1 {
			t.Fail()
		}

		called = true
	})
	require.NoError(t, err)

	s, err := vm.Compile("test.js", `x(1)`)
	require.NoError(t, err)

	if _, err = vm.Run(s); err != nil {
		t.Logf("err should have been nil; was %s\n", err.Error())
		t.Fail()
	}

	if !called {
		t.Fail()
	}
}

func TestNativeCallWithInt16(t *testing.T) {
	vm := New()

	called := false

	err := vm.Set("x", func(a1 int16) {
		if a1 != 1 {
			t.Fail()
		}

		called = true
	})
	require.NoError(t, err)

	s, err := vm.Compile("test.js", `x(1)`)
	require.NoError(t, err)

	if _, err = vm.Run(s); err != nil {
		t.Logf("err should have been nil; was %s\n", err.Error())
		t.Fail()
	}

	if !called {
		t.Fail()
	}
}

func TestNativeCallWithUint16(t *testing.T) {
	vm := New()

	called := false

	err := vm.Set("x", func(a1 uint16) {
		if a1 != 1 {
			t.Fail()
		}

		called = true
	})
	require.NoError(t, err)

	s, err := vm.Compile("test.js", `x(1)`)
	require.NoError(t, err)

	if _, err = vm.Run(s); err != nil {
		t.Logf("err should have been nil; was %s\n", err.Error())
		t.Fail()
	}

	if !called {
		t.Fail()
	}
}

func TestNativeCallWithInt32(t *testing.T) {
	vm := New()

	called := false

	err := vm.Set("x", func(a1 int32) {
		if a1 != 1 {
			t.Fail()
		}

		called = true
	})
	require.NoError(t, err)

	s, err := vm.Compile("test.js", `x(1)`)
	require.NoError(t, err)

	if _, err = vm.Run(s); err != nil {
		t.Logf("err should have been nil; was %s\n", err.Error())
		t.Fail()
	}

	if !called {
		t.Fail()
	}
}

func TestNativeCallWithUint32(t *testing.T) {
	vm := New()

	called := false

	err := vm.Set("x", func(a1 uint32) {
		if a1 != 1 {
			t.Fail()
		}

		called = true
	})
	require.NoError(t, err)

	s, err := vm.Compile("test.js", `x(1)`)
	require.NoError(t, err)

	if _, err = vm.Run(s); err != nil {
		t.Logf("err should have been nil; was %s\n", err.Error())
		t.Fail()
	}

	if !called {
		t.Fail()
	}
}

func TestNativeCallWithInt64(t *testing.T) {
	vm := New()

	called := false

	er
Download .txt
gitextract_6msnb3d6/

├── .clog.toml
├── .github/
│   └── workflows/
│       ├── release-build.yml
│       └── test-lint.yml
├── .gitignore
├── .golangci.yml
├── .goreleaser.yaml
├── DESIGN.markdown
├── LICENSE
├── README.md
├── array_test.go
├── ast/
│   ├── comments.go
│   ├── comments_test.go
│   ├── node.go
│   ├── walk.go
│   ├── walk_example_test.go
│   └── walk_test.go
├── builtin.go
├── builtin_array.go
├── builtin_boolean.go
├── builtin_date.go
├── builtin_error.go
├── builtin_function.go
├── builtin_json.go
├── builtin_math.go
├── builtin_number.go
├── builtin_object.go
├── builtin_regexp.go
├── builtin_string.go
├── builtin_test.go
├── call_test.go
├── clone.go
├── clone_test.go
├── cmpl.go
├── cmpl_evaluate.go
├── cmpl_evaluate_expression.go
├── cmpl_evaluate_statement.go
├── cmpl_parse.go
├── cmpl_test.go
├── console.go
├── consts.go
├── date_test.go
├── dbg/
│   └── dbg.go
├── dbg.go
├── documentation_test.go
├── error.go
├── error_native_test.go
├── error_test.go
├── evaluate.go
├── file/
│   └── file.go
├── function_stack_test.go
├── function_test.go
├── functional_benchmark_test.go
├── generate.go
├── global.go
├── global_test.go
├── go.mod
├── go.sum
├── inline.go
├── inline_test.go
├── issue_test.go
├── json_test.go
├── locale.go
├── math_test.go
├── native_stack_test.go
├── number_test.go
├── object.go
├── object_class.go
├── object_test.go
├── otto/
│   └── main.go
├── otto.go
├── otto_.go
├── otto_error_test.go
├── otto_test.go
├── panic_test.go
├── parser/
│   ├── comments_test.go
│   ├── error.go
│   ├── expression.go
│   ├── lexer.go
│   ├── lexer_test.go
│   ├── marshal_test.go
│   ├── parser.go
│   ├── parser_test.go
│   ├── regexp.go
│   ├── regexp_test.go
│   ├── scope.go
│   └── statement.go
├── parser_test.go
├── property.go
├── reflect_test.go
├── regexp_test.go
├── registry/
│   └── registry.go
├── repl/
│   ├── autocompleter.go
│   └── repl.go
├── result.go
├── runtime.go
├── runtime_test.go
├── scope.go
├── script.go
├── script_test.go
├── sourcemap_test.go
├── stash.go
├── string_test.go
├── terst/
│   └── terst.go
├── testing_test.go
├── token/
│   ├── generate.go
│   ├── token.go
│   └── token_const.go
├── tools/
│   ├── gen-jscore/
│   │   ├── .gen-jscore.yaml
│   │   ├── helpers.go
│   │   ├── main.go
│   │   └── templates/
│   │       ├── constructor.tmpl
│   │       ├── core-prototype-property.tmpl
│   │       ├── definition.tmpl
│   │       ├── function.tmpl
│   │       ├── global.tmpl
│   │       ├── name.tmpl
│   │       ├── property-entry.tmpl
│   │       ├── property-fields.tmpl
│   │       ├── property-order.tmpl
│   │       ├── property-value.tmpl
│   │       ├── property.tmpl
│   │       ├── prototype.tmpl
│   │       ├── root.tmpl
│   │       ├── type.tmpl
│   │       └── value.tmpl
│   ├── gen-tokens/
│   │   ├── .gen-tokens.yaml
│   │   ├── main.go
│   │   └── templates/
│   │       └── root.tmpl
│   └── tester/
│       └── main.go
├── type_arguments.go
├── type_array.go
├── type_boolean.go
├── type_date.go
├── type_error.go
├── type_function.go
├── type_go_array.go
├── type_go_map.go
├── type_go_map_test.go
├── type_go_slice.go
├── type_go_slice_test.go
├── type_go_struct.go
├── type_go_struct_test.go
├── type_number.go
├── type_reference.go
├── type_regexp.go
├── type_string.go
├── underscore/
│   ├── LICENSE.underscorejs
│   ├── README.md
│   ├── download.go
│   ├── generate.go
│   ├── testify
│   ├── underscore-min.js
│   └── underscore.go
├── underscore_arrays_test.go
├── underscore_chaining_test.go
├── underscore_collections_test.go
├── underscore_functions_test.go
├── underscore_objects_test.go
├── underscore_test.go
├── underscore_utility_test.go
├── value.go
├── value_boolean.go
├── value_kind.gen.go
├── value_number.go
├── value_primitive.go
├── value_string.go
└── value_test.go
Download .txt
SYMBOL INDEX (2249 symbols across 130 files)

FILE: array_test.go
  function TestArray (line 7) | func TestArray(t *testing.T) {
  function TestArray_toString (line 74) | func TestArray_toString(t *testing.T) {
  function TestArray_toLocaleString (line 102) | func TestArray_toLocaleString(t *testing.T) {
  function TestArray_concat (line 118) | func TestArray_concat(t *testing.T) {
  function TestArray_splice (line 175) | func TestArray_splice(t *testing.T) {
  function TestArray_shift (line 191) | func TestArray_shift(t *testing.T) {
  function TestArray_push (line 210) | func TestArray_push(t *testing.T) {
  function TestArray_pop (line 225) | func TestArray_pop(t *testing.T) {
  function TestArray_slice (line 242) | func TestArray_slice(t *testing.T) {
  function TestArray_sliceArguments (line 272) | func TestArray_sliceArguments(t *testing.T) {
  function TestArray_unshift (line 284) | func TestArray_unshift(t *testing.T) {
  function TestArray_reverse (line 299) | func TestArray_reverse(t *testing.T) {
  function TestArray_sort (line 312) | func TestArray_sort(t *testing.T) {
  function TestArray_isArray (line 336) | func TestArray_isArray(t *testing.T) {
  function TestArray_indexOf (line 348) | func TestArray_indexOf(t *testing.T) {
  function TestArray_lastIndexOf (line 389) | func TestArray_lastIndexOf(t *testing.T) {
  function TestArray_every (line 428) | func TestArray_every(t *testing.T) {
  function TestArray_some (line 478) | func TestArray_some(t *testing.T) {
  function TestArray_forEach (line 520) | func TestArray_forEach(t *testing.T) {
  function TestArray_indexing (line 568) | func TestArray_indexing(t *testing.T) {
  function TestArray_map (line 593) | func TestArray_map(t *testing.T) {
  function TestArray_filter (line 625) | func TestArray_filter(t *testing.T) {
  function TestArray_reduce (line 639) | func TestArray_reduce(t *testing.T) {
  function TestArray_reduceRight (line 659) | func TestArray_reduceRight(t *testing.T) {
  function TestArray_defineOwnProperty (line 679) | func TestArray_defineOwnProperty(t *testing.T) {
  function TestArray_new (line 704) | func TestArray_new(t *testing.T) {

FILE: ast/comments.go
  type CommentPosition (line 10) | type CommentPosition
    method String (line 58) | func (cp CommentPosition) String() string {
  constant _ (line 14) | _ CommentPosition = iota
  constant LEADING (line 16) | LEADING
  constant TRAILING (line 18) | TRAILING
  constant KEY (line 20) | KEY
  constant COLON (line 22) | COLON
  constant FINAL (line 24) | FINAL
  constant IF (line 26) | IF
  constant WHILE (line 28) | WHILE
  constant DO (line 30) | DO
  constant FOR (line 32) | FOR
  constant WITH (line 34) | WITH
  constant TBD (line 36) | TBD
  type Comment (line 40) | type Comment struct
    method String (line 86) | func (c Comment) String() string {
  function NewComment (line 47) | func NewComment(text string, idx file.Idx) *Comment {
  type Comments (line 91) | type Comments struct
    method String (line 118) | func (c *Comments) String() string {
    method FetchAll (line 124) | func (c *Comments) FetchAll() []*Comment {
    method Fetch (line 134) | func (c *Comments) Fetch() []*Comment {
    method ResetLineBreak (line 143) | func (c *Comments) ResetLineBreak() {
    method MarkPrimary (line 148) | func (c *Comments) MarkPrimary() {
    method AfterBlock (line 154) | func (c *Comments) AfterBlock() {
    method AddComment (line 160) | func (c *Comments) AddComment(comment *Comment) {
    method MarkComments (line 177) | func (c *Comments) MarkComments(position CommentPosition) {
    method Unset (line 192) | func (c *Comments) Unset() {
    method SetExpression (line 205) | func (c *Comments) SetExpression(node Expression) {
    method PostProcessNode (line 222) | func (c *Comments) PostProcessNode(node Node) {
    method applyComments (line 228) | func (c *Comments) applyComments(node, previous Node, position Comment...
    method AtLineBreak (line 245) | func (c *Comments) AtLineBreak() {
  function NewComments (line 110) | func NewComments() *Comments {
  type CommentMap (line 250) | type CommentMap
    method AddComment (line 253) | func (cm CommentMap) AddComment(node Node, comment *Comment) {
    method AddComments (line 261) | func (cm CommentMap) AddComments(node Node, comments []*Comment, posit...
    method Size (line 271) | func (cm CommentMap) Size() int {
    method MoveComments (line 281) | func (cm CommentMap) MoveComments(from, to Node, position CommentPosit...

FILE: ast/comments_test.go
  function TestCommentMap (line 9) | func TestCommentMap(t *testing.T) {
  function TestCommentMap_move (line 29) | func TestCommentMap_move(t *testing.T) {

FILE: ast/node.go
  type Node (line 14) | type Node interface
  type Expression (line 20) | type Expression interface
  type ArrayLiteral (line 26) | type ArrayLiteral struct
    method Idx0 (line 33) | func (al *ArrayLiteral) Idx0() file.Idx {
    method Idx1 (line 38) | func (al *ArrayLiteral) Idx1() file.Idx {
    method expression (line 43) | func (*ArrayLiteral) expression() {}
  type AssignExpression (line 46) | type AssignExpression struct
    method Idx0 (line 53) | func (ae *AssignExpression) Idx0() file.Idx {
    method Idx1 (line 58) | func (ae *AssignExpression) Idx1() file.Idx {
    method expression (line 63) | func (*AssignExpression) expression() {}
  type BadExpression (line 66) | type BadExpression struct
    method Idx0 (line 72) | func (be *BadExpression) Idx0() file.Idx {
    method Idx1 (line 77) | func (be *BadExpression) Idx1() file.Idx {
    method expression (line 82) | func (*BadExpression) expression() {}
  type BinaryExpression (line 85) | type BinaryExpression struct
    method Idx0 (line 93) | func (be *BinaryExpression) Idx0() file.Idx {
    method Idx1 (line 98) | func (be *BinaryExpression) Idx1() file.Idx {
    method expression (line 103) | func (*BinaryExpression) expression() {}
  type BooleanLiteral (line 106) | type BooleanLiteral struct
    method Idx0 (line 113) | func (bl *BooleanLiteral) Idx0() file.Idx {
    method Idx1 (line 118) | func (bl *BooleanLiteral) Idx1() file.Idx {
    method expression (line 123) | func (*BooleanLiteral) expression() {}
  type BracketExpression (line 126) | type BracketExpression struct
    method Idx0 (line 134) | func (be *BracketExpression) Idx0() file.Idx {
    method Idx1 (line 139) | func (be *BracketExpression) Idx1() file.Idx {
    method expression (line 144) | func (*BracketExpression) expression() {}
  type CallExpression (line 147) | type CallExpression struct
    method Idx0 (line 155) | func (ce *CallExpression) Idx0() file.Idx {
    method Idx1 (line 160) | func (ce *CallExpression) Idx1() file.Idx {
    method expression (line 165) | func (*CallExpression) expression() {}
  type ConditionalExpression (line 168) | type ConditionalExpression struct
    method Idx0 (line 175) | func (ce *ConditionalExpression) Idx0() file.Idx {
    method Idx1 (line 180) | func (ce *ConditionalExpression) Idx1() file.Idx {
    method expression (line 185) | func (*ConditionalExpression) expression() {}
  type DotExpression (line 188) | type DotExpression struct
    method Idx0 (line 194) | func (de *DotExpression) Idx0() file.Idx {
    method Idx1 (line 199) | func (de *DotExpression) Idx1() file.Idx {
    method expression (line 204) | func (*DotExpression) expression() {}
  type EmptyExpression (line 207) | type EmptyExpression struct
    method Idx0 (line 213) | func (ee *EmptyExpression) Idx0() file.Idx {
    method Idx1 (line 218) | func (ee *EmptyExpression) Idx1() file.Idx {
    method expression (line 223) | func (*EmptyExpression) expression() {}
  type FunctionLiteral (line 226) | type FunctionLiteral struct
    method Idx0 (line 236) | func (fl *FunctionLiteral) Idx0() file.Idx {
    method Idx1 (line 241) | func (fl *FunctionLiteral) Idx1() file.Idx {
    method expression (line 246) | func (*FunctionLiteral) expression() {}
  type Identifier (line 249) | type Identifier struct
    method Idx0 (line 255) | func (i *Identifier) Idx0() file.Idx {
    method Idx1 (line 260) | func (i *Identifier) Idx1() file.Idx {
    method expression (line 265) | func (*Identifier) expression() {}
  type NewExpression (line 268) | type NewExpression struct
    method Idx0 (line 277) | func (ne *NewExpression) Idx0() file.Idx {
    method Idx1 (line 282) | func (ne *NewExpression) Idx1() file.Idx {
    method expression (line 290) | func (*NewExpression) expression() {}
  type NullLiteral (line 293) | type NullLiteral struct
    method Idx0 (line 299) | func (nl *NullLiteral) Idx0() file.Idx {
    method Idx1 (line 304) | func (nl *NullLiteral) Idx1() file.Idx {
    method expression (line 309) | func (*NullLiteral) expression() {}
  type NumberLiteral (line 312) | type NumberLiteral struct
    method Idx0 (line 319) | func (nl *NumberLiteral) Idx0() file.Idx {
    method Idx1 (line 324) | func (nl *NumberLiteral) Idx1() file.Idx {
    method expression (line 329) | func (*NumberLiteral) expression() {}
  type ObjectLiteral (line 332) | type ObjectLiteral struct
    method Idx0 (line 339) | func (ol *ObjectLiteral) Idx0() file.Idx {
    method Idx1 (line 344) | func (ol *ObjectLiteral) Idx1() file.Idx {
    method expression (line 349) | func (*ObjectLiteral) expression() {}
  type ParameterList (line 352) | type ParameterList struct
  type Property (line 359) | type Property struct
  type RegExpLiteral (line 366) | type RegExpLiteral struct
    method Idx0 (line 375) | func (rl *RegExpLiteral) Idx0() file.Idx {
    method Idx1 (line 380) | func (rl *RegExpLiteral) Idx1() file.Idx {
    method expression (line 385) | func (*RegExpLiteral) expression() {}
  type SequenceExpression (line 388) | type SequenceExpression struct
    method Idx0 (line 393) | func (se *SequenceExpression) Idx0() file.Idx {
    method Idx1 (line 398) | func (se *SequenceExpression) Idx1() file.Idx {
    method expression (line 403) | func (*SequenceExpression) expression() {}
  type StringLiteral (line 406) | type StringLiteral struct
    method Idx0 (line 413) | func (sl *StringLiteral) Idx0() file.Idx {
    method Idx1 (line 418) | func (sl *StringLiteral) Idx1() file.Idx {
    method expression (line 423) | func (*StringLiteral) expression() {}
  type ThisExpression (line 426) | type ThisExpression struct
    method Idx0 (line 431) | func (te *ThisExpression) Idx0() file.Idx {
    method Idx1 (line 436) | func (te *ThisExpression) Idx1() file.Idx {
    method expression (line 441) | func (*ThisExpression) expression() {}
  type UnaryExpression (line 444) | type UnaryExpression struct
    method Idx0 (line 452) | func (ue *UnaryExpression) Idx0() file.Idx {
    method Idx1 (line 460) | func (ue *UnaryExpression) Idx1() file.Idx {
    method expression (line 468) | func (*UnaryExpression) expression() {}
  type VariableExpression (line 471) | type VariableExpression struct
    method Idx0 (line 478) | func (ve *VariableExpression) Idx0() file.Idx {
    method Idx1 (line 483) | func (ve *VariableExpression) Idx1() file.Idx {
    method expression (line 491) | func (*VariableExpression) expression() {}
  type Statement (line 494) | type Statement interface
  type BadStatement (line 500) | type BadStatement struct
    method Idx0 (line 506) | func (bs *BadStatement) Idx0() file.Idx {
    method Idx1 (line 511) | func (bs *BadStatement) Idx1() file.Idx {
    method statement (line 516) | func (*BadStatement) statement() {}
  type BlockStatement (line 519) | type BlockStatement struct
    method Idx0 (line 526) | func (bs *BlockStatement) Idx0() file.Idx {
    method Idx1 (line 531) | func (bs *BlockStatement) Idx1() file.Idx {
    method statement (line 536) | func (*BlockStatement) statement() {}
  type BranchStatement (line 539) | type BranchStatement struct
    method Idx0 (line 546) | func (bs *BranchStatement) Idx0() file.Idx {
    method Idx1 (line 551) | func (bs *BranchStatement) Idx1() file.Idx {
    method statement (line 559) | func (*BranchStatement) statement() {}
  type CaseStatement (line 562) | type CaseStatement struct
    method Idx0 (line 569) | func (cs *CaseStatement) Idx0() file.Idx {
    method Idx1 (line 574) | func (cs *CaseStatement) Idx1() file.Idx {
    method statement (line 579) | func (*CaseStatement) statement() {}
  type CatchStatement (line 582) | type CatchStatement struct
    method Idx0 (line 589) | func (cs *CatchStatement) Idx0() file.Idx {
    method Idx1 (line 594) | func (cs *CatchStatement) Idx1() file.Idx {
    method statement (line 599) | func (*CatchStatement) statement() {}
  type DebuggerStatement (line 602) | type DebuggerStatement struct
    method Idx0 (line 607) | func (ds *DebuggerStatement) Idx0() file.Idx {
    method Idx1 (line 612) | func (ds *DebuggerStatement) Idx1() file.Idx {
    method statement (line 617) | func (*DebuggerStatement) statement() {}
  type DoWhileStatement (line 620) | type DoWhileStatement struct
    method Idx0 (line 628) | func (dws *DoWhileStatement) Idx0() file.Idx {
    method Idx1 (line 633) | func (dws *DoWhileStatement) Idx1() file.Idx {
    method statement (line 638) | func (*DoWhileStatement) statement() {}
  type EmptyStatement (line 641) | type EmptyStatement struct
    method Idx0 (line 646) | func (es *EmptyStatement) Idx0() file.Idx {
    method Idx1 (line 651) | func (es *EmptyStatement) Idx1() file.Idx {
    method statement (line 656) | func (*EmptyStatement) statement() {}
  type ExpressionStatement (line 659) | type ExpressionStatement struct
    method Idx0 (line 664) | func (es *ExpressionStatement) Idx0() file.Idx {
    method Idx1 (line 669) | func (es *ExpressionStatement) Idx1() file.Idx {
    method statement (line 674) | func (*ExpressionStatement) statement() {}
  type ForInStatement (line 677) | type ForInStatement struct
    method Idx0 (line 685) | func (fis *ForInStatement) Idx0() file.Idx {
    method Idx1 (line 690) | func (fis *ForInStatement) Idx1() file.Idx {
    method statement (line 695) | func (*ForInStatement) statement() {}
  type ForStatement (line 698) | type ForStatement struct
    method Idx0 (line 707) | func (fs *ForStatement) Idx0() file.Idx {
    method Idx1 (line 712) | func (fs *ForStatement) Idx1() file.Idx {
    method statement (line 717) | func (*ForStatement) statement() {}
  type FunctionStatement (line 720) | type FunctionStatement struct
    method Idx0 (line 725) | func (fs *FunctionStatement) Idx0() file.Idx {
    method Idx1 (line 730) | func (fs *FunctionStatement) Idx1() file.Idx {
    method statement (line 735) | func (*FunctionStatement) statement() {}
  type IfStatement (line 738) | type IfStatement struct
    method Idx0 (line 746) | func (is *IfStatement) Idx0() file.Idx {
    method Idx1 (line 751) | func (is *IfStatement) Idx1() file.Idx {
    method statement (line 759) | func (*IfStatement) statement() {}
  type LabelledStatement (line 762) | type LabelledStatement struct
    method Idx0 (line 769) | func (ls *LabelledStatement) Idx0() file.Idx {
    method Idx1 (line 774) | func (ls *LabelledStatement) Idx1() file.Idx {
    method statement (line 779) | func (*LabelledStatement) statement() {}
  type ReturnStatement (line 782) | type ReturnStatement struct
    method Idx0 (line 788) | func (rs *ReturnStatement) Idx0() file.Idx {
    method Idx1 (line 793) | func (rs *ReturnStatement) Idx1() file.Idx {
    method statement (line 801) | func (*ReturnStatement) statement() {}
  type SwitchStatement (line 804) | type SwitchStatement struct
    method Idx0 (line 813) | func (ss *SwitchStatement) Idx0() file.Idx {
    method Idx1 (line 818) | func (ss *SwitchStatement) Idx1() file.Idx {
    method statement (line 823) | func (*SwitchStatement) statement() {}
  type ThrowStatement (line 826) | type ThrowStatement struct
    method Idx0 (line 832) | func (ts *ThrowStatement) Idx0() file.Idx {
    method Idx1 (line 837) | func (ts *ThrowStatement) Idx1() file.Idx {
    method statement (line 842) | func (*ThrowStatement) statement() {}
  type TryStatement (line 845) | type TryStatement struct
    method Idx0 (line 853) | func (ts *TryStatement) Idx0() file.Idx {
    method Idx1 (line 858) | func (ts *TryStatement) Idx1() file.Idx {
    method statement (line 866) | func (*TryStatement) statement() {}
  type VariableStatement (line 869) | type VariableStatement struct
    method Idx0 (line 875) | func (vs *VariableStatement) Idx0() file.Idx {
    method Idx1 (line 880) | func (vs *VariableStatement) Idx1() file.Idx {
    method statement (line 885) | func (*VariableStatement) statement() {}
  type WhileStatement (line 888) | type WhileStatement struct
    method Idx0 (line 895) | func (ws *WhileStatement) Idx0() file.Idx {
    method Idx1 (line 900) | func (ws *WhileStatement) Idx1() file.Idx {
    method statement (line 905) | func (*WhileStatement) statement() {}
  type WithStatement (line 908) | type WithStatement struct
    method Idx0 (line 915) | func (ws *WithStatement) Idx0() file.Idx {
    method Idx1 (line 920) | func (ws *WithStatement) Idx1() file.Idx {
    method statement (line 925) | func (*WithStatement) statement() {}
  type Declaration (line 928) | type Declaration interface
  type FunctionDeclaration (line 933) | type FunctionDeclaration struct
    method declaration (line 937) | func (*FunctionDeclaration) declaration() {}
  type VariableDeclaration (line 940) | type VariableDeclaration struct
    method declaration (line 946) | func (*VariableDeclaration) declaration() {}
  type Program (line 949) | type Program struct
    method Idx0 (line 957) | func (p *Program) Idx0() file.Idx {
    method Idx1 (line 962) | func (p *Program) Idx1() file.Idx {

FILE: ast/walk.go
  type Visitor (line 8) | type Visitor interface
  function Walk (line 18) | func Walk(v Visitor, n Node) {

FILE: ast/walk_example_test.go
  type walkExample (line 12) | type walkExample struct
    method Enter (line 17) | func (w *walkExample) Enter(n ast.Node) ast.Visitor {
    method Exit (line 34) | func (w *walkExample) Exit(n ast.Node) {
  function ExampleVisitor_codeRewrite (line 39) | func ExampleVisitor_codeRewrite() {

FILE: ast/walk_test.go
  type walker (line 12) | type walker struct
    method push (line 23) | func (w *walker) push(n ast.Node) {
    method pop (line 27) | func (w *walker) pop(n ast.Node) {
    method Enter (line 41) | func (w *walker) Enter(n ast.Node) ast.Visitor {
    method Exit (line 73) | func (w *walker) Exit(n ast.Node) {
  function TestVisitorRewrite (line 77) | func TestVisitorRewrite(t *testing.T) {
  function Test_issue261 (line 103) | func Test_issue261(t *testing.T) {
  function TestBadStatement (line 140) | func TestBadStatement(t *testing.T) {

FILE: builtin.go
  function builtinGlobalEval (line 16) | func builtinGlobalEval(call FunctionCall) Value {
  function builtinGlobalIsNaN (line 35) | func builtinGlobalIsNaN(call FunctionCall) Value {
  function builtinGlobalIsFinite (line 40) | func builtinGlobalIsFinite(call FunctionCall) Value {
  function digitValue (line 45) | func digitValue(chr rune) int {
  function builtinGlobalParseInt (line 57) | func builtinGlobalParseInt(call FunctionCall) Value {
  function builtinGlobalParseFloat (line 140) | func builtinGlobalParseFloat(call FunctionCall) Value {
  function encodeDecodeURI (line 168) | func encodeDecodeURI(call FunctionCall, escape *regexp.Regexp) Value {
  function builtinGlobalEncodeURI (line 218) | func builtinGlobalEncodeURI(call FunctionCall) Value {
  function builtinGlobalEncodeURIComponent (line 224) | func builtinGlobalEncodeURIComponent(call FunctionCall) Value {
  function decodeURI (line 231) | func decodeURI(input string, reserve bool) (string, bool) {
  function builtinGlobalDecodeURI (line 243) | func builtinGlobalDecodeURI(call FunctionCall) Value {
  function builtinGlobalDecodeURIComponent (line 251) | func builtinGlobalDecodeURIComponent(call FunctionCall) Value {
  function builtinShouldEscape (line 261) | func builtinShouldEscape(chr byte) bool {
  constant escapeBase16 (line 268) | escapeBase16 = "0123456789ABCDEF"
  function builtinEscape (line 270) | func builtinEscape(input string) string {
  function builtinUnescape (line 299) | func builtinUnescape(input string) string {
  function builtinGlobalEscape (line 331) | func builtinGlobalEscape(call FunctionCall) Value {
  function builtinGlobalUnescape (line 335) | func builtinGlobalUnescape(call FunctionCall) Value {

FILE: builtin_array.go
  function builtinArray (line 10) | func builtinArray(call FunctionCall) Value {
  function builtinNewArray (line 14) | func builtinNewArray(obj *object, argumentList []Value) Value {
  function builtinNewArrayNative (line 18) | func builtinNewArrayNative(rt *runtime, argumentList []Value) *object {
  function builtinArrayToString (line 28) | func builtinArrayToString(call FunctionCall) Value {
  function builtinArrayToLocaleString (line 38) | func builtinArrayToLocaleString(call FunctionCall) Value {
  function builtinArrayConcat (line 64) | func builtinArrayConcat(call FunctionCall) Value {
  function builtinArrayShift (line 93) | func builtinArrayShift(call FunctionCall) Value {
  function builtinArrayPush (line 115) | func builtinArrayPush(call FunctionCall) Value {
  function builtinArrayPop (line 129) | func builtinArrayPop(call FunctionCall) Value {
  function builtinArrayJoin (line 142) | func builtinArrayJoin(call FunctionCall) Value {
  function builtinArraySplice (line 167) | func builtinArraySplice(call FunctionCall) Value {
  function builtinArraySlice (line 247) | func builtinArraySlice(call FunctionCall) Value {
  function builtinArrayUnshift (line 270) | func builtinArrayUnshift(call FunctionCall) Value {
  function builtinArrayReverse (line 295) | func builtinArrayReverse(call FunctionCall) Value {
  function sortCompare (line 339) | func sortCompare(thisObject *object, index0, index1 uint, compare *objec...
  function arraySortSwap (line 391) | func arraySortSwap(thisObject *object, index0, index1 uint) {
  function arraySortQuickPartition (line 420) | func arraySortQuickPartition(thisObject *object, left, right, pivot uint...
  function arraySortQuickSort (line 442) | func arraySortQuickSort(thisObject *object, left, right uint, compare *o...
  function builtinArraySort (line 453) | func builtinArraySort(call FunctionCall) Value {
  function builtinArrayIsArray (line 468) | func builtinArrayIsArray(call FunctionCall) Value {
  function builtinArrayIndexOf (line 472) | func builtinArrayIndexOf(call FunctionCall) Value {
  function builtinArrayLastIndexOf (line 500) | func builtinArrayLastIndexOf(call FunctionCall) Value {
  function builtinArrayEvery (line 528) | func builtinArrayEvery(call FunctionCall) Value {
  function builtinArraySome (line 547) | func builtinArraySome(call FunctionCall) Value {
  function builtinArrayForEach (line 565) | func builtinArrayForEach(call FunctionCall) Value {
  function builtinArrayMap (line 581) | func builtinArrayMap(call FunctionCall) Value {
  function builtinArrayFilter (line 600) | func builtinArrayFilter(call FunctionCall) Value {
  function builtinArrayReduce (line 620) | func builtinArrayReduce(call FunctionCall) Value {
  function builtinArrayReduceRight (line 653) | func builtinArrayReduceRight(call FunctionCall) Value {

FILE: builtin_boolean.go
  function builtinBoolean (line 5) | func builtinBoolean(call FunctionCall) Value {
  function builtinNewBoolean (line 9) | func builtinNewBoolean(obj *object, argumentList []Value) Value {
  function builtinBooleanToString (line 13) | func builtinBooleanToString(call FunctionCall) Value {
  function builtinBooleanValueOf (line 22) | func builtinBooleanValueOf(call FunctionCall) Value {

FILE: builtin_date.go
  constant builtinDateDateTimeLayout (line 13) | builtinDateDateTimeLayout = time.RFC1123
  constant builtinDateDateLayout (line 14) | builtinDateDateLayout     = "Mon, 02 Jan 2006"
  constant builtinDateTimeLayout (line 15) | builtinDateTimeLayout     = "15:04:05 MST"
  function builtinDate (line 23) | func builtinDate(call FunctionCall) Value {
  function builtinNewDate (line 29) | func builtinNewDate(obj *object, argumentList []Value) Value {
  function builtinDateToString (line 33) | func builtinDateToString(call FunctionCall) Value {
  function builtinDateToDateString (line 41) | func builtinDateToDateString(call FunctionCall) Value {
  function builtinDateToTimeString (line 49) | func builtinDateToTimeString(call FunctionCall) Value {
  function builtinDateToUTCString (line 57) | func builtinDateToUTCString(call FunctionCall) Value {
  function builtinDateToISOString (line 65) | func builtinDateToISOString(call FunctionCall) Value {
  function builtinDateToJSON (line 73) | func builtinDateToJSON(call FunctionCall) Value {
  function builtinDateToGMTString (line 89) | func builtinDateToGMTString(call FunctionCall) Value {
  function builtinDateGetTime (line 97) | func builtinDateGetTime(call FunctionCall) Value {
  function builtinDateSetTime (line 107) | func builtinDateSetTime(call FunctionCall) Value {
  function builtinDateBeforeSet (line 115) | func builtinDateBeforeSet(call FunctionCall, argumentLimit int, timeLoca...
  function builtinDateParse (line 151) | func builtinDateParse(call FunctionCall) Value {
  function builtinDateUTC (line 156) | func builtinDateUTC(call FunctionCall) Value {
  function builtinDateNow (line 160) | func builtinDateNow(call FunctionCall) Value {
  function builtinDateToLocaleString (line 166) | func builtinDateToLocaleString(call FunctionCall) Value {
  function builtinDateToLocaleDateString (line 175) | func builtinDateToLocaleDateString(call FunctionCall) Value {
  function builtinDateToLocaleTimeString (line 184) | func builtinDateToLocaleTimeString(call FunctionCall) Value {
  function builtinDateValueOf (line 192) | func builtinDateValueOf(call FunctionCall) Value {
  function builtinDateGetYear (line 200) | func builtinDateGetYear(call FunctionCall) Value {
  function builtinDateGetFullYear (line 210) | func builtinDateGetFullYear(call FunctionCall) Value {
  function builtinDateGetUTCFullYear (line 220) | func builtinDateGetUTCFullYear(call FunctionCall) Value {
  function builtinDateGetMonth (line 228) | func builtinDateGetMonth(call FunctionCall) Value {
  function builtinDateGetUTCMonth (line 236) | func builtinDateGetUTCMonth(call FunctionCall) Value {
  function builtinDateGetDate (line 244) | func builtinDateGetDate(call FunctionCall) Value {
  function builtinDateGetUTCDate (line 252) | func builtinDateGetUTCDate(call FunctionCall) Value {
  function builtinDateGetDay (line 260) | func builtinDateGetDay(call FunctionCall) Value {
  function builtinDateGetUTCDay (line 269) | func builtinDateGetUTCDay(call FunctionCall) Value {
  function builtinDateGetHours (line 277) | func builtinDateGetHours(call FunctionCall) Value {
  function builtinDateGetUTCHours (line 285) | func builtinDateGetUTCHours(call FunctionCall) Value {
  function builtinDateGetMinutes (line 293) | func builtinDateGetMinutes(call FunctionCall) Value {
  function builtinDateGetUTCMinutes (line 301) | func builtinDateGetUTCMinutes(call FunctionCall) Value {
  function builtinDateGetSeconds (line 309) | func builtinDateGetSeconds(call FunctionCall) Value {
  function builtinDateGetUTCSeconds (line 317) | func builtinDateGetUTCSeconds(call FunctionCall) Value {
  function builtinDateGetMilliseconds (line 325) | func builtinDateGetMilliseconds(call FunctionCall) Value {
  function builtinDateGetUTCMilliseconds (line 333) | func builtinDateGetUTCMilliseconds(call FunctionCall) Value {
  function builtinDateGetTimezoneOffset (line 341) | func builtinDateGetTimezoneOffset(call FunctionCall) Value {
  function builtinDateSetMilliseconds (line 361) | func builtinDateSetMilliseconds(call FunctionCall) Value {
  function builtinDateSetUTCMilliseconds (line 374) | func builtinDateSetUTCMilliseconds(call FunctionCall) Value {
  function builtinDateSetSeconds (line 387) | func builtinDateSetSeconds(call FunctionCall) Value {
  function builtinDateSetUTCSeconds (line 403) | func builtinDateSetUTCSeconds(call FunctionCall) Value {
  function builtinDateSetMinutes (line 419) | func builtinDateSetMinutes(call FunctionCall) Value {
  function builtinDateSetUTCMinutes (line 438) | func builtinDateSetUTCMinutes(call FunctionCall) Value {
  function builtinDateSetHours (line 457) | func builtinDateSetHours(call FunctionCall) Value {
  function builtinDateSetUTCHours (line 480) | func builtinDateSetUTCHours(call FunctionCall) Value {
  function builtinDateSetDate (line 503) | func builtinDateSetDate(call FunctionCall) Value {
  function builtinDateSetUTCDate (line 516) | func builtinDateSetUTCDate(call FunctionCall) Value {
  function builtinDateSetMonth (line 529) | func builtinDateSetMonth(call FunctionCall) Value {
  function builtinDateSetUTCMonth (line 545) | func builtinDateSetUTCMonth(call FunctionCall) Value {
  function builtinDateSetYear (line 561) | func builtinDateSetYear(call FunctionCall) Value {
  function builtinDateSetFullYear (line 578) | func builtinDateSetFullYear(call FunctionCall) Value {
  function builtinDateSetUTCFullYear (line 597) | func builtinDateSetUTCFullYear(call FunctionCall) Value {

FILE: builtin_error.go
  function builtinError (line 7) | func builtinError(call FunctionCall) Value {
  function builtinNewError (line 11) | func builtinNewError(obj *object, argumentList []Value) Value {
  function builtinErrorToString (line 15) | func builtinErrorToString(call FunctionCall) Value {
  method newEvalError (line 44) | func (rt *runtime) newEvalError(message Value) *object {
  function builtinEvalError (line 50) | func builtinEvalError(call FunctionCall) Value {
  function builtinNewEvalError (line 54) | func builtinNewEvalError(obj *object, argumentList []Value) Value {
  method newTypeError (line 58) | func (rt *runtime) newTypeError(message Value) *object {
  function builtinTypeError (line 64) | func builtinTypeError(call FunctionCall) Value {
  function builtinNewTypeError (line 68) | func builtinNewTypeError(obj *object, argumentList []Value) Value {
  method newRangeError (line 72) | func (rt *runtime) newRangeError(message Value) *object {
  function builtinRangeError (line 78) | func builtinRangeError(call FunctionCall) Value {
  function builtinNewRangeError (line 82) | func builtinNewRangeError(obj *object, argumentList []Value) Value {
  method newURIError (line 86) | func (rt *runtime) newURIError(message Value) *object {
  method newReferenceError (line 92) | func (rt *runtime) newReferenceError(message Value) *object {
  function builtinReferenceError (line 98) | func builtinReferenceError(call FunctionCall) Value {
  function builtinNewReferenceError (line 102) | func builtinNewReferenceError(obj *object, argumentList []Value) Value {
  method newSyntaxError (line 106) | func (rt *runtime) newSyntaxError(message Value) *object {
  function builtinSyntaxError (line 112) | func builtinSyntaxError(call FunctionCall) Value {
  function builtinNewSyntaxError (line 116) | func builtinNewSyntaxError(obj *object, argumentList []Value) Value {
  function builtinURIError (line 120) | func builtinURIError(call FunctionCall) Value {
  function builtinNewURIError (line 124) | func builtinNewURIError(obj *object, argumentList []Value) Value {

FILE: builtin_function.go
  function builtinFunction (line 13) | func builtinFunction(call FunctionCall) Value {
  function builtinNewFunction (line 17) | func builtinNewFunction(obj *object, argumentList []Value) Value {
  function argumentList2parameterList (line 21) | func argumentList2parameterList(argumentList []Value) []string {
  function builtinNewFunctionNative (line 32) | func builtinNewFunctionNative(rt *runtime, argumentList []Value) *object {
  function builtinFunctionToString (line 52) | func builtinFunctionToString(call FunctionCall) Value {
  function builtinFunctionApply (line 66) | func builtinFunctionApply(call FunctionCall) Value {
  function builtinFunctionCall (line 94) | func builtinFunctionCall(call FunctionCall) Value {
  function builtinFunctionBind (line 110) | func builtinFunctionBind(call FunctionCall) Value {

FILE: builtin_json.go
  type builtinJSONParseContext (line 10) | type builtinJSONParseContext struct
  function builtinJSONParse (line 15) | func builtinJSONParse(call FunctionCall) Value {
  function builtinJSONReviveWalk (line 42) | func builtinJSONReviveWalk(ctx builtinJSONParseContext, holder *object, ...
  function builtinJSONParseWalk (line 71) | func builtinJSONParseWalk(ctx builtinJSONParseContext, rawValue interfac...
  type builtinJSONStringifyContext (line 101) | type builtinJSONStringifyContext struct
  function builtinJSONStringify (line 109) | func builtinJSONStringify(call FunctionCall) Value {
  function builtinJSONStringifyWalk (line 195) | func builtinJSONStringifyWalk(ctx builtinJSONStringifyContext, key strin...

FILE: builtin_math.go
  function builtinMathAbs (line 10) | func builtinMathAbs(call FunctionCall) Value {
  function builtinMathAcos (line 15) | func builtinMathAcos(call FunctionCall) Value {
  function builtinMathAcosh (line 20) | func builtinMathAcosh(call FunctionCall) Value {
  function builtinMathAsin (line 25) | func builtinMathAsin(call FunctionCall) Value {
  function builtinMathAsinh (line 30) | func builtinMathAsinh(call FunctionCall) Value {
  function builtinMathAtan (line 35) | func builtinMathAtan(call FunctionCall) Value {
  function builtinMathAtan2 (line 40) | func builtinMathAtan2(call FunctionCall) Value {
  function builtinMathAtanh (line 52) | func builtinMathAtanh(call FunctionCall) Value {
  function builtinMathCbrt (line 57) | func builtinMathCbrt(call FunctionCall) Value {
  function builtinMathCos (line 62) | func builtinMathCos(call FunctionCall) Value {
  function builtinMathCeil (line 67) | func builtinMathCeil(call FunctionCall) Value {
  function builtinMathCosh (line 72) | func builtinMathCosh(call FunctionCall) Value {
  function builtinMathExp (line 77) | func builtinMathExp(call FunctionCall) Value {
  function builtinMathExpm1 (line 82) | func builtinMathExpm1(call FunctionCall) Value {
  function builtinMathFloor (line 87) | func builtinMathFloor(call FunctionCall) Value {
  function builtinMathLog (line 92) | func builtinMathLog(call FunctionCall) Value {
  function builtinMathLog10 (line 97) | func builtinMathLog10(call FunctionCall) Value {
  function builtinMathLog1p (line 102) | func builtinMathLog1p(call FunctionCall) Value {
  function builtinMathLog2 (line 107) | func builtinMathLog2(call FunctionCall) Value {
  function builtinMathMax (line 112) | func builtinMathMax(call FunctionCall) Value {
  function builtinMathMin (line 133) | func builtinMathMin(call FunctionCall) Value {
  function builtinMathPow (line 154) | func builtinMathPow(call FunctionCall) Value {
  function builtinMathRandom (line 164) | func builtinMathRandom(call FunctionCall) Value {
  function builtinMathRound (line 174) | func builtinMathRound(call FunctionCall) Value {
  function builtinMathSin (line 183) | func builtinMathSin(call FunctionCall) Value {
  function builtinMathSinh (line 188) | func builtinMathSinh(call FunctionCall) Value {
  function builtinMathSqrt (line 193) | func builtinMathSqrt(call FunctionCall) Value {
  function builtinMathTan (line 198) | func builtinMathTan(call FunctionCall) Value {
  function builtinMathTanh (line 203) | func builtinMathTanh(call FunctionCall) Value {
  function builtinMathTrunc (line 208) | func builtinMathTrunc(call FunctionCall) Value {

FILE: builtin_number.go
  function numberValueFromNumberArgumentList (line 14) | func numberValueFromNumberArgumentList(argumentList []Value) Value {
  function builtinNumber (line 21) | func builtinNumber(call FunctionCall) Value {
  function builtinNewNumber (line 25) | func builtinNewNumber(obj *object, argumentList []Value) Value {
  function builtinNumberToString (line 29) | func builtinNumberToString(call FunctionCall) Value {
  function builtinNumberValueOf (line 47) | func builtinNumberValueOf(call FunctionCall) Value {
  function builtinNumberToFixed (line 51) | func builtinNumberToFixed(call FunctionCall) Value {
  function builtinNumberToExponential (line 65) | func builtinNumberToExponential(call FunctionCall) Value {
  function builtinNumberToPrecision (line 79) | func builtinNumberToPrecision(call FunctionCall) Value {
  function builtinNumberIsNaN (line 94) | func builtinNumberIsNaN(call FunctionCall) Value {
  function builtinNumberToLocaleString (line 101) | func builtinNumberToLocaleString(call FunctionCall) Value {

FILE: builtin_object.go
  function builtinObject (line 10) | func builtinObject(call FunctionCall) Value {
  function builtinNewObject (line 20) | func builtinNewObject(obj *object, argumentList []Value) Value {
  function builtinObjectValueOf (line 33) | func builtinObjectValueOf(call FunctionCall) Value {
  function builtinObjectHasOwnProperty (line 37) | func builtinObjectHasOwnProperty(call FunctionCall) Value {
  function builtinObjectIsPrototypeOf (line 43) | func builtinObjectIsPrototypeOf(call FunctionCall) Value {
  function builtinObjectPropertyIsEnumerable (line 59) | func builtinObjectPropertyIsEnumerable(call FunctionCall) Value {
  function builtinObjectToString (line 69) | func builtinObjectToString(call FunctionCall) Value {
  function builtinObjectToLocaleString (line 82) | func builtinObjectToLocaleString(call FunctionCall) Value {
  function builtinObjectGetPrototypeOf (line 90) | func builtinObjectGetPrototypeOf(call FunctionCall) Value {
  function builtinObjectGetOwnPropertyDescriptor (line 104) | func builtinObjectGetOwnPropertyDescriptor(call FunctionCall) Value {
  function builtinObjectDefineProperty (line 119) | func builtinObjectDefineProperty(call FunctionCall) Value {
  function builtinObjectDefineProperties (line 131) | func builtinObjectDefineProperties(call FunctionCall) Value {
  function builtinObjectCreate (line 148) | func builtinObjectCreate(call FunctionCall) Value {
  function builtinObjectIsExtensible (line 170) | func builtinObjectIsExtensible(call FunctionCall) Value {
  function builtinObjectPreventExtensions (line 178) | func builtinObjectPreventExtensions(call FunctionCall) Value {
  function builtinObjectAssign (line 187) | func builtinObjectAssign(call FunctionCall) Value {
  function builtinObjectIsSealed (line 220) | func builtinObjectIsSealed(call FunctionCall) Value {
  function builtinObjectSeal (line 239) | func builtinObjectSeal(call FunctionCall) Value {
  function builtinObjectIsFrozen (line 255) | func builtinObjectIsFrozen(call FunctionCall) Value {
  function builtinObjectFreeze (line 274) | func builtinObjectFreeze(call FunctionCall) Value {
  function builtinObjectKeys (line 299) | func builtinObjectKeys(call FunctionCall) Value {
  function builtinObjectValues (line 310) | func builtinObjectValues(call FunctionCall) Value {
  function builtinObjectGetOwnPropertyNames (line 321) | func builtinObjectGetOwnPropertyNames(call FunctionCall) Value {

FILE: builtin_regexp.go
  function builtinRegExp (line 9) | func builtinRegExp(call FunctionCall) Value {
  function builtinNewRegExp (line 20) | func builtinNewRegExp(obj *object, argumentList []Value) Value {
  function builtinRegExpToString (line 27) | func builtinRegExpToString(call FunctionCall) Value {
  function builtinRegExpExec (line 43) | func builtinRegExpExec(call FunctionCall) Value {
  function builtinRegExpTest (line 53) | func builtinRegExpTest(call FunctionCall) Value {
  function builtinRegExpCompile (line 98) | func builtinRegExpCompile(call FunctionCall) Value {

FILE: builtin_string.go
  function stringValueFromStringArgumentList (line 14) | func stringValueFromStringArgumentList(argumentList []Value) Value {
  function builtinString (line 21) | func builtinString(call FunctionCall) Value {
  function builtinNewString (line 25) | func builtinNewString(obj *object, argumentList []Value) Value {
  function builtinStringToString (line 29) | func builtinStringToString(call FunctionCall) Value {
  function builtinStringValueOf (line 33) | func builtinStringValueOf(call FunctionCall) Value {
  function builtinStringFromCharCode (line 37) | func builtinStringFromCharCode(call FunctionCall) Value {
  function builtinStringCharAt (line 45) | func builtinStringCharAt(call FunctionCall) Value {
  function builtinStringCharCodeAt (line 55) | func builtinStringCharCodeAt(call FunctionCall) Value {
  function builtinStringConcat (line 65) | func builtinStringConcat(call FunctionCall) Value {
  function lastIndexRune (line 75) | func lastIndexRune(s, substr string) int {
  function indexRune (line 82) | func indexRune(s, substr string) int {
  function utf16Length (line 89) | func utf16Length(s string) int {
  function builtinStringIndexOf (line 93) | func builtinStringIndexOf(call FunctionCall) Value {
  function builtinStringLastIndexOf (line 116) | func builtinStringLastIndexOf(call FunctionCall) Value {
  function builtinStringMatch (line 142) | func builtinStringMatch(call FunctionCall) Value {
  function builtinStringFindAndReplaceString (line 175) | func builtinStringFindAndReplaceString(input []byte, lastIndex int, matc...
  function builtinStringReplace (line 211) | func builtinStringReplace(call FunctionCall) Value {
  function builtinStringSearch (line 284) | func builtinStringSearch(call FunctionCall) Value {
  function builtinStringSplit (line 299) | func builtinStringSplit(call FunctionCall) Value {
  function builtinStringSlice (line 401) | func builtinStringSlice(call FunctionCall) Value {
  function builtinStringSubstring (line 413) | func builtinStringSubstring(call FunctionCall) Value {
  function builtinStringSubstr (line 425) | func builtinStringSubstr(call FunctionCall) Value {
  function builtinStringStartsWith (line 450) | func builtinStringStartsWith(call FunctionCall) Value {
  function builtinStringToLowerCase (line 461) | func builtinStringToLowerCase(call FunctionCall) Value {
  function builtinStringToUpperCase (line 466) | func builtinStringToUpperCase(call FunctionCall) Value {
  constant builtinStringTrimWhitespace (line 472) | builtinStringTrimWhitespace = "\u0009\u000A\u000B\u000C\u000D\u0020\u00A...
  function builtinStringTrim (line 474) | func builtinStringTrim(call FunctionCall) Value {
  function builtinStringTrimStart (line 480) | func builtinStringTrimStart(call FunctionCall) Value {
  function builtinStringTrimEnd (line 484) | func builtinStringTrimEnd(call FunctionCall) Value {
  function builtinStringTrimLeft (line 489) | func builtinStringTrimLeft(call FunctionCall) Value {
  function builtinStringTrimRight (line 496) | func builtinStringTrimRight(call FunctionCall) Value {
  function builtinStringLocaleCompare (line 502) | func builtinStringLocaleCompare(call FunctionCall) Value {
  function builtinStringToLocaleLowerCase (line 514) | func builtinStringToLocaleLowerCase(call FunctionCall) Value {
  function builtinStringToLocaleUpperCase (line 518) | func builtinStringToLocaleUpperCase(call FunctionCall) Value {

FILE: builtin_test.go
  function TestString_substr (line 7) | func TestString_substr(t *testing.T) {
  function Test_builtin_escape (line 94) | func Test_builtin_escape(t *testing.T) {
  function Test_builtin_unescape (line 106) | func Test_builtin_unescape(t *testing.T) {
  function TestGlobal_escape (line 118) | func TestGlobal_escape(t *testing.T) {
  function TestGlobal_unescape (line 133) | func TestGlobal_unescape(t *testing.T) {
  function TestNumber_isNaN (line 148) | func TestNumber_isNaN(t *testing.T) {

FILE: call_test.go
  constant testAb (line 11) | testAb = "ab"
  function BenchmarkNativeCallWithString (line 14) | func BenchmarkNativeCallWithString(b *testing.B) {
  function BenchmarkNativeCallWithFloat32 (line 28) | func BenchmarkNativeCallWithFloat32(b *testing.B) {
  function BenchmarkNativeCallWithFloat64 (line 42) | func BenchmarkNativeCallWithFloat64(b *testing.B) {
  function BenchmarkNativeCallWithInt (line 56) | func BenchmarkNativeCallWithInt(b *testing.B) {
  function BenchmarkNativeCallWithUint (line 70) | func BenchmarkNativeCallWithUint(b *testing.B) {
  function BenchmarkNativeCallWithInt8 (line 84) | func BenchmarkNativeCallWithInt8(b *testing.B) {
  function BenchmarkNativeCallWithUint8 (line 98) | func BenchmarkNativeCallWithUint8(b *testing.B) {
  function BenchmarkNativeCallWithInt16 (line 112) | func BenchmarkNativeCallWithInt16(b *testing.B) {
  function BenchmarkNativeCallWithUint16 (line 126) | func BenchmarkNativeCallWithUint16(b *testing.B) {
  function BenchmarkNativeCallWithInt32 (line 140) | func BenchmarkNativeCallWithInt32(b *testing.B) {
  function BenchmarkNativeCallWithUint32 (line 154) | func BenchmarkNativeCallWithUint32(b *testing.B) {
  function BenchmarkNativeCallWithInt64 (line 168) | func BenchmarkNativeCallWithInt64(b *testing.B) {
  function BenchmarkNativeCallWithUint64 (line 182) | func BenchmarkNativeCallWithUint64(b *testing.B) {
  function BenchmarkNativeCallWithStringInt (line 196) | func BenchmarkNativeCallWithStringInt(b *testing.B) {
  function BenchmarkNativeCallWithIntVariadic0 (line 210) | func BenchmarkNativeCallWithIntVariadic0(b *testing.B) {
  function BenchmarkNativeCallWithIntVariadic1 (line 224) | func BenchmarkNativeCallWithIntVariadic1(b *testing.B) {
  function BenchmarkNativeCallWithIntVariadic3 (line 238) | func BenchmarkNativeCallWithIntVariadic3(b *testing.B) {
  function BenchmarkNativeCallWithIntVariadic10 (line 252) | func BenchmarkNativeCallWithIntVariadic10(b *testing.B) {
  function BenchmarkNativeCallWithIntArray0 (line 266) | func BenchmarkNativeCallWithIntArray0(b *testing.B) {
  function BenchmarkNativeCallWithIntArray1 (line 280) | func BenchmarkNativeCallWithIntArray1(b *testing.B) {
  function BenchmarkNativeCallWithIntArray3 (line 294) | func BenchmarkNativeCallWithIntArray3(b *testing.B) {
  function BenchmarkNativeCallWithIntArray10 (line 308) | func BenchmarkNativeCallWithIntArray10(b *testing.B) {
  function BenchmarkNativeCallWithIntVariadicArray0 (line 322) | func BenchmarkNativeCallWithIntVariadicArray0(b *testing.B) {
  function BenchmarkNativeCallWithIntVariadicArray1 (line 336) | func BenchmarkNativeCallWithIntVariadicArray1(b *testing.B) {
  function BenchmarkNativeCallWithIntVariadicArray3 (line 350) | func BenchmarkNativeCallWithIntVariadicArray3(b *testing.B) {
  function BenchmarkNativeCallWithIntVariadicArray10 (line 364) | func BenchmarkNativeCallWithIntVariadicArray10(b *testing.B) {
  function BenchmarkNativeCallWithStringIntVariadic0 (line 378) | func BenchmarkNativeCallWithStringIntVariadic0(b *testing.B) {
  function BenchmarkNativeCallWithStringIntVariadic1 (line 392) | func BenchmarkNativeCallWithStringIntVariadic1(b *testing.B) {
  function BenchmarkNativeCallWithStringIntVariadic3 (line 406) | func BenchmarkNativeCallWithStringIntVariadic3(b *testing.B) {
  function BenchmarkNativeCallWithStringIntVariadic10 (line 420) | func BenchmarkNativeCallWithStringIntVariadic10(b *testing.B) {
  function BenchmarkNativeCallWithStringIntVariadicArray0 (line 434) | func BenchmarkNativeCallWithStringIntVariadicArray0(b *testing.B) {
  function BenchmarkNativeCallWithStringIntVariadicArray1 (line 448) | func BenchmarkNativeCallWithStringIntVariadicArray1(b *testing.B) {
  function BenchmarkNativeCallWithStringIntVariadicArray3 (line 462) | func BenchmarkNativeCallWithStringIntVariadicArray3(b *testing.B) {
  function BenchmarkNativeCallWithStringIntVariadicArray10 (line 476) | func BenchmarkNativeCallWithStringIntVariadicArray10(b *testing.B) {
  function BenchmarkNativeCallWithMap (line 490) | func BenchmarkNativeCallWithMap(b *testing.B) {
  function BenchmarkNativeCallWithMapVariadic (line 504) | func BenchmarkNativeCallWithMapVariadic(b *testing.B) {
  function BenchmarkNativeCallWithMapVariadicArray (line 518) | func BenchmarkNativeCallWithMapVariadicArray(b *testing.B) {
  function BenchmarkNativeCallWithFunction (line 532) | func BenchmarkNativeCallWithFunction(b *testing.B) {
  function BenchmarkNativeCallWithFunctionInt (line 546) | func BenchmarkNativeCallWithFunctionInt(b *testing.B) {
  function BenchmarkNativeCallWithFunctionString (line 560) | func BenchmarkNativeCallWithFunctionString(b *testing.B) {
  function TestNativeCallWithString (line 574) | func TestNativeCallWithString(t *testing.T) {
  function TestNativeCallWithFloat32 (line 601) | func TestNativeCallWithFloat32(t *testing.T) {
  function TestNativeCallWithFloat64 (line 628) | func TestNativeCallWithFloat64(t *testing.T) {
  function TestNativeCallWithInt (line 655) | func TestNativeCallWithInt(t *testing.T) {
  function TestNativeCallWithUint (line 682) | func TestNativeCallWithUint(t *testing.T) {
  function TestNativeCallWithInt8 (line 709) | func TestNativeCallWithInt8(t *testing.T) {
  function TestNativeCallWithUint8 (line 736) | func TestNativeCallWithUint8(t *testing.T) {
  function TestNativeCallWithInt16 (line 763) | func TestNativeCallWithInt16(t *testing.T) {
  function TestNativeCallWithUint16 (line 790) | func TestNativeCallWithUint16(t *testing.T) {
  function TestNativeCallWithInt32 (line 817) | func TestNativeCallWithInt32(t *testing.T) {
  function TestNativeCallWithUint32 (line 844) | func TestNativeCallWithUint32(t *testing.T) {
  function TestNativeCallWithInt64 (line 871) | func TestNativeCallWithInt64(t *testing.T) {
  function TestNativeCallWithUint64 (line 898) | func TestNativeCallWithUint64(t *testing.T) {
  function TestNativeCallWithStringInt (line 925) | func TestNativeCallWithStringInt(t *testing.T) {
  function TestNativeCallWithIntVariadic0 (line 952) | func TestNativeCallWithIntVariadic0(t *testing.T) {
  function TestNativeCallWithIntVariadic1 (line 979) | func TestNativeCallWithIntVariadic1(t *testing.T) {
  function TestNativeCallWithIntVariadic3 (line 1006) | func TestNativeCallWithIntVariadic3(t *testing.T) {
  function TestNativeCallWithIntVariadic10 (line 1033) | func TestNativeCallWithIntVariadic10(t *testing.T) {
  function TestNativeCallWithIntArray0 (line 1060) | func TestNativeCallWithIntArray0(t *testing.T) {
  function TestNativeCallWithIntArray1 (line 1087) | func TestNativeCallWithIntArray1(t *testing.T) {
  function TestNativeCallWithIntArray3 (line 1114) | func TestNativeCallWithIntArray3(t *testing.T) {
  function TestNativeCallWithIntArray10 (line 1141) | func TestNativeCallWithIntArray10(t *testing.T) {
  function TestNativeCallWithIntVariadicArray0 (line 1168) | func TestNativeCallWithIntVariadicArray0(t *testing.T) {
  function TestNativeCallWithIntVariadicArray1 (line 1195) | func TestNativeCallWithIntVariadicArray1(t *testing.T) {
  function TestNativeCallWithIntVariadicArray3 (line 1222) | func TestNativeCallWithIntVariadicArray3(t *testing.T) {
  function TestNativeCallWithIntVariadicArray10 (line 1249) | func TestNativeCallWithIntVariadicArray10(t *testing.T) {
  function TestNativeCallWithStringIntVariadic0 (line 1276) | func TestNativeCallWithStringIntVariadic0(t *testing.T) {
  function TestNativeCallWithStringIntVariadic1 (line 1303) | func TestNativeCallWithStringIntVariadic1(t *testing.T) {
  function TestNativeCallWithStringIntVariadic3 (line 1330) | func TestNativeCallWithStringIntVariadic3(t *testing.T) {
  function TestNativeCallWithStringIntVariadic10 (line 1357) | func TestNativeCallWithStringIntVariadic10(t *testing.T) {
  function TestNativeCallWithStringIntVariadicArray0 (line 1384) | func TestNativeCallWithStringIntVariadicArray0(t *testing.T) {
  function TestNativeCallWithStringIntVariadicArray1 (line 1411) | func TestNativeCallWithStringIntVariadicArray1(t *testing.T) {
  function TestNativeCallWithStringIntVariadicArray3 (line 1438) | func TestNativeCallWithStringIntVariadicArray3(t *testing.T) {
  function TestNativeCallWithStringIntVariadicArray10 (line 1465) | func TestNativeCallWithStringIntVariadicArray10(t *testing.T) {
  function TestNativeCallWithMap (line 1492) | func TestNativeCallWithMap(t *testing.T) {
  function TestNativeCallWithMapVariadic (line 1519) | func TestNativeCallWithMapVariadic(t *testing.T) {
  function TestNativeCallWithMapVariadicArray (line 1546) | func TestNativeCallWithMapVariadicArray(t *testing.T) {
  function TestNativeCallWithFunctionVoidBool (line 1573) | func TestNativeCallWithFunctionVoidBool(t *testing.T) {
  function TestNativeCallWithFunctionIntInt (line 1600) | func TestNativeCallWithFunctionIntInt(t *testing.T) {
  function TestNativeCallWithFunctionStringString (line 1627) | func TestNativeCallWithFunctionStringString(t *testing.T) {
  type testNativeCallWithStruct (line 1654) | type testNativeCallWithStruct struct
    method MakeStruct (line 1662) | func (t testNativeCallWithStruct) MakeStruct(s string) testNativeCallW...
    method MakeStructPointer (line 1666) | func (t testNativeCallWithStruct) MakeStructPointer(s string) *testNat...
    method CallWithStruct (line 1670) | func (t testNativeCallWithStruct) CallWithStruct(a testNativeCallWithS...
    method CallPointerWithStruct (line 1674) | func (t *testNativeCallWithStruct) CallPointerWithStruct(a testNativeC...
    method CallWithStructPointer (line 1678) | func (t testNativeCallWithStruct) CallWithStructPointer(a *testNativeC...
    method CallPointerWithStructPointer (line 1682) | func (t *testNativeCallWithStruct) CallPointerWithStructPointer(a *tes...
  type testNativeCallWithStructArg (line 1658) | type testNativeCallWithStructArg struct
  function TestNativeCallMethodWithStruct (line 1686) | func TestNativeCallMethodWithStruct(t *testing.T) {
  function TestNativeCallPointerMethodWithStruct (line 1715) | func TestNativeCallPointerMethodWithStruct(t *testing.T) {
  function TestNativeCallMethodWithStructPointer (line 1744) | func TestNativeCallMethodWithStructPointer(t *testing.T) {
  function TestNativeCallPointerMethodWithStructPointer (line 1773) | func TestNativeCallPointerMethodWithStructPointer(t *testing.T) {
  function TestNativeCallNilInterfaceArg (line 1802) | func TestNativeCallNilInterfaceArg(t *testing.T) {

FILE: clone.go
  type cloner (line 7) | type cloner struct
    method object (line 86) | func (c *cloner) object(in *object) *object {
    method dclStash (line 95) | func (c *cloner) dclStash(in *dclStash) (*dclStash, bool) {
    method objectStash (line 104) | func (c *cloner) objectStash(in *objectStash) (*objectStash, bool) {
    method fnStash (line 113) | func (c *cloner) fnStash(in *fnStash) (*fnStash, bool) {
    method value (line 122) | func (c *cloner) value(in Value) Value {
    method valueArray (line 130) | func (c *cloner) valueArray(in []Value) []Value {
    method stash (line 138) | func (c *cloner) stash(in stasher) stasher {
    method property (line 145) | func (c *cloner) property(in property) property {
    method dclProperty (line 167) | func (c *cloner) dclProperty(in dclProperty) dclProperty {
  method clone (line 15) | func (rt *runtime) clone() *runtime {

FILE: clone_test.go
  function TestCloneGetterSetter (line 9) | func TestCloneGetterSetter(t *testing.T) {

FILE: cmpl.go
  type compiler (line 8) | type compiler struct

FILE: cmpl_evaluate.go
  method cmplEvaluateNodeProgram (line 7) | func (rt *runtime) cmplEvaluateNodeProgram(node *nodeProgram, eval bool)...
  method cmplCallNodeFunction (line 18) | func (rt *runtime) cmplCallNodeFunction(function *object, stash *fnStash...
  method cmplFunctionDeclaration (line 66) | func (rt *runtime) cmplFunctionDeclaration(list []*nodeFunctionLiteral) {
  method cmplVariableDeclaration (line 83) | func (rt *runtime) cmplVariableDeclaration(list []string) {

FILE: cmpl_evaluate_expression.go
  method cmplEvaluateNodeExpression (line 11) | func (rt *runtime) cmplEvaluateNodeExpression(node nodeExpression) Value {
  method cmplEvaluateNodeArrayLiteral (line 102) | func (rt *runtime) cmplEvaluateNodeArrayLiteral(node *nodeArrayLiteral) ...
  method cmplEvaluateNodeAssignExpression (line 118) | func (rt *runtime) cmplEvaluateNodeAssignExpression(node *nodeAssignExpr...
  method cmplEvaluateNodeBinaryExpression (line 133) | func (rt *runtime) cmplEvaluateNodeBinaryExpression(node *nodeBinaryExpr...
  method cmplEvaluateNodeBinaryExpressionComparison (line 156) | func (rt *runtime) cmplEvaluateNodeBinaryExpressionComparison(node *node...
  method cmplEvaluateNodeBracketExpression (line 163) | func (rt *runtime) cmplEvaluateNodeBracketExpression(node *nodeBracketEx...
  method cmplEvaluateNodeCallExpression (line 177) | func (rt *runtime) cmplEvaluateNodeCallExpression(node *nodeCallExpressi...
  method cmplEvaluateNodeConditionalExpression (line 237) | func (rt *runtime) cmplEvaluateNodeConditionalExpression(node *nodeCondi...
  method cmplEvaluateNodeDotExpression (line 246) | func (rt *runtime) cmplEvaluateNodeDotExpression(node *nodeDotExpression...
  method cmplEvaluateNodeNewExpression (line 257) | func (rt *runtime) cmplEvaluateNodeNewExpression(node *nodeNewExpression...
  method cmplEvaluateNodeObjectLiteral (line 301) | func (rt *runtime) cmplEvaluateNodeObjectLiteral(node *nodeObjectLiteral...
  method cmplEvaluateNodeSequenceExpression (line 327) | func (rt *runtime) cmplEvaluateNodeSequenceExpression(node *nodeSequence...
  method cmplEvaluateNodeUnaryExpression (line 336) | func (rt *runtime) cmplEvaluateNodeUnaryExpression(node *nodeUnaryExpres...
  method cmplEvaluateNodeVariableExpression (line 434) | func (rt *runtime) cmplEvaluateNodeVariableExpression(node *nodeVariable...

FILE: cmpl_evaluate_statement.go
  method cmplEvaluateNodeStatement (line 10) | func (rt *runtime) cmplEvaluateNodeStatement(node nodeStatement) Value {
  method cmplEvaluateNodeStatementList (line 116) | func (rt *runtime) cmplEvaluateNodeStatementList(list []nodeStatement) V...
  method cmplEvaluateNodeDoWhileStatement (line 136) | func (rt *runtime) cmplEvaluateNodeDoWhileStatement(node *nodeDoWhileSta...
  method cmplEvaluateNodeForInStatement (line 171) | func (rt *runtime) cmplEvaluateNodeForInStatement(node *nodeForInStateme...
  method cmplEvaluateNodeForStatement (line 233) | func (rt *runtime) cmplEvaluateNodeForStatement(node *nodeForStatement) ...
  method cmplEvaluateNodeIfStatement (line 294) | func (rt *runtime) cmplEvaluateNodeIfStatement(node *nodeIfStatement) Va...
  method cmplEvaluateNodeSwitchStatement (line 306) | func (rt *runtime) cmplEvaluateNodeSwitchStatement(node *nodeSwitchState...
  method cmplEvaluateNodeTryStatement (line 347) | func (rt *runtime) cmplEvaluateNodeTryStatement(node *nodeTryStatement) ...
  method cmplEvaluateModeWhileStatement (line 384) | func (rt *runtime) cmplEvaluateModeWhileStatement(node *nodeWhileStateme...
  method cmplEvaluateNodeWithStatement (line 418) | func (rt *runtime) cmplEvaluateNodeWithStatement(node *nodeWithStatement...

FILE: cmpl_parse.go
  method parseExpression (line 18) | func (cmpl *compiler) parseExpression(expr ast.Expression) nodeExpression {
  method parseStatement (line 198) | func (cmpl *compiler) parseStatement(stmt ast.Statement) nodeStatement {
  function cmplParse (line 359) | func cmplParse(in *ast.Program) *nodeProgram {
  method parse (line 370) | func (cmpl *compiler) parse() *nodeProgram {
  type nodeProgram (line 393) | type nodeProgram struct
  type node (line 400) | type node interface
  type nodeExpression (line 403) | type nodeExpression interface
  type nodeArrayLiteral (line 408) | type nodeArrayLiteral struct
    method expressionNode (line 604) | func (*nodeArrayLiteral) expressionNode()          {}
  type nodeAssignExpression (line 412) | type nodeAssignExpression struct
    method expressionNode (line 605) | func (*nodeAssignExpression) expressionNode()      {}
  type nodeBinaryExpression (line 418) | type nodeBinaryExpression struct
    method expressionNode (line 606) | func (*nodeBinaryExpression) expressionNode()      {}
  type nodeBracketExpression (line 425) | type nodeBracketExpression struct
    method expressionNode (line 607) | func (*nodeBracketExpression) expressionNode()     {}
  type nodeCallExpression (line 431) | type nodeCallExpression struct
    method expressionNode (line 608) | func (*nodeCallExpression) expressionNode()        {}
  type nodeConditionalExpression (line 436) | type nodeConditionalExpression struct
    method expressionNode (line 609) | func (*nodeConditionalExpression) expressionNode() {}
  type nodeDotExpression (line 442) | type nodeDotExpression struct
    method expressionNode (line 610) | func (*nodeDotExpression) expressionNode()         {}
  type nodeFunctionLiteral (line 448) | type nodeFunctionLiteral struct
    method expressionNode (line 611) | func (*nodeFunctionLiteral) expressionNode()       {}
  type nodeIdentifier (line 458) | type nodeIdentifier struct
    method expressionNode (line 612) | func (*nodeIdentifier) expressionNode()            {}
  type nodeLiteral (line 463) | type nodeLiteral struct
    method expressionNode (line 613) | func (*nodeLiteral) expressionNode()               {}
  type nodeNewExpression (line 467) | type nodeNewExpression struct
    method expressionNode (line 614) | func (*nodeNewExpression) expressionNode()         {}
  type nodeObjectLiteral (line 472) | type nodeObjectLiteral struct
    method expressionNode (line 615) | func (*nodeObjectLiteral) expressionNode()         {}
  type nodeProperty (line 476) | type nodeProperty struct
  type nodeRegExpLiteral (line 482) | type nodeRegExpLiteral struct
    method expressionNode (line 616) | func (*nodeRegExpLiteral) expressionNode()         {}
  type nodeSequenceExpression (line 487) | type nodeSequenceExpression struct
    method expressionNode (line 617) | func (*nodeSequenceExpression) expressionNode()    {}
  type nodeThisExpression (line 491) | type nodeThisExpression struct
    method expressionNode (line 618) | func (*nodeThisExpression) expressionNode()        {}
  type nodeUnaryExpression (line 493) | type nodeUnaryExpression struct
    method expressionNode (line 619) | func (*nodeUnaryExpression) expressionNode()       {}
  type nodeVariableExpression (line 499) | type nodeVariableExpression struct
    method expressionNode (line 620) | func (*nodeVariableExpression) expressionNode()    {}
  type nodeStatement (line 507) | type nodeStatement interface
  type nodeBlockStatement (line 512) | type nodeBlockStatement struct
    method statementNode (line 624) | func (*nodeBlockStatement) statementNode()      {}
  type nodeBranchStatement (line 516) | type nodeBranchStatement struct
    method statementNode (line 625) | func (*nodeBranchStatement) statementNode()     {}
  type nodeCaseStatement (line 521) | type nodeCaseStatement struct
    method statementNode (line 626) | func (*nodeCaseStatement) statementNode()       {}
  type nodeCatchStatement (line 526) | type nodeCatchStatement struct
    method statementNode (line 627) | func (*nodeCatchStatement) statementNode()      {}
  type nodeDebuggerStatement (line 531) | type nodeDebuggerStatement struct
    method statementNode (line 628) | func (*nodeDebuggerStatement) statementNode()   {}
  type nodeDoWhileStatement (line 533) | type nodeDoWhileStatement struct
    method statementNode (line 629) | func (*nodeDoWhileStatement) statementNode()    {}
  type nodeEmptyStatement (line 538) | type nodeEmptyStatement struct
    method statementNode (line 630) | func (*nodeEmptyStatement) statementNode()      {}
  type nodeExpressionStatement (line 540) | type nodeExpressionStatement struct
    method statementNode (line 631) | func (*nodeExpressionStatement) statementNode() {}
  type nodeForInStatement (line 544) | type nodeForInStatement struct
    method statementNode (line 632) | func (*nodeForInStatement) statementNode()      {}
  type nodeForStatement (line 550) | type nodeForStatement struct
    method statementNode (line 633) | func (*nodeForStatement) statementNode()        {}
  type nodeIfStatement (line 557) | type nodeIfStatement struct
    method statementNode (line 634) | func (*nodeIfStatement) statementNode()         {}
  type nodeLabelledStatement (line 563) | type nodeLabelledStatement struct
    method statementNode (line 635) | func (*nodeLabelledStatement) statementNode()   {}
  type nodeReturnStatement (line 568) | type nodeReturnStatement struct
    method statementNode (line 636) | func (*nodeReturnStatement) statementNode()     {}
  type nodeSwitchStatement (line 572) | type nodeSwitchStatement struct
    method statementNode (line 637) | func (*nodeSwitchStatement) statementNode()     {}
  type nodeThrowStatement (line 578) | type nodeThrowStatement struct
    method statementNode (line 638) | func (*nodeThrowStatement) statementNode()      {}
  type nodeTryStatement (line 582) | type nodeTryStatement struct
    method statementNode (line 639) | func (*nodeTryStatement) statementNode()        {}
  type nodeVariableStatement (line 588) | type nodeVariableStatement struct
    method statementNode (line 640) | func (*nodeVariableStatement) statementNode()   {}
  type nodeWhileStatement (line 592) | type nodeWhileStatement struct
    method statementNode (line 641) | func (*nodeWhileStatement) statementNode()      {}
  type nodeWithStatement (line 597) | type nodeWithStatement struct
    method statementNode (line 642) | func (*nodeWithStatement) statementNode()       {}

FILE: cmpl_test.go
  function Test_cmpl (line 9) | func Test_cmpl(t *testing.T) {
  function TestParse_cmpl (line 35) | func TestParse_cmpl(t *testing.T) {

FILE: console.go
  function formatForConsole (line 9) | func formatForConsole(argumentList []Value) string {
  function builtinConsoleLog (line 17) | func builtinConsoleLog(call FunctionCall) Value {
  function builtinConsoleError (line 22) | func builtinConsoleError(call FunctionCall) Value {
  function builtinConsoleDir (line 28) | func builtinConsoleDir(call FunctionCall) Value {
  function builtinConsoleTime (line 32) | func builtinConsoleTime(call FunctionCall) Value {
  function builtinConsoleTimeEnd (line 36) | func builtinConsoleTimeEnd(call FunctionCall) Value {
  function builtinConsoleTrace (line 40) | func builtinConsoleTrace(call FunctionCall) Value {
  function builtinConsoleAssert (line 44) | func builtinConsoleAssert(call FunctionCall) Value {

FILE: consts.go
  constant classStringName (line 5) | classStringName   = "String"
  constant classGoArrayName (line 6) | classGoArrayName  = "GoArray"
  constant classGoSliceName (line 7) | classGoSliceName  = "GoSlice"
  constant classNumberName (line 8) | classNumberName   = "Number"
  constant classDateName (line 9) | classDateName     = "Date"
  constant classArrayName (line 10) | classArrayName    = "Array"
  constant classFunctionName (line 11) | classFunctionName = "Function"
  constant classObjectName (line 12) | classObjectName   = "Object"
  constant classRegExpName (line 13) | classRegExpName   = "RegExp"
  constant classBooleanName (line 14) | classBooleanName  = "Boolean"
  constant classMathName (line 15) | classMathName     = "Math"
  constant classJSONName (line 16) | classJSONName     = "JSON"
  constant classErrorName (line 19) | classErrorName          = "Error"
  constant classEvalErrorName (line 20) | classEvalErrorName      = "EvalError"
  constant classTypeErrorName (line 21) | classTypeErrorName      = "TypeError"
  constant classRangeErrorName (line 22) | classRangeErrorName     = "RangeError"
  constant classReferenceErrorName (line 23) | classReferenceErrorName = "ReferenceError"
  constant classSyntaxErrorName (line 24) | classSyntaxErrorName    = "SyntaxError"
  constant classURIErrorName (line 25) | classURIErrorName       = "URIError"
  constant propertyName (line 28) | propertyName        = "name"
  constant propertyLength (line 29) | propertyLength      = "length"
  constant propertyPrototype (line 30) | propertyPrototype   = "prototype"
  constant propertyConstructor (line 31) | propertyConstructor = "constructor"
  constant methodToString (line 34) | methodToString = "toString"

FILE: date_test.go
  function mockTimeLocal (line 9) | func mockTimeLocal(location *time.Location) func() {
  function mockUTC (line 18) | func mockUTC() func() {
  function TestDate (line 22) | func TestDate(t *testing.T) {
  function TestDate_parse (line 125) | func TestDate_parse(t *testing.T) {
  function TestDate_UTC (line 147) | func TestDate_UTC(t *testing.T) {
  function TestDate_now (line 159) | func TestDate_now(t *testing.T) {
  function TestDate_toISOString (line 172) | func TestDate_toISOString(t *testing.T) {
  function TestDate_toJSON (line 182) | func TestDate_toJSON(t *testing.T) {
  function TestDate_setYear (line 192) | func TestDate_setYear(t *testing.T) {
  function TestDateDefaultValue (line 206) | func TestDateDefaultValue(t *testing.T) {
  function TestDate_April1978 (line 219) | func TestDate_April1978(t *testing.T) {
  function TestDate_setMilliseconds (line 232) | func TestDate_setMilliseconds(t *testing.T) {
  function TestDate_new (line 246) | func TestDate_new(t *testing.T) {
  function TestDateComparison (line 271) | func TestDateComparison(t *testing.T) {
  function TestDate_setSeconds (line 285) | func TestDate_setSeconds(t *testing.T) {
  function TestDate_setMinutes (line 320) | func TestDate_setMinutes(t *testing.T) {
  function TestDate_setHours (line 357) | func TestDate_setHours(t *testing.T) {
  function TestDate_setMonth (line 396) | func TestDate_setMonth(t *testing.T) {
  function TestDate_setFullYear (line 431) | func TestDate_setFullYear(t *testing.T) {
  function TestDate_setTime (line 468) | func TestDate_setTime(t *testing.T) {

FILE: dbg/dbg.go
  type _frmt (line 70) | type _frmt struct
  function operandCount (line 84) | func operandCount(format string) int {
  function parseFormat (line 102) | func parseFormat(format string) (frmt _frmt) {
  type Dbgr (line 131) | type Dbgr struct
    method Dbg (line 165) | func (d Dbgr) Dbg(values ...interface{}) {
    method Dbgf (line 169) | func (d Dbgr) Dbgf(values ...interface{}) {
    method DbgDbgf (line 173) | func (d Dbgr) DbgDbgf() (dbg DbgFunction, dbgf DbgFunction) {
    method dbgf (line 183) | func (d Dbgr) dbgf(values ...interface{}) {
    method getEmit (line 269) | func (d *Dbgr) getEmit() emit {
    method SetOutput (line 282) | func (d *Dbgr) SetOutput(output interface{}) {
  type DbgFunction (line 135) | type DbgFunction
  function NewDbgr (line 137) | func NewDbgr() *Dbgr {
  function New (line 155) | func New(options ...interface{}) (dbg DbgFunction, dbgf DbgFunction) {
  function standardEmit (line 311) | func standardEmit() emit {
  function ln (line 317) | func ln(tmp string) string {
  type emit (line 325) | type emit interface
  type emitWriter (line 329) | type emitWriter struct
    method emit (line 333) | func (ew emitWriter) emit(frmt _frmt, format string, values ...interfa...
  type emitLogger (line 347) | type emitLogger struct
    method emit (line 351) | func (el emitLogger) emit(frmt _frmt, format string, values ...interfa...
  type emitLog (line 365) | type emitLog struct
    method emit (line 368) | func (el emitLog) emit(frmt _frmt, format string, values ...interface{...

FILE: documentation_test.go
  function ExampleSynopsis (line 8) | func ExampleSynopsis() { //nolint:govet
  function ExampleConsole (line 119) | func ExampleConsole() { //nolint:govet

FILE: error.go
  type exception (line 10) | type exception struct
    method eject (line 20) | func (e *exception) eject() interface{} {
  function newException (line 14) | func newException(value interface{}) *exception {
  type ottoError (line 26) | type ottoError struct
    method format (line 34) | func (e ottoError) format() string {
    method formatWithStack (line 44) | func (e ottoError) formatWithStack() string {
    method describe (line 122) | func (e ottoError) describe(format string, in ...interface{}) string {
    method messageValue (line 126) | func (e ottoError) messageValue() Value {
  type frame (line 52) | type frame struct
    method location (line 66) | func (fr frame) location() string {
  type at (line 64) | type at
  type Error (line 95) | type Error struct
    method Error (line 102) | func (e Error) Error() string {
    method String (line 112) | func (e Error) String() string {
    method GoString (line 118) | func (e Error) GoString() string {
  method typeErrorResult (line 133) | func (rt *runtime) typeErrorResult(throw bool) bool {
  function newError (line 140) | func newError(rt *runtime, name string, stackFramesToPop int, in ...inte...
  method panicTypeError (line 194) | func (rt *runtime) panicTypeError(argumentList ...interface{}) *exception {
  method panicReferenceError (line 200) | func (rt *runtime) panicReferenceError(argumentList ...interface{}) *exc...
  method panicURIError (line 206) | func (rt *runtime) panicURIError(argumentList ...interface{}) *exception {
  method panicSyntaxError (line 212) | func (rt *runtime) panicSyntaxError(argumentList ...interface{}) *except...
  method panicRangeError (line 218) | func (rt *runtime) panicRangeError(argumentList ...interface{}) *excepti...
  function catchPanic (line 224) | func catchPanic(function func()) (err error) {

FILE: error_native_test.go
  function TestErrorContextNative (line 13) | func TestErrorContextNative(t *testing.T) {

FILE: error_test.go
  function TestError (line 9) | func TestError(t *testing.T) {
  function TestError_instanceof (line 19) | func TestError_instanceof(t *testing.T) {
  function TestPanicValue (line 27) | func TestPanicValue(t *testing.T) {
  function Test_catchPanic (line 49) | func Test_catchPanic(t *testing.T) {
  function asError (line 66) | func asError(t *testing.T, err error) *Error {
  function TestErrorContext (line 73) | func TestErrorContext(t *testing.T) {
  function TestMakeCustomErrorReturn (line 260) | func TestMakeCustomErrorReturn(t *testing.T) {
  function TestMakeCustomError (line 302) | func TestMakeCustomError(t *testing.T) {
  function TestMakeCustomErrorFreshVM (line 330) | func TestMakeCustomErrorFreshVM(t *testing.T) {
  function TestMakeTypeError (line 342) | func TestMakeTypeError(t *testing.T) {
  function TestMakeRangeError (line 370) | func TestMakeRangeError(t *testing.T) {
  function TestMakeSyntaxError (line 398) | func TestMakeSyntaxError(t *testing.T) {
  function TestErrorStackProperty (line 426) | func TestErrorStackProperty(t *testing.T) {
  function TestErrorMessageContainingFormatCharacters (line 450) | func TestErrorMessageContainingFormatCharacters(t *testing.T) {

FILE: evaluate.go
  method evaluateMultiply (line 11) | func (rt *runtime) evaluateMultiply(left float64, right float64) Value {...
  method evaluateDivide (line 16) | func (rt *runtime) evaluateDivide(left float64, right float64) Value {
  method evaluateModulo (line 47) | func (rt *runtime) evaluateModulo(left float64, right float64) Value { /...
  method calculateBinaryExpression (line 52) | func (rt *runtime) calculateBinaryExpression(operator token.Token, left ...
  type lessThanResult (line 137) | type lessThanResult
  constant lessThanFalse (line 140) | lessThanFalse lessThanResult = iota
  constant lessThanTrue (line 141) | lessThanTrue
  constant lessThanUndefined (line 142) | lessThanUndefined
  function calculateLessThan (line 145) | func calculateLessThan(left Value, right Value, leftFirst bool) lessThan...
  method calculateComparison (line 205) | func (rt *runtime) calculateComparison(comparator token.Token, left Valu...

FILE: file/file.go
  type Idx (line 14) | type Idx
  type Position (line 18) | type Position struct
    method isValid (line 27) | func (p *Position) isValid() bool {
    method String (line 37) | func (p *Position) String() string {
  type FileSet (line 52) | type FileSet struct
    method AddFile (line 60) | func (fs *FileSet) AddFile(filename, src string) int {
    method nextBase (line 72) | func (fs *FileSet) nextBase() int {
    method File (line 80) | func (fs *FileSet) File(idx Idx) *File {
    method Position (line 90) | func (fs *FileSet) Position(idx Idx) *Position {
  type File (line 101) | type File struct
    method WithSourceMap (line 118) | func (fl *File) WithSourceMap(sm *sourcemap.Consumer) *File {
    method Name (line 124) | func (fl *File) Name() string {
    method Source (line 129) | func (fl *File) Source() string {
    method Base (line 134) | func (fl *File) Base() int {
    method Position (line 139) | func (fl *File) Position(idx Idx) *Position {
  function NewFile (line 109) | func NewFile(filename, src string, base int) *File {

FILE: function_stack_test.go
  function TestFunction_stack (line 13) | func TestFunction_stack(t *testing.T) {

FILE: function_test.go
  function TestFunction (line 7) | func TestFunction(t *testing.T) {
  function Test_argumentList2parameterList (line 19) | func Test_argumentList2parameterList(t *testing.T) {
  function TestFunction_new (line 25) | func TestFunction_new(t *testing.T) {
  function TestFunction_apply (line 68) | func TestFunction_apply(t *testing.T) {
  function TestFunction_call (line 77) | func TestFunction_call(t *testing.T) {
  function TestFunctionArguments (line 86) | func TestFunctionArguments(t *testing.T) {
  function TestFunctionDeclarationInFunction (line 129) | func TestFunctionDeclarationInFunction(t *testing.T) {
  function TestArguments_defineOwnProperty (line 149) | func TestArguments_defineOwnProperty(t *testing.T) {
  function TestFunction_bind (line 182) | func TestFunction_bind(t *testing.T) {
  function TestFunction_toString (line 265) | func TestFunction_toString(t *testing.T) {
  function TestFunction_length (line 282) | func TestFunction_length(t *testing.T) {
  function TestFunction_name (line 290) | func TestFunction_name(t *testing.T) {
  function TestFunction_caller (line 300) | func TestFunction_caller(t *testing.T) {

FILE: functional_benchmark_test.go
  function TestGoSliceQuickSort (line 12) | func TestGoSliceQuickSort(t *testing.T) {
  function TestGoSliceHeapSort (line 16) | func TestGoSliceHeapSort(t *testing.T) {
  function TestJsArrayQuicksort (line 20) | func TestJsArrayQuicksort(t *testing.T) {
  function TestJsArrayHeapSort (line 24) | func TestJsArrayHeapSort(t *testing.T) {
  function TestJsArrayMergeSort (line 28) | func TestJsArrayMergeSort(t *testing.T) {
  function TestCryptoAes (line 32) | func TestCryptoAes(t *testing.T) {
  function BenchmarkGoSliceQuickSort100000000 (line 40) | func BenchmarkGoSliceQuickSort100000000(b *testing.B) {
  function BenchmarkGoSliceHeapSort100000000 (line 44) | func BenchmarkGoSliceHeapSort100000000(b *testing.B) {
  function BenchmarkJsArrayQuickSort500 (line 48) | func BenchmarkJsArrayQuickSort500(b *testing.B) {
  function BenchmarkJsArrayMergeSort500 (line 52) | func BenchmarkJsArrayMergeSort500(b *testing.B) {
  function BenchmarkJsArrayHeapSort500 (line 56) | func BenchmarkJsArrayHeapSort500(b *testing.B) {
  function BenchmarkCryptoAES (line 60) | func BenchmarkCryptoAES(b *testing.B) {
  function testGoSliceSort (line 72) | func testGoSliceSort(t *testing.T, sortFuncCall string, sortCode string) {
  function testJsArraySort (line 100) | func testJsArraySort(t *testing.T, sortFuncCall string, sortCode string) {
  function benchmarkGoSliceSort (line 122) | func benchmarkGoSliceSort(b *testing.B, size int, sortFuncCall string, s...
  function benchmarkJsArraySort (line 145) | func benchmarkJsArraySort(b *testing.B, size int, sortFuncCall string, s...
  constant jsQuickSort (line 177) | jsQuickSort = `
  constant jsMergeSort (line 219) | jsMergeSort = `
  constant jsHeapSort (line 254) | jsHeapSort = `
  constant jsCryptoAES (line 313) | jsCryptoAES = `

FILE: global.go
  function newContext (line 44) | func newContext() *runtime {
  method newBaseObject (line 58) | func (rt *runtime) newBaseObject() *object {
  method newClassObject (line 62) | func (rt *runtime) newClassObject(class string) *object {
  method newPrimitiveObject (line 66) | func (rt *runtime) newPrimitiveObject(class string, value Value) *object {
  method primitiveValue (line 72) | func (o *object) primitiveValue() Value {
  method hasPrimitive (line 82) | func (o *object) hasPrimitive() bool { //nolint:unused
  method newObject (line 90) | func (rt *runtime) newObject() *object {
  method newArray (line 96) | func (rt *runtime) newArray(length uint32) *object {
  method newArrayOf (line 102) | func (rt *runtime) newArrayOf(valueArray []Value) *object {
  method newString (line 113) | func (rt *runtime) newString(value Value) *object {
  method newBoolean (line 119) | func (rt *runtime) newBoolean(value Value) *object {
  method newNumber (line 125) | func (rt *runtime) newNumber(value Value) *object {
  method newRegExp (line 131) | func (rt *runtime) newRegExp(patternValue Value, flagsValue Value) *obje...
  method newRegExpDirect (line 153) | func (rt *runtime) newRegExpDirect(pattern string, flags string) *object {
  method newDate (line 160) | func (rt *runtime) newDate(epoch float64) *object {
  method newError (line 166) | func (rt *runtime) newError(name string, message Value, stackFramesToPop...
  method newNativeFunction (line 190) | func (rt *runtime) newNativeFunction(name, file string, line int, fn nat...
  method newNodeFunction (line 199) | func (rt *runtime) newNodeFunction(node *nodeFunctionLiteral, scopeEnvir...
  method newBoundFunction (line 210) | func (rt *runtime) newBoundFunction(target *object, this Value, argument...

FILE: global_test.go
  function TestGlobal (line 10) | func TestGlobal(t *testing.T) {
  function TestGlobalLength (line 122) | func TestGlobalLength(t *testing.T) {
  function TestGlobalError (line 132) | func TestGlobalError(t *testing.T) {
  function TestGlobalReadOnly (line 146) | func TestGlobalReadOnly(t *testing.T) {
  function Test_isNaN (line 165) | func Test_isNaN(t *testing.T) {
  function Test_isFinite (line 180) | func Test_isFinite(t *testing.T) {
  function Test_parseInt (line 196) | func Test_parseInt(t *testing.T) {
  function Test_parseFloat (line 220) | func Test_parseFloat(t *testing.T) {
  function Test_encodeURI (line 249) | func Test_encodeURI(t *testing.T) {
  function Test_encodeURIComponent (line 264) | func Test_encodeURIComponent(t *testing.T) {
  function Test_decodeURI (line 273) | func Test_decodeURI(t *testing.T) {
  function Test_decodeURIComponent (line 290) | func Test_decodeURIComponent(t *testing.T) {
  function TestGlobal_skipEnumeration (line 308) | func TestGlobal_skipEnumeration(t *testing.T) {

FILE: inline.go
  method newContext (line 9) | func (rt *runtime) newContext() {
  method newConsole (line 8350) | func (rt *runtime) newConsole() *object {
  function intValue (line 8744) | func intValue(value int) Value {
  function int32Value (line 8751) | func int32Value(value int32) Value {
  function int64Value (line 8758) | func int64Value(value int64) Value {
  function uint16Value (line 8765) | func uint16Value(value uint16) Value {
  function uint32Value (line 8772) | func uint32Value(value uint32) Value {
  function float64Value (line 8779) | func float64Value(value float64) Value {
  function stringValue (line 8786) | func stringValue(value string) Value {
  function string16Value (line 8793) | func string16Value(value []uint16) Value {
  function boolValue (line 8800) | func boolValue(value bool) Value {
  function objectValue (line 8807) | func objectValue(value *object) Value {

FILE: inline_test.go
  function TestGetOwnPropertyNames (line 10) | func TestGetOwnPropertyNames(t *testing.T) {

FILE: issue_test.go
  function Test_issue116 (line 14) | func Test_issue116(t *testing.T) {
  function Test_issue262 (line 26) | func Test_issue262(t *testing.T) {
  function Test_issue5 (line 37) | func Test_issue5(t *testing.T) {
  function Test_issue13 (line 46) | func Test_issue13(t *testing.T) {
  function Test_issue16 (line 104) | func Test_issue16(t *testing.T) {
  function Test_issue21 (line 138) | func Test_issue21(t *testing.T) {
  function Test_issue24 (line 186) | func Test_issue24(t *testing.T) {
  function Test_issue39 (line 276) | func Test_issue39(t *testing.T) {
  function Test_issue64 (line 300) | func Test_issue64(t *testing.T) {
  function Test_issue73 (line 329) | func Test_issue73(t *testing.T) {
  function Test_7_3_1 (line 342) | func Test_7_3_1(t *testing.T) {
  function Test_7_3_3 (line 351) | func Test_7_3_3(t *testing.T) {
  function Test_S7_3_A2_1_T1 (line 359) | func Test_S7_3_A2_1_T1(t *testing.T) {
  function Test_S7_8_3_A2_1_T1 (line 369) | func Test_S7_8_3_A2_1_T1(t *testing.T) {
  function Test_S7_8_4_A4_2_T3 (line 379) | func Test_S7_8_4_A4_2_T3(t *testing.T) {
  function Test_S7_9_A1 (line 389) | func Test_S7_9_A1(t *testing.T) {
  function Test_S7_9_A3 (line 409) | func Test_S7_9_A3(t *testing.T) {
  function Test_7_3_10 (line 422) | func Test_7_3_10(t *testing.T) {
  function Test_bug (line 439) | func Test_bug(t *testing.T) {
  function Test_issue79 (line 531) | func Test_issue79(t *testing.T) {
  function Test_issue80 (line 565) | func Test_issue80(t *testing.T) {
  function Test_issue86 (line 583) | func Test_issue86(t *testing.T) {
  function Test_issue87 (line 603) | func Test_issue87(t *testing.T) {
  function Test_S9_3_1_A2 (line 645) | func Test_S9_3_1_A2(t *testing.T) {
  function Test_S15_1_2_2_A2_T10 (line 659) | func Test_S15_1_2_2_A2_T10(t *testing.T) {
  function Test_S15_1_2_3_A2_T10 (line 673) | func Test_S15_1_2_3_A2_T10(t *testing.T) {
  function Test_issue234 (line 687) | func Test_issue234(t *testing.T) {
  function Test_issue186 (line 698) | func Test_issue186(t *testing.T) {
  function Test_issue266 (line 752) | func Test_issue266(t *testing.T) {
  function Test_issue369 (line 776) | func Test_issue369(t *testing.T) {
  type testResult (line 805) | type testResult struct
    method LastInsertId (line 807) | func (r *testResult) LastInsertId() (int64, error) {
    method RowsAffected (line 811) | func (r *testResult) RowsAffected() (int64, error) {
  type testStmt (line 816) | type testStmt struct
    method Close (line 819) | func (s *testStmt) Close() error {
    method NumInput (line 824) | func (s *testStmt) NumInput() int {
    method Exec (line 829) | func (s *testStmt) Exec(args []driver.Value) (driver.Result, error) {
    method Query (line 834) | func (s *testStmt) Query(args []driver.Value) (driver.Rows, error) {
  type testConn (line 839) | type testConn struct
    method Prepare (line 842) | func (c *testConn) Prepare(query string) (driver.Stmt, error) {
    method Close (line 847) | func (c *testConn) Close() error {
    method Begin (line 852) | func (c *testConn) Begin() (driver.Tx, error) {
  type testDriver (line 857) | type testDriver struct
    method Open (line 860) | func (db *testDriver) Open(name string) (driver.Conn, error) {
  function Test_issue390 (line 864) | func Test_issue390(t *testing.T) {
  type testSetType (line 900) | type testSetType struct
  function Test_issue386 (line 906) | func Test_issue386(t *testing.T) {
  function Test_issue383 (line 937) | func Test_issue383(t *testing.T) {
  function Test_issue357 (line 953) | func Test_issue357(t *testing.T) {
  function Test_issue302 (line 973) | func Test_issue302(t *testing.T) {
  function Test_issue329 (line 1005) | func Test_issue329(t *testing.T) {
  function Test_issue317 (line 1028) | func Test_issue317(t *testing.T) {
  function Test_issue252 (line 1090) | func Test_issue252(t *testing.T) {
  function Test_issue177 (line 1120) | func Test_issue177(t *testing.T) {
  function Test_issue285 (line 1137) | func Test_issue285(t *testing.T) {

FILE: json_test.go
  function BenchmarkJSON_parse (line 9) | func BenchmarkJSON_parse(b *testing.B) {
  function TestJSON_parse (line 23) | func TestJSON_parse(t *testing.T) {
  function TestJSON_stringify (line 78) | func TestJSON_stringify(t *testing.T) {

FILE: math_test.go
  function TestMath_toString (line 13) | func TestMath_toString(t *testing.T) {
  function TestMath_abs (line 21) | func TestMath_abs(t *testing.T) {
  function TestMath_acos (line 40) | func TestMath_acos(t *testing.T) {
  function TestMath_acosh (line 53) | func TestMath_acosh(t *testing.T) {
  function TestMath_asin (line 67) | func TestMath_asin(t *testing.T) {
  function TestMath_asinh (line 81) | func TestMath_asinh(t *testing.T) {
  function TestMath_atan (line 95) | func TestMath_atan(t *testing.T) {
  function TestMath_atan2 (line 111) | func TestMath_atan2(t *testing.T) {
  function TestMath_atanh (line 150) | func TestMath_atanh(t *testing.T) {
  function TestMath_cbrt (line 163) | func TestMath_cbrt(t *testing.T) {
  function TestMath_ceil (line 179) | func TestMath_ceil(t *testing.T) {
  function TestMath_cos (line 196) | func TestMath_cos(t *testing.T) {
  function TestMath_cosh (line 210) | func TestMath_cosh(t *testing.T) {
  function TestMath_exp (line 220) | func TestMath_exp(t *testing.T) {
  function TestMath_expm1 (line 232) | func TestMath_expm1(t *testing.T) {
  function TestMath_floor (line 244) | func TestMath_floor(t *testing.T) {
  function TestMath_log (line 260) | func TestMath_log(t *testing.T) {
  function TestMath_log10 (line 275) | func TestMath_log10(t *testing.T) {
  function TestMath_log1p (line 289) | func TestMath_log1p(t *testing.T) {
  function TestMath_log2 (line 302) | func TestMath_log2(t *testing.T) {
  function TestMath_max (line 317) | func TestMath_max(t *testing.T) {
  function TestMath_min (line 325) | func TestMath_min(t *testing.T) {
  function TestMath_pow (line 333) | func TestMath_pow(t *testing.T) {
  function TestMath_round (line 369) | func TestMath_round(t *testing.T) {
  function TestMath_sin (line 386) | func TestMath_sin(t *testing.T) {
  function TestMath_sinh (line 400) | func TestMath_sinh(t *testing.T) {
  function TestMath_sqrt (line 414) | func TestMath_sqrt(t *testing.T) {
  function TestMath_tan (line 428) | func TestMath_tan(t *testing.T) {
  function TestMath_tanh (line 442) | func TestMath_tanh(t *testing.T) {
  function TestMath_trunc (line 455) | func TestMath_trunc(t *testing.T) {

FILE: native_stack_test.go
  function TestNativeStackFrames (line 9) | func TestNativeStackFrames(t *testing.T) {

FILE: number_test.go
  function TestNumber (line 7) | func TestNumber(t *testing.T) {
  function TestNumber_toString (line 19) | func TestNumber_toString(t *testing.T) {
  function TestNumber_toFixed (line 70) | func TestNumber_toFixed(t *testing.T) {
  function TestNumber_toExponential (line 108) | func TestNumber_toExponential(t *testing.T) {
  function TestNumber_toPrecision (line 120) | func TestNumber_toPrecision(t *testing.T) {
  function TestNumber_toLocaleString (line 133) | func TestNumber_toLocaleString(t *testing.T) {
  function TestValue_number (line 147) | func TestValue_number(t *testing.T) {
  function Test_NaN (line 157) | func Test_NaN(t *testing.T) {

FILE: object.go
  type object (line 3) | type object struct
    method getOwnProperty (line 28) | func (o *object) getOwnProperty(name string) *property {
    method getProperty (line 33) | func (o *object) getProperty(name string) *property {
    method get (line 38) | func (o *object) get(name string) Value {
    method canPut (line 43) | func (o *object) canPut(name string) bool {
    method put (line 48) | func (o *object) put(name string, value Value, throw bool) {
    method hasProperty (line 53) | func (o *object) hasProperty(name string) bool {
    method hasOwnProperty (line 57) | func (o *object) hasOwnProperty(name string) bool {
    method DefaultValue (line 70) | func (o *object) DefaultValue(hint defaultValueHint) Value {
    method String (line 97) | func (o *object) String() string {
    method defineProperty (line 101) | func (o *object) defineProperty(name string, value Value, mode propert...
    method defineOwnProperty (line 106) | func (o *object) defineOwnProperty(name string, descriptor property, t...
    method delete (line 110) | func (o *object) delete(name string, throw bool) bool {
    method enumerate (line 114) | func (o *object) enumerate(all bool, each func(string) bool) {
    method readProperty (line 118) | func (o *object) readProperty(name string) (property, bool) {
    method writeProperty (line 123) | func (o *object) writeProperty(name string, value interface{}, mode pr...
    method deleteProperty (line 133) | func (o *object) deleteProperty(name string) {
  function newObject (line 14) | func newObject(rt *runtime, class string) *object {
  type defaultValueHint (line 61) | type defaultValueHint
  constant defaultValueNoHint (line 64) | defaultValueNoHint defaultValueHint = iota
  constant defaultValueHintString (line 65) | defaultValueHintString
  constant defaultValueHintNumber (line 66) | defaultValueHintNumber

FILE: object_class.go
  type objectClass (line 7) | type objectClass struct
  function objectEnumerate (line 22) | func objectEnumerate(obj *object, all bool, each func(string) bool) {
  function init (line 41) | func init() {
  function objectGetOwnProperty (line 166) | func objectGetOwnProperty(obj *object, name string) *property {
  function objectGetProperty (line 176) | func objectGetProperty(obj *object, name string) *property {
  function objectGet (line 188) | func objectGet(obj *object, name string) Value {
  function objectCanPut (line 196) | func objectCanPut(obj *object, name string) bool {
  function objectCanPutDetails (line 201) | func objectCanPutDetails(obj *object, name string) (canPut bool, prop *p...
  function objectPut (line 239) | func objectPut(obj *object, name string, value Value, throw bool) {
  function objectHasProperty (line 303) | func objectHasProperty(obj *object, name string) bool {
  function objectHasOwnProperty (line 307) | func objectHasOwnProperty(obj *object, name string) bool {
  function objectDefineOwnProperty (line 312) | func objectDefineOwnProperty(obj *object, name string, descriptor proper...
  function objectDelete (line 445) | func objectDelete(obj *object, name string, throw bool) bool {
  function objectClone (line 457) | func objectClone(in *object, out *object, clone *cloner) *object {

FILE: object_test.go
  function TestObject_ (line 7) | func TestObject_(t *testing.T) {
  function TestStringObject (line 25) | func TestStringObject(t *testing.T) {
  function TestObject_getPrototypeOf (line 34) | func TestObject_getPrototypeOf(t *testing.T) {
  function TestObject_new (line 52) | func TestObject_new(t *testing.T) {
  function TestObject_create (line 62) | func TestObject_create(t *testing.T) {
  function TestObject_toLocaleString (line 99) | func TestObject_toLocaleString(t *testing.T) {
  function TestObject_isExtensible (line 118) | func TestObject_isExtensible(t *testing.T) {
  function TestObject_preventExtensions (line 136) | func TestObject_preventExtensions(t *testing.T) {
  function TestObject_isSealed (line 168) | func TestObject_isSealed(t *testing.T) {
  function TestObject_seal (line 177) | func TestObject_seal(t *testing.T) {
  function TestObject_isFrozen (line 210) | func TestObject_isFrozen(t *testing.T) {
  function TestObject_freeze (line 234) | func TestObject_freeze(t *testing.T) {
  function TestObject_defineProperty (line 267) | func TestObject_defineProperty(t *testing.T) {
  function TestObject_assign (line 313) | func TestObject_assign(t *testing.T) {
  function TestObject_keys (line 358) | func TestObject_keys(t *testing.T) {
  function TestObject_values (line 408) | func TestObject_values(t *testing.T) {
  function TestObject_getOwnPropertyNames (line 442) | func TestObject_getOwnPropertyNames(t *testing.T) {
  function TestObjectGetterSetter (line 464) | func TestObjectGetterSetter(t *testing.T) {
  function TestProperty (line 703) | func TestProperty(t *testing.T) {

FILE: otto.go
  type Otto (line 233) | type Otto struct
    method clone (line 260) | func (o *Otto) clone() *Otto {
    method Run (line 293) | func (o Otto) Run(src interface{}) (Value, error) {
    method Eval (line 306) | func (o Otto) Eval(src interface{}) (Value, error) {
    method Get (line 323) | func (o Otto) Get(name string) (Value, error) {
    method getValue (line 334) | func (o Otto) getValue(name string) Value {
    method Set (line 347) | func (o Otto) Set(name string, value interface{}) error {
    method setValue (line 358) | func (o Otto) setValue(name string, value Value) {
    method SetDebuggerHandler (line 363) | func (o Otto) SetDebuggerHandler(fn func(vm *Otto)) {
    method SetRandomSource (line 368) | func (o Otto) SetRandomSource(fn func() float64) {
    method SetStackDepthLimit (line 380) | func (o Otto) SetStackDepthLimit(limit int) {
    method SetStackTraceLimit (line 389) | func (o Otto) SetStackTraceLimit(limit int) {
    method MakeCustomError (line 395) | func (o Otto) MakeCustomError(name, message string) Value {
    method MakeRangeError (line 401) | func (o Otto) MakeRangeError(message string) Value {
    method MakeSyntaxError (line 407) | func (o Otto) MakeSyntaxError(message string) Value {
    method MakeTypeError (line 413) | func (o Otto) MakeTypeError(message string) Value {
    method Context (line 431) | func (o Otto) Context() Context {
    method ContextLimit (line 438) | func (o Otto) ContextLimit(limit int) Context {
    method ContextSkip (line 445) | func (o Otto) ContextSkip(limit int, skipNative bool) Context {
    method Call (line 536) | func (o Otto) Call(source string, this interface{}, argumentList ...in...
    method Object (line 612) | func (o Otto) Object(source string) (*Object, error) {
    method ToValue (line 624) | func (o Otto) ToValue(value interface{}) (Value, error) {
    method Copy (line 636) | func (o *Otto) Copy() *Otto {
  function New (line 241) | func New() *Otto {
  function Run (line 277) | func Run(src interface{}) (*Otto, Value, error) {
  type Context (line 419) | type Context struct
  type Object (line 645) | type Object struct
    method Call (line 662) | func (o Object) Call(name string, argumentList ...interface{}) (Value,...
    method Value (line 674) | func (o Object) Value() Value {
    method Get (line 679) | func (o Object) Get(name string) (Value, error) {
    method Set (line 694) | func (o Object) Set(name string, value interface{}) error {
    method Keys (line 708) | func (o Object) Keys() []string {
    method KeysByParent (line 719) | func (o Object) KeysByParent() [][]string {
    method Class (line 748) | func (o Object) Class() string {
    method MarshalJSON (line 753) | func (o Object) MarshalJSON() ([]byte, error) {

FILE: otto/main.go
  function readSource (line 16) | func readSource(filename string) ([]byte, error) {
  function main (line 23) | func main() {

FILE: otto_.go
  function isIdentifier (line 12) | func isIdentifier(value string) bool {
  method toValueArray (line 16) | func (rt *runtime) toValueArray(arguments ...interface{}) []Value {
  function stringToArrayIndex (line 33) | func stringToArrayIndex(name string) int64 {
  function isUint32 (line 49) | func isUint32(value int64) bool {
  function arrayIndexToString (line 53) | func arrayIndexToString(index int64) string {
  function valueOfArrayIndex (line 57) | func valueOfArrayIndex(array []Value, index int) Value {
  function getValueOfArrayIndex (line 62) | func getValueOfArrayIndex(array []Value, index int) (Value, bool) {
  function valueToRangeIndex (line 74) | func valueToRangeIndex(indexValue Value, length int64, negativeIsZero bo...
  function rangeStartEnd (line 98) | func rangeStartEnd(array []Value, size int64, negativeIsZero bool) (star...
  function rangeStartLength (line 116) | func rangeStartLength(source []Value, size int64) (start, length int64) ...
  function hereBeDragons (line 134) | func hereBeDragons(arguments ...interface{}) string {

FILE: otto_error_test.go
  function TestOttoError (line 7) | func TestOttoError(t *testing.T) {

FILE: otto_test.go
  function TestOtto (line 14) | func TestOtto(t *testing.T) {
  function TestFunction__ (line 61) | func TestFunction__(t *testing.T) {
  function TestIf (line 74) | func TestIf(t *testing.T) {
  function TestSequence (line 129) | func TestSequence(t *testing.T) {
  function TestCall (line 139) | func TestCall(t *testing.T) {
  function TestRunFunctionWithSetArguments (line 149) | func TestRunFunctionWithSetArguments(t *testing.T) {
  function TestRunFunctionWithArgumentsPassedToCall (line 166) | func TestRunFunctionWithArgumentsPassedToCall(t *testing.T) {
  function TestMember (line 180) | func TestMember(t *testing.T) {
  function Test_this (line 196) | func Test_this(t *testing.T) {
  function TestWhile (line 206) | func TestWhile(t *testing.T) {
  function TestSwitch_break (line 222) | func TestSwitch_break(t *testing.T) {
  function TestTryFinally (line 303) | func TestTryFinally(t *testing.T) {
  function TestTryCatch (line 378) | func TestTryCatch(t *testing.T) {
  function TestWith (line 416) | func TestWith(t *testing.T) {
  function TestSwitch (line 440) | func TestSwitch(t *testing.T) {
  function TestForIn (line 489) | func TestForIn(t *testing.T) {
  function TestFor (line 511) | func TestFor(t *testing.T) {
  function TestLabelled (line 575) | func TestLabelled(t *testing.T) {
  function TestConditional (line 622) | func TestConditional(t *testing.T) {
  function TestArrayLiteral (line 632) | func TestArrayLiteral(t *testing.T) {
  function TestAssignment (line 642) | func TestAssignment(t *testing.T) {
  function TestBinaryOperation (line 658) | func TestBinaryOperation(t *testing.T) {
  function Test_typeof (line 670) | func Test_typeof(t *testing.T) {
  function Test_PrimitiveValueObjectValue (line 681) | func Test_PrimitiveValueObjectValue(t *testing.T) {
  function Test_eval (line 690) | func Test_eval(t *testing.T) {
  function Test_evalDirectIndirect (line 733) | func Test_evalDirectIndirect(t *testing.T) {
  function TestError_URIError (line 756) | func TestError_URIError(t *testing.T) {
  function TestTo (line 775) | func TestTo(t *testing.T) {
  function TestShouldError (line 794) | func TestShouldError(t *testing.T) {
  function TestAPI (line 805) | func TestAPI(t *testing.T) {
  function TestObjectKeys (line 860) | func TestObjectKeys(t *testing.T) {
  function TestUnicode (line 880) | func TestUnicode(t *testing.T) {
  function TestDotMember (line 894) | func TestDotMember(t *testing.T) {
  function Test_stringToFloat (line 920) | func Test_stringToFloat(t *testing.T) {
  function Test_delete (line 927) | func Test_delete(t *testing.T) {
  function TestObject_defineOwnProperty (line 953) | func TestObject_defineOwnProperty(t *testing.T) {
  function Test_assignmentEvaluationOrder (line 994) | func Test_assignmentEvaluationOrder(t *testing.T) {
  function TestOttoCall (line 1010) | func TestOttoCall(t *testing.T) {
  function TestOttoCall_new (line 1055) | func TestOttoCall_new(t *testing.T) {
  function TestOttoCall_newWithBrackets (line 1071) | func TestOttoCall_newWithBrackets(t *testing.T) {
  function TestOttoCall_throw (line 1082) | func TestOttoCall_throw(t *testing.T) {
  function TestOttoCopy (line 1135) | func TestOttoCopy(t *testing.T) {
  function TestOttoCall_clone (line 1232) | func TestOttoCall_clone(t *testing.T) {
  function TestOttoRun (line 1368) | func TestOttoRun(t *testing.T) {
  function makeTestOttoEvalFunction (line 1434) | func makeTestOttoEvalFunction(t *testing.T, src, expected interface{}) f...
  function TestOttoEval (line 1449) | func TestOttoEval(t *testing.T) {
  function TestOttoContext (line 1514) | func TestOttoContext(t *testing.T) {
  function Test_objectLength (line 1676) | func Test_objectLength(t *testing.T) {
  function Test_stackLimit (line 1694) | func Test_stackLimit(t *testing.T) {
  function TestOttoInterrupt (line 1757) | func TestOttoInterrupt(t *testing.T) {
  function BenchmarkNew (line 1806) | func BenchmarkNew(b *testing.B) {
  function BenchmarkClone (line 1812) | func BenchmarkClone(b *testing.B) {

FILE: panic_test.go
  function Test_panic (line 7) | func Test_panic(t *testing.T) {

FILE: parser/comments_test.go
  function checkComments (line 11) | func checkComments(actual []*ast.Comment, expected []string, position as...
  function displayComments (line 35) | func displayComments(m ast.CommentMap) {
  function TestParser_comments (line 45) | func TestParser_comments(t *testing.T) {
  function TestParser_comments2 (line 1424) | func TestParser_comments2(t *testing.T) {

FILE: parser/error.go
  constant errUnexpectedToken (line 12) | errUnexpectedToken      = "Unexpected token %v"
  constant errUnexpectedEndOfInput (line 13) | errUnexpectedEndOfInput = "Unexpected end of input"
  type Error (line 51) | type Error struct
    method Error (line 58) | func (e Error) Error() string {
  method error (line 71) | func (p *parser) error(place interface{}, msg string, msgValues ...inter...
  method errorUnexpected (line 91) | func (p *parser) errorUnexpected(idx file.Idx, chr rune) {
  method errorUnexpectedToken (line 99) | func (p *parser) errorUnexpectedToken(tkn token.Token) {
  type ErrorList (line 123) | type ErrorList
    method Add (line 126) | func (el *ErrorList) Add(position file.Position, msg string) {
    method Reset (line 131) | func (el *ErrorList) Reset() {
    method Len (line 136) | func (el *ErrorList) Len() int {
    method Swap (line 141) | func (el *ErrorList) Swap(i, j int) {
    method Less (line 146) | func (el *ErrorList) Less(i, j int) bool {
    method Sort (line 164) | func (el *ErrorList) Sort() {
    method Error (line 169) | func (el *ErrorList) Error() string {
    method Err (line 182) | func (el *ErrorList) Err() error {

FILE: parser/expression.go
  method parseIdentifier (line 11) | func (p *parser) parseIdentifier() *ast.Identifier {
  method parsePrimaryExpression (line 30) | func (p *parser) parsePrimaryExpression() ast.Expression {
  method parseRegExpLiteral (line 121) | func (p *parser) parseRegExpLiteral() *ast.RegExpLiteral {
  method parseVariableDeclaration (line 173) | func (p *parser) parseVariableDeclaration(declarationList *[]*ast.Variab...
  method parseVariableDeclarationList (line 206) | func (p *parser) parseVariableDeclarationList(idx file.Idx) []ast.Expres...
  method parseObjectPropertyKey (line 233) | func (p *parser) parseObjectPropertyKey() (string, string) {
  method parseObjectProperty (line 267) | func (p *parser) parseObjectProperty() ast.Property {
  method parseObjectLiteral (line 318) | func (p *parser) parseObjectLiteral() ast.Expression {
  method parseArrayLiteral (line 343) | func (p *parser) parseArrayLiteral() ast.Expression {
  method parseArgumentList (line 382) | func (p *parser) parseArgumentList() (argumentList []ast.Expression, idx...
  method parseCallExpression (line 408) | func (p *parser) parseCallExpression(left ast.Expression) ast.Expression {
  method parseDotMember (line 423) | func (p *parser) parseDotMember(left ast.Expression) ast.Expression {
  method parseBracketMember (line 446) | func (p *parser) parseBracketMember(left ast.Expression) ast.Expression {
  method parseNewExpression (line 458) | func (p *parser) parseNewExpression() ast.Expression {
  method parseLeftHandSideExpression (line 479) | func (p *parser) parseLeftHandSideExpression() ast.Expression {
  method parseLeftHandSideExpressionAllowCall (line 507) | func (p *parser) parseLeftHandSideExpressionAllowCall() ast.Expression {
  method parsePostfixExpression (line 552) | func (p *parser) parsePostfixExpression() ast.Expression {
  method parseUnaryExpression (line 591) | func (p *parser) parseUnaryExpression() ast.Expression {
  method parseMultiplicativeExpression (line 633) | func (p *parser) parseMultiplicativeExpression() ast.Expression {
  method parseAdditiveExpression (line 655) | func (p *parser) parseAdditiveExpression() ast.Expression {
  method parseShiftExpression (line 676) | func (p *parser) parseShiftExpression() ast.Expression {
  method parseRelationalExpression (line 698) | func (p *parser) parseRelationalExpression() ast.Expression {
  method parseEqualityExpression (line 757) | func (p *parser) parseEqualityExpression() ast.Expression {
  method parseBitwiseAndExpression (line 780) | func (p *parser) parseBitwiseAndExpression() ast.Expression {
  method parseBitwiseExclusiveOrExpression (line 801) | func (p *parser) parseBitwiseExclusiveOrExpression() ast.Expression {
  method parseBitwiseOrExpression (line 822) | func (p *parser) parseBitwiseOrExpression() ast.Expression {
  method parseLogicalAndExpression (line 843) | func (p *parser) parseLogicalAndExpression() ast.Expression {
  method parseLogicalOrExpression (line 864) | func (p *parser) parseLogicalOrExpression() ast.Expression {
  method parseConditionalExpression (line 885) | func (p *parser) parseConditionalExpression() ast.Expression {
  method parseAssignmentExpression (line 911) | func (p *parser) parseAssignmentExpression() ast.Expression {
  method parseExpression (line 973) | func (p *parser) parseExpression() ast.Expression {

FILE: parser/lexer.go
  type chr (line 18) | type chr struct
  function isDecimalDigit (line 25) | func isDecimalDigit(chr rune) bool {
  function digitValue (line 29) | func digitValue(chr rune) int {
  function unicodeIDStart (line 72) | func unicodeIDStart(r rune) bool {
  function unicodeIDContinue (line 80) | func unicodeIDContinue(r rune) bool {
  function isDigit (line 88) | func isDigit(chr rune, base int) bool {
  function isIdentifierStart (line 92) | func isIdentifierStart(chr rune) bool {
  function isIdentifierPart (line 98) | func isIdentifierPart(chr rune) bool {
  method scanIdentifier (line 105) | func (p *parser) scanIdentifier() (string, error) {
  function isLineWhiteSpace (line 148) | func isLineWhiteSpace(chr rune) bool { //nolint:unused, deadcode
  function isLineTerminator (line 161) | func isLineTerminator(chr rune) bool {
  method scan (line 169) | func (p *parser) scan() (tkn token.Token, literal string, idx file.Idx) ...
  method switch2 (line 356) | func (p *parser) switch2(tkn0, tkn1 token.Token) token.Token {
  method switch3 (line 364) | func (p *parser) switch3(tkn0, tkn1 token.Token, chr2 rune, tkn2 token.T...
  method switch4 (line 376) | func (p *parser) switch4(tkn0, tkn1 token.Token, chr2 rune, tkn2, tkn3 t...
  method switch6 (line 392) | func (p *parser) switch6(tkn0, tkn1 token.Token, chr2 rune, tkn2, tkn3 t...
  method chrAt (line 416) | func (p *parser) chrAt(index int) chr { //nolint:unused
  method peek (line 424) | func (p *parser) peek() rune {
  method read (line 431) | func (p *parser) read() {
  method read (line 450) | func (p *regExpParser) read() {
  method readSingleLineComment (line 468) | func (p *parser) readSingleLineComment() []rune {
  method readMultiLineComment (line 482) | func (p *parser) readMultiLineComment() []rune {
  method skipSingleLineComment (line 501) | func (p *parser) skipSingleLineComment() {
  method skipMultiLineComment (line 510) | func (p *parser) skipMultiLineComment() {
  method skipWhiteSpace (line 524) | func (p *parser) skipWhiteSpace() {
  method scanMantissa (line 554) | func (p *parser) scanMantissa(base int) {
  method scanEscape (line 560) | func (p *parser) scanEscape(quote rune) {
  method scanString (line 593) | func (p *parser) scanString(offset int) (string, error) {
  method scanNewline (line 637) | func (p *parser) scanNewline() {
  function hex2decimal (line 647) | func hex2decimal(chr byte) (rune, bool) {
  function parseNumberLiteral (line 661) | func parseNumberLiteral(literal string) (value interface{}, err error) {...
  function parseStringLiteral (line 701) | func parseStringLiteral(literal string) (string, error) {
  method scanNumericLiteral (line 826) | func (p *parser) scanNumericLiteral(decimalPoint bool) (token.Token, str...

FILE: parser/lexer_test.go
  function TestLexer (line 16) | func TestLexer(t *testing.T) {

FILE: parser/marshal_test.go
  function marshal (line 16) | func marshal(name string, children ...interface{}) interface{} {
  function testMarshalNode (line 40) | func testMarshalNode(node interface{}) interface{} {
  function testMarshal (line 185) | func testMarshal(node interface{}) string {
  function TestParserAST (line 193) | func TestParserAST(t *testing.T) {

FILE: parser/parser.go
  type Mode (line 49) | type Mode
  constant IgnoreRegExpErrors (line 53) | IgnoreRegExpErrors Mode = 1 << iota
  constant StoreComments (line 56) | StoreComments
  type parser (line 59) | type parser struct
    method Scan (line 227) | func (p *parser) Scan() (token.Token, string, file.Idx) {
    method slice (line 231) | func (p *parser) slice(idx0, idx1 file.Idx) string {
    method parse (line 241) | func (p *parser) parse() (*ast.Program, error) {
    method next (line 255) | func (p *parser) next() {
    method optionalSemicolon (line 259) | func (p *parser) optionalSemicolon() {
    method semicolon (line 275) | func (p *parser) semicolon() {
    method idxOf (line 286) | func (p *parser) idxOf(offset int) file.Idx {
    method expect (line 290) | func (p *parser) expect(value token.Token) file.Idx {
    method position (line 323) | func (p *parser) position(idx file.Idx) file.Position {
  type Parser (line 83) | type Parser interface
  function newParser (line 87) | func newParser(filename, src string, base int, sm *sourcemap.Consumer) *...
  function NewParser (line 99) | func NewParser(filename, src string) Parser {
  function ReadSource (line 104) | func ReadSource(filename string, src interface{}) ([]byte, error) {
  function ReadSourceMap (line 129) | func ReadSourceMap(filename string, src interface{}) (*sourcemap.Consume...
  function ParseFileWithSourceMap (line 155) | func ParseFileWithSourceMap(fileSet *file.FileSet, filename string, java...
  function ParseFile (line 204) | func ParseFile(fileSet *file.FileSet, filename string, src interface{}, ...
  function ParseFunction (line 212) | func ParseFunction(parameterList, body string) (*ast.FunctionLiteral, er...
  function lineCount (line 299) | func lineCount(str string) (int, int) {

FILE: parser/parser_test.go
  function firstErr (line 15) | func firstErr(err error) error {
  function testParse (line 25) | func testParse(src string) (*parser, *ast.Program, error) {
  function testParseWithMode (line 29) | func testParseWithMode(src string, mode Mode) (parser *parser, program *...
  function TestParseFile (line 49) | func TestParseFile(t *testing.T) {
  function TestParseFunction (line 68) | func TestParseFunction(t *testing.T) {
  function TestParserErr (line 92) | func TestParserErr(t *testing.T) {
  function TestParser (line 497) | func TestParser(t *testing.T) {
  function Test_parseStringLiteral (line 894) | func Test_parseStringLiteral(t *testing.T) {
  function Test_parseNumberLiteral (line 964) | func Test_parseNumberLiteral(t *testing.T) {
  function Test_praseRegExpLiteral (line 978) | func Test_praseRegExpLiteral(t *testing.T) {
  function TestPosition (line 1004) | func TestPosition(t *testing.T) {
  function BenchmarkParser (line 1245) | func BenchmarkParser(b *testing.B) {

FILE: parser/regexp.go
  type regExpParser (line 9) | type regExpParser struct
    method scan (line 59) | func (p *regExpParser) scan() {
    method scanGroup (line 82) | func (p *regExpParser) scanGroup() {
    method scanBracket (line 116) | func (p *regExpParser) scanBracket() {
    method scanEscape (line 136) | func (p *regExpParser) scanEscape(inClass bool) {
    method pass (line 335) | func (p *regExpParser) pass() {
    method error (line 346) | func (p *regExpParser) error(offset int, msg string, msgValues ...inte...
  function TransformRegExp (line 33) | func TransformRegExp(pattern string) (string, error) {

FILE: parser/regexp_test.go
  function TestRegExp (line 8) | func TestRegExp(t *testing.T) {
  function TestTransformRegExp (line 142) | func TestTransformRegExp(t *testing.T) {

FILE: parser/scope.go
  type scope (line 7) | type scope struct
    method declare (line 28) | func (p *scope) declare(declaration ast.Declaration) {
    method hasLabel (line 32) | func (p *scope) hasLabel(name string) bool {
  method openScope (line 17) | func (p *parser) openScope() {
  method closeScope (line 24) | func (p *parser) closeScope() {

FILE: parser/statement.go
  method parseBlockStatement (line 8) | func (p *parser) parseBlockStatement() *ast.BlockStatement {
  method parseEmptyStatement (line 37) | func (p *parser) parseEmptyStatement() ast.Statement {
  method parseStatementList (line 42) | func (p *parser) parseStatementList() (list []ast.Statement) { //nolint:...
  method parseStatement (line 51) | func (p *parser) parseStatement() ast.Statement {
  method parseTryStatement (line 150) | func (p *parser) parseTryStatement() ast.Statement {
  method parseFunctionParameterList (line 214) | func (p *parser) parseFunctionParameterList() *ast.ParameterList {
  method parseFunctionStatement (line 243) | func (p *parser) parseFunctionStatement() *ast.FunctionStatement {
  method parseFunction (line 258) | func (p *parser) parseFunction(declaration bool) *ast.FunctionLiteral {
  method parseFunctionBlock (line 286) | func (p *parser) parseFunctionBlock(node *ast.FunctionLiteral) {
  method parseDebuggerStatement (line 298) | func (p *parser) parseDebuggerStatement() ast.Statement {
  method parseReturnStatement (line 312) | func (p *parser) parseReturnStatement() ast.Statement {
  method parseThrowStatement (line 341) | func (p *parser) parseThrowStatement() ast.Statement {
  method parseSwitchStatement (line 371) | func (p *parser) parseSwitchStatement() ast.Statement {
  method parseWithStatement (line 423) | func (p *parser) parseWithStatement() ast.Statement {
  method parseCaseStatement (line 452) | func (p *parser) parseCaseStatement() *ast.CaseStatement {
  method parseIterationStatement (line 494) | func (p *parser) parseIterationStatement() ast.Statement {
  method parseForIn (line 503) | func (p *parser) parseForIn(into ast.Expression) *ast.ForInStatement {
  method parseFor (line 519) | func (p *parser) parseFor(initializer ast.Expression) *ast.ForStatement {
  method parseForOrForInStatement (line 548) | func (p *parser) parseForOrForInStatement() ast.Statement {
  method parseVariableStatement (line 631) | func (p *parser) parseVariableStatement() *ast.VariableStatement {
  method parseDoWhileStatement (line 653) | func (p *parser) parseDoWhileStatement() ast.Statement {
  method parseWhileStatement (line 698) | func (p *parser) parseWhileStatement() ast.Statement {
  method parseIfStatement (line 726) | func (p *parser) parseIfStatement() ast.Statement {
  method parseSourceElement (line 762) | func (p *parser) parseSourceElement() ast.Statement {
  method parseSourceElements (line 767) | func (p *parser) parseSourceElements() []ast.Statement {
  method parseProgram (line 784) | func (p *parser) parseProgram() *ast.Program {
  method parseBreakStatement (line 794) | func (p *parser) parseBreakStatement() ast.Statement {
  method parseContinueStatement (line 851) | func (p *parser) parseContinueStatement() ast.Statement {
  method nextStatement (line 896) | func (p *parser) nextStatement() {

FILE: parser_test.go
  function TestPersistence (line 7) | func TestPersistence(t *testing.T) {

FILE: property.go
  type propertyMode (line 5) | type propertyMode
  constant modeWriteMask (line 8) | modeWriteMask     propertyMode = 0o700
  constant modeEnumerateMask (line 9) | modeEnumerateMask propertyMode = 0o070
  constant modeConfigureMask (line 10) | modeConfigureMask propertyMode = 0o007
  constant modeOnMask (line 11) | modeOnMask        propertyMode = 0o111
  constant modeSetMask (line 12) | modeSetMask       propertyMode = 0o222
  type propertyGetSet (line 15) | type propertyGetSet
  type property (line 19) | type property struct
    method writable (line 24) | func (p property) writable() bool {
    method writeOn (line 28) | func (p *property) writeOn() {
    method writeOff (line 32) | func (p *property) writeOff() {
    method writeClear (line 36) | func (p *property) writeClear() {
    method writeSet (line 40) | func (p property) writeSet() bool {
    method enumerable (line 44) | func (p property) enumerable() bool {
    method enumerateOn (line 48) | func (p *property) enumerateOn() {
    method enumerateOff (line 52) | func (p *property) enumerateOff() {
    method enumerateSet (line 56) | func (p property) enumerateSet() bool {
    method configurable (line 60) | func (p property) configurable() bool {
    method configureOn (line 64) | func (p *property) configureOn() {
    method configureOff (line 68) | func (p *property) configureOff() {
    method configureSet (line 72) | func (p property) configureSet() bool { //nolint:unused
    method copy (line 76) | func (p property) copy() *property { //nolint:unused
    method get (line 81) | func (p property) get(this *object) Value {
    method isAccessorDescriptor (line 93) | func (p property) isAccessorDescriptor() bool {
    method isDataDescriptor (line 98) | func (p property) isDataDescriptor() bool {
    method isGenericDescriptor (line 106) | func (p property) isGenericDescriptor() bool {
    method isEmpty (line 110) | func (p property) isEmpty() bool {
  function toPropertyDescriptor (line 117) | func toPropertyDescriptor(rt *runtime, value Value) property {
  method fromPropertyDescriptor (line 197) | func (rt *runtime) fromPropertyDescriptor(descriptor property) *object {

FILE: reflect_test.go
  type abcStruct (line 15) | type abcStruct struct
    method String (line 24) | func (abc abcStruct) String() string {
    method FuncPointer (line 28) | func (abc *abcStruct) FuncPointer() string {
    method Func (line 32) | func (abc abcStruct) Func() {
    method FuncReturn1 (line 35) | func (abc abcStruct) FuncReturn1() string {
    method FuncReturn2 (line 39) | func (abc abcStruct) FuncReturn2() (string, error) {
    method Func1Return1 (line 43) | func (abc abcStruct) Func1Return1(a string) string {
    method Func2Return1 (line 47) | func (abc abcStruct) Func2Return1(x, y string) string {
    method FuncEllipsis (line 51) | func (abc abcStruct) FuncEllipsis(xyz ...string) int {
    method FuncReturnStruct (line 55) | func (abc abcStruct) FuncReturnStruct() _mnoStruct {
    method Func1Int (line 59) | func (abc abcStruct) Func1Int(i int) int {
    method Func1Int8 (line 63) | func (abc abcStruct) Func1Int8(i int8) int8 {
    method Func1Int16 (line 67) | func (abc abcStruct) Func1Int16(i int16) int16 {
    method Func1Int32 (line 71) | func (abc abcStruct) Func1Int32(i int32) int32 {
    method Func1Int64 (line 75) | func (abc abcStruct) Func1Int64(i int64) int64 {
    method Func1Uint (line 79) | func (abc abcStruct) Func1Uint(i uint) uint {
    method Func1Uint8 (line 83) | func (abc abcStruct) Func1Uint8(i uint8) uint8 {
    method Func1Uint16 (line 87) | func (abc abcStruct) Func1Uint16(i uint16) uint16 {
    method Func1Uint32 (line 91) | func (abc abcStruct) Func1Uint32(i uint32) uint32 {
    method Func1Uint64 (line 95) | func (abc abcStruct) Func1Uint64(i uint64) uint64 {
    method Func2Int (line 99) | func (abc abcStruct) Func2Int(i, j int) int {
    method Func2StringInt (line 103) | func (abc abcStruct) Func2StringInt(s string, i int) string {
    method Func1IntVariadic (line 107) | func (abc abcStruct) Func1IntVariadic(a ...int) int {
    method Func2IntVariadic (line 115) | func (abc abcStruct) Func2IntVariadic(s string, a ...int) string {
    method Func2IntArrayVariadic (line 123) | func (abc abcStruct) Func2IntArrayVariadic(s string, a ...[]int) string {
  type _mnoStruct (line 133) | type _mnoStruct struct
    method Func (line 137) | func (mno _mnoStruct) Func() string {
  function TestReflect (line 141) | func TestReflect(t *testing.T) {
  function Test_reflectStruct (line 157) | func Test_reflectStruct(t *testing.T) {
  function Test_reflectMap (line 339) | func Test_reflectMap(t *testing.T) {
  function Test_reflectMapIterateKeys (line 431) | func Test_reflectMapIterateKeys(t *testing.T) {
  function Test_reflectSlice (line 487) | func Test_reflectSlice(t *testing.T) {
  function Test_reflectArray (line 544) | func Test_reflectArray(t *testing.T) {
  function Test_reflectArray_concat (line 675) | func Test_reflectArray_concat(t *testing.T) {
  function Test_reflectMapInterface (line 692) | func Test_reflectMapInterface(t *testing.T) {
  function TestPassthrough (line 726) | func TestPassthrough(t *testing.T) {
  type TestDynamicFunctionReturningInterfaceMyStruct1 (line 766) | type TestDynamicFunctionReturningInterfaceMyStruct1 struct
    method Error (line 768) | func (m *TestDynamicFunctionReturningInterfaceMyStruct1) Error() strin...
  type TestDynamicFunctionReturningInterfaceMyStruct2 (line 770) | type TestDynamicFunctionReturningInterfaceMyStruct2 struct
    method Error (line 772) | func (m *TestDynamicFunctionReturningInterfaceMyStruct2) Error() strin...
  function TestDynamicFunctionReturningInterface (line 774) | func TestDynamicFunctionReturningInterface(t *testing.T) {
  function TestStructCallParameterConversion (line 805) | func TestStructCallParameterConversion(t *testing.T) {
  type TestTextUnmarshallerCallParameterConversionMyStruct (line 852) | type TestTextUnmarshallerCallParameterConversionMyStruct struct
    method UnmarshalText (line 854) | func (m *TestTextUnmarshallerCallParameterConversionMyStruct) Unmarsha...
  function TestTextUnmarshallerCallParameterConversion (line 862) | func TestTextUnmarshallerCallParameterConversion(t *testing.T) {
  function TestJSONRawMessageCallParameterConversion (line 888) | func TestJSONRawMessageCallParameterConversion(t *testing.T) {

FILE: regexp_test.go
  function TestRegExp (line 8) | func TestRegExp(t *testing.T) {
  function TestRegExp_global (line 77) | func TestRegExp_global(t *testing.T) {
  function TestRegExp_exec (line 97) | func TestRegExp_exec(t *testing.T) {
  function TestRegExp_test (line 164) | func TestRegExp_test(t *testing.T) {
  function TestRegExp_toString (line 173) | func TestRegExp_toString(t *testing.T) {
  function TestRegExp_zaacbbbcac (line 182) | func TestRegExp_zaacbbbcac(t *testing.T) {
  function TestRegExpCopying (line 198) | func TestRegExpCopying(t *testing.T) {
  function TestRegExp_multiline (line 215) | func TestRegExp_multiline(t *testing.T) {
  function TestRegExp_source (line 226) | func TestRegExp_source(t *testing.T) {
  function TestRegExp_newRegExp (line 250) | func TestRegExp_newRegExp(t *testing.T) {
  function TestRegExp_flags (line 262) | func TestRegExp_flags(t *testing.T) {
  function TestRegExp_controlCharacter (line 274) | func TestRegExp_controlCharacter(t *testing.T) {
  function TestRegExp_notNotEmptyCharacterClass (line 290) | func TestRegExp_notNotEmptyCharacterClass(t *testing.T) {
  function TestRegExp_compile (line 301) | func TestRegExp_compile(t *testing.T) {

FILE: registry/registry.go
  type Entry (line 9) | type Entry struct
    method Enable (line 23) | func (e *Entry) Enable() {
    method Disable (line 28) | func (e *Entry) Disable() {
    method Source (line 33) | func (e Entry) Source() string {
  function newEntry (line 15) | func newEntry(source func() string) *Entry {
  function Apply (line 38) | func Apply(callback func(Entry)) {
  function Register (line 48) | func Register(source func() string) *Entry {

FILE: repl/autocompleter.go
  type autoCompleter (line 10) | type autoCompleter struct
    method Do (line 16) | func (a *autoCompleter) Do(line []rune, pos int) ([][]rune, int) {

FILE: repl/repl.go
  function DebuggerHandler (line 19) | func DebuggerHandler(vm *otto.Otto) {
  function Run (line 29) | func Run(vm *otto.Otto) error {
  function RunWithPrompt (line 34) | func RunWithPrompt(vm *otto.Otto, prompt string) error {
  function RunWithPrelude (line 41) | func RunWithPrelude(vm *otto.Otto, prelude string) error {
  function RunWithPromptAndPrelude (line 48) | func RunWithPromptAndPrelude(vm *otto.Otto, prompt, prelude string) error {
  type Options (line 56) | type Options struct
  function RunWithOptions (line 71) | func RunWithOptions(vm *otto.Otto, options Options) error {

FILE: result.go
  type resultKind (line 3) | type resultKind
  constant _ (line 6) | _ resultKind = iota
  constant resultReturn (line 7) | resultReturn
  constant resultBreak (line 8) | resultBreak
  constant resultContinue (line 9) | resultContinue
  type result (line 12) | type result struct
  function newReturnResult (line 18) | func newReturnResult(value Value) result {
  function newContinueResult (line 22) | func newContinueResult(target string) result {
  function newBreakResult (line 26) | func newBreakResult(target string) result {

FILE: runtime.go
  type global (line 20) | type global struct
  type runtime (line 56) | type runtime struct
    method enterScope (line 71) | func (rt *runtime) enterScope(scop *scope) {
    method leaveScope (line 84) | func (rt *runtime) leaveScope() {
    method enterGlobalScope (line 89) | func (rt *runtime) enterGlobalScope() {
    method enterFunctionScope (line 93) | func (rt *runtime) enterFunctionScope(outer stasher, this Value) *fnSt...
    method putValue (line 109) | func (rt *runtime) putValue(reference referencer, value Value) {
    method tryCatchEvaluate (line 118) | func (rt *runtime) tryCatchEvaluate(inner func() Value) (tryValue Valu...
    method toObject (line 146) | func (rt *runtime) toObject(value Value) *object {
    method objectCoerce (line 163) | func (rt *runtime) objectCoerce(value Value) (*object, error) {
    method safeToValue (line 203) | func (rt *runtime) safeToValue(value interface{}) (Value, error) {
    method convertNumeric (line 213) | func (rt *runtime) convertNumeric(v Value, t reflect.Type) reflect.Val...
    method convertCallParameter (line 341) | func (rt *runtime) convertCallParameter(v Value, t reflect.Type) (refl...
    method toValue (line 634) | func (rt *runtime) toValue(value interface{}) Value {
    method newGoSlice (line 786) | func (rt *runtime) newGoSlice(value reflect.Value) *object {
    method newGoArray (line 792) | func (rt *runtime) newGoArray(value reflect.Value) *object {
    method parse (line 798) | func (rt *runtime) parse(filename string, src, sm interface{}) (*ast.P...
    method cmplParse (line 802) | func (rt *runtime) cmplParse(filename string, src, sm interface{}) (*n...
    method parseSource (line 811) | func (rt *runtime) parseSource(src, sm interface{}) (*nodeProgram, *as...
    method cmplRunOrEval (line 824) | func (rt *runtime) cmplRunOrEval(src, sm interface{}, eval bool) (Valu...
    method cmplRun (line 845) | func (rt *runtime) cmplRun(src, sm interface{}) (Value, error) {
    method cmplEval (line 849) | func (rt *runtime) cmplEval(src, sm interface{}) (Value, error) {
    method parseThrow (line 853) | func (rt *runtime) parseThrow(err error) {
    method cmplParseOrThrow (line 869) | func (rt *runtime) cmplParseOrThrow(src, sm interface{}) *nodeProgram {
  function checkObjectCoercible (line 182) | func checkObjectCoercible(rt *runtime, value Value) {
  function testObjectCoercible (line 190) | func testObjectCoercible(value Value) (isObject, mustCoerce bool) { //no...
  function fieldIndexByName (line 291) | func fieldIndexByName(t reflect.Type, name string) []int {

FILE: runtime_test.go
  function TestOperator (line 12) | func TestOperator(t *testing.T) {
  function TestFunction_ (line 75) | func TestFunction_(t *testing.T) {
  function TestDoWhile (line 224) | func TestDoWhile(t *testing.T) {
  function TestContinueBreak (line 245) | func TestContinueBreak(t *testing.T) {
  function TestTryCatchError (line 298) | func TestTryCatchError(t *testing.T) {
  function TestPositiveNegativeZero (line 315) | func TestPositiveNegativeZero(t *testing.T) {
  function TestComparison (line 328) | func TestComparison(t *testing.T) {
  function TestComparisonRelational (line 369) | func TestComparisonRelational(t *testing.T) {
  function TestArguments (line 387) | func TestArguments(t *testing.T) {
  function TestObjectLiteral (line 434) | func TestObjectLiteral(t *testing.T) {
  function TestUnaryPrefix (line 475) | func TestUnaryPrefix(t *testing.T) {
  function TestUnaryPostfix (line 503) | func TestUnaryPostfix(t *testing.T) {
  function TestBinaryLogicalOperation (line 533) | func TestBinaryLogicalOperation(t *testing.T) {
  function TestBinaryBitwiseOperation (line 555) | func TestBinaryBitwiseOperation(t *testing.T) {
  function TestBinaryShiftOperation (line 570) | func TestBinaryShiftOperation(t *testing.T) {
  function TestParenthesizing (line 599) | func TestParenthesizing(t *testing.T) {
  function Test_instanceof (line 616) | func Test_instanceof(t *testing.T) {
  function TestIn (line 638) | func TestIn(t *testing.T) {
  function Test_new (line 650) | func Test_new(t *testing.T) {
  function TestNewFunction (line 662) | func TestNewFunction(t *testing.T) {
  function TestNewPrototype (line 695) | func TestNewPrototype(t *testing.T) {
  function TestBlock (line 708) | func TestBlock(t *testing.T) {
  function Test_toString (line 729) | func Test_toString(t *testing.T) {
  function TestEvaluationOrder (line 739) | func TestEvaluationOrder(t *testing.T) {
  function TestClone (line 750) | func TestClone(t *testing.T) {
  function Test_debugger (line 773) | func Test_debugger(t *testing.T) {
  function Test_random (line 810) | func Test_random(t *testing.T) {
  function Test_stringArray (line 839) | func Test_stringArray(t *testing.T) {
  type goByteArrayWithMethodsTest (line 866) | type goByteArrayWithMethodsTest
    method S (line 868) | func (g goByteArrayWithMethodsTest) S() string    { return string(g[:]) }
    method F (line 869) | func (g goByteArrayWithMethodsTest) F(i int) byte { return g[i] }
  function Test_goByteArrayWithMethods_typeof_S (line 871) | func Test_goByteArrayWithMethods_typeof_S(t *testing.T) {
  function Test_goByteArrayWithMethods_S (line 881) | func Test_goByteArrayWithMethods_S(t *testing.T) {
  function Test_goByteArrayWithMethods_F0 (line 891) | func Test_goByteArrayWithMethods_F0(t *testing.T) {
  function Test_goByteArrayWithMethods_F1 (line 901) | func Test_goByteArrayWithMethods_F1(t *testing.T) {

FILE: scope.go
  type scope (line 4) | type scope struct
  function newScope (line 14) | func newScope(lexical stasher, variable stasher, this *object) *scope {

FILE: script.go
  type Script (line 16) | type Script struct
    method String (line 51) | func (s *Script) String() string {
    method marshalBinary (line 59) | func (s *Script) marshalBinary() ([]byte, error) {
    method unmarshalBinary (line 86) | func (s *Script) unmarshalBinary(data []byte) (err error) { //nolint:n...
  method Compile (line 28) | func (o *Otto) Compile(filename string, src interface{}) (*Script, error) {
  method CompileWithSourceMap (line 34) | func (o *Otto) CompileWithSourceMap(filename string, src, sm interface{}...

FILE: script_test.go
  function TestScript (line 9) | func TestScript(t *testing.T) {
  function TestFunctionCall_CallerLocation (line 83) | func TestFunctionCall_CallerLocation(t *testing.T) {

FILE: sourcemap_test.go
  constant testSourcemapCodeOriginal (line 10) | testSourcemapCodeOriginal  = "function functionA(argA, argB) {\n  functi...
  constant testSourcemapCodeMangled (line 11) | testSourcemapCodeMangled   = "function functionA(argA,argB){functionB(ar...
  constant testSourcemapContent (line 12) | testSourcemapContent       = `{"version":3,"sources":["hello.js"],"names...
  constant testSourcemapInline (line 13) | testSourcemapInline        = "function functionA(argA,argB){functionB(ar...
  constant testSourcemapOriginalStack (line 14) | testSourcemapOriginalStack = "ReferenceError: 'functionExternal' is not ...
  constant testSourcemapMangledStack (line 15) | testSourcemapMangledStack  = "ReferenceError: 'functionExternal' is not ...
  constant testSourcemapMappedStack (line 16) | testSourcemapMappedStack   = "ReferenceError: 'functionExternal' is not ...
  function TestSourceMapOriginalWithNoSourcemap (line 19) | func TestSourceMapOriginalWithNoSourcemap(t *testing.T) {
  function TestSourceMapMangledWithNoSourcemap (line 37) | func TestSourceMapMangledWithNoSourcemap(t *testing.T) {
  function TestSourceMapMangledWithSourcemap (line 55) | func TestSourceMapMangledWithSourcemap(t *testing.T) {
  function TestSourceMapMangledWithInlineSourcemap (line 73) | func TestSourceMapMangledWithInlineSourcemap(t *testing.T) {
  function TestSourceMapContextPosition (line 91) | func TestSourceMapContextPosition(t *testing.T) {
  function TestSourceMapContextStacktrace (line 117) | func TestSourceMapContextStacktrace(t *testing.T) {

FILE: stash.go
  type stasher (line 8) | type stasher interface
  type objectStash (line 24) | type objectStash struct
    method runtime (line 30) | func (s *objectStash) runtime() *runtime {
    method clone (line 46) | func (s *objectStash) clone(c *cloner) stasher {
    method hasBinding (line 59) | func (s *objectStash) hasBinding(name string) bool {
    method createBinding (line 63) | func (s *objectStash) createBinding(name string, deletable bool, value...
    method setBinding (line 75) | func (s *objectStash) setBinding(name string, value Value, strict bool) {
    method setValue (line 79) | func (s *objectStash) setValue(name string, value Value, throw bool) {
    method getBinding (line 87) | func (s *objectStash) getBinding(name string, throw bool) Value {
    method deleteBinding (line 97) | func (s *objectStash) deleteBinding(name string) bool {
    method outer (line 101) | func (s *objectStash) outer() stasher {
    method newReference (line 105) | func (s *objectStash) newReference(name string, strict bool, atv at) r...
  method newObjectStash (line 34) | func (rt *runtime) newObjectStash(obj *object, outer stasher) *objectSta...
  type dclStash (line 109) | type dclStash struct
    method clone (line 130) | func (s *dclStash) clone(c *cloner) stasher {
    method hasBinding (line 147) | func (s *dclStash) hasBinding(name string) bool {
    method runtime (line 152) | func (s *dclStash) runtime() *runtime {
    method createBinding (line 156) | func (s *dclStash) createBinding(name string, deletable bool, value Va...
    method setBinding (line 168) | func (s *dclStash) setBinding(name string, value Value, strict bool) {
    method setValue (line 181) | func (s *dclStash) setValue(name string, value Value, throw bool) {
    method getBinding (line 190) | func (s *dclStash) getBinding(name string, throw bool) Value {
    method deleteBinding (line 204) | func (s *dclStash) deleteBinding(name string) bool {
    method outer (line 216) | func (s *dclStash) outer() stasher {
    method newReference (line 220) | func (s *dclStash) newReference(name string, strict bool, _ at) refere...
  type dclProperty (line 115) | type dclProperty struct
  method newDeclarationStash (line 122) | func (rt *runtime) newDeclarationStash(outer stasher) *dclStash {
  type fnStash (line 231) | type fnStash struct
    method clone (line 247) | func (s *fnStash) clone(c *cloner) stasher {
  method newFunctionStash (line 237) | func (rt *runtime) newFunctionStash(outer stasher) *fnStash {
  function getStashProperties (line 266) | func getStashProperties(stash stasher) []string {

FILE: string_test.go
  function TestString (line 9) | func TestString(t *testing.T) {
  function TestString_charAt (line 34) | func TestString_charAt(t *testing.T) {
  function TestString_charCodeAt (line 47) | func TestString_charCodeAt(t *testing.T) {
  function TestString_fromCharCode (line 60) | func TestString_fromCharCode(t *testing.T) {
  function TestString_concat (line 78) | func TestString_concat(t *testing.T) {
  function TestString_indexOf (line 88) | func TestString_indexOf(t *testing.T) {
  function TestString_lastIndexOf (line 121) | func TestString_lastIndexOf(t *testing.T) {
  function TestString_match (line 152) | func TestString_match(t *testing.T) {
  function BenchmarkString_match (line 167) | func BenchmarkString_match(b *testing.B) {
  function TestString_replace (line 178) | func TestString_replace(t *testing.T) {
  function BenchmarkString_replace (line 211) | func BenchmarkString_replace(b *testing.B) {
  function TestString_search (line 222) | func TestString_search(t *testing.T) {
  function BenchmarkString_search (line 233) | func BenchmarkString_search(b *testing.B) {
  function TestString_split (line 244) | func TestString_split(t *testing.T) {
  function BenchmarkString_splitWithString (line 278) | func BenchmarkString_splitWithString(b *testing.B) {
  function BenchmarkString_splitWithRegex (line 290) | func BenchmarkString_splitWithRegex(b *testing.B) {
  function TestString_slice (line 302) | func TestString_slice(t *testing.T) {
  function TestString_length (line 315) | func TestString_length(t *testing.T) {
  function TestString_slice_unicode (line 325) | func TestString_slice_unicode(t *testing.T) {
  function TestString_substring_unicode (line 338) | func TestString_substring_unicode(t *testing.T) {
  function TestString_substring (line 353) | func TestString_substring(t *testing.T) {
  function TestString_toCase (line 369) | func TestString_toCase(t *testing.T) {
  function Test_floatToString (line 384) | func Test_floatToString(t *testing.T) {
  function TestString_indexing (line 409) | func TestString_indexing(t *testing.T) {
  function TestString_trim (line 422) | func TestString_trim(t *testing.T) {
  function TestString_trimLeft (line 437) | func TestString_trimLeft(t *testing.T) {
  function TestString_trimRight (line 451) | func TestString_trimRight(t *testing.T) {
  function TestString_localeCompare (line 465) | func TestString_localeCompare(t *testing.T) {
  function TestString_startsWith (line 475) | func TestString_startsWith(t *testing.T) {
  function TestString_trimStart (line 484) | func TestString_trimStart(t *testing.T) {
  function TestString_trimEnd (line 498) | func TestString_trimEnd(t *testing.T) {

FILE: terst/terst.go
  function Is (line 82) | func Is(arguments ...interface{}) bool {
  type ErrFail (line 97) | type ErrFail
  type ErrInvalid (line 100) | type ErrInvalid
  function registerScope (line 112) | func registerScope(pc uintptr, scope *_scope) {
  function getScope (line 118) | func getScope() *_scope {
  function floatCompare (line 123) | func floatCompare(a float64, b float64) int {
  function bigIntCompare (line 133) | func bigIntCompare(a *big.Int, b *big.Int) int {
  function bigInt (line 137) | func bigInt(value int64) *big.Int {
  function bigUint (line 141) | func bigUint(value uint64) *big.Int {
  function toString (line 145) | func toString(value interface{}) (string, error) {
  function matchString (line 157) | func matchString(got string, expect *regexp.Regexp) (int, error) {
  function match (line 164) | func match(got []byte, expect *regexp.Regexp) (int, error) {
  function compareMatch (line 171) | func compareMatch(got, expect interface{}) (int, error) {
  function floatPromote (line 203) | func floatPromote(value reflect.Value) (float64, error) {
  function bigIntPromote (line 217) | func bigIntPromote(value reflect.Value) (*big.Int, error) {
  function compareOther (line 228) | func compareOther(got, expect interface{}) (int, error) {
  function compareNumber (line 266) | func compareNumber(got, expect interface{}) (int, error) {
  function IsErr (line 303) | func IsErr(arguments ...interface{}) error {
  function typeKindString (line 394) | func typeKindString(value interface{}) string {
  function Terst (line 429) | func Terst(t *testing.T, arguments ...func()) {
  function decorate (line 488) | func decorate(call entry, s string) string {
  function findScope (line 521) | func findScope() (*_scope, entry) {
  type Call (line 545) | type Call struct
    method TestFunc (line 566) | func (cl *Call) TestFunc() *goruntime.Func {
    method T (line 571) | func (cl *Call) T() *testing.T {
    method Log (line 576) | func (cl *Call) Log(arguments ...interface{}) {
    method Logf (line 581) | func (cl *Call) Logf(format string, arguments ...interface{}) {
    method Error (line 586) | func (cl *Call) Error(arguments ...interface{}) {
    method Errorf (line 592) | func (cl *Call) Errorf(format string, arguments ...interface{}) {
    method Skip (line 598) | func (cl *Call) Skip(arguments ...interface{}) {
    method Skipf (line 604) | func (cl *Call) Skipf(format string, arguments ...interface{}) {
  function Caller (line 553) | func Caller() *Call {
  type _scope (line 609) | type _scope struct
    method reset (line 407) | func (s *_scope) reset() {
    method report (line 471) | func (s *_scope) report() {
    method log (line 480) | func (s *_scope) log(call entry, str string) {
  type entry (line 619) | type entry struct
  function findFunc (line 626) | func findFunc(match string) (entry, *goruntime.Func) {
  function findTestFunc (line 649) | func findTestFunc() (entry, *goruntime.Func) {
  function findTerstFunc (line 653) | func findTerstFunc() (entry, *goruntime.Func) {

FILE: testing_test.go
  function tt (line 12) | func tt(t *testing.T, arguments ...func()) {
  function is (line 24) | func is(arguments ...interface{}) bool {
  function test (line 62) | func test(arguments ...interface{}) (func(string, ...interface{}) Value,...
  type _tester (line 70) | type _tester struct
    method Get (line 80) | func (te *_tester) Get(name string) (Value, error) {
    method Set (line 84) | func (te *_tester) Set(name string, value interface{}) Value {
    method Run (line 93) | func (te *_tester) Run(src interface{}) (Value, error) {
    method test (line 97) | func (te *_tester) test(name string, expect ...interface{}) Value {
  function newTester (line 74) | func newTester() *_tester {

FILE: token/token.go
  type Token (line 9) | type Token
    method String (line 16) | func (tkn Token) String() string {
  type keyword (line 27) | type keyword struct
  function IsKeyword (line 59) | func IsKeyword(literal string) (Token, bool) {

FILE: token/token_const.go
  constant _ (line 6) | _ Token = iota
  constant ILLEGAL (line 9) | ILLEGAL
  constant EOF (line 10) | EOF
  constant COMMENT (line 11) | COMMENT
  constant KEYWORD (line 12) | KEYWORD
  constant STRING (line 14) | STRING
  constant BOOLEAN (line 15) | BOOLEAN
  constant NULL (line 16) | NULL
  constant NUMBER (line 17) | NUMBER
  constant IDENTIFIER (line 18) | IDENTIFIER
  constant PLUS (line 20) | PLUS
  constant MINUS (line 21) | MINUS
  constant MULTIPLY (line 22) | MULTIPLY
  constant SLASH (line 23) | SLASH
  constant REMAINDER (line 24) | REMAINDER
  constant AND (line 26) | AND
  constant OR (line 27) | OR
  constant EXCLUSIVE_OR (line 28) | EXCLUSIVE_OR
  constant SHIFT_LEFT (line 29) | SHIFT_LEFT
  constant SHIFT_RIGHT (line 30) | SHIFT_RIGHT
  constant UNSIGNED_SHIFT_RIGHT (line 31) | UNSIGNED_SHIFT_RIGHT
  constant AND_NOT (line 32) | AND_NOT
  constant ADD_ASSIGN (line 34) | ADD_ASSIGN
  constant SUBTRACT_ASSIGN (line 35) | SUBTRACT_ASSIGN
  constant MULTIPLY_ASSIGN (line 36) | MULTIPLY_ASSIGN
  constant QUOTIENT_ASSIGN (line 37) | QUOTIENT_ASSIGN
  constant REMAINDER_ASSIGN (line 38) | REMAINDER_ASSIGN
  constant AND_ASSIGN (line 40) | AND_ASSIGN
  constant OR_ASSIGN (line 41) | OR_ASSIGN
  constant EXCLUSIVE_OR_ASSIGN (line 42) | EXCLUSIVE_OR_ASSIGN
  constant SHIFT_LEFT_ASSIGN (line 43) | SHIFT_LEFT_ASSIGN
  constant SHIFT_RIGHT_ASSIGN (line 44) | SHIFT_RIGHT_ASSIGN
  constant UNSIGNED_SHIFT_RIGHT_ASSIGN (line 45) | UNSIGNED_SHIFT_RIGHT_ASSIGN
  constant AND_NOT_ASSIGN (line 46) | AND_NOT_ASSIGN
  constant LOGICAL_AND (line 48) | LOGICAL_AND
  constant LOGICAL_OR (line 49) | LOGICAL_OR
  constant INCREMENT (line 50) | INCREMENT
  constant DECREMENT (line 51) | DECREMENT
  constant EQUAL (line 53) | EQUAL
  constant STRICT_EQUAL (line 54) | STRICT_EQUAL
  constant LESS (line 55) | LESS
  constant GREATER (line 56) | GREATER
  constant ASSIGN (line 57) | ASSIGN
  constant NOT (line 58) | NOT
  constant BITWISE_NOT (line 60) | BITWISE_NOT
  constant NOT_EQUAL (line 62) | NOT_EQUAL
  constant STRICT_NOT_EQUAL (line 63) | STRICT_NOT_EQUAL
  constant LESS_OR_EQUAL (line 64) | LESS_OR_EQUAL
  constant GREATER_OR_EQUAL (line 65) | GREATER_OR_EQUAL
  constant LEFT_PARENTHESIS (line 67) | LEFT_PARENTHESIS
  constant LEFT_BRACKET (line 68) | LEFT_BRACKET
  constant LEFT_BRACE (line 69) | LEFT_BRACE
  constant COMMA (line 70) | COMMA
  constant PERIOD (line 71) | PERIOD
  constant RIGHT_PARENTHESIS (line 73) | RIGHT_PARENTHESIS
  constant RIGHT_BRACKET (line 74) | RIGHT_BRACKET
  constant RIGHT_BRACE (line 75) | RIGHT_BRACE
  constant SEMICOLON (line 76) | SEMICOLON
  constant COLON (line 77) | COLON
  constant QUESTION_MARK (line 78) | QUESTION_MARK
  constant _ (line 80) | _
  constant IF (line 81) | IF
  constant IN (line 82) | IN
  constant DO (line 83) | DO
  constant VAR (line 85) | VAR
  constant FOR (line 86) | FOR
  constant NEW (line 87) | NEW
  constant TRY (line 88) | TRY
  constant THIS (line 90) | THIS
  constant ELSE (line 91) | ELSE
  constant CASE (line 92) | CASE
  constant VOID (line 93) | VOID
  constant WITH (line 94) | WITH
  constant WHILE (line 96) | WHILE
  constant BREAK (line 97) | BREAK
  constant CATCH (line 98) | CATCH
  constant THROW (line 99) | THROW
  constant RETURN (line 101) | RETURN
  constant TYPEOF (line 102) | TYPEOF
  constant DELETE (line 103) | DELETE
  constant SWITCH (line 104) | SWITCH
  constant DEFAULT (line 106) | DEFAULT
  constant FINALLY (line 107) | FINALLY
  constant FUNCTION (line 109) | FUNCTION
  constant CONTINUE (line 110) | CONTINUE
  constant DEBUGGER (line 111) | DEBUGGER
  constant INSTANCEOF (line 113) | INSTANCEOF

FILE: tools/gen-jscore/helpers.go
  function ucfirst (line 9) | func ucfirst(val string) string {
  function dict (line 19) | func dict(values ...interface{}) (map[string]interface{}, error) {

FILE: tools/gen-jscore/main.go
  type jsType (line 24) | type jsType struct
    method BlankConstructor (line 36) | func (t jsType) BlankConstructor() bool {
  type prototype (line 41) | type prototype struct
    method Property (line 49) | func (p prototype) Property(name string) (*property, error) {
  type property (line 60) | type property struct
  type value (line 70) | type value struct
  type config (line 76) | type config struct
    method Type (line 83) | func (c config) Type(name string) (*jsType, error) {
  function generate (line 94) | func generate(filename string) (err error) {
  function main (line 135) | func main() {

FILE: tools/gen-tokens/main.go
  type token (line 24) | type token struct
  type config (line 33) | type config struct
  function generate (line 38) | func generate(filename string) (err error) {
  function main (line 77) | func main() {

FILE: tools/tester/main.go
  constant dataDir (line 32) | dataDir = "testdata"
  constant downloadWorkers (line 35) | downloadWorkers = 40
  constant librariesURL (line 38) | librariesURL = "http://api.cdnjs.com/libraries"
  constant requestTimeout (line 41) | requestTimeout = time.Second * 20
  type libraries (line 71) | type libraries struct
  type library (line 76) | type library struct
    method fetch (line 82) | func (l library) fetch() error {
  function test (line 120) | func test(filename string) (took time.Duration, parseError, err error) {...
  function fetchAll (line 170) | func fetchAll(src string) error {
  type result (line 234) | type result struct
  function report (line 243) | func report(files []string) error {
  function main (line 315) | func main() {

FILE: type_arguments.go
  method newArgumentsObject (line 7) | func (rt *runtime) newArgumentsObject(indexOfParameterName []string, sta...
  type argumentsObject (line 28) | type argumentsObject struct
    method clone (line 33) | func (o argumentsObject) clone(c *cloner) argumentsObject {
    method get (line 42) | func (o argumentsObject) get(name string) (Value, bool) {
    method put (line 53) | func (o argumentsObject) put(name string, value Value) {
    method delete (line 59) | func (o argumentsObject) delete(name string) {
  function argumentsGet (line 64) | func argumentsGet(obj *object, name string) Value {
  function argumentsGetOwnProperty (line 71) | func argumentsGetOwnProperty(obj *object, name string) *property {
  function argumentsDefineOwnProperty (line 79) | func argumentsDefineOwnProperty(obj *object, name string, descriptor pro...
  function argumentsDelete (line 92) | func argumentsDelete(obj *object, name string, throw bool) bool {

FILE: type_array.go
  method newArrayObject (line 7) | func (rt *runtime) newArrayObject(length uint32) *object {
  function isArray (line 15) | func isArray(obj *object) bool {
  function objectLength (line 28) | func objectLength(obj *object) uint32 {
  function arrayUint32 (line 43) | func arrayUint32(rt *runtime, value Value) uint32 {
  function arrayDefineOwnProperty (line 52) | func arrayDefineOwnProperty(obj *object, name string, descriptor propert...

FILE: type_boolean.go
  method newBooleanObject (line 3) | func (rt *runtime) newBooleanObject(value Value) *object {

FILE: type_date.go
  type dateObject (line 10) | type dateObject struct
    method Time (line 61) | func (d *dateObject) Time() Time.Time {
    method Epoch (line 65) | func (d *dateObject) Epoch() int64 {
    method Value (line 69) | func (d *dateObject) Value() Value {
    method SetNaN (line 74) | func (d *dateObject) SetNaN() {
    method SetTime (line 81) | func (d *dateObject) SetTime(time Time.Time) {
    method Set (line 85) | func (d *dateObject) Set(epoch float64) {
  type ecmaTime (line 24) | type ecmaTime struct
    method goTime (line 48) | func (t *ecmaTime) goTime() Time.Time {
  function newEcmaTime (line 35) | func newEcmaTime(goTime Time.Time) ecmaTime {
  function epochToInteger (line 103) | func epochToInteger(value float64) int64 {
  function epochToTime (line 110) | func epochToTime(value float64) (Time.Time, error) {
  function timeToEpoch (line 122) | func timeToEpoch(time Time.Time) float64 {
  method newDateObject (line 126) | func (rt *runtime) newDateObject(epoch float64) *object {
  method dateValue (line 137) | func (o *object) dateValue() dateObject {
  function dateObjectOf (line 142) | func dateObjectOf(rt *runtime, date *object) dateObject {
  function dateToGoMonth (line 153) | func dateToGoMonth(month int) Time.Month {
  function dateFromGoMonth (line 157) | func dateFromGoMonth(month Time.Month) int {
  function dateFromGoDay (line 161) | func dateFromGoDay(day Time.Weekday) int {
  function newDateTime (line 166) | func newDateTime(argumentList []Value, location *Time.Location) float64 {
  function dateParse (line 264) | func dateParse(date string) float64 {

FILE: type_error.go
  method newErrorObject (line 3) | func (rt *runtime) newErrorObject(name string, message Value, stackFrame...
  method newErrorObjectError (line 26) | func (rt *runtime) newErrorObjectError(err ottoError) *object {

FILE: type_function.go
  type constructFunction (line 4) | type constructFunction
  function defaultConstruct (line 7) | func defaultConstruct(fn *object, argumentList []Value) Value {
  type nativeFunction (line 26) | type nativeFunction
  type nativeFunctionObject (line 29) | type nativeFunctionObject struct
  method newNativeFunctionProperty (line 37) | func (rt *runtime) newNativeFunctionProperty(name, file string, line int...
  method newNativeFunctionObject (line 51) | func (rt *runtime) newNativeFunctionObject(name, file string, line int, ...
  type bindFunctionObject (line 76) | type bindFunctionObject struct
    method construct (line 102) | func (fn bindFunctionObject) construct(argumentList []Value) Value {
  method newBoundFunctionObject (line 82) | func (rt *runtime) newBoundFunctionObject(target *object, this Value, ar...
  type nodeFunctionObject (line 116) | type nodeFunctionObject struct
  method newNodeFunctionObject (line 121) | func (rt *runtime) newNodeFunctionObject(node *nodeFunctionLiteral, stas...
  method isCall (line 152) | func (o *object) isCall() bool {
  method call (line 165) | func (o *object) call(this Value, argumentList []Value, eval bool, frm f...
  method construct (line 225) | func (o *object) construct(argumentList []Value) Value {
  method hasInstance (line 247) | func (o *object) hasInstance(of Value) bool {
  type FunctionCall (line 272) | type FunctionCall struct
    method Argument (line 284) | func (f FunctionCall) Argument(index int) Value {
    method getArgument (line 288) | func (f FunctionCall) getArgument(index int) (Value, bool) {
    method slice (line 292) | func (f FunctionCall) slice(index int) []Value {
    method thisObject (line 299) | func (f *FunctionCall) thisObject() *object {
    method thisClassObject (line 307) | func (f *FunctionCall) thisClassObject(class string) *object {
    method toObject (line 314) | func (f FunctionCall) toObject(value Value) *object {
    method CallerLocation (line 319) | func (f FunctionCall) CallerLocation() string {

FILE: type_go_array.go
  method newGoArrayObject (line 8) | func (rt *runtime) newGoArrayObject(value reflect.Value) *object {
  type goArrayObject (line 16) | type goArrayObject struct
    method getValue (line 36) | func (o goArrayObject) getValue(name string) (reflect.Value, bool) { /...
    method getValueIndex (line 51) | func (o goArrayObject) getValueIndex(index int64) (reflect.Value, bool) {
    method setValue (line 60) | func (o goArrayObject) setValue(index int64, value Value) bool {
  function newGoArrayObject (line 22) | func newGoArrayObject(value reflect.Value) *goArrayObject {
  function goArrayGetOwnProperty (line 73) | func goArrayGetOwnProperty(obj *object, name string) *property {
  function goArrayEnumerate (line 106) | func goArrayEnumerate(obj *object, all bool, each func(string) bool) {
  function goArrayDefineOwnProperty (line 120) | func goArrayDefineOwnProperty(obj *object, name string, descriptor prope...
  function goArrayDelete (line 135) | func goArrayDelete(obj *object, name string, throw bool) bool {

FILE: type_go_map.go
  method newGoMapObject (line 7) | func (rt *runtime) newGoMapObject(value reflect.Value) *object {
  type goMapObject (line 15) | type goMapObject struct
    method toKey (line 32) | func (o goMapObject) toKey(name string) reflect.Value {
    method toValue (line 40) | func (o goMapObject) toValue(value Value) reflect.Value {
  function newGoMapObject (line 21) | func newGoMapObject(value reflect.Value) *goMapObject {
  function goMapGetOwnProperty (line 48) | func goMapGetOwnProperty(obj *object, name string) *property {
  function goMapEnumerate (line 80) | func goMapEnumerate(obj *object, all bool, each func(string) bool) {
  function goMapDefineOwnProperty (line 90) | func goMapDefineOwnProperty(obj *object, name string, descriptor propert...
  function goMapDelete (line 103) | func goMapDelete(obj *object, name string, throw bool) bool {

FILE: type_go_map_test.go
  type GoMapTest (line 9) | type GoMapTest
    method Join (line 11) | func (s GoMapTest) Join() string {
  function TestGoMap (line 33) | func TestGoMap(t *testing.T) {

FILE: type_go_slice.go
  method newGoSliceObject (line 8) | func (rt *runtime) newGoSliceObject(value reflect.Value) *object {
  type goSliceObject (line 16) | type goSliceObject struct
    method getValue (line 26) | func (o goSliceObject) getValue(index int64) (reflect.Value, bool) {
    method setLength (line 33) | func (o *goSliceObject) setLength(value Value) {
    method setValue (line 54) | func (o *goSliceObject) setValue(index int64, value Value) bool {
  function newGoSliceObject (line 20) | func newGoSliceObject(value reflect.Value) *goSliceObject {
  function goSliceGetOwnProperty (line 74) | func goSliceGetOwnProperty(obj *object, name string) *property {
  function goSliceEnumerate (line 107) | func goSliceEnumerate(obj *object, all bool, each func(string) bool) {
  function goSliceDefineOwnProperty (line 121) | func goSliceDefineOwnProperty(obj *object, name string, descriptor prope...
  function goSliceDelete (line 134) | func goSliceDelete(obj *object, name string, throw bool) bool {

FILE: type_go_slice_test.go
  type GoSliceTest (line 5) | type GoSliceTest
    method Sum (line 7) | func (s GoSliceTest) Sum() int {
  function TestGoSlice (line 15) | func TestGoSlice(t *testing.T) {

FILE: type_go_struct.go
  method newGoStructObject (line 16) | func (rt *runtime) newGoStructObject(value reflect.Value) *object {
  type goStructObject (line 24) | type goStructObject struct
    method getValue (line 37) | func (o goStructObject) getValue(name string) reflect.Value {
    method fieldIndex (line 56) | func (o goStructObject) fieldIndex(name string) []int { //nolint:unused
    method method (line 60) | func (o goStructObject) method(name string) (reflect.Method, bool) { /...
    method setValue (line 64) | func (o goStructObject) setValue(rt *runtime, name string, value Value...
  function newGoStructObject (line 28) | func newGoStructObject(value reflect.Value) *goStructObject {
  function goStructGetOwnProperty (line 79) | func goStructGetOwnProperty(obj *object, name string) *property {
  function validGoStructName (line 89) | func validGoStructName(name string) bool {
  function goStructEnumerate (line 96) | func goStructEnumerate(obj *object, all bool, each func(string) bool) {
  function goStructCanPut (line 122) | func goStructCanPut(obj *object, name string) bool {
  function goStructPut (line 132) | func goStructPut(obj *object, name string, value Value, throw bool) {
  function goStructMarshalJSON (line 141) | func goStructMarshalJSON(obj *object) json.Marshaler {

FILE: type_go_struct_test.go
  function TestGoStructEmbeddedFields (line 7) | func TestGoStructEmbeddedFields(t *testing.T) {
  function TestGoStructNilBoolPointerField (line 28) | func TestGoStructNilBoolPointerField(t *testing.T) {
  function TestGoStructError (line 47) | func TestGoStructError(t *testing.T) {

FILE: type_number.go
  method newNumberObject (line 3) | func (rt *runtime) newNumberObject(value Value) *object {

FILE: type_reference.go
  type referencer (line 3) | type referencer interface
  type propertyReference (line 12) | type propertyReference struct
    method invalid (line 30) | func (pr *propertyReference) invalid() bool {
    method getValue (line 34) | func (pr *propertyReference) getValue() Value {
    method putValue (line 41) | func (pr *propertyReference) putValue(value Value) string {
    method delete (line 49) | func (pr *propertyReference) delete() bool {
  function newPropertyReference (line 20) | func newPropertyReference(rt *runtime, base *object, name string, strict...
  type stashReference (line 57) | type stashReference struct
    method invalid (line 63) | func (sr *stashReference) invalid() bool {
    method getValue (line 67) | func (sr *stashReference) getValue() Value {
    method putValue (line 71) | func (sr *stashReference) putValue(value Value) string {
    method delete (line 76) | func (sr *stashReference) delete() bool {
  function getIdentifierReference (line 85) | func getIdentifierReference(rt *runtime, stash stasher, name string, str...

FILE: type_regexp.go
  type regExpObject (line 10) | type regExpObject struct
  method newRegExpObject (line 19) | func (rt *runtime) newRegExpObject(pattern string, flags string) *object {
  method regExpValue (line 81) | func (o *object) regExpValue() regExpObject {
  function execRegExp (line 86) | func execRegExp(this *object, target string) (bool, []int) {
  function execResultToArray (line 124) | func execResultToArray(rt *runtime, target string, result []int) *object {

FILE: type_string.go
  type stringObjecter (line 9) | type stringObjecter interface
  type stringASCII (line 15) | type stringASCII
    method Length (line 17) | func (str stringASCII) Length() int {
    method At (line 21) | func (str stringASCII) At(at int) rune {
    method String (line 25) | func (str stringASCII) String() string {
  type stringWide (line 29) | type stringWide struct
    method Length (line 34) | func (str stringWide) Length() int {
    method At (line 41) | func (str stringWide) At(at int) rune {
    method String (line 48) | func (str stringWide) String() string {
  function newStringObject (line 52) | func newStringObject(str string) stringObjecter {
  function stringAt (line 67) | func stringAt(str stringObjecter, index int) rune {
  method newStringObject (line 74) | func (rt *runtime) newStringObject(value Value) *object {
  method stringValue (line 84) | func (o *object) stringValue() stringObjecter {
  function stringEnumerate (line 91) | func stringEnumerate(obj *object, all bool, each func(string) bool) {
  function stringGetOwnProperty (line 103) | func stringGetOwnProperty(obj *object, name string) *property {

FILE: underscore/download.go
  function download (line 21) | func download(url, output string) (err error) {
  function main (line 54) | func main() {

FILE: underscore/underscore-min.js
  function j (line 6) | function j(n,r){return r=null==r?n.length-1:+r,function(){for(var t=Math...
  function w (line 6) | function w(n){var r=typeof n;return"function"===r||"object"===r&&!!n}
  function _ (line 6) | function _(n){return void 0===n}
  function A (line 6) | function A(n){return!0===n||!1===n||"[object Boolean]"===a.call(n)}
  function x (line 6) | function x(n){var r="[object "+n+"]";return function(n){return a.call(n)...
  function W (line 6) | function W(n,r){return null!=n&&f.call(n,r)}
  function $ (line 6) | function $(n){return O(n)&&y(n)}
  function C (line 6) | function C(n){return function(){return n}}
  function K (line 6) | function K(n){return function(r){var t=n(r);return"number"==typeof t&&t>...
  function J (line 6) | function J(n){return function(r){return null==r?void 0:r[n]}}
  function Z (line 6) | function Z(n,r){r=function(n){for(var r={},t=n.length,e=0;e<t;++e)r[n[e]...
  function nn (line 6) | function nn(n){if(!w(n))return[];if(p)return p(n);var r=[];for(var t in ...
  function rn (line 6) | function rn(n,r){var t=nn(r),e=t.length;if(null==n)return!e;for(var u=Ob...
  function tn (line 6) | function tn(n){return n instanceof tn?n:this instanceof tn?void(this._wr...
  function en (line 6) | function en(n){return new Uint8Array(n.buffer||n,n.byteOffset||0,G(n))}
  function on (line 6) | function on(n,r,t,e){if(n===r)return 0!==n||1/n==1/r;if(null==n||null==r...
  function an (line 6) | function an(n){if(!w(n))return[];var r=[];for(var t in n)r.push(t);retur...
  function fn (line 6) | function fn(n){var r=Y(n);return function(t){if(null==t)return!1;var e=a...
  function jn (line 6) | function jn(n){for(var r=nn(n),t=r.length,e=Array(t),u=0;u<t;u++)e[u]=n[...
  function wn (line 6) | function wn(n){for(var r={},t=nn(n),e=0,u=t.length;e<u;e++)r[n[t[e]]]=t[...
  function _n (line 6) | function _n(n){var r=[];for(var t in n)D(n[t])&&r.push(t);return r.sort()}
  function An (line 6) | function An(n,r){return function(t){var e=arguments.length;if(r&&(t=Obje...
  function Mn (line 6) | function Mn(n){if(!w(n))return{};if(v)return v(n);var r=function(){};r.p...
  function En (line 6) | function En(n){return U(n)?n:[n]}
  function Bn (line 6) | function Bn(n){return tn.toPath(n)}
  function Nn (line 6) | function Nn(n,r){for(var t=r.length,e=0;e<t;e++){if(null==n)return;n=n[r...
  function In (line 6) | function In(n,r,t){var e=Nn(n,Bn(r));return _(e)?t:e}
  function Tn (line 6) | function Tn(n){return n}
  function kn (line 6) | function kn(n){return n=Sn({},n),function(r){return rn(r,n)}}
  function Dn (line 6) | function Dn(n){return n=Bn(n),function(r){return Nn(r,n)}}
  function Rn (line 6) | function Rn(n,r,t){if(void 0===r)return n;switch(null==t?3:t){case 1:ret...
  function Vn (line 6) | function Vn(n,r,t){return null==n?Tn:D(n)?Rn(n,r,t):w(n)&&!U(n)?kn(n):Dn...
  function Fn (line 6) | function Fn(n,r){return Vn(n,r,1/0)}
  function Pn (line 6) | function Pn(n,r,t){return tn.iteratee!==Fn?tn.iteratee(n,r):Vn(n,r,t)}
  function qn (line 6) | function qn(){}
  function Un (line 6) | function Un(n,r){return null==r&&(r=n,n=0),n+Math.floor(Math.random()*(r...
  function zn (line 6) | function zn(n){var r=function(r){return n[r]},t="(?:"+nn(n).join("|")+")...
  function Qn (line 6) | function Qn(n){return"\\"+Gn[n]}
  function Zn (line 6) | function Zn(n,r,t,e,u){if(!(e instanceof r))return n.apply(t,u);var i=Mn...
  function er (line 6) | function er(n,r,t,e){if(e=e||[],r||0===r){if(r<=0)return e.concat(n)}els...
  function ar (line 6) | function ar(n){return function(){return!n.apply(this,arguments)}}
  function fr (line 6) | function fr(n,r){var t;return function(){return--n>0&&(t=r.apply(this,ar...
  function lr (line 6) | function lr(n,r,t){r=Pn(r,t);for(var e,u=nn(n),i=0,o=u.length;i<o;i++)if...
  function sr (line 6) | function sr(n){return function(r,t,e){t=Pn(t,e);for(var u=Y(r),i=n>0?0:u...
  function hr (line 6) | function hr(n,r,t,e){for(var u=(t=Pn(t,e,1))(r),i=0,o=Y(n);i<o;){var a=M...
  function yr (line 6) | function yr(n,r,t){return function(e,u,i){var a=0,f=Y(e);if("number"==ty...
  function br (line 6) | function br(n,r,t){var e=(tr(n)?pr:lr)(n,r,t);if(void 0!==e&&-1!==e)retu...
  function mr (line 6) | function mr(n,r,t){var e,u;if(r=Rn(r,t),tr(n))for(e=0,u=n.length;e<u;e++...
  function jr (line 6) | function jr(n,r,t){r=Pn(r,t);for(var e=!tr(n)&&nn(n),u=(e||n).length,i=A...
  function wr (line 6) | function wr(n){var r=function(r,t,e,u){var i=!tr(r)&&nn(r),o=(i||r).leng...
  function xr (line 6) | function xr(n,r,t){var e=[];return r=Pn(r,t),mr(n,(function(n,t,u){r(n,t...
  function Sr (line 6) | function Sr(n,r,t){r=Pn(r,t);for(var e=!tr(n)&&nn(n),u=(e||n).length,i=0...
  function Or (line 6) | function Or(n,r,t){r=Pn(r,t);for(var e=!tr(n)&&nn(n),u=(e||n).length,i=0...
  function Mr (line 6) | function Mr(n,r,t,e){return tr(n)||(n=jn(n)),("number"!=typeof t||e)&&(t...
  function Br (line 6) | function Br(n,r){return jr(n,Dn(r))}
  function Nr (line 6) | function Nr(n,r,t){var e,u,i=-1/0,o=-1/0;if(null==r||"number"==typeof r&...
  function Tr (line 6) | function Tr(n){return n?U(n)?o.call(n):S(n)?n.match(Ir):tr(n)?jr(n,Tn):j...
  function kr (line 6) | function kr(n,r,t){if(null==r||t)return tr(n)||(n=jn(n)),n[Un(n.length-1...
  function Dr (line 6) | function Dr(n,r){return function(t,e,u){var i=r?[[],[]]:{};return e=Pn(e...
  function qr (line 6) | function qr(n,r,t){return r in t}
  function zr (line 6) | function zr(n,r,t){return o.call(n,0,Math.max(0,n.length-(null==r||t?1:r...
  function Lr (line 6) | function Lr(n,r,t){return null==n||n.length<1?null==r||t?void 0:[]:null=...
  function $r (line 6) | function $r(n,r,t){return o.call(n,null==r||t?1:r)}
  function Jr (line 6) | function Jr(n,r,t,e){A(r)||(e=t,t=r,r=!1),null!=t&&(t=Pn(t,e));for(var u...
  function Hr (line 6) | function Hr(n){for(var r=n&&Nr(n,Y).length||0,t=Array(r),e=0;e<r;e++)t[e...
  function Xr (line 6) | function Xr(n,r){return n._chain?tn(r).chain():r}
  function Yr (line 6) | function Yr(n){return mr(_n(n),(function(r){var t=tn[r]=n[r];tn.prototyp...

FILE: underscore/underscore.go
  function Enable (line 36) | func Enable() {
  function Disable (line 41) | func Disable() {
  function Source (line 46) | func Source() string {

FILE: underscore_arrays_test.go
  function Test_underscore_arrays_0 (line 8) | func Test_underscore_arrays_0(t *testing.T) {
  function Test_underscore_arrays_1 (line 33) | func Test_underscore_arrays_1(t *testing.T) {
  function Test_underscore_arrays_2 (line 55) | func Test_underscore_arrays_2(t *testing.T) {
  function Test_underscore_arrays_3 (line 73) | func Test_underscore_arrays_3(t *testing.T) {
  function Test_underscore_arrays_4 (line 95) | func Test_underscore_arrays_4(t *testing.T) {
  function Test_underscore_arrays_5 (line 110) | func Test_underscore_arrays_5(t *testing.T) {
  function Test_underscore_arrays_6 (line 127) | func Test_underscore_arrays_6(t *testing.T) {
  function Test_underscore_arrays_7 (line 147) | func Test_underscore_arrays_7(t *testing.T) {
  function Test_underscore_arrays_8 (line 177) | func Test_underscore_arrays_8(t *testing.T) {
  function Test_underscore_arrays_9 (line 194) | func Test_underscore_arrays_9(t *testing.T) {
  function Test_underscore_arrays_10 (line 211) | func Test_underscore_arrays_10(t *testing.T) {
  function Test_underscore_arrays_11 (line 228) | func Test_underscore_arrays_11(t *testing.T) {
  function Test_underscore_arrays_12 (line 243) | func Test_underscore_arrays_12(t *testing.T) {
  function Test_underscore_arrays_13 (line 267) | func Test_underscore_arrays_13(t *testing.T) {
  function Test_underscore_arrays_14 (line 301) | func Test_underscore_arrays_14(t *testing.T) {
  function Test_underscore_arrays_15 (line 327) | func Test_underscore_arrays_15(t *testing.T) {

FILE: underscore_chaining_test.go
  function Test_underscore_chaining_0 (line 8) | func Test_underscore_chaining_0(t *testing.T) {
  function Test_underscore_chaining_1 (line 35) | func Test_underscore_chaining_1(t *testing.T) {
  function Test_underscore_chaining_2 (line 56) | func Test_underscore_chaining_2(t *testing.T) {
  function Test_underscore_chaining_3 (line 77) | func Test_underscore_chaining_3(t *testing.T) {

FILE: underscore_collections_test.go
  function Test_underscore_collections_0 (line 8) | func Test_underscore_collections_0(t *testing.T) {
  function Test_underscore_collections_1 (line 46) | func Test_underscore_collections_1(t *testing.T) {
  function Test_underscore_collections_2 (line 86) | func Test_underscore_collections_2(t *testing.T) {
  function Test_underscore_collections_3 (line 125) | func Test_underscore_collections_3(t *testing.T) {
  function Test_underscore_collections_4 (line 194) | func Test_underscore_collections_4(t *testing.T) {
  function Test_underscore_collections_5 (line 209) | func Test_underscore_collections_5(t *testing.T) {
  function Test_underscore_collections_6 (line 223) | func Test_underscore_collections_6(t *testing.T) {
  function Test_underscore_collections_7 (line 240) | func Test_underscore_collections_7(t *testing.T) {
  function Test_underscore_collections_8 (line 262) | func Test_underscore_collections_8(t *testing.T) {
  function Test_underscore_collections_9 (line 283) | func Test_underscore_collections_9(t *testing.T) {
  function Test_underscore_collections_10 (line 308) | func Test_underscore_collections_10(t *testing.T) {
  function Test_underscore_collections_11 (line 324) | func Test_underscore_collections_11(t *testing.T) {
  function Test_underscore_collections_12 (line 340) | func Test_underscore_collections_12(t *testing.T) {
  function Test_underscore_collections_13 (line 356) | func Test_underscore_collections_13(t *testing.T) {
  function Test_underscore_collections_14 (line 379) | func Test_underscore_collections_14(t *testing.T) {
  function Test_underscore_collections_15 (line 393) | func Test_underscore_collections_15(t *testing.T) {
  function Test_underscore_collections_16 (line 412) | func Test_underscore_collections_16(t *testing.T) {
  function Test_underscore_collections_17 (line 429) | func Test_underscore_collections_17(t *testing.T) {
  function Test_underscore_collections_18 (line 454) | func Test_underscore_collections_18(t *testing.T) {
  function Test_underscore_collections_19 (line 483) | func Test_underscore_collections_19(t *testing.T) {
  function Test_underscore_collections_20 (line 528) | func Test_underscore_collections_20(t *testing.T) {
  function Test_underscore_collections_21 (line 566) | func Test_underscore_collections_21(t *testing.T) {
  function Test_underscore_collections_22 (line 604) | func Test_underscore_collections_22(t *testing.T) {
  function Test_underscore_collections_23 (line 631) | func Test_underscore_collections_23(t *testing.T) {
  function Test_underscore_collections_24 (line 647) | func Test_underscore_collections_24(t *testing.T) {
  function Test_underscore_collections_25 (line 677) | func Test_underscore_collections_25(t *testing.T) {

FILE: underscore_functions_test.go
  function Test_underscore_functions_0 (line 8) | func Test_underscore_functions_0(t *testing.T) {
  function Test_underscore_functions_1 (line 52) | func Test_underscore_functions_1(t *testing.T) {
  function Test_underscore_functions_2 (line 69) | func Test_underscore_functions_2(t *testing.T) {
  function Test_underscore_functions_3 (line 91) | func Test_underscore_functions_3(t *testing.T) {
  function Test_underscore_functions_4 (line 116) | func Test_underscore_functions_4(t *testing.T) {
  function Test_underscore_functions_5 (line 133) | func Test_underscore_functions_5(t *testing.T) {
  function Test_underscore_functions_6 (line 158) | func Test_underscore_functions_6(t *testing.T) {
  function Test_underscore_functions_7 (line 177) | func Test_underscore_functions_7(t *testing.T) {

FILE: underscore_objects_test.go
  function Test_underscore_objects_0 (line 8) | func Test_underscore_objects_0(t *testing.T) {
  function Test_underscore_objects_1 (line 29) | func Test_underscore_objects_1(t *testing.T) {
  function Test_underscore_objects_2 (line 43) | func Test_underscore_objects_2(t *testing.T) {
  function Test_underscore_objects_3 (line 57) | func Test_underscore_objects_3(t *testing.T) {
  function Test_underscore_objects_4 (line 75) | func Test_underscore_objects_4(t *testing.T) {
  function Test_underscore_objects_5 (line 93) | func Test_underscore_objects_5(t *testing.T) {
  function Test_underscore_objects_6 (line 122) | func Test_underscore_objects_6(t *testing.T) {
  function Test_underscore_objects_7 (line 145) | func Test_underscore_objects_7(t *testing.T) {
  function Test_underscore_objects_8 (line 168) | func Test_underscore_objects_8(t *testing.T) {
  function Test_underscore_objects_9 (line 199) | func Test_underscore_objects_9(t *testing.T) {
  function Test_underscore_objects_10 (line 224) | func Test_underscore_objects_10(t *testing.T) {
  function Test_underscore_objects_11 (line 468) | func Test_underscore_objects_11(t *testing.T) {
  function Test_underscore_objects_12 (line 493) | func Test_underscore_objects_12(t *testing.T) {
  function Test_underscore_objects_13 (line 513) | func Test_underscore_objects_13(t *testing.T) {
  function Test_underscore_objects_14 (line 535) | func Test_underscore_objects_14(t *testing.T) {
  function Test_underscore_objects_15 (line 561) | func Test_underscore_objects_15(t *testing.T) {
  function Test_underscore_objects_16 (line 578) | func Test_underscore_objects_16(t *testing.T) {
  function Test_underscore_objects_17 (line 600) | func Test_underscore_objects_17(t *testing.T) {
  function Test_underscore_objects_18 (line 622) | func Test_underscore_objects_18(t *testing.T) {
  function Test_underscore_objects_19 (line 647) | func Test_underscore_objects_19(t *testing.T) {
  function Test_underscore_objects_20 (line 665) | func Test_underscore_objects_20(t *testing.T) {
  function Test_underscore_objects_21 (line 683) | func Test_underscore_objects_21(t *testing.T) {
  function Test_underscore_objects_22 (line 700) | func Test_underscore_objects_22(t *testing.T) {
  function Test_underscore_objects_23 (line 725) | func Test_underscore_objects_23(t *testing.T) {
  function Test_underscore_objects_24 (line 745) | func Test_underscore_objects_24(t *testing.T) {
  function Test_underscore_objects_25 (line 763) | func Test_underscore_objects_25(t *testing.T) {
  function Test_underscore_objects_26 (line 784) | func Test_underscore_objects_26(t *testing.T) {
  function Test_underscore_objects_27 (line 808) | func Test_underscore_objects_27(t *testing.T) {

FILE: underscore_test.go
  function init (line 11) | func init() {
  function underscoreTest (line 23) | func underscoreTest() func(string, ...interface{}) Value {
  method underscore (line 33) | func (te *_tester) underscore() {
  function Test_underscore (line 149) | func Test_underscore(t *testing.T) {

FILE: underscore_utility_test.go
  function Test_underscore_utility_0 (line 8) | func Test_underscore_utility_0(t *testing.T) {
  function Test_underscore_utility_1 (line 23) | func Test_underscore_utility_1(t *testing.T) {
  function Test_underscore_utility_2 (line 37) | func Test_underscore_utility_2(t *testing.T) {
  function Test_underscore_utility_3 (line 60) | func Test_underscore_utility_3(t *testing.T) {
  function Test_underscore_utility_4 (line 75) | func Test_underscore_utility_4(t *testing.T) {
  function Test_underscore_utility_5 (line 96) | func Test_underscore_utility_5(t *testing.T) {
  function Test_underscore_utility_6 (line 115) | func Test_underscore_utility_6(t *testing.T) {
  function Test_underscore_utility_7 (line 130) | func Test_underscore_utility_7(t *testing.T) {
  function Test_underscore_utility_8 (line 147) | func Test_underscore_utility_8(t *testing.T) {
  function Test_underscore_utility_9 (line 265) | func Test_underscore_utility_9(t *testing.T) {
  function Test_underscore_utility_10 (line 283) | func Test_underscore_utility_10(t *testing.T) {
  function Test_underscore_utility_11 (line 297) | func Test_underscore_utility_11(t *testing.T) {
  function Test_underscore_utility_12 (line 315) | func Test_underscore_utility_12(t *testing.T) {
  function Test_underscore_utility_13 (line 332) | func Test_underscore_utility_13(t *testing.T) {
  function Test_underscore_utility_14 (line 347) | func Test_underscore_utility_14(t *testing.T) {
  function Test_underscore_utility_15 (line 374) | func Test_underscore_utility_15(t *testing.T) {
  function Test_underscore_utility_16 (line 393) | func Test_underscore_utility_16(t *testing.T) {
  function Test_underscore_utility_17 (line 408) | func Test_underscore_utility_17(t *testing.T) {

FILE: value.go
  type valueKind (line 12) | type valueKind
  constant valueUndefined (line 15) | valueUndefined valueKind = iota
  constant valueNull (line 16) | valueNull
  constant valueNumber (line 17) | valueNumber
  constant valueString (line 18) | valueString
  constant valueBoolean (line 19) | valueBoolean
  constant valueObject (line 20) | valueObject
  constant valueEmpty (line 23) | valueEmpty
  constant valueResult (line 24) | valueResult
  constant valueReference (line 25) | valueReference
  type Value (line 29) | type Value struct
    method safe (line 34) | func (v Value) safe() bool {
    method isEmpty (line 57) | func (v Value) isEmpty() bool {
    method IsDefined (line 69) | func (v Value) IsDefined() bool {
    method IsUndefined (line 74) | func (v Value) IsUndefined() bool {
    method IsNull (line 84) | func (v Value) IsNull() bool {
    method isCallable (line 90) | func (v Value) isCallable() bool {
    method Call (line 105) | func (v Value) Call(this Value, argumentList ...interface{}) (Value, e...
    method call (line 117) | func (v Value) call(rt *runtime, this Value, argumentList ...interface...
    method constructSafe (line 124) | func (v Value) constructSafe(rt *runtime, this Value, argumentList ......
    method construct (line 132) | func (v Value) construct(rt *runtime, this Value, argumentList ...inte...
    method IsPrimitive (line 140) | func (v Value) IsPrimitive() bool {
    method IsBoolean (line 145) | func (v Value) IsBoolean() bool {
    method IsNumber (line 150) | func (v Value) IsNumber() bool {
    method IsNaN (line 155) | func (v Value) IsNaN() bool {
    method IsString (line 171) | func (v Value) IsString() bool {
    method IsObject (line 176) | func (v Value) IsObject() bool {
    method IsFunction (line 181) | func (v Value) IsFunction() bool {
    method Class (line 200) | func (v Value) Class() string {
    method isArray (line 207) | func (v Value) isArray() bool { //nolint:unused
    method isStringObject (line 214) | func (v Value) isStringObject() bool { //nolint:unused
    method isBooleanObject (line 221) | func (v Value) isBooleanObject() bool { //nolint:unused
    method isNumberObject (line 228) | func (v Value) isNumberObject() bool { //nolint:unused
    method isDate (line 235) | func (v Value) isDate() bool { //nolint:unused
    method isRegExp (line 242) | func (v Value) isRegExp() bool {
    method isError (line 249) | func (v Value) isError() bool { //nolint:unused
    method String (line 372) | func (v Value) String() string {
    method ToBoolean (line 389) | func (v Value) ToBoolean() (bool, error) {
    method numberValue (line 397) | func (v Value) numberValue() Value {
    method ToFloat (line 411) | func (v Value) ToFloat() (float64, error) {
    method ToInteger (line 426) | func (v Value) ToInteger() (int64, error) {
    method ToString (line 443) | func (v Value) ToString() (string, error) {
    method object (line 451) | func (v Value) object() *object {
    method Object (line 461) | func (v Value) Object() *Object {
    method reference (line 471) | func (v Value) reference() referencer {
    method resolve (line 476) | func (v Value) resolve() Value {
    method Export (line 610) | func (v Value) Export() (interface{}, error) {
    method export (line 614) | func (v Value) export() interface{} {
    method evaluateBreakContinue (line 715) | func (v Value) evaluateBreakContinue(labels []string) resultKind {
    method evaluateBreak (line 727) | func (v Value) evaluateBreak(labels []string) resultKind {
    method toReflectValue (line 741) | func (v Value) toReflectValue(typ reflect.Type) (reflect.Value, error) {
    method MarshalJSON (line 972) | func (v Value) MarshalJSON() ([]byte, error) {
  function ToValue (line 49) | func ToValue(value interface{}) (Value, error) {
  function UndefinedValue (line 64) | func UndefinedValue() Value {
  function NullValue (line 79) | func NullValue() Value {
  function reflectValuePanic (line 258) | func reflectValuePanic(value interface{}, kind reflect.Kind) {
  function toValue (line 270) | func toValue(value interface{}) Value {
  function NaNValue (line 496) | func NaNValue() Value {
  function positiveInfinityValue (line 500) | func positiveInfinityValue() Value {
  function negativeInfinityValue (line 504) | func negativeInfinityValue() Value {
  function positiveZeroValue (line 508) | func positiveZeroValue() Value {
  function negativeZeroValue (line 512) | func negativeZeroValue() Value {
  function TrueValue (line 521) | func TrueValue() Value {
  function FalseValue (line 530) | func FalseValue() Value {
  function sameValue (line 534) | func sameValue(x Value, y Value) bool {
  function strictEqualityComparison (line 568) | func strictEqualityComparison(x Value, y Value) bool {
  function stringToReflectValue (line 883) | func stringToReflectValue(value string, kind reflect.Kind) (reflect.Valu...

FILE: value_boolean.go
  method bool (line 10) | func (v Value) bool() bool {

FILE: value_kind.gen.go
  function _ (line 7) | func _() {
  constant _valueKind_name (line 22) | _valueKind_name = "UndefinedNullNumberStringBooleanObjectEmptyResultRefe...
  method String (line 26) | func (i valueKind) String() string {

FILE: value_number.go
  function parseNumber (line 14) | func parseNumber(value string) float64 {
  method float64 (line 46) | func (v Value) float64() float64 {
  constant sqrt1_2 (line 90) | sqrt1_2 float64 = math.Sqrt2 / 2
  constant maxUint32 (line 94) | maxUint32 = math.MaxUint32
  constant maxInt (line 95) | maxInt    = int(^uint(0) >> 1)
  constant int64MaxInt8 (line 98) | int64MaxInt8   int64 = math.MaxInt8
  constant int64MinInt8 (line 99) | int64MinInt8   int64 = math.MinInt8
  constant int64MaxInt16 (line 100) | int64MaxInt16  int64 = math.MaxInt16
  constant int64MinInt16 (line 101) | int64MinInt16  int64 = math.MinInt16
  constant int64MaxInt32 (line 102) | int64MaxInt32  int64 = math.MaxInt32
  constant int64MinInt32 (line 103) | int64MinInt32  int64 = math.MinInt32
  constant int64MaxUint8 (line 104) | int64MaxUint8  int64 = math.MaxUint8
  constant int64MaxUint16 (line 105) | int64MaxUint16 int64 = math.MaxUint16
  constant int64MaxUint32 (line 106) | int64MaxUint32 int64 = math.MaxUint32
  constant floatMaxInt (line 109) | floatMaxInt    float64 = float64(int(^uint(0) >> 1))
  constant floatMinInt (line 110) | floatMinInt    float64 = float64(-maxInt - 1)
  constant floatMaxUint (line 111) | floatMaxUint   float64 = float64(^uint(0))
  constant floatMaxUint64 (line 112) | floatMaxUint64 float64 = math.MaxUint64
  constant floatMaxInt64 (line 113) | floatMaxInt64  float64 = math.MaxInt64
  constant floatMinInt64 (line 114) | floatMinInt64  float64 = math.MinInt64
  function toIntegerFloat (line 117) | func toIntegerFloat(value Value) float64 {
  type numberKind (line 131) | type numberKind
  constant numberInteger (line 134) | numberInteger  numberKind = iota
  constant numberFloat (line 135) | numberFloat
  constant numberInfinity (line 136) | numberInfinity
  constant numberNaN (line 137) | numberNaN
  type _number (line 140) | type _number struct
  method number (line 149) | func (v Value) number() _number {
  function toInt32 (line 217) | func toInt32(value Value) int32 {
  function toUint32 (line 236) | func toUint32(value Value) uint32 {
  function toUint16 (line 260) | func toUint16(value Value) uint16 {
  function toIntSign (line 280) | func toIntSign(value Value) int {

FILE: value_primitive.go
  function toNumberPrimitive (line 3) | func toNumberPrimitive(value Value) Value {
  function toPrimitiveValue (line 7) | func toPrimitiveValue(value Value) Value {
  function toPrimitive (line 11) | func toPrimitive(value Value, hint defaultValueHint) Value {

FILE: value_string.go
  function floatToString (line 15) | func floatToString(value float64, bitsize int) string {
  function numberToStringRadix (line 32) | func numberToStringRadix(value Value, radix int) string {
  method string (line 50) | func (v Value) string() string {

FILE: value_test.go
  function TestValue (line 10) | func TestValue(t *testing.T) {
  function TestObject (line 23) | func TestObject(t *testing.T) {
  type intAlias (line 29) | type intAlias
  function TestToValue (line 31) | func TestToValue(t *testing.T) {
  function TestToBoolean (line 119) | func TestToBoolean(t *testing.T) {
  function TestToFloat (line 137) | func TestToFloat(t *testing.T) {
  function TestToString (line 154) | func TestToString(t *testing.T) {
  function Test_toInt32 (line 168) | func Test_toInt32(t *testing.T) {
  function Test_toUint32 (line 190) | func Test_toUint32(t *testing.T) {
  function Test_toUint16 (line 212) | func Test_toUint16(t *testing.T) {
  function Test_sameValue (line 234) | func Test_sameValue(t *testing.T) {
  function TestExport (line 243) | func TestExport(t *testing.T) {
  function Test_toReflectValue (line 349) | func Test_toReflectValue(t *testing.T) {
  function TestJSONMarshaling (line 358) | func TestJSONMarshaling(t *testing.T) {
  function TestNestedJSONMarshaling (line 401) | func TestNestedJSONMarshaling(t *testing.T) {
Condensed preview — 167 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (1,456K chars).
[
  {
    "path": ".clog.toml",
    "chars": 340,
    "preview": "[clog]\nrepository = \"https://github.com/robertkrimen/otto\"\nsubtitle = \"Release Notes\"\n\n[sections]\n\"Refactors\" = [\"refact"
  },
  {
    "path": ".github/workflows/release-build.yml",
    "chars": 837,
    "preview": "name: Build Release\n\non:\n  push:\n    tags:\n      - 'v[0-9]+.[0-9]+.[0-9]+*'\n\njobs:\n  goreleaser:\n    name: Release Go Bi"
  },
  {
    "path": ".github/workflows/test-lint.yml",
    "chars": 1029,
    "preview": "name: Go test and lint\n\non:\n  pull_request:\n    branches: 'master'\n\njobs:\n  go-test-lint:\n    strategy:\n      matrix:\n  "
  },
  {
    "path": ".gitignore",
    "chars": 148,
    "preview": ".test\notto/otto\notto/otto-*\ntools/tester/testdata/\ntools/tester/tester\ntools/gen-jscore/gen-jscore\ntools/gen-tokens/gen-"
  },
  {
    "path": ".golangci.yml",
    "chars": 1306,
    "preview": "run:\n  timeout: 6m\n\nlinters-settings:\n  govet:\n    settings:\n      shadow:\n        strict: true\n    enable-all: true\n  g"
  },
  {
    "path": ".goreleaser.yaml",
    "chars": 2015,
    "preview": "# When adding options check the documentation at https://goreleaser.com\nbefore:\n  hooks:\n    - go mod tidy\nbuilds:\n  - e"
  },
  {
    "path": "DESIGN.markdown",
    "chars": 81,
    "preview": "* Designate the filename of \"anonymous\" source code by the hash (md5/sha1, etc.)\n"
  },
  {
    "path": "LICENSE",
    "chars": 1057,
    "preview": "Copyright (c) 2012 Robert Krimen\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this s"
  },
  {
    "path": "README.md",
    "chars": 20340,
    "preview": "# otto\n\n[![GoDoc Reference](https://pkg.go.dev/badge/github.com/robertkrimen/otto.svg)](https://pkg.go.dev/github.com/ro"
  },
  {
    "path": "array_test.go",
    "chars": 18911,
    "preview": "package otto\n\nimport (\n\t\"testing\"\n)\n\nfunc TestArray(t *testing.T) {\n\ttt(t, func() {\n\t\ttest, _ := test()\n\n\t\ttest(`\n      "
  },
  {
    "path": "ast/comments.go",
    "chars": 7304,
    "preview": "package ast\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/robertkrimen/otto/file\"\n)\n\n// CommentPosition determines where the comment is"
  },
  {
    "path": "ast/comments_test.go",
    "chars": 1424,
    "preview": "package ast\n\nimport (\n\t\"testing\"\n\n\t\"github.com/robertkrimen/otto/file\"\n)\n\nfunc TestCommentMap(t *testing.T) {\n\tstatement"
  },
  {
    "path": "ast/node.go",
    "chars": 20206,
    "preview": "// Package ast declares types representing a JavaScript AST.\n//\n// # Warning\n// The parser and AST interfaces are still "
  },
  {
    "path": "ast/walk.go",
    "chars": 4076,
    "preview": "package ast\n\nimport \"fmt\"\n\n// Visitor Enter method is invoked for each node encountered by Walk.\n// If the result visito"
  },
  {
    "path": "ast/walk_example_test.go",
    "chars": 1238,
    "preview": "package ast_test\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\n\t\"github.com/robertkrimen/otto/ast\"\n\t\"github.com/robertkrimen/otto/file\"\n\t\"git"
  },
  {
    "path": "ast/walk_test.go",
    "chars": 3050,
    "preview": "package ast_test\n\nimport (\n\t\"testing\"\n\n\t\"github.com/robertkrimen/otto/ast\"\n\t\"github.com/robertkrimen/otto/file\"\n\t\"github"
  },
  {
    "path": "builtin.go",
    "chars": 8054,
    "preview": "package otto\n\nimport (\n\t\"encoding/hex\"\n\t\"errors\"\n\t\"math\"\n\t\"net/url\"\n\t\"regexp\"\n\t\"strconv\"\n\t\"strings\"\n\t\"unicode/utf16\"\n\t\"u"
  },
  {
    "path": "builtin_array.go",
    "chars": 19657,
    "preview": "package otto\n\nimport (\n\t\"strconv\"\n\t\"strings\"\n)\n\n// Array\n\nfunc builtinArray(call FunctionCall) Value {\n\treturn objectVal"
  },
  {
    "path": "builtin_boolean.go",
    "chars": 719,
    "preview": "package otto\n\n// Boolean\n\nfunc builtinBoolean(call FunctionCall) Value {\n\treturn boolValue(call.Argument(0).bool())\n}\n\nf"
  },
  {
    "path": "builtin_date.go",
    "chars": 15480,
    "preview": "package otto\n\nimport (\n\t\"math\"\n\t\"time\"\n)\n\n// Date\n\nconst (\n\t// TODO Be like V8?\n\t// builtinDateDateTimeLayout = \"Mon Jan"
  },
  {
    "path": "builtin_error.go",
    "chars": 3566,
    "preview": "package otto\n\nimport (\n\t\"fmt\"\n)\n\nfunc builtinError(call FunctionCall) Value {\n\treturn objectValue(call.runtime.newError("
  },
  {
    "path": "builtin_function.go",
    "chars": 3775,
    "preview": "package otto\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"unicode\"\n\n\t\"github.com/robertkrimen/otto/parser\"\n)\n\n// Function\n\nfunc builtin"
  },
  {
    "path": "builtin_json.go",
    "chars": 7721,
    "preview": "package otto\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"strings\"\n)\n\ntype builtinJSONParseContext struct {\n\treviver Val"
  },
  {
    "path": "builtin_math.go",
    "chars": 5044,
    "preview": "package otto\n\nimport (\n\t\"math\"\n\t\"math/rand\"\n)\n\n// Math\n\nfunc builtinMathAbs(call FunctionCall) Value {\n\tnumber := call.A"
  },
  {
    "path": "builtin_number.go",
    "chars": 3127,
    "preview": "package otto\n\nimport (\n\t\"math\"\n\t\"strconv\"\n\n\t\"golang.org/x/text/language\"\n\t\"golang.org/x/text/message\"\n\t\"golang.org/x/tex"
  },
  {
    "path": "builtin_object.go",
    "chars": 8945,
    "preview": "package otto\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\n// Object\n\nfunc builtinObject(call FunctionCall) Value {\n\tvalue := call.Argu"
  },
  {
    "path": "builtin_regexp.go",
    "chars": 2496,
    "preview": "package otto\n\nimport (\n\t\"fmt\"\n)\n\n// RegExp\n\nfunc builtinRegExp(call FunctionCall) Value {\n\tpattern := call.Argument(0)\n\t"
  },
  {
    "path": "builtin_string.go",
    "chars": 14088,
    "preview": "package otto\n\nimport (\n\t\"bytes\"\n\t\"regexp\"\n\t\"strconv\"\n\t\"strings\"\n\t\"unicode/utf16\"\n\t\"unicode/utf8\"\n)\n\n// String\n\nfunc stri"
  },
  {
    "path": "builtin_test.go",
    "chars": 3827,
    "preview": "package otto\n\nimport (\n\t\"testing\"\n)\n\nfunc TestString_substr(t *testing.T) {\n\ttt(t, func() {\n\t\ttest, _ := test()\n\n\t\ttest("
  },
  {
    "path": "call_test.go",
    "chars": 33147,
    "preview": "package otto\n\nimport (\n\t\"reflect\"\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/require\"\n)\n\nconst (\n\ttestAb = \"ab\"\n)\n\nfunc B"
  },
  {
    "path": "clone.go",
    "chars": 3953,
    "preview": "package otto\n\nimport (\n\t\"fmt\"\n)\n\ntype cloner struct {\n\truntime     *runtime\n\tobj         map[*object]*object\n\tobjectstas"
  },
  {
    "path": "clone_test.go",
    "chars": 332,
    "preview": "package otto\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestCloneGetterSetter(t *testing.T) {\n"
  },
  {
    "path": "cmpl.go",
    "chars": 166,
    "preview": "package otto\n\nimport (\n\t\"github.com/robertkrimen/otto/ast\"\n\t\"github.com/robertkrimen/otto/file\"\n)\n\ntype compiler struct "
  },
  {
    "path": "cmpl_evaluate.go",
    "chars": 2506,
    "preview": "package otto\n\nimport (\n\t\"strconv\"\n)\n\nfunc (rt *runtime) cmplEvaluateNodeProgram(node *nodeProgram, eval bool) Value {\n\ti"
  },
  {
    "path": "cmpl_evaluate_expression.go",
    "chars": 12400,
    "preview": "package otto\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\tgoruntime \"runtime\"\n\n\t\"github.com/robertkrimen/otto/token\"\n)\n\nfunc (rt *runtime) "
  },
  {
    "path": "cmpl_evaluate_statement.go",
    "chars": 10403,
    "preview": "package otto\n\nimport (\n\t\"fmt\"\n\tgoruntime \"runtime\"\n\n\t\"github.com/robertkrimen/otto/token\"\n)\n\nfunc (rt *runtime) cmplEval"
  },
  {
    "path": "cmpl_parse.go",
    "chars": 15053,
    "preview": "package otto\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/robertkrimen/otto/ast\"\n\t\"github.com/robertkrimen/otto/file\"\n\t\"github.com/rob"
  },
  {
    "path": "cmpl_test.go",
    "chars": 872,
    "preview": "package otto\n\nimport (\n\t\"testing\"\n\n\t\"github.com/robertkrimen/otto/parser\"\n)\n\nfunc Test_cmpl(t *testing.T) {\n\ttt(t, func("
  },
  {
    "path": "console.go",
    "chars": 1007,
    "preview": "package otto\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc formatForConsole(argumentList []Value) string {\n\toutput := []stri"
  },
  {
    "path": "consts.go",
    "chars": 906,
    "preview": "package otto\n\nconst (\n\t// Common classes.\n\tclassStringName   = \"String\"\n\tclassGoArrayName  = \"GoArray\"\n\tclassGoSliceName"
  },
  {
    "path": "date_test.go",
    "chars": 12911,
    "preview": "package otto\n\nimport (\n\t\"math\"\n\t\"testing\"\n\t\"time\"\n)\n\nfunc mockTimeLocal(location *time.Location) func() {\n\tlocal := time"
  },
  {
    "path": "dbg/dbg.go",
    "chars": 8132,
    "preview": "// This file was AUTOMATICALLY GENERATED by dbg-import (smuggol) from github.com/robertkrimen/dbg\n\n/*\nPackage dbg is a p"
  },
  {
    "path": "dbg.go",
    "chars": 190,
    "preview": "// This file was AUTOMATICALLY GENERATED by dbg-import (smuggol) for github.com/robertkrimen/dbg\n\npackage otto\n\nimport ("
  },
  {
    "path": "documentation_test.go",
    "chars": 2545,
    "preview": "package otto\n\nimport (\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc ExampleSynopsis() { //nolint:govet\n\tvm := New()\n\t_, err := vm.Run(`\n        "
  },
  {
    "path": "error.go",
    "chars": 5039,
    "preview": "package otto\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\n\t\"github.com/robertkrimen/otto/file\"\n)\n\ntype exception struct {\n\tvalue interfac"
  },
  {
    "path": "error_native_test.go",
    "chars": 1123,
    "preview": "package otto\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/require\"\n)\n\n// this is its own file because the tests i"
  },
  {
    "path": "error_test.go",
    "chars": 10255,
    "preview": "package otto\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestError(t *testing.T) {\n\ttt(t, func("
  },
  {
    "path": "evaluate.go",
    "chars": 7451,
    "preview": "package otto\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"strings\"\n\n\t\"github.com/robertkrimen/otto/token\"\n)\n\nfunc (rt *runtime) evaluateMu"
  },
  {
    "path": "file/file.go",
    "chars": 3661,
    "preview": "// Package file encapsulates the file abstractions used by the ast & parser.\npackage file\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\n\t"
  },
  {
    "path": "function_stack_test.go",
    "chars": 2055,
    "preview": "package otto\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/require\"\n)\n\n// this is its own file because the tests i"
  },
  {
    "path": "function_test.go",
    "chars": 9072,
    "preview": "package otto\n\nimport (\n\t\"testing\"\n)\n\nfunc TestFunction(t *testing.T) {\n\ttt(t, func() {\n\t\ttest, _ := test()\n\n\t\ttest(`\n   "
  },
  {
    "path": "functional_benchmark_test.go",
    "chars": 23970,
    "preview": "package otto\n\nimport (\n\t\"math/rand\"\n\t\"strconv\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc Tes"
  },
  {
    "path": "generate.go",
    "chars": 155,
    "preview": "package otto\n\n//go:generate go run ./tools/gen-jscore -output inline.go\n//go:generate stringer -type=valueKind -trimpref"
  },
  {
    "path": "global.go",
    "chars": 5460,
    "preview": "package otto\n\nimport (\n\t\"strconv\"\n\t\"time\"\n)\n\nvar (\n\tprototypeValueObject   = interface{}(nil)\n\tprototypeValueFunction = "
  },
  {
    "path": "global_test.go",
    "chars": 11281,
    "preview": "package otto\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc TestGlobal(t *testing.T) {\n\ttt(t, func() {\n\t\ttest, v"
  },
  {
    "path": "go.mod",
    "chars": 385,
    "preview": "module github.com/robertkrimen/otto\n\ngo 1.22\n\nrequire (\n\tgithub.com/stretchr/testify v1.8.1\n\tgolang.org/x/text v0.4.0\n\tg"
  },
  {
    "path": "go.sum",
    "chars": 2375,
    "preview": "github.com/chzyer/logex v1.2.1 h1:XHDu3E6q+gdHgsdTPH6ImJMIp436vR6MPtH8gP05QzM=\ngithub.com/chzyer/logex v1.2.1/go.mod h1:"
  },
  {
    "path": "inline.go",
    "chars": 183729,
    "preview": "// Code generated by tools/gen-jscore. DO NOT EDIT.\n\npackage otto\n\nimport (\n\t\"math\"\n)\n\nfunc (rt *runtime) newContext() {"
  },
  {
    "path": "inline_test.go",
    "chars": 5031,
    "preview": "package otto\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestGetOwnPropertyNames(t *test"
  },
  {
    "path": "issue_test.go",
    "chars": 28027,
    "preview": "package otto\n\nimport (\n\t\"database/sql\"\n\t\"database/sql/driver\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.co"
  },
  {
    "path": "json_test.go",
    "chars": 4577,
    "preview": "package otto\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc BenchmarkJSON_parse(b *testing.B) {\n\tv"
  },
  {
    "path": "locale.go",
    "chars": 101,
    "preview": "package otto\n\nimport \"golang.org/x/text/language\"\n\nvar defaultLanguage = language.MustParse(\"en-US\")\n"
  },
  {
    "path": "math_test.go",
    "chars": 10875,
    "preview": "package otto\n\nimport (\n\t\"math\"\n\t\"testing\"\n)\n\nvar (\n\tnaN      = math.NaN()\n\tinfinity = math.Inf(1)\n)\n\nfunc TestMath_toStr"
  },
  {
    "path": "native_stack_test.go",
    "chars": 2836,
    "preview": "package otto\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestNativeStackFrames(t *testing.T) {\n"
  },
  {
    "path": "number_test.go",
    "chars": 4341,
    "preview": "package otto\n\nimport (\n\t\"testing\"\n)\n\nfunc TestNumber(t *testing.T) {\n\ttt(t, func() {\n\t\ttest, _ := test()\n\n\t\ttest(`\n     "
  },
  {
    "path": "object.go",
    "chars": 3485,
    "preview": "package otto\n\ntype object struct {\n\tvalue         interface{}\n\truntime       *runtime\n\tobjectClass   *objectClass\n\tproto"
  },
  {
    "path": "object_class.go",
    "chars": 11684,
    "preview": "package otto\n\nimport (\n\t\"encoding/json\"\n)\n\ntype objectClass struct {\n\tgetOwnProperty    func(*object, string) *property\n"
  },
  {
    "path": "object_test.go",
    "chars": 19552,
    "preview": "package otto\n\nimport (\n\t\"testing\"\n)\n\nfunc TestObject_(t *testing.T) {\n\ttt(t, func() {\n\t\ttest, _ := test()\n\n\t\tobj := newO"
  },
  {
    "path": "otto/main.go",
    "chars": 829,
    "preview": "package main\n\nimport (\n\t\"errors\"\n\t\"flag\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\n\t\"github.com/robertkrimen/otto\"\n\t\"github.com/robertkrimen/o"
  },
  {
    "path": "otto.go",
    "chars": 20880,
    "preview": "/*\nPackage otto is a JavaScript parser and interpreter written natively in Go.\n\nhttp://godoc.org/github.com/robertkrimen"
  },
  {
    "path": "otto_.go",
    "chars": 3566,
    "preview": "package otto\n\nimport (\n\t\"fmt\"\n\t\"regexp\"\n\tgoruntime \"runtime\"\n\t\"strconv\"\n)\n\nvar isIdentifierRegexp *regexp.Regexp = regex"
  },
  {
    "path": "otto_error_test.go",
    "chars": 913,
    "preview": "package otto\n\nimport (\n\t\"testing\"\n)\n\nfunc TestOttoError(t *testing.T) {\n\ttt(t, func() {\n\t\tvm := New()\n\n\t\t_, err := vm.Ru"
  },
  {
    "path": "otto_test.go",
    "chars": 38283,
    "preview": "package otto\n\nimport (\n\t\"bytes\"\n\t\"errors\"\n\t\"io\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/robertkrimen/otto/parser\"\n\t\"github.com/"
  },
  {
    "path": "panic_test.go",
    "chars": 1123,
    "preview": "package otto\n\nimport (\n\t\"testing\"\n)\n\nfunc Test_panic(t *testing.T) {\n\ttt(t, func() {\n\t\ttest, _ := test()\n\n\t\t// Test that"
  },
  {
    "path": "parser/comments_test.go",
    "chars": 46978,
    "preview": "package parser\n\nimport (\n\t\"fmt\"\n\t\"reflect\"\n\t\"testing\"\n\n\t\"github.com/robertkrimen/otto/ast\"\n)\n\nfunc checkComments(actual "
  },
  {
    "path": "parser/error.go",
    "chars": 5621,
    "preview": "package parser\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n\n\t\"github.com/robertkrimen/otto/file\"\n\t\"github.com/robertkrimen/otto/token\"\n)\n\nc"
  },
  {
    "path": "parser/expression.go",
    "chars": 20431,
    "preview": "package parser\n\nimport (\n\t\"regexp\"\n\n\t\"github.com/robertkrimen/otto/ast\"\n\t\"github.com/robertkrimen/otto/file\"\n\t\"github.co"
  },
  {
    "path": "parser/lexer.go",
    "chars": 19013,
    "preview": "package parser\n\nimport (\n\t\"bytes\"\n\t\"errors\"\n\t\"fmt\"\n\t\"regexp\"\n\t\"strconv\"\n\t\"strings\"\n\t\"unicode\"\n\t\"unicode/utf8\"\n\n\t\"github."
  },
  {
    "path": "parser/lexer_test.go",
    "chars": 7054,
    "preview": "package parser\n\nimport (\n\t\"testing\"\n\n\t\"github.com/robertkrimen/otto/file\"\n\t\"github.com/robertkrimen/otto/terst\"\n\t\"github"
  },
  {
    "path": "parser/marshal_test.go",
    "chars": 15056,
    "preview": "package parser\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"os\"\n\t\"reflect\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/robertkri"
  },
  {
    "path": "parser/parser.go",
    "chars": 8292,
    "preview": "/*\nPackage parser implements a parser for JavaScript.\n\n\timport (\n\t    \"github.com/robertkrimen/otto/parser\"\n\t)\n\nParse an"
  },
  {
    "path": "parser/parser_test.go",
    "chars": 37414,
    "preview": "package parser\n\nimport (\n\t\"errors\"\n\t\"regexp\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/robertkrimen/otto/ast\"\n\t\"github.com/rob"
  },
  {
    "path": "parser/regexp.go",
    "chars": 6959,
    "preview": "package parser\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"strconv\"\n)\n\ntype regExpParser struct {\n\tgoRegexp  *bytes.Buffer\n\tstr       st"
  },
  {
    "path": "parser/regexp_test.go",
    "chars": 2707,
    "preview": "package parser\n\nimport (\n\t\"regexp\"\n\t\"testing\"\n)\n\nfunc TestRegExp(t *testing.T) {\n\ttt(t, func() {\n\t\t{\n\t\t\t// err\n\t\t\ttest :"
  },
  {
    "path": "parser/scope.go",
    "chars": 808,
    "preview": "package parser\n\nimport (\n\t\"github.com/robertkrimen/otto/ast\"\n)\n\ntype scope struct {\n\touter           *scope\n\tdeclaration"
  },
  {
    "path": "parser/statement.go",
    "chars": 21849,
    "preview": "package parser\n\nimport (\n\t\"github.com/robertkrimen/otto/ast\"\n\t\"github.com/robertkrimen/otto/token\"\n)\n\nfunc (p *parser) p"
  },
  {
    "path": "parser_test.go",
    "chars": 846,
    "preview": "package otto\n\nimport (\n\t\"testing\"\n)\n\nfunc TestPersistence(t *testing.T) {\n\ttt(t, func() {\n\t\ttest, _ := test()\n\n\t\ttest(`\n"
  },
  {
    "path": "property.go",
    "chars": 5306,
    "preview": "package otto\n\n// property\n\ntype propertyMode int\n\nconst (\n\tmodeWriteMask     propertyMode = 0o700\n\tmodeEnumerateMask pro"
  },
  {
    "path": "reflect_test.go",
    "chars": 18130,
    "preview": "package otto\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"math\"\n\t\"reflect\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/stretchr/"
  },
  {
    "path": "regexp_test.go",
    "chars": 8011,
    "preview": "package otto\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n)\n\nfunc TestRegExp(t *testing.T) {\n\ttt(t, func() {\n\t\ttest, _ := test()\n\n\t\ttest("
  },
  {
    "path": "registry/registry.go",
    "chars": 1052,
    "preview": "// Package registry is an experimental package to facilitate altering the otto runtime via import.\n//\n// This interface "
  },
  {
    "path": "repl/autocompleter.go",
    "chars": 1009,
    "preview": "package repl\n\nimport (\n\t\"regexp\"\n\t\"strings\"\n\n\t\"github.com/robertkrimen/otto\"\n)\n\ntype autoCompleter struct {\n\tvm *otto.Ot"
  },
  {
    "path": "repl/repl.go",
    "chars": 3668,
    "preview": "// Package repl implements a REPL (read-eval-print loop) for otto.\npackage repl\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"strin"
  },
  {
    "path": "result.go",
    "chars": 526,
    "preview": "package otto\n\ntype resultKind int\n\nconst (\n\t_ resultKind = iota\n\tresultReturn\n\tresultBreak\n\tresultContinue\n)\n\ntype resul"
  },
  {
    "path": "runtime.go",
    "chars": 22688,
    "preview": "package otto\n\nimport (\n\t\"encoding\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"math\"\n\t\"path\"\n\t\"reflect\"\n\tgoruntime \"runtime\"\n\t\"s"
  },
  {
    "path": "runtime_test.go",
    "chars": 17734,
    "preview": "package otto\n\nimport (\n\t\"math\"\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/require\"\n)\n\n// FIXME terst, Review tests\n\nfunc "
  },
  {
    "path": "scope.go",
    "chars": 340,
    "preview": "package otto\n\n// An ECMA-262 ExecutionContext.\ntype scope struct {\n\tlexical  stasher\n\tvariable stasher\n\tthis     *object"
  },
  {
    "path": "script.go",
    "chars": 2867,
    "preview": "package otto\n\nimport (\n\t\"bytes\"\n\t\"encoding/gob\"\n\t\"errors\"\n)\n\n// ErrVersion is an error which represents a version mismat"
  },
  {
    "path": "script_test.go",
    "chars": 1969,
    "preview": "package otto\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestScript(t *testing.T) {\n\ttt(t, func"
  },
  {
    "path": "sourcemap_test.go",
    "chars": 4425,
    "preview": "package otto\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/require\"\n)\n\nconst (\n\ttestSourcemapCodeOriginal  = \"func"
  },
  {
    "path": "stash.go",
    "chars": 6300,
    "preview": "package otto\n\nimport (\n\t\"fmt\"\n)\n\n// stasher is implemented by types which can stash data.\ntype stasher interface {\n\thasB"
  },
  {
    "path": "string_test.go",
    "chars": 13181,
    "preview": "package otto\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestString(t *testing.T) {\n\ttt(t, func"
  },
  {
    "path": "terst/terst.go",
    "chars": 15218,
    "preview": "// This file was AUTOMATICALLY GENERATED by terst-import (smuggol) from github.com/robertkrimen/terst\n\n/*\nPackage terst "
  },
  {
    "path": "testing_test.go",
    "chars": 2468,
    "preview": "package otto\n\nimport (\n\t\"errors\"\n\t\"strings\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/robertkrimen/otto/terst\"\n)\n\nfunc tt(t *test"
  },
  {
    "path": "token/generate.go",
    "chars": 79,
    "preview": "package token\n\n//go:generate go run ../tools/gen-tokens -output token_const.go\n"
  },
  {
    "path": "token/token.go",
    "chars": 1603,
    "preview": "// Package token defines constants representing the lexical tokens of JavaScript (ECMA5).\npackage token\n\nimport (\n\t\"strc"
  },
  {
    "path": "token/token_const.go",
    "chars": 7263,
    "preview": "// Code generated by tools/gen-tokens. DO NOT EDIT.\n\npackage token\n\nconst (\n\t_ Token = iota\n\n\t// Control.\n\tILLEGAL\n\tEOF\n"
  },
  {
    "path": "tools/gen-jscore/.gen-jscore.yaml",
    "chars": 18424,
    "preview": "types:\n  - name: Object\n    core: true\n    properties:\n      - name: length\n        mode: 0\n        value: 1\n      - nam"
  },
  {
    "path": "tools/gen-jscore/helpers.go",
    "chars": 892,
    "preview": "package main\n\nimport (\n\t\"fmt\"\n\t\"unicode\"\n)\n\n// ucfirst converts the first rune of val to uppercase an returns the result"
  },
  {
    "path": "tools/gen-jscore/main.go",
    "chars": 3409,
    "preview": "// Command gen-jscore generates go representations of JavaScript core types file.\npackage main\n\nimport (\n\t\"embed\"\n\t\"flag"
  },
  {
    "path": "tools/gen-jscore/templates/constructor.tmpl",
    "chars": 261,
    "preview": "{{- with .Prototype.Property \"constructor\"}}\n    // {{$.Name}} constructor definition.\n    rt.global.{{$.Name}}Prototype"
  },
  {
    "path": "tools/gen-jscore/templates/core-prototype-property.tmpl",
    "chars": 331,
    "preview": "{{/* Expects .(jsType) */}}\n\n// {{.Name}} prototype property definition.\nrt.global.{{.Name}}Prototype.property = {{templ"
  },
  {
    "path": "tools/gen-jscore/templates/definition.tmpl",
    "chars": 533,
    "preview": "&object{\n    runtime:     rt,\n    class:       class{{or .Class \"Function\"}}Name,\n    objectClass: class{{or .ObjectClas"
  },
  {
    "path": "tools/gen-jscore/templates/function.tmpl",
    "chars": 930,
    "preview": "&object{\n    runtime:     rt,\n    class:       classFunctionName,\n    objectClass: classObject,\n    prototype:   rt.glob"
  },
  {
    "path": "tools/gen-jscore/templates/global.tmpl",
    "chars": 184,
    "preview": "// {{.Name}} properties.\nrt.globalObject.property = {{template \"property.tmpl\" .}}\n\n// {{.Name}} property order.\nrt.glob"
  },
  {
    "path": "tools/gen-jscore/templates/name.tmpl",
    "chars": 366,
    "preview": "{{- if eq . \"length\" \"prototype\" \"constructor\" -}}\nproperty{{ucfirst .}}\n{{- else if eq . \"toString\" -}}\nmethodToString\n"
  },
  {
    "path": "tools/gen-jscore/templates/property-entry.tmpl",
    "chars": 105,
    "preview": "{{- template \"name.tmpl\" .Property.Name}}: {{- template \"property-value.tmpl\" .}},{{/* No newline */ -}}\n"
  },
  {
    "path": "tools/gen-jscore/templates/property-fields.tmpl",
    "chars": 168,
    "preview": "{{- /* expects .Name and .Properties */ -}}\n{{if .Properties}}\nproperty: {{template \"property.tmpl\" .}},\npropertyOrder: "
  },
  {
    "path": "tools/gen-jscore/templates/property-order.tmpl",
    "chars": 138,
    "preview": "{{- /* expects .Properties */ -}}\n[]string{\n{{range .Properties -}}\n    {{template \"name.tmpl\" .Name}},\n{{end -}}\n}{{/* "
  },
  {
    "path": "tools/gen-jscore/templates/property-value.tmpl",
    "chars": 522,
    "preview": "{{with .Property}} {\n    mode: {{if .Mode}}{{.Mode}}{{else if or .Function (eq .Name \"constructor\")}}0o101{{else}}0{{end"
  },
  {
    "path": "tools/gen-jscore/templates/property.tmpl",
    "chars": 350,
    "preview": "{{- /* Expects .Name and .Properties */ -}}\nmap[string]property{\n{{range .Properties -}}\n    {{- /* Skip constructor whi"
  },
  {
    "path": "tools/gen-jscore/templates/prototype.tmpl",
    "chars": 634,
    "preview": "{{/* Expects .Name.(jsType.Name), .Prototype and optional .BlankConstructor */}}\n{{- with .Prototype}}\n// {{$.Name}} pro"
  },
  {
    "path": "tools/gen-jscore/templates/root.tmpl",
    "chars": 907,
    "preview": "// Code generated by tools/gen-jscore. DO NOT EDIT.\n\npackage otto\n\nimport (\n\t\"math\"\n)\n\nfunc (rt *runtime) newContext() {"
  },
  {
    "path": "tools/gen-jscore/templates/type.tmpl",
    "chars": 261,
    "preview": "{{if not .Core | and .Prototype}}\n{{template \"prototype.tmpl\" dict \"Name\" .Name \"Prototype\" .Prototype}}\n{{- end}}\n\n// {"
  },
  {
    "path": "tools/gen-jscore/templates/value.tmpl",
    "chars": 276,
    "preview": "func {{.Name}}Value(value {{or .Type .Name}}) Value {\n\treturn Value{\n\t\tkind:\n{{- if contains .Name \"string\"}}\nvalueStrin"
  },
  {
    "path": "tools/gen-tokens/.gen-tokens.yaml",
    "chars": 3792,
    "preview": "tokens:\n  - group: Control\n  - name: ILLEGAL\n  - name: EOF\n  - name: COMMENT\n  - name: KEYWORD\n\n  - group: Types\n  - nam"
  },
  {
    "path": "tools/gen-tokens/main.go",
    "chars": 1777,
    "preview": "// Command gen-tokens generates go representations of JavaScript tokens.\npackage main\n\nimport (\n\t\"embed\"\n\t\"flag\"\n\t\"fmt\"\n"
  },
  {
    "path": "tools/gen-tokens/templates/root.tmpl",
    "chars": 1469,
    "preview": "// Code generated by tools/gen-tokens. DO NOT EDIT.\n\npackage token\n\nconst (\n\t_ Token = iota\n    {{range .Tokens}}\n      "
  },
  {
    "path": "tools/tester/main.go",
    "chars": 8523,
    "preview": "// Command tester automates the ability to download a suite of JavaScript libraries from a CDN and check if otto can han"
  },
  {
    "path": "type_arguments.go",
    "chars": 2723,
    "preview": "package otto\n\nimport (\n\t\"strconv\"\n)\n\nfunc (rt *runtime) newArgumentsObject(indexOfParameterName []string, stash stasher,"
  },
  {
    "path": "type_array.go",
    "chars": 3225,
    "preview": "package otto\n\nimport (\n\t\"strconv\"\n)\n\nfunc (rt *runtime) newArrayObject(length uint32) *object {\n\tobj := rt.newObject()\n\t"
  },
  {
    "path": "type_boolean.go",
    "chars": 148,
    "preview": "package otto\n\nfunc (rt *runtime) newBooleanObject(value Value) *object {\n\treturn rt.newPrimitiveObject(classBooleanName,"
  },
  {
    "path": "type_date.go",
    "chars": 5962,
    "preview": "package otto\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"regexp\"\n\tTime \"time\"\n)\n\ntype dateObject struct {\n\ttime  Time.Time\n\tvalue Value\n\t"
  },
  {
    "path": "type_error.go",
    "chars": 1676,
    "preview": "package otto\n\nfunc (rt *runtime) newErrorObject(name string, message Value, stackFramesToPop int) *object {\n\tobj := rt.n"
  },
  {
    "path": "type_function.go",
    "chars": 8485,
    "preview": "package otto\n\n// constructFunction.\ntype constructFunction func(*object, []Value) Value\n\n// 13.2.2 [[Construct]].\nfunc d"
  },
  {
    "path": "type_go_array.go",
    "chars": 3643,
    "preview": "package otto\n\nimport (\n\t\"reflect\"\n\t\"strconv\"\n)\n\nfunc (rt *runtime) newGoArrayObject(value reflect.Value) *object {\n\to :="
  },
  {
    "path": "type_go_map.go",
    "chars": 2797,
    "preview": "package otto\n\nimport (\n\t\"reflect\"\n)\n\nfunc (rt *runtime) newGoMapObject(value reflect.Value) *object {\n\tobj := rt.newObje"
  },
  {
    "path": "type_go_map_test.go",
    "chars": 839,
    "preview": "package otto\n\nimport (\n\t\"sort\"\n\t\"strconv\"\n\t\"testing\"\n)\n\ntype GoMapTest map[string]int\n\nfunc (s GoMapTest) Join() string "
  },
  {
    "path": "type_go_slice.go",
    "chars": 3498,
    "preview": "package otto\n\nimport (\n\t\"reflect\"\n\t\"strconv\"\n)\n\nfunc (rt *runtime) newGoSliceObject(value reflect.Value) *object {\n\to :="
  },
  {
    "path": "type_go_slice_test.go",
    "chars": 395,
    "preview": "package otto\n\nimport \"testing\"\n\ntype GoSliceTest []int\n\nfunc (s GoSliceTest) Sum() int {\n\tsum := 0\n\tfor _, v := range s "
  },
  {
    "path": "type_go_struct.go",
    "chars": 3717,
    "preview": "package otto\n\nimport (\n\t\"encoding/json\"\n\t\"reflect\"\n)\n\n// FIXME Make a note about not being able to modify a struct unles"
  },
  {
    "path": "type_go_struct_test.go",
    "chars": 1465,
    "preview": "package otto\n\nimport (\n\t\"testing\"\n)\n\nfunc TestGoStructEmbeddedFields(t *testing.T) {\n\ttype A struct {\n\t\tA1 string `json:"
  },
  {
    "path": "type_number.go",
    "chars": 142,
    "preview": "package otto\n\nfunc (rt *runtime) newNumberObject(value Value) *object {\n\treturn rt.newPrimitiveObject(classNumberName, v"
  },
  {
    "path": "type_reference.go",
    "chars": 2064,
    "preview": "package otto\n\ntype referencer interface {\n\tinvalid() bool               // IsUnresolvableReference\n\tgetValue() Value    "
  },
  {
    "path": "type_regexp.go",
    "chars": 3717,
    "preview": "package otto\n\nimport (\n\t\"fmt\"\n\t\"regexp\"\n\n\t\"github.com/robertkrimen/otto/parser\"\n)\n\ntype regExpObject struct {\n\tregularEx"
  },
  {
    "path": "type_string.go",
    "chars": 2195,
    "preview": "package otto\n\nimport (\n\t\"strconv\"\n\t\"unicode/utf16\"\n\t\"unicode/utf8\"\n)\n\ntype stringObjecter interface {\n\tLength() int\n\tAt("
  },
  {
    "path": "underscore/LICENSE.underscorejs",
    "chars": 1139,
    "preview": "Copyright (c) 2009-2022 Jeremy Ashkenas, Julian Gonggrijp, and DocumentCloud and Investigative Reporters & Editors\n\nPerm"
  },
  {
    "path": "underscore/README.md",
    "chars": 320,
    "preview": "# underscore\n\n[![Reference](https://pkg.go.dev/badge/github.com/robertkrimen/otto/underscore.svg)](https://pkg.go.dev/gi"
  },
  {
    "path": "underscore/download.go",
    "chars": 1157,
    "preview": "//go:build generate\n\npackage main\n\nimport (\n\t\"context\"\n\t\"flag\"\n\t\"fmt\"\n\t\"io\"\n\t\"log\"\n\t\"net/http\"\n\t\"os\"\n\t\"time\"\n)\n\nvar (\n\tu"
  },
  {
    "path": "underscore/generate.go",
    "chars": 268,
    "preview": "package underscore\n\n//go:generate go run download.go --url https://underscorejs.org/underscore-min.js --output underscor"
  },
  {
    "path": "underscore/testify",
    "chars": 1604,
    "preview": "#!/usr/bin/env perl\n\nuse strict;\nuse warnings;\n\nmy $underscore_test = shift @ARGV || \"\";\nif (!-d $underscore_test) {\n   "
  },
  {
    "path": "underscore/underscore-min.js",
    "chars": 19571,
    "preview": "!function(n,r){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=r():\"function\"==typeof define&&define"
  },
  {
    "path": "underscore/underscore.go",
    "chars": 1099,
    "preview": "// Package underscore contains the source for the JavaScript utility-belt library.\n//\n//\timport (\n//\t\t_ \"github.com/robe"
  },
  {
    "path": "underscore_arrays_test.go",
    "chars": 12083,
    "preview": "package otto\n\nimport (\n\t\"testing\"\n)\n\n// first.\nfunc Test_underscore_arrays_0(t *testing.T) {\n\ttt(t, func() {\n\t\ttest := u"
  },
  {
    "path": "underscore_chaining_test.go",
    "chars": 2311,
    "preview": "package otto\n\nimport (\n\t\"testing\"\n)\n\n// map/flatten/reduce.\nfunc Test_underscore_chaining_0(t *testing.T) {\n\ttt(t, func("
  },
  {
    "path": "underscore_collections_test.go",
    "chars": 20630,
    "preview": "package otto\n\nimport (\n\t\"testing\"\n)\n\n// each.\nfunc Test_underscore_collections_0(t *testing.T) {\n\ttt(t, func() {\n\t\ttest "
  },
  {
    "path": "underscore_functions_test.go",
    "chars": 5964,
    "preview": "package otto\n\nimport (\n\t\"testing\"\n)\n\n// bind.\nfunc Test_underscore_functions_0(t *testing.T) {\n\ttt(t, func() {\n\t\ttest :="
  },
  {
    "path": "underscore_objects_test.go",
    "chars": 29632,
    "preview": "package otto\n\nimport (\n\t\"testing\"\n)\n\n// keys.\nfunc Test_underscore_objects_0(t *testing.T) {\n\ttt(t, func() {\n\t\ttest := u"
  },
  {
    "path": "underscore_test.go",
    "chars": 4048,
    "preview": "package otto\n\nimport (\n\t\"sync\"\n\t\"testing\"\n\n\t\"github.com/robertkrimen/otto/terst\"\n\t\"github.com/robertkrimen/otto/undersco"
  },
  {
    "path": "underscore_utility_test.go",
    "chars": 12709,
    "preview": "package otto\n\nimport (\n\t\"testing\"\n)\n\n// #750 - Return _ instance.\nfunc Test_underscore_utility_0(t *testing.T) {\n\ttt(t, "
  },
  {
    "path": "value.go",
    "chars": 26491,
    "preview": "package otto\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"math\"\n\t\"reflect\"\n\t\"strconv\"\n\t\"unicode/utf16\"\n)\n\ntype valueKind int\n\ncon"
  },
  {
    "path": "value_boolean.go",
    "chars": 754,
    "preview": "package otto\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"reflect\"\n\t\"unicode/utf16\"\n)\n\nfunc (v Value) bool() bool {\n\tif v.kind == valueBoo"
  },
  {
    "path": "value_kind.gen.go",
    "chars": 908,
    "preview": "// Code generated by \"stringer -type=valueKind -trimprefix=value -output=value_kind.gen.go\"; DO NOT EDIT.\n\npackage otto\n"
  },
  {
    "path": "value_number.go",
    "chars": 6157,
    "preview": "package otto\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"math\"\n\t\"regexp\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar stringToNumberParseInteger = rege"
  },
  {
    "path": "value_primitive.go",
    "chars": 494,
    "preview": "package otto\n\nfunc toNumberPrimitive(value Value) Value {\n\treturn toPrimitive(value, defaultValueHintNumber)\n}\n\nfunc toP"
  },
  {
    "path": "value_string.go",
    "chars": 2604,
    "preview": "package otto\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"regexp\"\n\t\"strconv\"\n\t\"unicode/utf16\"\n)\n\nvar matchLeading0Exponent = regexp.MustCo"
  },
  {
    "path": "value_test.go",
    "chars": 9253,
    "preview": "package otto\n\nimport (\n\t\"encoding/json\"\n\t\"math\"\n\t\"reflect\"\n\t\"testing\"\n)\n\nfunc TestValue(t *testing.T) {\n\ttt(t, func() {\n"
  }
]

About this extraction

This page contains the full source code of the robertkrimen/otto GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 167 files (1.2 MB), approximately 374.0k tokens, and a symbol index with 2249 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!