mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-07 16:28:38 +09:00
Issue #1691 - Part 1: Provide a way of associating a private value with a script or module.
This is a prerequisite for dynamic import (cherry picked from commit 2e2972647ee29340df51a804f05e40fc1da2c89b)
This commit is contained in:
parent
d75c6c1815
commit
1a6b3a822c
10 changed files with 129 additions and 43 deletions
|
|
@ -638,12 +638,22 @@ class ScriptSourceObject : public NativeObject
|
|||
return static_cast<JSScript*>(untyped);
|
||||
}
|
||||
|
||||
void setPrivate(const Value& value) {
|
||||
setReservedSlot(PRIVATE_SLOT, value);
|
||||
}
|
||||
Value getPrivate() const {
|
||||
return getReservedSlot(PRIVATE_SLOT);
|
||||
}
|
||||
|
||||
private:
|
||||
static const uint32_t SOURCE_SLOT = 0;
|
||||
static const uint32_t ELEMENT_SLOT = 1;
|
||||
static const uint32_t ELEMENT_PROPERTY_SLOT = 2;
|
||||
static const uint32_t INTRODUCTION_SCRIPT_SLOT = 3;
|
||||
static const uint32_t RESERVED_SLOTS = 4;
|
||||
enum {
|
||||
SOURCE_SLOT = 0,
|
||||
ELEMENT_SLOT,
|
||||
ELEMENT_PROPERTY_SLOT,
|
||||
INTRODUCTION_SCRIPT_SLOT,
|
||||
PRIVATE_SLOT,
|
||||
RESERVED_SLOTS
|
||||
};
|
||||
};
|
||||
|
||||
enum GeneratorKind { NotGenerator, LegacyGenerator, StarGenerator };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue