Qt 4.8
Functions
qscriptobjectsnapshot.cpp File Reference
#include "qscriptobjectsnapshot_p.h"
#include <QtCore/qmap.h>
#include <QtCore/qset.h>
#include <QtCore/qvector.h>
#include <QtCore/qnumeric.h>
#include <QtScript/qscriptvalueiterator.h>

Go to the source code of this file.

Functions

static bool _q_equal (const QScriptValue &v1, const QScriptValue &v2)
 

Function Documentation

◆ _q_equal()

static bool _q_equal ( const QScriptValue v1,
const QScriptValue v2 
)
static

Definition at line 60 of file qscriptobjectsnapshot.cpp.

Referenced by QScriptObjectSnapshot::capture().

61 {
62  if (v1.strictlyEquals(v2))
63  return true;
64  if (v1.isNumber() && v2.isNumber() && qIsNaN(v1.toNumber()) && qIsNaN(v2.toNumber()))
65  return true;
66  return false;
67 }
Q_CORE_EXPORT bool qIsNaN(double d)
Returns true if the double {d} is not a number (NaN).
Definition: qnumeric.cpp:55
qsreal toNumber() const
Returns the number value of this QScriptValue, as defined in ECMA-262 section 9.3, "ToNumber".
bool isNumber() const
Returns true if this QScriptValue is of the primitive type Number; otherwise returns false...
bool strictlyEquals(const QScriptValue &other) const
Returns true if this QScriptValue is equal to other using strict comparison (no conversion), otherwise returns false.