1 Already declared local variables and functions may be exported using the 2 curly brace export list syntax. 3 4 -- File test-var-decl.uc -- 5 let testvar = 123; 6 const testconst = "Test"; 7 8 function testfunc() { 9 print("Hello, world!\n"); 10 } 11 12 export { testvar, testconst, testfunc }; 13 -- End -- 14 15 -- Testcase -- 16 import { testvar, testconst, testfunc } from "./files/test-var-decl.uc"; 17 18 print([ testvar, testconst, testfunc ], "\n"); 19 -- End -- 20 21 -- Args -- 22 -R 23 -- End -- 24 25 -- Expect stdout -- 26 [ 123, "Test", "function testfunc() { ... }" ] 27 -- End --
This page was automatically generated by LXR 0.3.1. • OpenWrt