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

Function TestObjectAssignPatternRest

compiler_test.go:4030–4040  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

4028}
4029
4030func TestObjectAssignPatternRest(t *testing.T) {
4031 const SCRIPT = `
4032 let a, b, c, d;
4033 ({a, b, c, ...d} = {a: 1, b: 2, d: 4});
4034 assert.sameValue(a, 1, "a");
4035 assert.sameValue(b, 2, "b");
4036 assert.sameValue(c, undefined, "c");
4037 assert(deepEqual(d, {d: 4}), "d");
4038 `
4039 testScriptWithTestLibX(SCRIPT, _undefined, t)
4040}
4041
4042func TestObjectBindPattern(t *testing.T) {
4043 const SCRIPT = `

Callers

nothing calls this directly

Calls 1

testScriptWithTestLibXFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…