github.com/hirochachacha/plua@v0.0.0-20170217012138-c82f520cc725/stdlib/debug/testdata/setlocal.lua (about)

     1  function x()
     2  	local a = 4
     3  	y()
     4  	assert(a == 10)
     5  end
     6  
     7  function y()
     8  	debug.setlocal(2, 1, 10)
     9  end
    10  
    11  x()
    12  
    13  function x(...)
    14  	debug.setlocal(1, -1, 15)
    15  	assert(... == 15)
    16  end
    17  
    18  x(10)