summaryrefslogtreecommitdiff
path: root/src/syscall/js/js_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/syscall/js/js_test.go')
-rw-r--r--src/syscall/js/js_test.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/syscall/js/js_test.go b/src/syscall/js/js_test.go
index 7d5b1a238a..53d21a3f4f 100644
--- a/src/syscall/js/js_test.go
+++ b/src/syscall/js/js_test.go
@@ -146,6 +146,16 @@ func TestNew(t *testing.T) {
}
}
+func TestInstanceOf(t *testing.T) {
+ someArray := js.Global.Get("Array").New()
+ if got, want := someArray.InstanceOf(js.Global.Get("Array")), true; got != want {
+ t.Errorf("got %#v, want %#v", got, want)
+ }
+ if got, want := someArray.InstanceOf(js.Global.Get("Function")), false; got != want {
+ t.Errorf("got %#v, want %#v", got, want)
+ }
+}
+
func TestCallback(t *testing.T) {
c := make(chan struct{})
cb := js.NewCallback(func(args []js.Value) {