MCPcopy Create free account
hub / github.com/dop251/goja / TestExportToWrappedMapCustom

Function TestExportToWrappedMapCustom

object_test.go:286–299  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

284}
285
286func TestExportToWrappedMapCustom(t *testing.T) {
287 type CustomMap map[string]bool
288 vm := New()
289 m := CustomMap{}
290 var exported CustomMap
291 err := vm.ExportTo(vm.ToValue(m), &exported)
292 if err != nil {
293 t.Fatal(err)
294 }
295 exported["test"] = true
296 if v := m["test"]; v != true {
297 t.Fatalf("Unexpected m[\"test\"]: %v", v)
298 }
299}
300
301func TestExportToSliceNonIterable(t *testing.T) {
302 vm := New()

Callers

nothing calls this directly

Calls 3

NewFunction · 0.85
ExportToMethod · 0.80
ToValueMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…