You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was looking at how the mixin code works. In the test case paraphrased below, If I wanted to implement a mixin where I called the Sub-class's thing before the implemented thing, how do you do that? Calling this.thing directly will just give an infinite loop.
test('should implement a wrapper method for mixins', 5, function () {
...
inst.implement({
thing: function (n) {
console.log('Implement#thing()');
ok(true, 'called implementer');
//this.supr(); would be called by subclass' thing, if we could
this.thing(); // WARNING infinite loop. want to call the Sub's thing, not the base thing
// this.myself(); would be a good expression for that
this.boooshr();
},
boooshr: function () {
console.log('Implement#boooshr()');
ok(true, 'called boooshr');
}
}).thing();
The text was updated successfully, but these errors were encountered:
I was looking at how the mixin code works. In the test case paraphrased below, If I wanted to implement a mixin where I called the Sub-class's thing before the implemented thing, how do you do that? Calling this.thing directly will just give an infinite loop.
test('should implement a wrapper method for mixins', 5, function () {
...
inst.implement({
thing: function (n) {
console.log('Implement#thing()');
ok(true, 'called implementer');
//this.supr(); would be called by subclass' thing, if we could
this.thing(); // WARNING infinite loop. want to call the Sub's thing, not the base thing
// this.myself(); would be a good expression for that
this.boooshr();
},
boooshr: function () {
console.log('Implement#boooshr()');
ok(true, 'called boooshr');
}
}).thing();
The text was updated successfully, but these errors were encountered: