From 975ae6706b4ac868425193cf25bcbbb268051b5d Mon Sep 17 00:00:00 2001 From: Sunil Shetye Date: Wed, 18 Jul 2018 16:28:24 +0530 Subject: handle empty array in comparison --- js/Misc/CBLOCK.js | 2 +- js/Misc/CBLOCK4.js | 2 +- js/Misc/DEBUG.js | 2 +- js/Misc/DSUPER.js | 2 +- js/Misc/MBLOCK.js | 2 +- js/Misc/MPBLOCK.js | 2 +- js/Misc/generic_block.js | 2 +- js/Misc/generic_block2.js | 2 +- js/Misc/generic_block3.js | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) (limited to 'js/Misc') diff --git a/js/Misc/CBLOCK.js b/js/Misc/CBLOCK.js index 91cec33f..1d9bfc55 100644 --- a/js/Misc/CBLOCK.js +++ b/js/Misc/CBLOCK.js @@ -96,7 +96,7 @@ function CBLOCK() { } else { var funtyp = 2004; } - if ([[this.ci],[this.co]]!=[]) { + if ([[this.ci],[this.co]].length!=0) { if (max([[this.ci],[this.co]])>1) { message("vector event links not supported"); throw "user error"; diff --git a/js/Misc/CBLOCK4.js b/js/Misc/CBLOCK4.js index 247ef9b2..128533b0 100644 --- a/js/Misc/CBLOCK4.js +++ b/js/Misc/CBLOCK4.js @@ -87,7 +87,7 @@ function CBLOCK4() { } else { var funtyp = 2004; } - if ([[this.ci],[this.co]]!=[]) { + if ([[this.ci],[this.co]].length!=0) { if (max([[this.ci],[this.co]])>1) { message("vector event links not supported"); throw "user error"; diff --git a/js/Misc/DEBUG.js b/js/Misc/DEBUG.js index e16c4c3d..3be54709 100644 --- a/js/Misc/DEBUG.js +++ b/js/Misc/DEBUG.js @@ -22,7 +22,7 @@ function DEBUG() { while (1==1) { var tmpvar0 = dialog([["Enter scilab instructions for debugging."],[" Inputs are block and flag, output is block"]],textmp); var txt = tmpvar0[0]; - if (txt!=[]) { + if (txt.length!=0) { var tt = ["block=debug_scicos(block,flag)"]; if (execstr("deff(tt,txt)","errcatch")==0) { var warnMode = warning("query"); diff --git a/js/Misc/DSUPER.js b/js/Misc/DSUPER.js index aefaa9fa..96fc3fc9 100644 --- a/js/Misc/DSUPER.js +++ b/js/Misc/DSUPER.js @@ -19,7 +19,7 @@ function DSUPER() { var exprs0 = this.graphics.exprs[2-1][1-1]; var btitre = this.graphics.exprs[2-1][2-1][1-1]; var bitems = this.graphics.exprs[2-1][2-1].slice(2-1,$); - if (exprs0==[]) { + if (exprs0.length==0) { return; } var tmpvar0 = script2var(context,PREVAR_scicos_context); diff --git a/js/Misc/MBLOCK.js b/js/Misc/MBLOCK.js index 456a536a..06504708 100644 --- a/js/Misc/MBLOCK.js +++ b/js/Misc/MBLOCK.js @@ -233,7 +233,7 @@ function MBLOCK() { } } if (ok) { - if (extF==".mo"&&fileinfo(this.funam)!=[]) { + if (extF==".mo"&&fileinfo(this.funam).length!=0) { var tt = mgetl(this.funam); } else { var tt = this.exprs.funtxt; diff --git a/js/Misc/MPBLOCK.js b/js/Misc/MPBLOCK.js index 97a9a895..f20e0135 100644 --- a/js/Misc/MPBLOCK.js +++ b/js/Misc/MPBLOCK.js @@ -234,7 +234,7 @@ function MPBLOCK() { mo.model = nameF; mo.inputs = this.in1; mo.outputs = this.out; - if (pprop!=[]) { + if (pprop.length!=0) { if (max(pprop)>0) { mo.parameters = list(transpose(param),paramv,transpose(pprop)); } else { diff --git a/js/Misc/generic_block.js b/js/Misc/generic_block.js index cfe26859..12e9bfcf 100644 --- a/js/Misc/generic_block.js +++ b/js/Misc/generic_block.js @@ -82,7 +82,7 @@ function generic_block() { throw "user error"; var ok = false; } - if ([[this.ci],[this.co]]!=[]) { + if ([[this.ci],[this.co]].length!=0) { if (max([[this.ci],[this.co]])>1) { message("vector event links not supported"); throw "user error"; diff --git a/js/Misc/generic_block2.js b/js/Misc/generic_block2.js index dd85d849..91a33aab 100644 --- a/js/Misc/generic_block2.js +++ b/js/Misc/generic_block2.js @@ -86,7 +86,7 @@ function generic_block2() { throw "user error"; var ok = false; } - if ([[this.ci],[this.co]]!=[]) { + if ([[this.ci],[this.co]].length!=0) { if (max([[this.ci],[this.co]])>1) { message("vector event links not supported"); throw "user error"; diff --git a/js/Misc/generic_block3.js b/js/Misc/generic_block3.js index 4c5814ec..68ea054a 100644 --- a/js/Misc/generic_block3.js +++ b/js/Misc/generic_block3.js @@ -88,7 +88,7 @@ function generic_block3() { throw "user error"; var ok = false; } - if ([[this.ci],[this.co]]!=[]) { + if ([[this.ci],[this.co]].length!=0) { if (max([[this.ci],[this.co]])>1) { message("vector event links not supported"); throw "user error"; -- cgit