Code — Copy and Paste AJS
Quick Access to the Code for the AJS Object
T
he JavaScript code that defines the AJS object can be acquired in structured and minified forms by downloading the zip file that is available through the Download page on this site.
However, some developers may be unable or unwilling to perform such downloads, therefore this page offers an alternative, wherein the code can be acquired simply by performing a click-drag operation across the listing below, before copying and pasting the selection into a file within an editor.
Developers who desire a minified version should either pass the code below through a minifier such as JSMin, or should download the zip file. See the Download page for a discussion of obfuscation (scrunching) and compression issues.
Note that the point size of the listing below is deliberately small in order to allow the reader to gain an overall impression of the structure of the code, and in order to make it a little easier to mark out with a click-drag of the mouse. Exception object message-strings are laid out on a single line for each in order to facilitate comparison between the contents of different messages.
AJS v1.0 Source
 /*
 == AspectJS - AJS V1.0 =========================================================

 Copyright (c) 2007 Dodeca Technologies Ltd.

 Designed and developed by Richard Vaughan.

 For API documentation visit: http://www.aspectjs.com/API_00.htm
 For a tutorial visit:        http://www.aspectjs.com/Tutorial_00.htm

 Permission is granted hereby and free of charge, to any person obtaining a copy
 of this software and associated applications-programming-interface (API) documentation
 (the 'Software'), to deal in the Software without restriction including, and without
 limitation, the rights to use, copy, modify, merge, publish, distribute, sub-license,
 and/or sell copies of the Software, and to permit persons to whom the Software is
 furnished to do the same, subject to the following three conditions:

 1) The Software is provided 'as is', without warranty of any kind, express or
    implied, and including, but not limited to, the warranties of merchantability,
    fitness for a particular purpose, and non-infringement. In no event shall the
    authors or copyright holders be liable for any claim, damages or other
    liability; whether in an action of contract, tort or otherwise, arising from,
    out of, or in connection with the Software, its use, or any other dealings in
    the Software.

 2) This license does not extend to any tutorial documentation provided by Dodeca
    Technologies Ltd, and the sole copyright to such documentation resides with
    that company.

 3) The Software will not be used with malicious intent.

 ================================================================================*/

 var AJS =
    {
    NullFunc          : function () { },
    NullFuncCallTotal : 0,

    // - ---------------------------------------------

    CheckInterceptArgs  : function (IntercepteeOwner, Interceptee, Caller, FixTypeStr, ClientCallPoint)
       {
       if (IntercepteeOwner                     ===  undefined) { throw new Error ("AJS." + Caller + " - IntercepteeOwner-argument is undefined. Client-code call point: "                                                                                      + ClientCallPoint); }
       if (IntercepteeOwner                     ===  null)      { throw new Error ("AJS." + Caller + " - IntercepteeOwner-argument is null. Client-code call point: "                                                                                           + ClientCallPoint); }
       if (typeof IntercepteeOwner              !== "object")   { throw new Error ("AJS." + Caller + " - IntercepteeOwner-argument does not refer to an object. Client-code call point: "                                                                       + ClientCallPoint); }

       if (Interceptee                          ===  undefined) { throw new Error ("AJS." + Caller + " - Interceptee argument is undefined. Client-code call point: "                                                                                           + ClientCallPoint); }
       if (Interceptee                          ===  null)      { throw new Error ("AJS." + Caller + " - Interceptee argument is null. Client-code call point: "                                                                                                + ClientCallPoint); }

       if (Interceptee in IntercepteeOwner      ===  false)     { throw new Error ("AJS." + Caller + " - '" + Interceptee + "' is not a member of the specified Interceptee-owner (possible reason: missing quotes). Client-code call point: "                  + ClientCallPoint); }
       if (typeof IntercepteeOwner[Interceptee] !== "function") { throw new Error ("AJS." + Caller + " - '" + Interceptee + "' member of IntercepteeOwner is not a function. Client-code call point: "                                                          + ClientCallPoint); }

       },

    // - ---------------------------------------------

    CheckFixArgs : function (Func, ExecMax, Caller, FixTypeStr, ClientCallPoint)
       {
       if (Func                                 ===  undefined) { throw new Error ("AJS." + Caller + " - "  + FixTypeStr  + " function-reference argument is undefined. Client-code call point: "                                                               + ClientCallPoint); }
       if (Func                                 ===  null)      { throw new Error ("AJS." + Caller + " - "  + FixTypeStr  + " function-reference argument is null. Client-code call point: "                                                                    + ClientCallPoint); }
       if (typeof Func                          !=  "function") { throw new Error ("AJS." + Caller + " - "  + FixTypeStr  + " function-reference argument does not refer to a function (possible reason: argument wrapped in quotes). Client-code call point: " + ClientCallPoint); }

       if (ExecMax !== undefined)
          {
          if (typeof ExecMax !=  "number") { throw new Error ("AJS." + Caller + " - ExecMax argument is non-numeric. Client-code call point: "             + ClientCallPoint); }
          if (ExecMax        <    1)       { throw new Error ("AJS." + Caller + " - ExecMax argument has a value of less than 1. Client-code call point: " + ClientCallPoint); }
          }

       },

    // - -----------------------------------------------------------------------------------------------------------------------

    CreateHeadSentinel : function (OnHeadNextSet)
       {
       this.OnHeadNextSet = OnHeadNextSet;

       this.Next      = null;
       this.SetNext_  = function (NewNext)
          {
          this.Next   = NewNext;
          this.OnHeadNextSet ();
          };

       this.GetRef_   = function () { return this.Next; };

       },

    // - ---------------------------------------------

    CreateTailSentinel : function (HeadSentinel)
       {
       this.Execute_ = AJS.NullFunc;

       this.Prev     = HeadSentinel;
       this.SetPrev_ = function (NewPrev) { this.Prev = NewPrev; };

       this.GetRef_  = function () { return this.Prev; };

       },


    // - -----------------------------------------------------------------------------------------------------------------------

    CreateAffix : function      (Func, Arg, ExecMax, Prev, Next, CreateSuffix, Caller, FixTypeStr, ClientCallPoint)
       {
              this.CheckFixArgs (Func,      ExecMax,                           Caller, FixTypeStr, ClientCallPoint);
       return this.CreateAffix_ (Func, Arg, ExecMax, Prev, Next, CreateSuffix,         FixTypeStr);
       },


    // - ---------------------------------------------

    CreateAffix_ : function (Func, Arg, ExecMax, Prev, Next, CreateSuffix, FixTypeStr)
       {
       var DecrExecMax = this.NullFunc;

       var DecrFunc    = function ()
          {
          ExecMax--;
          if (ExecMax === 0) { Affix.Remove (); }
          };

       if ((ExecMax)
       &&   ExecMax < Infinity) { DecrExecMax = DecrFunc; }

       // - ---------------------------------------------

       function MoveUp ()
          {
          if (Prev.GetRef_ () === Affix) { return false; }

          Prev.SetNext_ (Next);
          Next.SetPrev_ (Prev);

          Next = Prev;
          Prev = Prev.GetPrev_ ();

          Prev.SetNext_ (Affix);
          Next.SetPrev_ (Affix);

          return true;

          }

       function MoveDown ()
          {
          if (Next.GetRef_ () === Affix) { return false; }

          Prev.SetNext_ (Next);
          Next.SetPrev_ (Prev);

          Prev = Next;
          Next = Next.GetNext_ ();

          Prev.SetNext_ (Affix);
          Next.SetPrev_ (Affix);

          return true;

          }

       // - ---------------------------------------------

       var Affix =
          {
          Execute_  : function (PrevPrefixResult, IntercepteeArgs)
             {
             try       { PrevPrefixResult = Func.call (this, Arg, PrevPrefixResult, IntercepteeArgs); }
             catch (E) { }

             var TmpNext = Next;                                            // Keep a copy of reference to next in case DecrExecMax removes this affix
                                                                            // (in which case Next would point to the affix that thas just been removed)
             DecrExecMax           ();
             TmpNext.Execute_.call (this, PrevPrefixResult, IntercepteeArgs);

             },

          SetPrev_  : function (NewPrev) { Prev = NewPrev; },
          SetNext_  : function (NewNext) { Next = NewNext; },

          GetPrev   : function ()        { return Prev.GetRef_ (); },
          GetNext   : function ()        { return Next.GetRef_ (); },

          GetPrev_  : function ()        { return Prev;  },
          GetNext_  : function ()        { return Next;  },

          GetRef_   : function ()        { return Affix; },

          Promote   : MoveDown,
          Demote    : MoveUp,

          AddBefore : function (Func, Arg, ExecMax, ClientCallPoint)
             {
             if (this !== Affix) { throw new Error ("(AJS) Affix.AddAfter - 'this' reference does not refer to the affix object on which it should have been called; do not invoke AJS Affix-object methods using 'apply' or 'call'. Client-code call point: "); }
             return AJS.CreateAffix (Func, Arg, ExecMax, Prev, this, CreateSuffix, "AddBefore", FixTypeStr, ClientCallPoint);
             },

          AddAfter  : function (Func, Arg, ExecMax, ClientCallPoint)
             {
             if (this !== Affix) { throw new Error ("(AJS) Affix.AddAfter - 'this' reference does not refer to the Affix object on which it should have been called; do not invoke AJS Affix-object methods using 'apply' or 'call'. Client-code call point: "); }
             return AJS.CreateAffix (Func, Arg, ExecMax, this, Next, CreateSuffix, "AddAfter",  FixTypeStr, ClientCallPoint);
             },

          // - ---------------------------------------------

          Remove       : function ()
             {
             if (this !== Affix) { throw new Error ("(AJS) Affix.Remove - 'this' reference does not refer to the Affix object on which it should have been called; do not invoke AJS Affix-object methods using 'apply' or 'call'. Client-code call point: "); }

             Next.SetPrev_ (Prev);
             Prev.SetNext_ (Next);

             this.Next              =
             this.Prev              = this;

             this.Execute_          =
             this.SetPrev_          =
             this.SetNext_          = AJS.NullFunc;

             this.AddBefore         =
             this.AddAfter          = function () { AJS.NullFuncCallTotal++; return null;  };

             this.Promote           =
             this.Demote            = function () { AJS.NullFuncCallTotal++; return false; };

             this.Remove            = function () { AJS.NullFuncCallTotal++;               };

             this.GetExecsRemaining =
             this.SetExecMax        = function () { AJS.NullFuncCallTotal++; return 0;     };

             },


          // - ---------------------------------------------

          GetExecsRemaining : function () { return ExecMax; },
          SetExecMax        : function (NewMax, ClientCallPoint)
             {
             if (NewMax        ===  undefined) { throw new Error ("SetExecMax method of AJS " + FixTypeStr + "-object - NewMax argument is undefined. Client-code call point: "               + ClientCallPoint); }
             if (typeof NewMax !=  "number")   { throw new Error ("SetExecMax method of AJS " + FixTypeStr + "-object - NewMax argument is non-numeric. Client-code call point: "             + ClientCallPoint); }
             if (NewMax        <    1)         { throw new Error ("SetExecMax method of AJS " + FixTypeStr + "-object - NewMax argument has a value of less than 1. Client-code call point: " + ClientCallPoint); }

             var OldExecMax = ExecMax;

             ExecMax = NewMax;

             if (ExecMax === Infinity) { DecrExecMax = AJS.NullFunc; }
             else                      { DecrExecMax = DecrFunc;     }

             return OldExecMax;

             }

          };


       // - ---------------------------------------------

       if (CreateSuffix === true)
          {
          Affix.Promote  = MoveUp;
          Affix.Demote   = MoveDown;

          Affix.Execute_ = function (PrevSuffixResult, IntercepteeArgs, IntercepteeResult)
             {
             try       { PrevSuffixResult = Func.call (this, Arg, PrevSuffixResult, IntercepteeArgs, IntercepteeResult); }
             catch (E) { }

             var TmpNext = Next;                                            // Keep a copy of reference to next in case DecrExecMax removes this affix
                                                                            // (in which case Next would point to the affix that has just been removed)
             DecrExecMax           ();
             TmpNext.Execute_.call (this, PrevSuffixResult, IntercepteeArgs, IntercepteeResult);

             };

          }

       Prev.SetNext_ (Affix);
       Next.SetPrev_ (Affix);

       return Affix;

       },


    // - -----------------------------------------------------------------------------------------------------------------------

    CreateWrapper_ : function (Prefix, Suffix)
       {
       this.Prefix     = Prefix;
       this.Suffix     = Suffix;

       this.Promote    = function () { return (this.Prefix.Promote () && this.Suffix.Promote ()); };
       this.Demote     = function () { return (this.Prefix.Demote  () && this.Suffix.Demote  ()); };

       this.Remove     = function () { this.Prefix.Remove (); this.Suffix.Remove (); return this; };

       this.SetExecMax = function (NewMax_Prefix, NewMax_Suffix, ClientCallPoint)
          {
          this.Prefix.SetExecMax (NewMax_Prefix, ClientCallPoint);
          this.Suffix.SetExecMax (NewMax_Suffix, ClientCallPoint);
          };

       },

    // - -----------------------------------------------------------------------------------------------------------------------

    AddPrefix : function (IntercepteeOwner, Interceptee, PrefixFunc, PrefixArg, ExecMax, ClientCallPoint)
       {
       if (this !== AJS)                                          { throw new Error ("AJS.AddPrefix - 'this' reference does not refer to the AJS object; do not invoke AJS methods using 'apply' or 'call'. Client-code call point: " + ClientCallPoint); }

       this.CheckInterceptArgs (IntercepteeOwner, Interceptee, "AddPrefix", "prefix", ClientCallPoint);
       this.CheckFixArgs       (PrefixFunc,       ExecMax,     "AddPrefix", "prefix", ClientCallPoint);

       if (IntercepteeOwner[Interceptee].IsAspectJS_HP_Intercept) { throw new Error ("AJS.AddPrefix - Attempt made to intercept a function that is already intercepted by AJS_HP. Client-code call point: "                           + ClientCallPoint); }
       if (IntercepteeOwner[Interceptee].IsAspectJSIntercept)     { return IntercepteeOwner[Interceptee].AddPrefix (PrefixFunc, PrefixArg, ExecMax, ClientCallPoint); }

       function OnHeadNextSet ()
          {
          if (PrefixHead.Next == PrefixTail
          &&  SuffixHead.Next == SuffixTail) { IntercepteeOwner[Interceptee] = IntercepteeRef; }
          }

       var PrefixHead  = new this.CreateHeadSentinel (OnHeadNextSet);
       var PrefixTail  = new this.CreateTailSentinel (PrefixHead);

       var SuffixHead  = new this.CreateHeadSentinel (OnHeadNextSet);
       var SuffixTail  = new this.CreateTailSentinel (SuffixHead);

       PrefixHead.Next = PrefixTail;
       SuffixHead.Next = SuffixTail;

       // - ---------------------------------------------

       function Proxy ()
          {
          PrefixHead.Next.Execute_.call (this, undefined, arguments);  // Breaks encapsulation, but is harmless and more efficient

          var Result = IntercepteeRef.apply (this, arguments);

          SuffixHead.Next.Execute_.call (this, undefined, arguments, Result);

          return Result;

          }

       var IntercepteeRef = IntercepteeOwner[Interceptee];

       IntercepteeOwner[Interceptee] = Proxy;

       Proxy.IsAspectJSIntercept     = true;

       Proxy.AddPrefix               = function (PrefixFunc, PrefixArg, ExecMax, ClientCallPoint) { return AJS.CreateAffix_ (PrefixFunc, PrefixArg, ExecMax, PrefixTail.GetRef_ (), PrefixTail,            false, "prefix"); };
       Proxy.AddSuffix               = function (SuffixFunc, SuffixArg, ExecMax, ClientCallPoint) { return AJS.CreateAffix_ (SuffixFunc, SuffixArg, ExecMax, SuffixHead,            SuffixHead.GetRef_ (), false, "prefix"); };

       Proxy.AddWrapper              = function (PrefixFunc, PrefixArg, PrefixExecMax, SuffixFunc, SuffixArg, SuffixExecMax, ClientCallPoint)
          {
          return new AJS.CreateWrapper_ (AJS.CreateAffix_ (PrefixFunc, PrefixArg, PrefixExecMax, PrefixTail.GetRef_ (), PrefixTail,            false, "prefix"),
                                         AJS.CreateAffix_ (SuffixFunc, SuffixArg, SuffixExecMax, SuffixHead,            SuffixHead.GetRef_ (), true,  "suffix"));
          };

       Proxy.AddSymmetricWrapper    = function (WrapperFunc, WrapperArg, WrapperExecMax, ClientCallPoint)
          {
          return new AJS.CreateWrapper_ (AJS.CreateAffix_ (WrapperFunc, WrapperArg, WrapperExecMax, PrefixTail.GetRef_ (), PrefixTail,            false, "prefix"),
                                         AJS.CreateAffix_ (WrapperFunc, WrapperArg, WrapperExecMax, SuffixHead,            SuffixHead.GetRef_ (), true,  "suffix"));
          };

       return this.CreateAffix_ (PrefixFunc, PrefixArg, ExecMax, PrefixHead, PrefixTail, false, "prefix");

       },


    // - -----------------------------------------------------------------------------------------------------------------------

    AddSuffix : function (IntercepteeOwner, Interceptee, SuffixFunc, SuffixArg, ExecMax, ClientCallPoint)
       {
       if (this !== AJS)                                          { throw new Error ("AJS.AddSuffix - 'this' reference does not refer to the AJS object; do not invoke AJS methods using 'apply' or 'call'. Client-code call point: " + ClientCallPoint); }

       this.CheckInterceptArgs (IntercepteeOwner, Interceptee, "AddSuffix", "suffix", ClientCallPoint);
       this.CheckFixArgs       (SuffixFunc,       ExecMax,     "AddSuffix", "suffix", ClientCallPoint);

       if (IntercepteeOwner[Interceptee].IsAspectJS_HP_Intercept) { throw new Error ("AJS.AddSuffix - Attempt made to intercept a function that is already intercepted by AJS_HP. Client-code call point: "                           + ClientCallPoint); }
       if (IntercepteeOwner[Interceptee].IsAspectJSIntercept)     { return IntercepteeOwner[Interceptee].AddSuffix (SuffixFunc, SuffixArg, ExecMax, ClientCallPoint); }

       function OnHeadNextSet ()
          {
          if (PrefixHead.Next == PrefixTail
          &&  SuffixHead.Next == SuffixTail) { IntercepteeOwner[Interceptee] = IntercepteeRef; }
          }

       var PrefixHead  = new this.CreateHeadSentinel (OnHeadNextSet);
       var PrefixTail  = new this.CreateTailSentinel (PrefixHead);

       var SuffixHead  = new this.CreateHeadSentinel (OnHeadNextSet);
       var SuffixTail  = new this.CreateTailSentinel (SuffixHead);

       PrefixHead.Next = PrefixTail;
       SuffixHead.Next = SuffixTail;

       // - ---------------------------------------------

       function Proxy ()
          {
          PrefixHead.Next.Execute_.call (this, undefined, arguments);

          var Result = IntercepteeRef.apply (this, arguments);

          SuffixHead.Next.Execute_.call (this, undefined, arguments, Result);

          return Result;

          }

       var IntercepteeRef = IntercepteeOwner[Interceptee];

       IntercepteeOwner[Interceptee] = Proxy;

       Proxy.IsAspectJSIntercept     = true;

       Proxy.AddPrefix               = function (PrefixFunc, PrefixArg, ExecMax, ClientCallPoint) { return AJS.CreateAffix_ (PrefixFunc, PrefixArg, ExecMax, PrefixTail.GetRef_ (), PrefixTail,            false, "prefix"); };
       Proxy.AddSuffix               = function (SuffixFunc, SuffixArg, ExecMax, ClientCallPoint) { return AJS.CreateAffix_ (SuffixFunc, SuffixArg, ExecMax, SuffixHead,            SuffixHead.GetRef_ (), false, "prefix"); };

       Proxy.AddWrapper              = function (PrefixFunc, PrefixArg, PrefixExecMax, SuffixFunc, SuffixArg, SuffixExecMax, ClientCallPoint)
          {
          return new AJS.CreateWrapper_ (AJS.CreateAffix_ (PrefixFunc, PrefixArg, PrefixExecMax, PrefixTail.GetRef_ (), PrefixTail,            false, "prefix"),
                                         AJS.CreateAffix_ (SuffixFunc, SuffixArg, SuffixExecMax, SuffixHead,            SuffixHead.GetRef_ (), true,  "suffix"));
          };

       Proxy.AddSymmetricWrapper    = function (WrapperFunc, WrapperArg, WrapperExecMax, ClientCallPoint)
          {
          return new AJS.CreateWrapper_ (AJS.CreateAffix_ (WrapperFunc, WrapperArg, WrapperExecMax, PrefixTail.GetRef_ (), PrefixTail,            false, "prefix"),
                                         AJS.CreateAffix_ (WrapperFunc, WrapperArg, WrapperExecMax, SuffixHead,            SuffixHead.GetRef_ (), true,  "suffix"));
          };

       return this.CreateAffix_ (SuffixFunc, SuffixArg, ExecMax, SuffixHead, SuffixTail, true, "suffix");

       },

    // - -----------------------------------------------------------------------------------------------------------------------

    AddWrapper          : function (IntercepteeOwner, Interceptee, PrefixFunc, PrefixArg, PrefixExecMax,
                                                                   SuffixFunc, SuffixArg, SuffixExecMax, ClientCallPoint)
       {
       if (this !== AJS) { throw new Error ("AJS.AddWrapper - 'this' reference does not refer to the AJS object; do not invoke AJS methods using 'apply' or 'call'. Client-code call point: " + ClientCallPoint); }

       this.CheckInterceptArgs (IntercepteeOwner, Interceptee,   "AddWrapper", "prefix/suffix", ClientCallPoint);
       this.CheckFixArgs       (PrefixFunc,       PrefixExecMax, "AddWrapper", "prefix",        ClientCallPoint);
       this.CheckFixArgs       (SuffixFunc,       SuffixExecMax, "AddWrapper", "suffix",        ClientCallPoint);

       if (IntercepteeOwner[Interceptee].IsAspectJS_HP_Intercept) { throw new Error ("AJS.AddWrapper - Attempt made to intercept a function that is already intercepted by AJS_HP. Client-code call point: " + ClientCallPoint); }

       return this.AddWrapper_ (IntercepteeOwner, Interceptee, PrefixFunc, PrefixArg, PrefixExecMax,
                                                               SuffixFunc, SuffixArg, SuffixExecMax, "AddWrapper", ClientCallPoint);

       },

    AddSymmetricWrapper : function (IntercepteeOwner, Interceptee, WrapperFunc, WrapperArg, ExecMax, ClientCallPoint)
       {
       if (this !== AJS) { throw new Error ("AJS.AddSymmetricWrapper - 'this' reference does not refer to the AJS object; do not invoke AJS methods using 'apply' or 'call'. Client-code call point: " + ClientCallPoint); }

       this.CheckInterceptArgs (IntercepteeOwner, Interceptee, "AddSymmetricWrapper", "prefix/suffix", ClientCallPoint);
       this.CheckFixArgs       (WrapperFunc,      ExecMax,     "AddSymmetricWrapper", "prefix/suffix", ClientCallPoint);

       if (IntercepteeOwner[Interceptee].IsAspectJS_HP_Intercept) { throw new Error ("AJS.AddSymmetricWrapper - Attempt made to intercept a function that is already intercepted by AJS_HP. Client-code call point: " + ClientCallPoint); }

       return this.AddWrapper_ (IntercepteeOwner, Interceptee, WrapperFunc, WrapperArg, ExecMax,
                                                               WrapperFunc, WrapperArg, ExecMax, "AddSymmetricWrapper", ClientCallPoint);

       },

    // - ---------------------------------------------

    AddWrapper_         : function (IntercepteeOwner, Interceptee, PrefixFunc, PrefixArg, PrefixExecMax,
                                                                   SuffixFunc, SuffixArg, SuffixExecMax, AJSCaller, ClientCallPoint)
       {
       if (IntercepteeOwner[Interceptee].IsAspectJSIntercept) { return IntercepteeOwner[Interceptee].AddWrapper (PrefixFunc, PrefixArg, PrefixExecMax, SuffixFunc, SuffixArg, SuffixExecMax, ClientCallPoint); }

       function OnHeadNextSet ()
          {
          if (PrefixHead.Next == PrefixTail
          &&  SuffixHead.Next == SuffixTail) { IntercepteeOwner[Interceptee] = IntercepteeRef; }
          }

       var PrefixHead  = new this.CreateHeadSentinel (OnHeadNextSet);
       var PrefixTail  = new this.CreateTailSentinel (PrefixHead);

       var SuffixHead  = new this.CreateHeadSentinel (OnHeadNextSet);
       var SuffixTail  = new this.CreateTailSentinel (SuffixHead);

       PrefixHead.Next = PrefixTail;
       SuffixHead.Next = SuffixTail;

       // - ---------------------------------------------

       function Proxy ()
          {
          PrefixHead.Next.Execute_.call (this, undefined, arguments);

          var Result = IntercepteeRef.apply (this, arguments);

          SuffixHead.Next.Execute_.call (this, undefined, arguments, Result);

          return Result;

          }

       var IntercepteeRef = IntercepteeOwner[Interceptee];

       IntercepteeOwner[Interceptee] = Proxy;

       Proxy.IsAspectJSIntercept     = true;

       Proxy.AddPrefix               = function (PrefixFunc, PrefixArg, ExecMax, ClientCallPoint) { return AJS.CreateAffix_ (PrefixFunc, PrefixArg, ExecMax, PrefixTail.GetRef_ (), PrefixTail,            false, "prefix"); };
       Proxy.AddSuffix               = function (SuffixFunc, SuffixArg, ExecMax, ClientCallPoint) { return AJS.CreateAffix_ (SuffixFunc, SuffixArg, ExecMax, SuffixHead,            SuffixHead.GetRef_ (), false, "prefix"); };

       Proxy.AddWrapper              = function (PrefixFunc, PrefixArg, PrefixExecMax, SuffixFunc, SuffixArg, SuffixExecMax, ClientCallPoint)
          {
          return new AJS.CreateWrapper_ (AJS.CreateAffix_ (PrefixFunc, PrefixArg, PrefixExecMax, PrefixTail.GetRef_ (), PrefixTail,            false, "prefix"),
                                         AJS.CreateAffix_ (SuffixFunc, SuffixArg, SuffixExecMax, SuffixHead,            SuffixHead.GetRef_ (), true,  "suffix"));
          };

       Proxy.AddSymmetricWrapper    = function (WrapperFunc, WrapperArg, WrapperExecMax, ClientCallPoint)
          {
          return new AJS.CreateWrapper_ (AJS.CreateAffix_ (WrapperFunc, WrapperArg, WrapperExecMax, PrefixTail.GetRef_ (), PrefixTail,            false, "prefix"),
                                         AJS.CreateAffix_ (WrapperFunc, WrapperArg, WrapperExecMax, SuffixHead,            SuffixHead.GetRef_ (), true,  "suffix"));
          };

       // - ---------------------------------------------

       return new AJS.CreateWrapper_ (AJS.CreateAffix_ (PrefixFunc, PrefixArg, PrefixExecMax, PrefixHead, PrefixTail, false, "prefix"),
                                      AJS.CreateAffix_ (SuffixFunc, SuffixArg, SuffixExecMax, SuffixHead, SuffixTail, true,  "suffix"));

       }

    };
             
Copyright © Dodeca Technologies Ltd 2007