29 bool protoSet =
false;
31 protoSet =
a->setProtoFromNewTarget(newTarget);
32 if (!protoSet && weakMap) {
36 a->d()->isWeakMap = weakMap;
41 if (!iterable->isNullOrUndefined()) {
58 if (
done->toBoolean())
59 return a->asReturnedValue();
80 return a->asReturnedValue();
86 return construct(
f, argv, argc, newTarget,
true);
98 return construct(
f, argv, argc, newTarget,
false);
106 ctor->defineReadonlyProperty(
engine->id_prototype(), (
o =
this));
107 defineDefaultProperty(
engine->id_constructor(), (
o = ctor));
109 defineDefaultProperty(
QStringLiteral(
"delete"), method_delete, 1);
115 defineReadonlyConfigurableProperty(
engine->symbol_toStringTag(), val);
124 ctor->defineReadonlyProperty(
engine->id_prototype(), (
o =
this));
125 ctor->addSymbolSpecies();
126 defineDefaultProperty(
engine->id_constructor(), (
o = ctor));
129 defineDefaultProperty(
QStringLiteral(
"delete"), method_delete, 1);
130 defineDefaultProperty(
QStringLiteral(
"forEach"), method_forEach, 1);
135 defineAccessorProperty(
QStringLiteral(
"size"), method_get_size,
nullptr);
136 defineDefaultProperty(
QStringLiteral(
"values"), method_values, 0);
142 defineDefaultProperty(
engine->symbol_iterator(), entriesFn);
145 defineReadonlyConfigurableProperty(
engine->symbol_toStringTag(), val);
162 esTable->removeUnmarkedKeys();
169 Object::markObjects(that, markStack);
175 Scoped<MapObject> that(scope, thisObject);
176 if (!that || !that->d()->isWeakMap)
178 if (!argc || !argv[0].isObject())
181 return Encode(that->d()->esTable->remove(argv[0]));
188 Scoped<MapObject> that(scope, thisObject);
189 if (!that || !that->d()->isWeakMap)
191 if (!argc || !argv[0].isObject())
194 return that->d()->esTable->get(argv[0]);
200 Scoped<MapObject> that(scope, thisObject);
201 if (!that || !that->d()->isWeakMap)
203 if (!argc || !argv[0].isObject())
206 return Encode(that->d()->esTable->has(argv[0]));
212 Scoped<MapObject> that(scope, thisObject);
213 if ((!that || !that->d()->isWeakMap) ||
218 return that.asReturnedValue();
225 Scoped<MapObject> that(scope, thisObject);
226 if (!that || that->d()->isWeakMap)
229 that->d()->esTable->clear();
236 Scoped<MapObject> that(scope, thisObject);
237 if (!that || that->d()->isWeakMap)
246 Scoped<MapObject> that(scope, thisObject);
247 if (!that || that->d()->isWeakMap)
252 return ao->asReturnedValue();
258 Scoped<MapObject> that(scope, thisObject);
259 if (!that || that->d()->isWeakMap)
272 for (
uint i = 0;
i < that->d()->esTable->size(); ++
i) {
284 Scoped<MapObject> that(scope, thisObject);
285 if (!that || that->d()->isWeakMap)
294 Scoped<MapObject> that(scope, thisObject);
295 if (!that || that->d()->isWeakMap)
304 Scoped<MapObject> that(scope, thisObject);
305 if (!that || that->d()->isWeakMap)
310 return ao->asReturnedValue();
316 Scoped<MapObject> that(scope, thisObject);
317 if (!that || that->d()->isWeakMap)
321 return that.asReturnedValue();
327 Scoped<MapObject> that(scope, thisObject);
328 if (!that || that->d()->isWeakMap)
331 return Encode(that->d()->esTable->size());
337 Scoped<MapObject> that(scope, thisObject);
338 if (!that || that->d()->isWeakMap)
343 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)
void registerWeakMap(Heap::MapObject *map)
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
Object * weakMapPrototype() const
Heap::Object * newMapIteratorObject(Object *o)
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 method_keys(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue method_get(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue method_delete(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue method_set(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue method_values(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
void init(ExecutionEngine *engine, Object *ctor)
static ReturnedValue method_clear(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_get_size(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 PropertyKey fromArrayIndex(uint idx)
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 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 weakMap)
static ReturnedValue method_get(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_set(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue method_delete(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
void init(ExecutionEngine *engine, Object *ctor)