30 symbol.set(internalClass->engine,
s->d());
37 if (argc && !argv[0].isUndefined()) {
41 desc +=
s->toQString();
48 return f->engine()->throwTypeError(
QStringLiteral(
"Symbol can't be used together with |new|."));
56 if (
scope.hasException())
59 return scope.engine->identifierTable->insertSymbol(
desc)->asReturnedValue();
66 return e->throwTypeError(
QLatin1String(
"Symbol.keyFor: Argument is not a symbol."));
71 return e->newString(
arg.toQString().mid((1)))->asReturnedValue();
97 defineDefaultProperty(
QStringLiteral(
"toString"), method_toString);
102 defineReadonlyConfigurableProperty(
engine->symbol_toStringTag(),
v);
129 return s->asReturnedValue();
137 return o->d()->symbol->asReturnedValue();
138 return f->engine()->throwTypeError();
144 return e->memoryManager->alloc<
Symbol>(
s);
static constexpr QChar fromLatin1(char c) noexcept
Converts the Latin-1 character c to its equivalent QChar.
\macro QT_RESTRICTED_CAST_FROM_ASCII
QString mid(qsizetype position, qsizetype n=-1) const
Returns a string that contains n characters of this string, starting at the specified position index.
\qmltype Particle \inqmlmodule QtQuick.Particles
@ Attr_ReadOnly_ButConfigurable
static const void * symbol()
static QString toString(QV4::ReturnedValue v)
GLsizei const GLfloat * v
[13]
QLatin1StringView QLatin1String
#define QStringLiteral(str)
#define DEFINE_OBJECT_VTABLE(classname)
#define DEFINE_MANAGED_VTABLE(classname)
\inmodule QtCore \reentrant
static constexpr ReturnedValue undefined()
Heap::String * newString(const QString &s=QString())
ReturnedValue throwTypeError()
Heap::ExecutionContext * scope() const
ReturnedValue asReturnedValue() const
QString toQString() const
void init(QV4::ExecutionContext *scope)
void init(const QString &s)
void defineDefaultProperty(StringOrSymbol *name, const Value &value, PropertyAttributes attributes=Attr_Data|Attr_NotEnumerable)
void defineReadonlyConfigurableProperty(const QString &name, const Value &value)
void defineReadonlyProperty(const QString &name, const Value &value)
static PropertyKey fromStringOrSymbol(StringOrSymbol *b)
bool hasException() const
constexpr ReturnedValue asReturnedValue() const
static ReturnedValue method_keyFor(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue method_for(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue method_toString(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
void init(ExecutionEngine *engine, Object *ctor)
static ReturnedValue method_symbolToPrimitive(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue method_valueOf(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
static V4_NEEDS_DESTROY Heap::Symbol * create(ExecutionEngine *e, const QString &s)
QString descriptiveString() const
static constexpr VTable::CallAsConstructor virtualCallAsConstructor
static constexpr VTable::Call virtualCall
static constexpr Value fromInt32(int i)
Heap::String * toString(ExecutionEngine *e) const
static constexpr Value undefinedValue()