10#include <private/qv4mm_p.h>
12#include <wtf/MathExtras.h>
27 if (!std::isfinite(
number))
30 double d = ::floor(::fabs(
number));
39 return (
unsigned short)
number;
44 if (
val.isManagedOrUndefined()) {
48 if (
b->internalClass->vtable->isString)
54 double d =
val.doubleValue();
55 return d && !std::isnan(
d);
62 return std::numeric_limits<double>::quiet_NaN();
73 Scope scope(
val.objectValue()->engine());
91 switch (
value->type()) {
93 Q_ASSERT(!
"empty Value encountered");
94 Q_UNREACHABLE_RETURN(
QString());
100 if (
value->booleanValue())
105 Q_UNREACHABLE_RETURN(
QString());
118 Q_UNREACHABLE_RETURN(
QString());
126 return s->toQString();
128 return s->descriptiveString();
133 bool caughtException =
false;
137 caughtException =
true;
143 if (caughtException) {
162 return s->toQString();
165 static_cast<const Managed *
>(
this)->
engine()->throwTypeError();
183 return s->toQString();
187 static_cast<const Managed *
>(
this)->
engine()->throwTypeError();
214 return s->toPropertyKey();
218 if (!
v->isStringOrSymbol())
223 return s->toPropertyKey();
232 return s->isEqualTo(os);
235 : (
other.doubleValue() == 0 && !std::signbit(
other.doubleValue()));
250 return s->isEqualTo(os);
296 return s->toUInt(
ok);
\macro QT_RESTRICTED_CAST_FROM_ASCII
\qmltype Particle \inqmlmodule QtQuick.Particles
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLboolean GLboolean GLboolean b
GLsizei const GLfloat * v
[13]
GLenum GLuint GLenum GLsizei length
#define QStringLiteral(str)
static QString primitiveToQString(const Value *value)
ReturnedValue catchException(StackTrace *trace=nullptr)
ReturnedValue throwTypeError()
ExecutionEngine * engine() const
static PropertyKey invalid()
static PropertyKey fromArrayIndex(uint idx)
static Heap::Object * convertToObject(ExecutionEngine *engine, const Value &value)
static void numberToString(QString *result, double num, int radix=10)
static ReturnedValue toPrimitive(const Value &value, TypeHint typeHint)
static Heap::String * convertToString(ExecutionEngine *engine, Value value, TypeHint=STRING_HINT)
static double stringToNumber(const QString &s)
bool hasException() const
QV4_NEARLY_ALWAYS_INLINE double doubleValue() const
bool integerCompatible() const
QV4_NEARLY_ALWAYS_INLINE constexpr int int_32() const
bool isStringOrSymbol() const
static bool toBooleanImpl(Value val)
Heap::String * toString(ExecutionEngine *e) const
QV4::PropertyKey toPropertyKey(ExecutionEngine *e) const
unsigned int toUInt32() const
QML_NEARLY_ALWAYS_INLINE String * stringValue() const
bool sameValueZero(Value other) const
uint asArrayLength(bool *ok) const
QML_NEARLY_ALWAYS_INLINE Object * objectValue() const
QString toQString() const
double toNumberImpl() const
bool sameValue(Value other) const
QML_NEARLY_ALWAYS_INLINE Symbol * symbolValue() const
QString toQStringNoThrow() const
Heap::Object * toObject(ExecutionEngine *e) const