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

Function TestArrayExportProps

array_test.go:17–29  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

15}
16
17func TestArrayExportProps(t *testing.T) {
18 vm := New()
19 arr := vm.NewArray()
20 err := arr.DefineDataProperty("0", vm.ToValue(true), FLAG_TRUE, FLAG_FALSE, FLAG_TRUE)
21 if err != nil {
22 t.Fatal(err)
23 }
24 actual := arr.Export()
25 expected := []interface{}{true}
26 if !reflect.DeepEqual(actual, expected) {
27 t.Fatalf("Expected: %#v, actual: %#v", expected, actual)
28 }
29}
30
31func TestArrayCanonicalIndex(t *testing.T) {
32 const SCRIPT = `

Callers

nothing calls this directly

Calls 5

NewFunction · 0.85
NewArrayMethod · 0.80
DefineDataPropertyMethod · 0.80
ToValueMethod · 0.80
ExportMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…