mediawiki-extensions-Popups/resources
joakin ab4eff82e4 Don't use $.extend in nextState to preserve undefined fields
Since the state was cloned into an empty object with $.extend, undefined
properties were being deleted from it, not actually preserving those
keys. So:

         nextState({hi: undefined, ho: 1}, {ho: 2})
         //> {ho: 2}

It seems like a more consistent behavior would be to not lose any own
keys on the state as we do with the updates too, so that:

         nextState({hi: undefined, ho: 1}, {ho: 2})
         //> {hi: undefined, ho: 2}

Which is what this commit does by not using $.extend to clone the state
and instead just manually copy the keys to the new object, even the
undefined ones.

Change-Id: If4f2a3b0d25bb5ef34cfbc1f2c9c0b5479aeee9b
2016-12-05 20:16:36 +01:00
..
ext.popups Don't use $.extend in nextState to preserve undefined fields 2016-12-05 20:16:36 +01:00
ext.popups.core previews: Tidy up styles 2016-11-29 18:11:11 +00:00
ext.popups.desktop previews: Add generic fallback preview 2016-12-02 12:02:43 +00:00
ext.popups.images Hovercards: Improve layout of settings dialog to design spec 2016-08-10 14:01:36 -04:00
ext.popups.lib Use Redux and Redux Thunk 2016-11-08 15:33:20 -05:00
ext.popups.schemaPopups Hygiene: Rename getMassagedData to processHovercardEvent 2016-10-31 11:25:09 +00:00
ext.popups.schemaPopups.utils Hygiene: Rename getMassagedData to processHovercardEvent 2016-10-31 11:25:09 +00:00