From 509a59353c2e4a66e4ef6b18160c04e0e6929420 Mon Sep 17 00:00:00 2001 From: artemp Date: Mon, 19 May 2014 12:36:44 +0100 Subject: [PATCH] be more consistent with JS logic when evaluating operators on unicode_strings 'abc' + 'de' -> 'abcde' 'abc' ( - | * | / | % ) 'de' -> value_null --- include/mapnik/value.hpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/include/mapnik/value.hpp b/include/mapnik/value.hpp index 087cc710e..4d0a5ad4b 100644 --- a/include/mapnik/value.hpp +++ b/include/mapnik/value.hpp @@ -425,7 +425,7 @@ struct sub : public boost::static_visitor value_type operator() (value_unicode_string const& lhs, value_unicode_string const& ) const { - return lhs; + return value_type(); } value_type operator() (value_double lhs, value_integer rhs) const @@ -462,7 +462,7 @@ struct mult : public boost::static_visitor value_type operator() (value_unicode_string const& lhs, value_unicode_string const& ) const { - return lhs; + return value_type(); } value_type operator() (value_double lhs, value_integer rhs) const @@ -510,7 +510,7 @@ struct div: public boost::static_visitor value_type operator() (value_unicode_string const& lhs, value_unicode_string const&) const { - return lhs; + return value_type(); } value_type operator() (value_double lhs, value_integer rhs) const @@ -545,7 +545,7 @@ struct mod: public boost::static_visitor value_type operator() (value_unicode_string const& lhs, value_unicode_string const&) const { - return lhs; + return value_type(); } value_type operator() (value_bool lhs, @@ -595,8 +595,7 @@ struct negate : public boost::static_visitor value_type operator() (value_unicode_string const& ustr) const { - value_unicode_string inplace(ustr); - return inplace.reverse(); + return value_type(); } };