class Foo
{
// Switch based on 'input'
function doSomethingNext(input) {
var choices = {
1=>:operation1,
2=>:operation2,
3=>:operation3
};
var choice = choice[input];
if( choice != null ) {
self.method(choices[input]).invoke();
} else {
operationDefault();
}
}
var choice = choice[input];
should read
var choice = choices[input];