Created
May 6, 2011 17:59
-
-
Save textgoeshere/959446 to your computer and use it in GitHub Desktop.
coffeescript compilation order weirdness
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class window.SpreadsController extends Backbone.Controller | |
routes: | |
"/sports":"sports" | |
"/markets":"markets" | |
constructor: -> | |
super | |
window.sport_manager = new SportManagerView() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ubuntu 10.10 | |
// node v0.5.0-pre | |
// coffeescript 1.1.0 | |
(function() { | |
var __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) { | |
for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } | |
function ctor() { this.constructor = child; } | |
ctor.prototype = parent.prototype; | |
child.prototype = new ctor; | |
child.__super__ = parent.prototype; | |
return child; | |
}; | |
window.SpreadsController = (function() { | |
SpreadsController.prototype.routes = { | |
"/sports": "sports", | |
"/markets": "markets" | |
}; | |
__extends(SpreadsController, Backbone.Controller); ////////////////// __extends AFTER routes, BROKEN | |
function SpreadsController() { | |
SpreadsController.__super__.constructor.apply(this, arguments); | |
window.market_manager = new MarketManagerView(); | |
window.sport_manager = new SportManagerView(); | |
} | |
return SpreadsController; | |
})(); | |
}).call(this); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ubuntu 10.10 | |
// node v0.5.0-pre | |
// coffeescript 1.1.0 | |
(function() { | |
var __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) { | |
for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } | |
function ctor() { this.constructor = child; } | |
ctor.prototype = parent.prototype; | |
child.prototype = new ctor; | |
child.__super__ = parent.prototype; | |
return child; | |
}; | |
window.SpreadsController = (function() { | |
__extends(SpreadsController, Backbone.Controller); ///////////////// DIFFERENT ORDER, WORKING ROUTES | |
SpreadsController.prototype.routes = { | |
"/sports": "sports", | |
"/markets": "markets" | |
}; | |
function SpreadsController() { | |
SpreadsController.__super__.constructor.apply(this, arguments); | |
window.market_manager = new MarketManagerView(); | |
window.sport_manager = new SportManagerView(); | |
} | |
return SpreadsController; | |
})(); | |
}).call(this); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Brilliant, cheers Trevor, thanks for taking the time to clear that up for me!