antonmedv / monkberry

Monkberry is a JavaScript library for building web user interfaces
https://monkberry.js.org
MIT License
1.49k stars 78 forks source link

support of null in conditions like {% if previousTime != null %} #36

Open dmitrya1979 opened 7 years ago

dmitrya1979 commented 7 years ago

Great library. It looks like null is not supported http://jsfiddle.net/zq3ez61h/ Can it be extended to support nulls?

Nexxtron commented 7 years ago

Hello, got the same problem with (both "row" and "index" are defined!): {% if row[index] != undefined) %} in the compiled output the undefined/null gets recognized as variable: this.__cache__.index !== undefined && this.__cache__.row !== undefined && this.__cache__.undefined !== undefined

antonmedv commented 7 years ago

Currently undefined ignored on update in Monkberry. I'll add support for them in next Monkberry v5.

d9onis commented 7 years ago

+1