Skip to content

Instantly share code, notes, and snippets.

@tim-evans
Created April 12, 2011 03:28
Show Gist options
  • Save tim-evans/914859 to your computer and use it in GitHub Desktop.
Save tim-evans/914859 to your computer and use it in GitHub Desktop.
Bug with 'firstCurrentState'
var MyApp = window.MyApp = SC.Object.create();
MyApp.mixin(SC.StatechartManager, {
trace: YES,
initialState: 'stateA',
stateA: SC.State.design({
substatesAreConcurrent: YES,
stateC: SC.State.design({
initialSubstate: 'stateD',
stateD: SC.State.design()
})
}),
stateB: SC.State.design()
});
MyApp.getPath('firstCurrentState.name');
// -> 'stateD'
MyApp.gotoState('stateB');
MyApp.getPath('firstCurrentState.name');
// -> 'stateD' (should be 'stateB')
MyApp.get('currentStates').getEach('name');
// -> ['stateB']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment