changeset 5b1d25d2ef5b in sao:5.2
details: https://hg.tryton.org/sao?cmd=changeset;node=5b1d25d2ef5b
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 c96290ba9452 -r 5b1d25d2ef5b 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