changeset 8dc3f6b405d7 in sao:4.6
details: https://hg.tryton.org/sao?cmd=changeset;node=8dc3f6b405d7
description:
Use typeof instead of instanceof to test for string
All strings are not instance of String.
issue8706
(grafted from 041357d0c1be668a3f7dc66b9a6f057f237a07f8)
diffstat:
src/common.js | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diffs (12 lines):
diff -r 76c6d13e9b48 -r 8dc3f6b405d7 src/common.js
--- a/src/common.js Fri Oct 11 11:40:42 2019 +0200
+++ b/src/common.js Fri Oct 11 12:06:14 2019 +0200
@@ -1679,7 +1679,7 @@
}
if (~['integer', 'float', 'numeric', 'datetime', 'date',
'time'].indexOf(field.type)) {
- if ((value instanceof String) && value.contains('..'))
{
+ if ((typeof value == 'string') &&
value.contains('..')) {
var values = value.split('..', 2);
var lvalue = this.convert_value(field, values[0]);
var rvalue = this.convert_value(field, values[1]);