Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-5026

wicket-event.js defined Function.prototype.bind doesn't support prepended arguments

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.5.9
    • 1.5.10
    • wicket
    • None

    Description

      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:

      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)));
      		};
      	}
      }
      

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            mgrigorov Martin Tzvetanov Grigorov
            costescuandrei Andrei Costescu
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment