mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-05 15:28:39 +09:00
Issue #1691 - Part 6a: Support private values which contain pointers to cycle-collected C++ objects https://bugzilla.mozilla.org/show_bug.cgi?id=1342012
(cherry picked from commit 1286cca73d58332ba0becd0011f747713b8acfac)
This commit is contained in:
parent
5c09a3b3cc
commit
1b811bd711
10 changed files with 107 additions and 23 deletions
|
|
@ -641,10 +641,17 @@ class ScriptSourceObject : public NativeObject
|
|||
void setPrivate(const Value& value) {
|
||||
setReservedSlot(PRIVATE_SLOT, value);
|
||||
}
|
||||
|
||||
Value getPrivate() const {
|
||||
return getReservedSlot(PRIVATE_SLOT);
|
||||
}
|
||||
|
||||
Value canonicalPrivate() const {
|
||||
Value value = getReservedSlot(PRIVATE_SLOT);
|
||||
MOZ_ASSERT_IF(!isCanonical(), value.isUndefined());
|
||||
return value;
|
||||
}
|
||||
|
||||
private:
|
||||
enum {
|
||||
SOURCE_SLOT = 0,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue