atmosphere
  1. atmosphere
  2. ATMOSPHERE-121

jQuery plugin bug in removeCallback function

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.7.2
    • Fix Version/s: 0.7.2
    • Component/s: client-jquery
    • Labels:
      None

      Description

      Here is the current removeCallback function from the atmosphere jQuery plugin:

      removeCallback: function(func)
      {
      if (jQuery.inArray(func, jQuery.atmosphere.callbacks) != -1)

      { jQuery.atmosphere.callbacks.splice(index); }
      }
      As you can see from the above code snippet, the variable 'index' is not declared anywhere in the removeCallback function scope (and in the whole plugin either). I think this bug haven't been busted because this method is never used .
      Here is a simple patch for this method:

      removeCallback: function(func)
      {
      var index = jQuery.inArray(func, jQuery.atmosphere.callbacks);
      if (index != -1) { jQuery.atmosphere.callbacks.splice(index); }

      }

        Activity

        Show
        jfarcand added a comment - Fixed https://github.com/Atmosphere/atmosphere/compare/e6840132ca...50da61974b Thanks!!!

          People

          • Assignee:
            Unassigned
            Reporter:
            tinhtruong
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: