6#include <private/qv4alloca_p.h>
7#include <private/qv4codegen_p.h>
8#include <private/qv4context_p.h>
9#include <private/qv4function_p.h>
10#include <private/qv4mm_p.h>
11#include <private/qv4scopedvalue_p.h>
12#include <private/qv4script_p.h>
13#include <private/qv4stackframe_p.h>
14#include <private/qv4string_p.h>
15#include <private/qv4value_p.h>
17#include <wtf/MathExtras.h>
19#include <QtCore/private/qlocale_tools_p.h>
20#include <QtCore/private/qtools_p.h>
22#include <QtCore/qdebug.h>
23#include <QtCore/qstring.h>
39 if ( (uc > 0x60 && uc < 0x7B)
40 || (uc > 0x3F && uc < 0x5B)
41 || (uc > 0x2C && uc < 0x3A)
71 if ((
c == u
'%') && (
i + 1 <
length)) {
73 if ((
a == u
'u') && (
i + 4 <
length)) {
74 int d3 = fromHex(
input.at(
i+1).unicode());
75 int d2 = fromHex(
input.at(
i+2).unicode());
76 int d1 = fromHex(
input.at(
i+3).unicode());
77 int d0 = fromHex(
input.at(
i+4).unicode());
78 if ((d3 != -1) && (
d2 != -1) && (
d1 != -1) && (d0 != -1)) {
86 int d1 = fromHex(
a.unicode());
87 int d0 = fromHex(
input.at(
i+1).unicode());
88 if ((
d1 != -1) && (d0 != -1)) {
121 if ((
c.unicode() >=
'a' &&
c.unicode() <=
'z') ||
122 (
c.unicode() >=
'A' &&
c.unicode() <=
'Z') ||
123 (
c.unicode() >=
'0' &&
c.unicode() <=
'9')) {
126 const char *
r = unescapedSet;
128 if (*
r ==
c.unicode()) {
136 uint uc =
c.unicode();
137 if ((uc >= 0xDC00) && (uc <= 0xDFFF)) {
141 if (!((uc < 0xD800) || (uc > 0xDBFF))) {
148 if ((uc2 < 0xDC00) || (uc2 > 0xDFFF)) {
152 uc = ((uc - 0xD800) * 0x400) + (uc2 - 0xDC00) + 0x10000;
201 int d1 = fromHex(
input.at(
i+1).unicode());
202 int d0 = fromHex(
input.at(
i+2).unicode());
203 if ((
d1 == -1) || (d0 == -1))
206 int b = (
d1 << 4) | d0;
212 if ((
b & 0xe0) == 0xc0) {
216 }
else if ((
b & 0xf0) == 0xe0) {
220 }
else if ((
b & 0xf8) == 0xf0) {
231 for (
int j = 0;
j < need; ++
j) {
233 if (
input.at(
i) != percent)
236 d1 = fromHex(
input.at(
i+1).unicode());
237 d0 = fromHex(
input.at(
i+2).unicode());
238 if ((
d1 == -1) || (d0 == -1))
242 if ((
b & 0xC0) != 0x80)
246 uc = (uc << 6) + (
b & 0x3f);
258 ushort h =
ushort((((uc - 0x10000) >> 10) & 0x3FF) + 0xD800);
296 Heap::FunctionObject::init(
scope,
s.engine->id_eval());
338 ScopedValue thisObject(
scope, directCall ?
scope.engine->currentStackFrame->thisObject() :
scope.engine->globalObject->asReturnedValue());
351 return static_cast<const EvalFunction *
>(
f)->evalCall(thisObject, argv, argc,
false);
359 if (
c >=
'0' &&
c <=
'9')
361 else if (
c >=
'A' &&
c <=
'Z')
363 else if (
c >=
'a' &&
c <=
'z')
377 int R = radix->isUndefined() ? 0 : radix->toInt32();
393 bool stripPrefix =
true;
414 bool overflow =
false;
416 unsigned overflow_digit_count = 0;
426 if (overflow_digit_count == 0) {
430 ++overflow_digit_count;
444 double result = (double) v_overflow * pow(
static_cast<double>(
R),
static_cast<double>(overflow_digit_count));
460 QString trimmed = inputString->toQString().trimmed();
471 const char *
end =
nullptr;
486 if (argv[0].integerCompatible())
500 if (argv[0].integerCompatible())
bool startsWith(QByteArrayView other) const noexcept
constexpr qsizetype size() const noexcept
constexpr const_pointer constData() const noexcept
const char * constData() const noexcept
Returns a pointer to the const data stored in the byte array.
static constexpr bool requiresSurrogates(char32_t ucs4) noexcept
Returns true if the UCS-4-encoded character specified by ucs4 can be split into the high and low part...
constexpr char16_t unicode() const noexcept
Returns the numeric Unicode value of the QChar.
constexpr QStringView mid(qsizetype pos, qsizetype n=-1) const noexcept
Returns the substring of length length starting at position start in this object.
\macro QT_RESTRICTED_CAST_FROM_ASCII
QString trimmed() const &
\qmltype Particle \inqmlmodule QtQuick.Particles
ReturnedValue checkedResult(QV4::ExecutionEngine *v4, ReturnedValue result)
constexpr char toHexUpper(char32_t value) noexcept
constexpr int fromHex(char32_t c) noexcept
DBusConnection const char DBusError * error
GLboolean GLboolean GLboolean b
GLsizei const GLfloat * v
[13]
GLboolean GLboolean GLboolean GLboolean a
[7]
GLenum GLuint GLenum GLsizei length
GLfloat GLfloat GLfloat GLfloat h
GLenum GLenum GLenum input
static bool isStrict(const QmlIR::Document *doc)
QtPrivate::QRegularExpressionMatchIteratorRangeBasedForIterator begin(const QRegularExpressionMatchIterator &iterator)
#define QStringLiteral(str)
static void addEscapeSequence(QString &output, uchar ch)
static const char uriUnescapedReserved[]
static QString unescape(const QString &input)
static int toInt(const QChar &qc, int R)
static const char uriReserved[]
static const char uriUnescaped[]
static QString escape(const QString &input)
#define CHECK_EXCEPTION()
#define RETURN_UNDEFINED()
#define DEFINE_OBJECT_VTABLE(classname)
QT_BEGIN_NAMESPACE typedef uchar * output
QTextStream out(stdout)
[7]
\inmodule QtCore \reentrant
static constexpr ReturnedValue undefined()
CppStackFrame * currentStackFrame
ReturnedValue evalCall(const Value *thisObject, const Value *argv, int argc, bool directCall) const
Heap::String * newString(const QString &s=QString())
ExecutionContext * scriptContext() const
ReturnedValue throwURIError(const Value &msg)
ExecutionContext * currentContext() const
static Heap::FunctionObject * createScriptFunction(ExecutionContext *scope, Function *function)
Function * function() const
Heap::ExecutionContext * scope() const
bool call(QObject *thisObject, void **a, const QMetaType *types, int argc, ExecutionContext *context)
static ReturnedValue method_unescape(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue method_parseInt(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue method_parseFloat(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue method_isNaN(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
isNaN [15.1.2.4]
static ReturnedValue method_isFinite(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
isFinite [15.1.2.5]
static ReturnedValue method_encodeURIComponent(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
encodeURIComponent [15.1.3.4]
static ReturnedValue method_decodeURI(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
decodeURI [15.1.3.1]
static ReturnedValue method_decodeURIComponent(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
decodeURIComponent [15.1.3.2]
static ReturnedValue method_encodeURI(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
encodeURI [15.1.3.3]
static ReturnedValue method_escape(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
void init(QV4::ExecutionContext *scope)
ExecutionEngine * engine() const
constexpr ReturnedValue asReturnedValue() const
QString toQString() const
static constexpr VTable::Call virtualCall
static constexpr Value fromInt32(int i)
QML_NEARLY_ALWAYS_INLINE String * stringValue() const
static constexpr Value undefinedValue()
QString toQString() const