23 this->handler.
set(e, handler->d());
29 FunctionObject::init(e);
31 this->handler.
set(e, handler->d());
48 if (trap->isNullOrUndefined())
49 return target->get(
id, receiver, hasProperty);
50 if (!trap->isFunctionObject())
68 if (!trapResult->sameValue(targetDesc->value))
71 if (attributes.
isAccessor() && targetDesc->value.isUndefined()) {
72 if (!trapResult->isUndefined())
76 return trapResult->asReturnedValue();
92 if (trap->isNullOrUndefined())
94 if (!trap->isFunctionObject())
111 if (!
value.sameValue(targetDesc->value))
114 if (attributes.
isAccessor() && targetDesc->set.isUndefined())
124 if (!
o->d()->handler)
134 if (trap->isNullOrUndefined())
135 return target->deleteProperty(
id);
136 if (!trap->isFunctionObject())
161 if (!
o->d()->handler)
171 if (trap->isNullOrUndefined())
172 return target->hasProperty(
id);
173 if (!trap->isFunctionObject())
184 bool result = trapResult->toBoolean();
200 if (!
o->d()->handler) {
212 if (trap->isNullOrUndefined())
213 return target->getOwnProperty(
id,
p);
214 if (!trap->isFunctionObject()) {
227 if (!trapResult->isObject() && !trapResult->isUndefined()) {
234 if (trapResult->isUndefined()) {
240 if (!targetAttributes.isConfigurable() || !
target->isExtensible()) {
251 resultDesc->completed(&resultAttributes);
253 if (!targetDesc->isCompatible(targetAttributes, resultDesc, resultAttributes)) {
258 if (!resultAttributes.isConfigurable()) {
259 if (targetAttributes ==
Attr_Invalid || targetAttributes.isConfigurable()) {
266 p->value = resultDesc->value;
267 p->set = resultDesc->set;
269 return resultAttributes;
276 if (!
o->d()->handler) {
288 if (trap->isNullOrUndefined())
290 if (!trap->isFunctionObject()) {
308 bool extensibleTarget =
target->isExtensible();
309 bool settingConfigFalse =
attrs.hasConfigurable() && !
attrs.isConfigurable();
311 if (!extensibleTarget || settingConfigFalse) {
316 if (!targetDesc->isCompatible(targetAttributes,
p,
attrs)) {
320 if (settingConfigFalse && targetAttributes.isConfigurable()) {
333 if (!
o->d()->handler)
343 if (trap->isNullOrUndefined())
344 return target->isExtensible();
345 if (!trap->isFunctionObject())
355 bool result = trapResult->toBoolean();
367 if (!
o->d()->handler)
377 if (trap->isNullOrUndefined())
378 return target->preventExtensions();
379 if (!trap->isFunctionObject())
389 bool result = trapResult->toBoolean();
401 if (!
o->d()->handler) {
413 if (trap->isNullOrUndefined())
414 return target->getPrototypeOf();
415 if (!trap->isFunctionObject()) {
427 if (!trapResult->isNull() && !trapResult->isObject()) {
431 Heap::Object *proto = trapResult->isNull() ?
nullptr :
static_cast<Heap::Object *
>(trapResult->heapObject());
432 if (!
target->isExtensible()) {
433 Heap::Object *targetProto =
target->getPrototypeOf();
434 if (proto != targetProto) {
446 if (!
o->d()->handler) {
458 if (trap->isNullOrUndefined())
459 return target->setPrototypeOf(
p);
460 if (!trap->isFunctionObject()) {
474 if (!
target->isExtensible()) {
475 Heap::Object *targetProto =
target->getPrototypeOf();
476 if (
p->d() != targetProto) {
539 if (!
o->d()->handler) {
552 if (trap->isUndefined())
553 return target->ownPropertyKeys(iteratorTarget);
554 if (!trap->isFunctionObject()) {
570 uint len = trapResult->getLength();
574 key = trapResult->get(
i);
582 trapKeys->push_back(keyAsValue);
595 if (
attrs.isConfigurable())
596 targetConfigurableKeys->push_back(keyAsValue);
598 targetNonConfigurableKeys->push_back(keyAsValue);
600 if (
target->isExtensible() && targetNonConfigurableKeys->getLength() == 0) {
601 *iteratorTarget = *
m;
606 uncheckedResultKeys->copyArrayData(trapKeys);
608 len = targetNonConfigurableKeys->getLength();
617 if (
target->isExtensible()) {
618 *iteratorTarget = *
m;
622 len = targetConfigurableKeys->getLength();
631 len = uncheckedResultKeys->getLength();
639 *iteratorTarget = *
m;
649 if (!
o->d()->handler)
660 if (trap->isNullOrUndefined())
661 return target->callAsConstructor(argv, argc, newTarget);
662 if (!trap->isFunctionObject())
674 return result->asReturnedValue();
682 if (!
o->d()->handler)
693 if (trap->isNullOrUndefined())
695 if (!trap->isFunctionObject())
703 return trapFunction->call(handler,
arguments, 3);
713 Scoped<QV4::Proxy> ctor(scope,
this);
715 ctor->defineReadonlyConfigurableProperty(scope.engine->id_length(),
Value::fromInt32(2));
721 if (argc < 2 || !argv[0].isObject() || !argv[1].isObject())
725 const Object *handler =
static_cast<const Object *
>(argv + 1);
727 if (!ptarget->d()->handler)
730 if (!phandler->d()->handler)
734 if (!targetFunction) {
739 if (targetFunction->isConstructor()) {
741 targetFunction, handler)->asReturnedValue();
750 return f->engine()->throwTypeError();
765 scope.
engine,
nullptr, method_revoke));
771 o->defineDefaultProperty(
p,
proxy);
772 o->defineDefaultProperty(revoke, revoker);
773 return o->asReturnedValue();
ObjectType::Data * allocate(Args &&... args)
QSet< QString >::iterator it
QList< QVariant > arguments
Scoped< FunctionObject > ScopedFunctionObject
ReturnedValue checkedResult(QV4::ExecutionEngine *v4, ReturnedValue result)
Scoped< String > ScopedString
Scoped< StringOrSymbol > ScopedStringOrSymbol
static struct AttrInfo attrs[]
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLsizei const GLfloat * v
[13]
GLboolean GLboolean GLboolean GLboolean a
[7]
#define QStringLiteral(str)
static bool removeAllOccurrences(ArrayObject *target, ReturnedValue val)
#define DEFINE_OBJECT_VTABLE(classname)
PropertyKey next(const Object *o, Property *pd=nullptr, PropertyAttributes *attrs=nullptr) override
ProxyObjectOwnPropertyKeyIterator(ArrayObject *keys)
~ProxyObjectOwnPropertyKeyIterator() override=default
static constexpr ReturnedValue undefined()
static constexpr ReturnedValue null()
MemoryManager * memoryManager
String * id_length() const
Heap::Object * newObject()
Heap::String * newString(char16_t c)
Symbol * symbol_revokableProxy() const
Heap::ArrayObject * newArrayObject(int count=0)
ReturnedValue throwTypeError()
ReturnedValue name() const
ReturnedValue call(const Value *thisObject, const Value *argv, int argc) const
void init(const QV4::FunctionObject *target, const QV4::Object *handler)
Heap::InternalClass * internalClass() const
static void toPropertyDescriptor(ExecutionEngine *engine, const Value &v, Property *desc, PropertyAttributes *attrs)
static ReturnedValue fromPropertyDescriptor(ExecutionEngine *engine, const Property *desc, PropertyAttributes attrs)
bool set(StringOrSymbol *name, const Value &v, ThrowOnFailure shouldThrow)
ReturnedValue get(StringOrSymbol *name, bool *hasProperty=nullptr, const Value *receiver=nullptr) const
bool isConfigurable() const
static PropertyKey fromId(quint64 id)
static PropertyKey invalid()
static PropertyKey fromArrayIndex(uint idx)
static ReturnedValue method_revocable(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue method_revoke(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
Value * alloc(qint64 nValues) const =delete
bool hasException() const
static constexpr VTable::SetPrototypeOf virtualSetPrototypeOf
static constexpr VTable::DefineOwnProperty virtualDefineOwnProperty
static constexpr VTable::OwnPropertyKeys virtualOwnPropertyKeys
static constexpr VTable::GetOwnProperty virtualGetOwnProperty
static constexpr VTable::CallAsConstructor virtualCallAsConstructor
static constexpr VTable::Call virtualCall
static constexpr VTable::PreventExtensions virtualPreventExtensions
static constexpr VTable::GetPrototypeOf virtualGetPrototypeOf
static constexpr VTable::DeleteProperty virtualDeleteProperty
static constexpr VTable::Get virtualGet
static constexpr VTable::HasProperty virtualHasProperty
static constexpr VTable::Put virtualPut
static constexpr VTable::IsExtensible virtualIsExtensible
static constexpr Value fromInt32(int i)
static constexpr Value undefinedValue()
static constexpr Value fromReturnedValue(ReturnedValue val)
static Value fromUInt32(uint i)