The problem is the office facility. This code does not work:
offices: ringsted: [0..2690] .concat [2770, 2791] .concat [4000..4030] .concat [4050..4990] hilleroed: [2700..2765] .concat [2980..3670] .concat [4040] kgslyngby: [2800..2970]
While this goes:
offices: ringsted: [0..2690].concat [2770, 2791].concat [4000..4030].concat [4050..4990] hilleroed: [2700..2765].concat [2980..3670].concat [4040] kgslyngby: [2800..2970]
If you really want to keep line breaks, add a few characters:
offices: ringsted: ([0..2690] .concat [2770..2791] .concat [4000..4030] .concat [4050..4990]) hilleroed: ([2700..2765] .concat [2980..3670] .concat [4040]) kgslyngby: [2800..2970]
It seems like the compiler is confused about where your object definitions end up. If you leave without a password, you will get this js:
// without parens var _i, _j, _k, _l, _results, _results1, _results2, _results3; ({ offices: { ringsted: (function() { _results3 = []; for (_l = 0; _l <= 233; _l++){ _results3.push(_l); } return _results3; }).apply(this) }.concat((function() { _results2 = []; for (_k = 2770; _k <= 2791; _k++){ _results2.push(_k); } return _results2; }).apply(this)).concat((function() { _results1 = []; for (_j = 4000; _j <= 4030; _j++){ _results1.push(_j); } return _results1; }).apply(this)).concat((function() { _results = []; for (_i = 4050; _i <= 4990; _i++){ _results.push(_i); } return _results; }).apply(this)) });
What when launched in node repl returns:
TypeError: Object #<Object> has no method 'concat'
Which makes sense based on js but doesn't make sense based on coffee. This may be worth the problem .
TL; DR : use parens when you want function return values ββto be assigned to an object field.
source share