Closed reiner-dolp closed 6 years ago
Thank you! Was trying to minimize bits, but did not think about empty strings as values at the time.
Well, if we're talking about saving bits, there are shorter ways of doing this such as value !== undefined
(should be equivalent) and value != null
(handles both undefined and null in one go).
@lydell I tried to be consistent with line 22. But its just used there to not crash the program ifdocument
is an unknown global variable. Since we know x
exists, we could indeed refactor it to something shorter.
But the code is not really optimized for size anyway, right? And a minimizer will probably minimize it more aggressively to something like !function(u) { /* closure around whole code base */ value !== u /* u is undefined since it was not set on closure invokation */ }();
or value !== void 0
.
The only caller seems to be _VirtualDom_applyFacts, which passes through a value of 'undefined' for attributes and namespaced attributes. Set by line 900-903 in _VirtualDom_diffFacts.