Changes between Version 3 and Version 6 of Ticket #5039


Ignore:
Timestamp:
03/29/2017 11:53:44 AM (2 years ago)
Author:
sergz
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #5039

    • Property Priority changed from P1 to P2
    • Property Blocking changed from 5040 to
    • Property Summary changed from Add support of optional values in settings. to Add support of nullable values for non-objects in settings.
  • Ticket #5039 – Description

    v3 v6  
    11=== Background === 
    2 It turned out that current implementation does not support optional values because the check of type does not pass. Let's say the expected type of variable is a string or undefined, in this case if there is no default value it's not possible to set a string value because `typeof undefined /*undefined*/ != typeof stringValue /*string*/` and vice versa (to set undefined). 
     2It turned out that current implementation does not support nullable values, e.g. for strings because the check of type does not pass. Let's say the expected type of variable is a string, in this case if there the default value is null it's not possible to set a string value because `typeof null /*object*/ != typeof stringValue /*string*/` and vice versa (to set null). 
    33One can argue that we can have a special value but it's a magic value and soon or late it will bite. 
    44 
    55=== What to change === 
    66Adjust implementation in prefs.js to support optional values. An example where it works is a setting from #5040. 
     7Also get rid if the hack introduced in #5040.