我注意到咖啡脚本编译器对我来说有一个无法解释的行为:)
例如:
getImage: (req, res) =>
realty_id = req.query.id
if (realty_id?)
结果
ImageController.prototype.getImage = function(req, res) {
var realty_id,
_this = this;
realty_id = req.query.id;
if ((realty_id != null)
但实际上最后一行应该是: if ((typeof realty_id !== "undefined" && realty_id !== null))
当我注释掉“realty_id = req.query.id”时,它运行良好。有没有人对此作出解释?