Commit 2ca12d73 authored by Alexander.Trofimov's avatar Alexander.Trofimov

fix bug 35342

if convert to boolean Area and Area3D return error value
parent 567154a7
...@@ -170,17 +170,15 @@ ...@@ -170,17 +170,15 @@
arg2 = arg2.getElement(0); arg2 = arg2.getElement(0);
} }
arg0 = arg0.tocBool();
if (arg0 instanceof cError) { if (arg0 instanceof cError) {
return this.value = arg0; return this.value = arg0;
} else if (arg0 instanceof cString) {
return this.value = new cError(cErrorType.wrong_value_type);
} else if (arg0.value) {
return this.value = arg1 ? arg1 instanceof cEmpty ? new cNumber(0) : arg1 : new cBool(true);
} else { } else {
arg0 = arg0.tocBool(); return this.value = arg2 ? arg2 instanceof cEmpty ? new cNumber(0) : arg2 : new cBool(false);
if (arg0 instanceof cString) {
return this.value = new cError(cErrorType.wrong_value_type);
} else if (arg0.value) {
return this.value = arg1 ? arg1 instanceof cEmpty ? new cNumber(0) : arg1 : new cBool(true);
} else {
return this.value = arg2 ? arg2 instanceof cEmpty ? new cNumber(0) : arg2 : new cBool(false);
}
} }
}; };
......
...@@ -1012,7 +1012,7 @@ parserHelp.setDigitSeparator(AscCommon.g_oDefaultCultureInfo.NumberDecimalSepara ...@@ -1012,7 +1012,7 @@ parserHelp.setDigitSeparator(AscCommon.g_oDefaultCultureInfo.NumberDecimalSepara
return this.getValue()[0].tocString(); return this.getValue()[0].tocString();
}; };
cArea.prototype.tocBool = function () { cArea.prototype.tocBool = function () {
return this.getValue()[0].tocBool(); return new cError(cErrorType.wrong_value_type);
}; };
cArea.prototype.toString = function () { cArea.prototype.toString = function () {
var _c; var _c;
...@@ -1256,7 +1256,7 @@ parserHelp.setDigitSeparator(AscCommon.g_oDefaultCultureInfo.NumberDecimalSepara ...@@ -1256,7 +1256,7 @@ parserHelp.setDigitSeparator(AscCommon.g_oDefaultCultureInfo.NumberDecimalSepara
return this.getValue()[0].tocString(); return this.getValue()[0].tocString();
}; };
cArea3D.prototype.tocBool = function () { cArea3D.prototype.tocBool = function () {
return this.getValue()[0].tocBool(); return new cError(cErrorType.wrong_value_type);
}; };
cArea3D.prototype.tocArea = function () { cArea3D.prototype.tocArea = function () {
var wsR = this.wsRange(); var wsR = this.wsRange();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment