mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-24 16:17:29 +09:00
Issue #2173 - Add accessors to BinaryNode and subclasses
Based-on: m-c 1479659/3
This commit is contained in:
parent
4726d96fd2
commit
662419c507
14 changed files with 1134 additions and 919 deletions
|
|
@ -408,15 +408,13 @@ UnaryKid(ParseNode* pn)
|
|||
static inline ParseNode*
|
||||
BinaryRight(ParseNode* pn)
|
||||
{
|
||||
MOZ_ASSERT(pn->isArity(PN_BINARY));
|
||||
return pn->pn_right;
|
||||
return pn->as<BinaryNode>().right();
|
||||
}
|
||||
|
||||
static inline ParseNode*
|
||||
BinaryLeft(ParseNode* pn)
|
||||
{
|
||||
MOZ_ASSERT(pn->isArity(PN_BINARY));
|
||||
return pn->pn_left;
|
||||
return pn->as<BinaryNode>().left();
|
||||
}
|
||||
|
||||
static inline ParseNode*
|
||||
|
|
@ -634,31 +632,25 @@ NumberNodeHasFrac(ParseNode* pn)
|
|||
static ParseNode*
|
||||
DotBase(ParseNode* pn)
|
||||
{
|
||||
MOZ_ASSERT(pn->isKind(PNK_DOT));
|
||||
MOZ_ASSERT(pn->isArity(PN_BINARY));
|
||||
return pn->pn_left;
|
||||
return &pn->as<PropertyAccess>().expression();
|
||||
}
|
||||
|
||||
static PropertyName*
|
||||
DotMember(ParseNode* pn)
|
||||
{
|
||||
MOZ_ASSERT(pn->isKind(PNK_DOT));
|
||||
MOZ_ASSERT(pn->isArity(PN_BINARY));
|
||||
return pn->pn_right->pn_atom->asPropertyName();
|
||||
return &pn->as<PropertyAccess>().name();
|
||||
}
|
||||
|
||||
static ParseNode*
|
||||
ElemBase(ParseNode* pn)
|
||||
{
|
||||
MOZ_ASSERT(pn->isKind(PNK_ELEM));
|
||||
return BinaryLeft(pn);
|
||||
return &pn->as<PropertyByValueBase>().expression();
|
||||
}
|
||||
|
||||
static ParseNode*
|
||||
ElemIndex(ParseNode* pn)
|
||||
{
|
||||
MOZ_ASSERT(pn->isKind(PNK_ELEM));
|
||||
return BinaryRight(pn);
|
||||
return &pn->as<PropertyByValueBase>().key();
|
||||
}
|
||||
|
||||
static inline JSFunction*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue