31 bool protoSet =
false;
33 protoSet =
a->setProtoFromNewTarget(newTarget);
34 if (!protoSet && isWeak)
36 a->d()->isWeakSet = isWeak;
40 if (!iterable->isUndefined() && !iterable->isNull()) {
47 return a.asReturnedValue();
54 if (
done->toBoolean())
55 return a.asReturnedValue();
57 adder->call(
a, nextValue, 1);
64 return a.asReturnedValue();
69 return construct(
f, argv, argc, newTarget,
true);
80 return construct(
f, argv, argc, newTarget,
false);
88 ctor->defineReadonlyProperty(
engine->id_prototype(), (
o =
this));
89 defineDefaultProperty(
engine->id_constructor(), (
o = ctor));
96 defineReadonlyConfigurableProperty(
engine->symbol_toStringTag(), val);
102 Scoped<SetObject> that(scope, thisObject);
103 if ((!that || !that->d()->isWeakSet) ||
108 return that.asReturnedValue();
114 Scoped<SetObject> that(scope, thisObject);
115 if (!that || !that->d()->isWeakSet)
117 if (!argc || !argv[0].isObject())
120 return Encode(that->d()->esTable->remove(argv[0]));
126 Scoped<SetObject> that(scope, thisObject);
127 if (!that || !that->d()->isWeakSet)
129 if (!argc || !argv[0].isObject())
132 return Encode(that->d()->esTable->has(argv[0]));
140 ctor->defineReadonlyProperty(
engine->id_prototype(), (
o =
this));
141 ctor->addSymbolSpecies();
142 defineDefaultProperty(
engine->id_constructor(), (
o = ctor));
146 defineDefaultProperty(
QStringLiteral(
"delete"), method_delete, 1);
147 defineDefaultProperty(
QStringLiteral(
"entries"), method_entries, 0);
148 defineDefaultProperty(
QStringLiteral(
"forEach"), method_forEach, 1);
150 defineAccessorProperty(
QStringLiteral(
"size"), method_get_size,
nullptr);
158 defineDefaultProperty(
engine->symbol_iterator(), valuesFn);
161 defineReadonlyConfigurableProperty(
engine->symbol_toStringTag(), val);
178 esTable->removeUnmarkedKeys();
185 Object::markObjects(that, markStack);
191 Scoped<SetObject> that(scope, thisObject);
192 if (!that || that->d()->isWeakSet)
196 return that.asReturnedValue();
202 Scoped<SetObject> that(scope, thisObject);
203 if (!that || that->d()->isWeakSet)
206 that->d()->esTable->clear();
213 Scoped<SetObject> that(scope, thisObject);
214 if (!that || that->d()->isWeakSet)
217 return Encode(that->d()->esTable->remove(argv[0]));
223 Scoped<SetObject> that(scope, thisObject);
224 if (!that || that->d()->isWeakSet)
229 return ao->asReturnedValue();
235 Scoped<SetObject> that(scope, thisObject);
236 if (!that || that->d()->isWeakSet)
248 for (
uint i = 0;
i < that->d()->esTable->size(); ++
i) {
262 Scoped<SetObject> that(scope, thisObject);
263 if (!that || that->d()->isWeakSet)
266 return Encode(that->d()->esTable->has(argv[0]));
272 Scoped<SetObject> that(scope, thisObject);
273 if (!that || that->d()->isWeakSet)
276 return Encode(that->d()->esTable->size());
282 Scoped<SetObject> that(scope, thisObject);
283 if (!that || that->d()->isWeakSet)
288 return ao->asReturnedValue();
static QString fromLatin1(QByteArrayView ba)
This is an overloaded member function, provided for convenience. It differs from the above function o...
void markObjects(MarkStack *s, bool isWeakMap)
ObjectType::Data * allocate(Args &&... args)
QList< QVariant > arguments
Scoped< FunctionObject > ScopedFunctionObject
Scoped< String > ScopedString
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter * iter
GLboolean GLboolean GLboolean b
GLboolean GLboolean GLboolean GLboolean a
[7]
#define QStringLiteral(str)
#define CHECK_EXCEPTION()
#define DEFINE_OBJECT_VTABLE(classname)
static constexpr ReturnedValue undefined()
MemoryManager * memoryManager
Heap::Object * newSetIteratorObject(Object *o)
Object * weakSetPrototype() const
Heap::String * newString(char16_t c)
Heap::String * newIdentifier(const QString &text)
ReturnedValue throwTypeError()
static Heap::FunctionObject * createBuiltinFunction(ExecutionEngine *engine, StringOrSymbol *nameOrSymbol, VTable::Call code, int argumentCount)
void init(ExecutionEngine *engine)
void removeUnmarkedKeys()
static void markObjects(Heap::Base *that, MarkStack *markStack)
void init(ExecutionEngine *engine)
ExecutionEngine * engine() const
static ReturnedValue call(ExecutionEngine *, const Value &, int)
static ReturnedValue call(ExecutionEngine *, const Value &)
static ReturnedValue call(ExecutionEngine *, const Value &, Value *)
Value * alloc(qint64 nValues) const =delete
bool hasException() const
static ReturnedValue method_get_size(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue method_entries(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue method_forEach(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue method_add(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue method_has(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue method_values(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue method_clear(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
void init(ExecutionEngine *engine, Object *ctor)
static ReturnedValue method_delete(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
static constexpr VTable::CallAsConstructor virtualCallAsConstructor
static constexpr VTable::Call virtualCall
static constexpr Value fromInt32(int i)
static constexpr Value undefinedValue()
static ReturnedValue construct(const FunctionObject *f, const Value *argv, int argc, const Value *, bool weakSet)
static ReturnedValue method_add(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue method_has(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
void init(ExecutionEngine *engine, Object *ctor)
static ReturnedValue method_delete(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)