changeset 68d272044fa1 in sao:4.8
details: https://hg.tryton.org/sao?cmd=changeset;node=68d272044fa1
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 bacea42ac69a -r 68d272044fa1 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
@@ -1693,7 +1693,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]);

Reply via email to