-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
null/undefined are not falsy when not in the root context #409
Comments
Also, when rending |
Actually, |
From the lookup function: Context.prototype.lookup = function (name) {
var cache = this.cache;
var value;
if (name in cache) {
value = cache[name];
} else {
var context = this, names, index;
while (context) {
if (name.indexOf('.') > 0) {
value = context.view;
names = name.split('.');
index = 0;
while (value != null && index < names.length)
value = value[names[index++]];
} else if (typeof context.view == 'object') {
value = context.view[name];
}
if (value != null)
break;
context = context.parent;
}
cache[name] = value;
}
if (isFunction(value))
value = value.call(this.view);
return value;
}; If you analyse, when a value such as |
So the problem is not that The problem is on the lookup function, so I will fix this on PR #407. |
This gets fixed by PR #407. |
Fixed in a020430 |
Renders:
➜ test node test.js is foo is bar is [object Object]
When it should actually render:
➜ test node test.js is foo is bar is nothing
The text was updated successfully, but these errors were encountered: