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

Function TestCallLessArgsDynamic

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

Source from the content-addressed store, hash-verified

506}
507
508func TestCallLessArgsDynamic(t *testing.T) {
509 const SCRIPT = `
510function A(a, b, c) {
511 // Make it stashful
512 function B() {
513 return a;
514 }
515 return String(a) + " " + String(b) + " " + String(c);
516}
517
518A(1, 2);
519`
520 testScript(SCRIPT, asciiString("1 2 undefined"), t)
521}
522
523func TestCallLessArgsDynamicLocalVar(t *testing.T) {
524 const SCRIPT = `

Callers

nothing calls this directly

Calls 2

testScriptFunction · 0.85
asciiStringTypeAlias · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…