Re:Show HN: DubJS: A New Way to Build Web Apps
by wiradikusuma on Tuesday September 11, 2012 @08:26AM
(#4504998)
If it's possible to change the title, please prepend with Show HN. Some people (including me) like to vote just for the sake of it. There was a discussion here to vote up Show HNs to support those who ship (can't remember the link though).
Re:Show HN: DubJS: A New Way to Build Web Apps
by keen on Tuesday September 11, 2012 @08:27AM
(#4505005)
Done. Thank you.
Re:Show HN: DubJS: A New Way to Build Web Apps
by timruffles on Tuesday September 11, 2012 @09:52AM
(#4505373)
I can't see how the compiled code for Type is supposed to work?
If you deference a JS function from an object, you lose the context of `this`. So in
Ruby.prototype.cut = function () {
this.shape(); this.polish();
};
var old = Ruby.prototype.cut;
Ruby.prototype.cut = function () {
old(); this.engrave();
};
`Ruby.prototype.cut` will be called with `window` as `this`, so `this.shape` will be undefined. Use `old.call(this)` to get the behaviour you want.
This is my side-project that I've been working on for a while. It would mean a great deal if you'd give me some feedback.