[ 
https://issues.apache.org/jira/browse/WICKET-5026?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13571116#comment-13571116
 ] 

Emond Papegaaij commented on WICKET-5026:
-----------------------------------------

I'm not a fan of extending prototypes of built-in types, but if it's done, I 
think it's best to take the function from MDN: 
https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Function/bind
                
> [Patch] wicket-event.js defined Function.prototype.bind doesn't support 
> prepended arguments
> -------------------------------------------------------------------------------------------
>
>                 Key: WICKET-5026
>                 URL: https://issues.apache.org/jira/browse/WICKET-5026
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.9
>            Reporter: Andrei Costescu
>
> As the title says, for Safari, wicket defines Function.prototype.bind (cause 
> the browser doesn't have it).
> But it's not compatible to what the other browsers and frameworks offer. 
> Prepending arguments should be allowed.
> In Wicket 1.6 I don't know if this is still relevant with the switch to 
> jQuery (which has 'proxy'). The .js at least is no longer there.
> Just replace the existing Function.prototype.bind declaration with:
> {code:JavaScript}
> if (Function.prototype.bind == null) {
>       Function.prototype.bind = function(context) {
>               var method = this;
>               var args = Array.prototype.slice.call(arguments, 1);
>               return function() {
>                       return method.apply(context, 
> args.concat(Array.prototype.slice.call(arguments)));
>               };
>       }
> }
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to