Hey Wix Coders,
As some of you may have noticed, when calling a function from a web module, if the function returns undefined or an object that includes a nested undefined value, the undefined values are recursively replaced with null .
We’d like to align our protocol to the ECMAScript standards, which means replacing undefined with null only when necessary, since undefined and null are two different values in Javascript.
For example, a function in a web module that until now returned the array [1, undefined, 2] will now return the array [1, null, 2] .
However, a function in a web module that until now returned the object {a: 1, b: undefined} , which was received by the calling function as {a: 1, b: null} , will now return {a: 1} .
You can safely ignore this message if your code does not include any strict equality comparisons ( === or !== ) comparing a value returned from a web module function to null or undefined .
This change might affect the behavior of your code if you use an explicit comparison to compare values returned from web module function calls to undefined or null .
For example, if you have code that contains a condition similar to:
if (returnedValue === null)
Some cases that might have until now evaluated to true will now evaluate to false after this change goes into effect. The reason is that returnedValue may now be undefined instead of null.
To avoid any breaking changes to your code, you can use abstract equality comparisons (== and !=), and compare the returned value to null:
if (returnedValue == null)
Here the boolean expression will evaluate to true when the returned value is either undefined or null.
This change will be introduced on August 1st, 2018.
For more information about the standards, see the Mozilla developers guide.