Reputation: 2970
I have this coffeescript:
y = Object
y.x = true;
result = false
if 'x' in y
result = true
Which generates this javascript:
var result, y,
__indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
y = Object;
y.x = true;
result = false;
if (__indexOf.call(y, 'x') >= 0) {
result = true;
}
Clearly the result should be true but the javascript generated does not return this result. I know I could just escape the section as javascript but that seems hacky. Any help is greatly appreciated.
Upvotes: 1
Views: 313