Results 1 to 4 of 4

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

  1. #1
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Redwood City
    Posts
    30,856
    Vote Rating
    88
      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
    Longtime Sencha engineer. Now surplus to requirements apparently...

  2. #2
    Sencha User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    18,988
    Vote Rating
    934
      0  

    Default

    Got it, I'll update these in SVN.
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

  3. #3
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Redwood City
    Posts
    30,856
    Vote Rating
    88
      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.
    Longtime Sencha engineer. Now surplus to requirements apparently...

  4. #4
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Redwood City
    Posts
    30,856
    Vote Rating
    88
      0  

    Default

    Ah, obviously Ext.extend cannot use it, it must create a new function with a new prototype, that's the whole point!
    Longtime Sencha engineer. Now surplus to requirements apparently...

Posting Permissions

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