> What steps will reproduce the problem?
var delegate = 1;
$CreateAnonymousDelegate = function (target, func) {
if (target == null || func == null) return func;
delegate = function () {
return func.apply(target, arguments);
};
delegate.func = func;
delegate.target = target;
delegate.isDelegate = true;
return delegate;
}
var ad = $CreateAnonymousDelegate({}, function () {});
/* now delegate contains function instead of 1 */
> What is the expected output? What do you see instead?
The global "delegate" variable should not be modified by the
$CreateAnonymousDelegate function.
> What version of the product are you using? On what operating system?
SharpKit v4.24.3000
>Please provide any additional information below.
The issue can be easy solved by adding "var" before the "delegate =" string:
var delegate = function () {
return func.apply(target, arguments);
};
Thanks,
Alex
Original issue reported on code.google.com by alex.net...@gmail.com on 9 Feb 2012 at 7:40
Original issue reported on code.google.com by
alex.net...@gmail.com
on 9 Feb 2012 at 7:40