From 1aab1b716e1f2a4a58dd2bf3ca319df3761b151b Mon Sep 17 00:00:00 2001 From: Andreas Stöckel Date: Sat, 20 Dec 2014 18:28:07 +0100 Subject: additional comment in Variant.cpp --- src/core/common/Variant.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/core/common/Variant.cpp') diff --git a/src/core/common/Variant.cpp b/src/core/common/Variant.cpp index 78fdfce..dac3655 100644 --- a/src/core/common/Variant.cpp +++ b/src/core/common/Variant.cpp @@ -106,6 +106,7 @@ Variant::intType Variant::toInt() const case Type::STRING: return 0; // TODO: Parse string as int case Type::ARRAY: { + // JavaScript behaviour when converting arrays to ints const arrayType &a = asArray(); return (a.size() == 1) ? a[0].toInt() : 0; } @@ -129,6 +130,7 @@ Variant::doubleType Variant::toDouble() const case Type::STRING: return 0.0; // TODO: Parse string as double case Type::ARRAY: { + // JavaScript behaviour when converting array to doubles const arrayType &a = asArray(); return (a.size() == 1) ? a[0].toDouble() : 0; } -- cgit v1.2.3