Changes between Version 1 and Version 2 of Ticket #5039


Ignore:
Timestamp:
03/28/2017 09:21:53 AM (2 years ago)
Author:
sergz
Comment:

Basically, #5040 will be fixed with that issue.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #5039

    • Property Owner set to sergz
    • Property Priority changed from P3 to P1
    • Property Blocking changed from to 5040
    • Property Summary changed from Add support of nullable values in settings. to Add support of optional values in settings.
  • Ticket #5039 – Description

    v1 v2  
    11=== Background === 
    2 It turned out that current implementation does not support nullable values because the check of type does not pass. Let's say the expected type of variable is a nullable string, in this case if the default value is `null` then it's not possible to set a string value because `typeof null /*object*/ != typeof stringValue /*string*/` and vice versa (to set null). 
     2It 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). 
    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 === 
    6 Adjust implementation in prefs.js to support nullable values and get rid of hack like in #5040. 
     6Adjust implementation in prefs.js to support optional values. An example where it works is a setting from #5040.