stream.on("emission", function(obj) {
if (active)
{
var found = _.find(findable, function(o) {
return _.contains(o.props, obj.prop);
});
if (typeof found !== "undefined")
{
console.log ("ok")
}
}
});
有效,但例如js2coffee.org CS转换不是
stream.on "emission", (obj) ->
if active
found = _.find(findable, (o) ->
_.contains o.props, obj.prop
)
console.log "ok" if typeof found isnt "undefined"
return
产生TypeError: Cannot read property 'prop' of undefined
似乎无法在_.find的上下文中引用obj?