otto/clone_test.go
Steven Hartland 026a1d9a9c
chore: lint and naming refactor (#475)
Enable more linters, address the issues and do a major naming refactor
to use golang lower camelCase identifiers for types, functions, methods
and variable names.

Also: 
* Clean up inline generation so it doesn't rely on temporary variables.
* Remove unused functions generated by inline.pl.
2022-12-04 21:49:38 +00:00

23 lines
332 B
Go

package otto
import (
"testing"
"github.com/stretchr/testify/require"
)
func TestCloneGetterSetter(t *testing.T) {
vm := New()
_, err := vm.Run(`var x = Object.create(null, {
x: {
get: function() {},
set: function() {},
},
})`)
require.NoError(t, err)
require.NotPanics(t, func() {
vm.Copy()
})
}