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

Function TestArrayNestedCircularReference

builtin_array_circular_test.go:78–89  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

76}
77
78func TestArrayNestedCircularReference(t *testing.T) {
79 const SCRIPT = `
80 var A = [1, 2];
81 var B = [3, 4];
82 A[2] = B;
83 B[2] = A; // Mutual circular reference
84 var str = String(A);
85 // A contains B which contains A - circular refs should be empty
86 str === "1,2,3,4,";
87 `
88 testScript(SCRIPT, valueTrue, t)
89}
90
91func TestArrayCircularReferenceAccessOK(t *testing.T) {
92 const SCRIPT = `

Callers

nothing calls this directly

Calls 1

testScriptFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…