1 | const __provide__ = :| MY_INTEGER log die setvar_noleak setglobal_noleak invokableObj |
|
2 |
|
3 | # should be null
|
4 | echo "caller_no_leak = $[getVar('caller_no_leak')]"
|
5 |
|
6 | const MY_INTEGER = 42
|
7 |
|
8 | proc log {
|
9 | echo log @ARGV
|
10 | }
|
11 |
|
12 | proc die {
|
13 | echo die @ARGV
|
14 | }
|
15 |
|
16 | setvar setvar_noleak = 'util.ysh'
|
17 | setglobal setglobal_noleak = 'util.ysh'
|
18 |
|
19 |
|
20 | proc myInvoke (; self, param) {
|
21 | echo "sum = $[self.x + self.y + param]"
|
22 | }
|
23 |
|
24 | var methods = Object(null, {'__invoke__': myInvoke})
|
25 |
|
26 | var invokableObj = Object(methods, {x: 3, y: 4})
|
27 |
|
28 | #invokableObj (1)
|