Skip to content

Commit 41dfb9a

Browse files
author
Lauren McCarthy
committed
cherry picking changes from #1943 for #1937
1 parent 1b28352 commit 41dfb9a

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/io/files.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -466,17 +466,17 @@ p5.prototype.loadTable = function (path) {
466466
var sep = ',';
467467
var separatorSet = false;
468468
var decrementPreload = p5._getDecrementPreload.apply(this, arguments);
469-
470-
if(ext === 'tsv'){ //Only need to check if extension is tsv because csv is default
471-
sep = '\t';
469+
470+
if(ext === 'tsv'){ //Only need to check extension is tsv because csv is default
471+
sep = '\t';
472472
}
473473

474474
for (var i = 1; i < arguments.length; i++) {
475475
if ((typeof (arguments[i]) === 'function') &&
476476
(arguments[i] !== decrementPreload)) {
477477
if(!callback){
478478
callback = arguments[i];
479-
}else{
479+
} else {
480480
errorCallback = arguments[i];
481481
}
482482
} else if (typeof (arguments[i]) === 'string') {
@@ -858,7 +858,7 @@ p5.prototype.httpDo = function () {
858858
type = 'text';
859859
}
860860
}
861-
}else{
861+
} else {
862862
// Provided with arguments
863863
var path = arguments[0];
864864
var method = 'GET';
@@ -874,6 +874,8 @@ p5.prototype.httpDo = function () {
874874
} else {
875875
data = a;
876876
}
877+
} else if (typeof a === 'number') {
878+
data = a.toString();
877879
} else if (typeof a === 'object') {
878880
if(a.hasOwnProperty('jsonpCallback')){
879881
for (var attr in a) {

0 commit comments

Comments
 (0)