Handle 0 ints as strings in split by block

dev
Michael Ball 2016-07-19 03:09:29 -07:00
rodzic 78a627df27
commit c643a09615
1 zmienionych plików z 3 dodań i 3 usunięć

Wyświetl plik

@ -2441,10 +2441,10 @@ Process.prototype.reportTextSplit = function (string, delimiter) {
if (!contains(types, delType)) {
throw new Error('expecting a text delimiter instead of a ' + delType);
}
str = (string || '').toString();
str = isNil(string) ? '' string.toString();
switch (this.inputOption(delimiter)) {
case 'line':
// Unicode Compliant Line Splitting (Platform independent)
// Unicode compliant line splitting (platform independent)
// http://www.unicode.org/reports/tr18/#Line_Boundaries
del = /\r\n|[\n\v\f\r\x85\u2028\u2029]/;
break;
@ -2462,7 +2462,7 @@ Process.prototype.reportTextSplit = function (string, delimiter) {
del = '';
break;
default:
del = (delimiter || '').toString();
del = isNil(delimiter) ? '' : delimiter.toString();
}
return new List(str.split(del));
};