node.js - strange behavior of coffeescript compiler
- by JimBob
I noticed an unexplainable behavior of the coffeescript compiler for me :)
For example:
getImage: (req, res) =>
realty_id = req.query.id
if (realty_id?)
Result
ImageController.prototype.getImage = function(req, res) {
var realty_id,
_this = this;
realty_id = req.query.id;
if ((realty_id != null)
But actually the last line should be: if ((typeof realty_id !== "undefined" && realty_id !== null))
When I comment out "realty_id = req.query.id" it works well. Has anyone a explanation for that?