OILS / spec / testdata / module2 / util2.ysh View on Github | oilshell.org

26 lines, 15 significant
1
2
3#const __provide__ = :| echo-args |
4const __provide__ = :| echo-args badObj |
5
6proc echo-args (w1, w2, ...w_rest; t1, t2, ...t_rest; n1=42, n2=43, ...n_rest; block) {
7 pp test_ ([w1, w2])
8 pp test_ (w_rest)
9 echo
10
11 pp test_ ([t1, t2])
12 pp test_ (t_rest)
13 echo
14
15 pp test_ ([n1, n2])
16 pp test_ (n_rest)
17 echo
18
19 pp test_ (block)
20}
21
22# 'invoke_module' is in __builtins__ - it is the only value.BuiltinProc right now
23
24var methods = Object(null, {__invoke__: getVar('module-invoke')})
25#var methods = Object(null, {__invoke__: module_invoke})
26var badObj = Object(methods, {})