[prev in list] [next in list] [prev in thread] [next in thread]
List: osflash-sandy
Subject: [Sandy] [sandy commit] r684
From: bruce () zeusprod ! com (Bruce Epstein)
Date: 2008-07-11 2:44:03
Message-ID: 4876C8F3.7000003 () zeusprod ! com
[Download RAW message or body]
I noticed that sandy.commands.Delegate.create() in Sandy 3.0 acted
differently than com.bourre.commands.Delegate.create() in Sandy 1.2.
This caused me no end of headache, and I didn't want others to have the
same problem, so I fixed it for backward compatibility.
But I don't want to screw up anyone relying on the altered behavior by
reverting to the prior approach.
Maybe no one is using this feature.
How do I know if I'm helping or hurting the situation?
Cheers
Bruce
codesite-noreply at google.com wrote:
> Author: baepstein at gmail.com
> Date: Thu Jul 10 19:35:35 2008
> New Revision: 684
>
> Modified:
> trunk/sandy/as3/trunk/src/sandy/commands/Delegate.as
>
> Log:
> Modified Delegate.create() for backward compatibility, and renamed existing version \
> to createAppend(). Delegate.createAppend() puts any additional parameters passed to \
> it at the end of the arguments list. Delegate.create() puts the extra parameters at \
> the beginning of the arguments list, as did com.bourre.commands.Delegate.create() \
> in Sandy 1.2
>
> Modified: trunk/sandy/as3/trunk/src/sandy/commands/Delegate.as
> ==============================================================================
> --- trunk/sandy/as3/trunk/src/sandy/commands/Delegate.as (original)
> +++ trunk/sandy/as3/trunk/src/sandy/commands/Delegate.as Thu Jul 10 19:35:35 2008
> @@ -1,10 +1,11 @@
> -package sandy.commands
> +?package sandy.commands
> {
>
> /**
> * From LowRa library
> * @author Francis Bourre
> - * @version 1.0
> + * @author Bruce Epstein - modified create() for backward compatibility, and \
> renamed existing version to createAppend() + * @version 1.0.1
> */
> import flash.events.Event;
>
> @@ -14,7 +15,7 @@
> private var _f : Function;
> private var _a : Array;
>
> - public static function create( method : Function, ... args ) : Function
> + public static function createAppend( method : Function, ... args ) : Function
> {
> return function( ... rest ) : *
> {
> @@ -22,6 +23,15 @@
> };
> }
>
> + // Put the extra args at the beginning of the arguments list, as did \
> com.bourre.commands.Delegate.create(), instead of at the end. + public static \
> function create( method : Function, ... args ) : Function + {
> + return function( ... rest ) : *
> + {
> + return method.apply( null, rest.length>0? \
> (args.length>0?rest.concat(args):rest) : (args.length>0?args:null) ); + };
> + }
> +
> public function Delegate( f : Function, ... rest )
> {
> _f = f;
> @@ -81,4 +91,4 @@
> return "sandy.commands.Delegate";
> }
> }
> -}
> \ No newline at end of file
> +}
>
> _______________________________________________
> Sandy mailing list
> Sandy at osflash.org
> http://osflash.org/mailman/listinfo/sandy_osflash.org
>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic