Bug Tracker


Ticket #238 (closed bug: fixed)

Opened 8 years ago

Last modified 7 years ago

Seperate private and public $.extend

Reported by: anonymous Owned by:
Priority: major Milestone:
Component: core Version:
Keywords: Cc:
Blocking: Blocked by:


Using $.extend like this:

$.fn.myPlugin(options) {
  var settings = {
    // defaults
  $.extend(settings, options);

results in the jQuery object being extended when no options are passed. To simplify plugin writing, $.extend shouldn't do anything if the second parameter is null or undefined.

Changing this breaks code that already uses $.extend to extend jQuery itself.

Change History

comment:1 Changed 8 years ago by john

  • Status changed from new to closed
  • Resolution set to fixed

Fixed in SVN rev 441.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.


Add a comment

Modify Ticket

as closed

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.