mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-07-20 02:48:12 +08:00
Change IsDouble method: return true if value has integer type
This commit is contained in:
@ -65,7 +65,7 @@ namespace NSJSON
|
||||
|
||||
bool CPrimitive::isDouble() const
|
||||
{
|
||||
return m_type == ptDouble;
|
||||
return m_type == ptDouble || m_type == ptInteger;
|
||||
}
|
||||
|
||||
bool CPrimitive::isStringA() const
|
||||
|
||||
@ -247,7 +247,8 @@ TEST_F(CJSONTest, bool_)
|
||||
TEST_F(CJSONTest, int_)
|
||||
{
|
||||
CValue val = 42;
|
||||
EXPECT_FALSE(val.IsDouble());
|
||||
EXPECT_TRUE(val.IsDouble());
|
||||
EXPECT_TRUE(val.IsInt());
|
||||
JSSmart<CJSValue> jsVal = CJSContext::createInt(42);
|
||||
EXPECT_TRUE(compare(val, jsVal));
|
||||
val = 100;
|
||||
|
||||
Reference in New Issue
Block a user