| 1 | // Copyright (C) 2018 The Qt Company Ltd. |
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
| 3 | #ifndef QV4MODULE |
| 4 | #define QV4MODULE |
| 5 | |
| 6 | // |
| 7 | // W A R N I N G |
| 8 | // ------------- |
| 9 | // |
| 10 | // This file is not part of the Qt API. It exists purely as an |
| 11 | // implementation detail. This header file may change from version to |
| 12 | // version without notice, or even be removed. |
| 13 | // |
| 14 | // We mean it. |
| 15 | // |
| 16 | |
| 17 | #include "qv4object_p.h" |
| 18 | #include "qv4context_p.h" |
| 19 | |
| 20 | QT_BEGIN_NAMESPACE |
| 21 | |
| 22 | namespace QV4 { |
| 23 | |
| 24 | namespace Heap { |
| 25 | |
| 26 | #define ModuleMembers(class, Member) \ |
| 27 | Member(class, NoMark, ExecutableCompilationUnit *, unit) \ |
| 28 | Member(class, Pointer, CallContext *, scope) \ |
| 29 | Member(class, HeapValue, HeapValue, self) \ |
| 30 | Member(class, NoMark, bool, evaluated) |
| 31 | |
| 32 | DECLARE_EXPORTED_HEAP_OBJECT(Module, Object) { |
| 33 | DECLARE_MARKOBJECTS(Module) |
| 34 | |
| 35 | void init(ExecutionEngine *engine, ExecutableCompilationUnit *moduleUnit); |
| 36 | }; |
| 37 | |
| 38 | } |
| 39 | |
| 40 | struct Q_QML_EXPORT Module : public Object { |
| 41 | V4_OBJECT2(Module, Object) |
| 42 | |
| 43 | void evaluate(); |
| 44 | const Value *resolveExport(PropertyKey key) const; |
| 45 | |
| 46 | static ReturnedValue virtualGet(const Managed *m, PropertyKey id, const Value *receiver, bool *hasProperty); |
| 47 | static PropertyAttributes virtualGetOwnProperty(const Managed *m, PropertyKey id, Property *p); |
| 48 | static bool virtualHasProperty(const Managed *m, PropertyKey id); |
| 49 | static bool virtualPreventExtensions(Managed *); |
| 50 | static bool virtualDefineOwnProperty(Managed *, PropertyKey, const Property *, PropertyAttributes); |
| 51 | static bool virtualPut(Managed *, PropertyKey, const Value &, Value *); |
| 52 | static bool virtualDeleteProperty(Managed *m, PropertyKey id); |
| 53 | static OwnPropertyKeyIterator *virtualOwnPropertyKeys(const Object *m, Value *target); |
| 54 | static Heap::Object *virtualGetPrototypeOf(const Managed *); |
| 55 | static bool virtualSetPrototypeOf(Managed *, const Object *proto); |
| 56 | static bool virtualIsExtensible(const Managed *); |
| 57 | }; |
| 58 | |
| 59 | } |
| 60 | |
| 61 | QT_END_NAMESPACE |
| 62 | |
| 63 | #endif // QV4MODULE |
| 64 | |