make getNewLineCharacter errorproof
This commit is contained in:
parent
27dd31cf62
commit
40563347e9
1 changed files with 6 additions and 6 deletions
|
|
@ -140,16 +140,16 @@ var Document = function(text) {
|
||||||
*
|
*
|
||||||
**/
|
**/
|
||||||
this.getNewLineCharacter = function() {
|
this.getNewLineCharacter = function() {
|
||||||
switch (this.$newLineMode) {
|
switch (this.$newLineMode) {
|
||||||
case "windows":
|
case "windows":
|
||||||
return "\r\n";
|
return "\r\n";
|
||||||
|
|
||||||
case "unix":
|
case "unix":
|
||||||
return "\n";
|
return "\n";
|
||||||
|
|
||||||
case "auto":
|
default:
|
||||||
return this.$autoNewLine;
|
return this.$autoNewLine;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
this.$autoNewLine = "\n";
|
this.$autoNewLine = "\n";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue