Last active
April 8, 2016 08:16
-
-
Save dandehavilland/499dccb94945cbda7e8809384f4538b8 to your computer and use it in GitHub Desktop.
RSVP _super bug
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
import Ember from 'ember'; | |
import MixinOne from '../mixins/one'; | |
import MixinTwo from '../mixins/two'; | |
const { | |
on, | |
RSVP | |
} = Ember; | |
export default Ember.Controller.extend(MixinOne, MixinTwo, { | |
name: "RSVP _super bug", | |
theMethod() { | |
console.log('controller'); | |
RSVP.resolve().then(() => { | |
// this._super === ROOT() | |
console.log(this._super); | |
this._super.apply(this, ['with promise']); | |
}); | |
// this._super === superWrapper() | |
console.log(this._super); | |
this._super.apply(this, ['without promise']); | |
}, | |
callTheMethod: on('init', function() { | |
this.theMethod(); | |
}) | |
}); |
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
import Ember from 'ember'; | |
export default Ember.Mixin.create({ | |
theMethod() { | |
console.log('mixin-one', arguments); | |
return this._super.apply(this, arguments); | |
} | |
}); |
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
import Ember from 'ember'; | |
export default Ember.Mixin.create({ | |
theMethod() { | |
console.log('mixin-two', arguments); | |
return this._super.apply(this, arguments); | |
} | |
}); |
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
{ | |
"version": "0.7.2", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js", | |
"ember": "https://cdnjs.cloudflare.com/ajax/libs/ember.js/2.4.4/ember.debug.js", | |
"ember-data": "https://cdnjs.cloudflare.com/ajax/libs/ember-data.js/2.4.3/ember-data.js", | |
"ember-template-compiler": "https://cdnjs.cloudflare.com/ajax/libs/ember.js/2.4.4/ember-template-compiler.js" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment