mirror of
https://github.com/jashkenas/coffeescript.git
synced 2022-11-09 12:23:24 -05:00
Adding break to default switch clauses to pass lint.
This commit is contained in:
parent
6a9c4380f3
commit
12b217c8ec
3 changed files with 4 additions and 2 deletions
|
@ -135,6 +135,7 @@
|
|||
break;
|
||||
default:
|
||||
return 0;
|
||||
break;
|
||||
}
|
||||
this.line += count(string, '\n');
|
||||
return string.length;
|
||||
|
|
|
@ -1596,6 +1596,7 @@
|
|||
return '--';
|
||||
default:
|
||||
return pvar < 0 ? ' -= ' + pvar.slice(1) : ' += ' + pvar;
|
||||
break;
|
||||
}
|
||||
})();
|
||||
}
|
||||
|
@ -1677,7 +1678,7 @@
|
|||
}
|
||||
}
|
||||
if (this.otherwise) {
|
||||
code += idt1 + ("default:\n" + (this.otherwise.compile(o, LEVEL_TOP)) + "\n");
|
||||
code += idt1 + ("default:\n" + (this.otherwise.compile(o, LEVEL_TOP)) + "\n" + idt2 + "break;\n");
|
||||
}
|
||||
return code + this.tab + '}';
|
||||
};
|
||||
|
|
|
@ -1370,7 +1370,7 @@ exports.Switch = class Switch extends Base
|
|||
for expr in block.expressions by -1 when expr not instanceof Comment
|
||||
code += idt2 + 'break;\n' unless expr instanceof Return
|
||||
break
|
||||
code += idt1 + "default:\n#{ @otherwise.compile o, LEVEL_TOP }\n" if @otherwise
|
||||
code += idt1 + "default:\n#{ @otherwise.compile o, LEVEL_TOP }\n#{idt2}break;\n" if @otherwise
|
||||
code + @tab + '}'
|
||||
|
||||
#### If
|
||||
|
|
Loading…
Add table
Reference in a new issue