The application of a wrapper — where a function has both a prefix and a suffix — follows the same principle
as AddPrefix and AddSuffix, but is a little
more involved because it requires passing more parameters.
Example Seventeen illustrates the application of a wrapping intercept to a function. Here, the first two arguments
describe the interceptee, as in the examples above. The next four describe the prefix completely, including
its calling argument and execution limit (as in a full call to AddPrefix), and the remaining four parameters
describe the suffix, as in a call to AddSuffix. The trailing argument provides diagnostic information.
These parameters set the prefix such that it will execute for every invocation of MyFunc, and is passed the
value "Homer" every time it is called. Similarly, the suffix is passed the value "Beer", and is also set to execute
on every invocation of MyFunc.
The string passed as the ClientCallPoint argument does not appear in the output
because the call to AddWrapper is entirely legal (although it is shown here for demonstration purposes).
If the call were incorrect, however, AJS would throw an Error object,
the message property of which would contain that string.
Note that it is necessary to provide Arg and ExecMax
parameters to the prefix-describing portion of the call, even if
the prefix requires no calling argument, and must execute indefinitely. In the case of the suffix-describing parameters,
the calling-argument and execution-limit parameters can be omitted, as long as no argument is required for the diagnostic
information. If the affix functions do not require a calling argument then these parameters can be either
null or an empty string.