cfad47cfa3/t3compiler/tads3/test/data/replaced_in_anonfn.t

4b825dc642cb6eb9a060e54bf8d69288fbee4904cfad47cfa334b206c65f22086bcc5d63e6f70944
1
/*
2
 *   This tests using 'replaced()' (i.e., a call to the original version of
3
 *   a function that was replaced with 'modify') from within an anonymous
4
 *   function within the modifier function. 
5
 */
6
7
main(args)
8
{
9
    myfunc();
10
}
11
12
myfunc()
13
{
14
    "This is the original myfunc().\n";
15
}
16
17
modify myfunc()
18
{
19
    "This is the replaced myfunc().\n";
20
    "Calling replaced()...[\n";
21
    replaced();
22
    "]... back from replaced()\n";
23
24
    local f = new function()
25
    {
26
        "In anon - calling replaced...[\n";
27
        replaced();
28
        "]...back in anon\n";
29
    };
30
31
    "Again, using an anonymous function...[\n";
32
    f();
33
    "]...back from anon\n";
34
}
35