Repository navigation
Treat null as undefined - #128
Felix Becker (felixfbecker) wants to merge 1 commit into
Conversation
|
Hi Felix Becker (@felixfbecker), I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution! TTYL, MSBOT; |
1 similar comment
|
Hi Felix Becker (@felixfbecker), I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution! TTYL, MSBOT; |
bd46b08 to
e4d1bf5
Compare
|
This is IMO not a correct fix for the problem. If the value is null the property should be present. This is how non JS language work and the protocol defines it that way. I will look into #127 separately. Any objection to close. |
In non-JS languages the protocol structures are typically implemented as a class, and if the property is Again - sorry if I misunderstood the use of the helper function, I though this was the most generic way to solve it, because it doesn't only appear with |
|
Felix Becker (@felixfbecker) I reworked all this for the upcoming 3.0 release of the node libraries. The set function is gone and I try to be more preceise with null and undefined. I even enable strictNull and documented the API with undefined | null if allowed. For converting protocol objects into code objects a null value now gets mapped to undefined in this direction since VS Code's API accepts both and it makes the code more clear. However on the protocol layer itself I sometimes explicitly set thing to null if the spec requires this. For example a response must either contain a result or an error. If a request does return undefined in a node server I will set the result to null to honor this. I will close the PR since the set function is gone. |
Fixes #127