なぜこのようにコンパイルするのですか?
this.setAlunos = function(alunos){
if(this.getTurma() > 0){
this.alunos = alunos.split(",");
}
else{
throw "you must set a 'turma' before inserting students on it";
}
};
そして、これはしませんか?
this.setAlunos = function(alunos){
this.getTurma() > 0 ? this.alunos = alunos.split(",") : throw "you must set a 'turma' before inserting students on it";
};