Results 1 to 4 of 4

Thread: Suggestion: function(){} replace by Ext.emptyFn

  1. #1
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,607
    Vote Rating
    59
      0  

    Default Suggestion: function(){} replace by Ext.emptyFn

    There are three places where no-op implementations of functions are specified as

    Code:
    function(){}
    These can be replaced by a reference to the singleton no-op function Ext.emptyFn.

    • UpdateManager
    • DisplayField
    • GridPanel

  2. #2
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    18,377
    Vote Rating
    858
      0  

    Default

    Got it, I'll update these in SVN.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  3. #3
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,607
    Vote Rating
    59
      0  

    Default

    It could be that the other ocurrences could use it too.

    Like the default, no-op constructor created by Ext.extend if you do not provide one.

    I don't know if I like the idea of a load of classes all sharing a constructor, even if it is null. Perhaps Jack can decide whether that level of byte counting is worth it/safe.

  4. #4
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,607
    Vote Rating
    59
      0  

    Default

    Ah, obviously Ext.extend cannot use it, it must create a new function with a new prototype, that's the whole point!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •