mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-24 16:17:29 +09:00
Issue #2173 - Add a new PNK_ARGUMENTS node type for call argument lists
Also change PNK_GENEXP (not supported by upstream) to a PN_BINARY node Based-on: m-c 1378808/1
This commit is contained in:
parent
0b2e8c4818
commit
924140d400
12 changed files with 249 additions and 163 deletions
|
|
@ -465,22 +465,21 @@ static inline ParseNode*
|
|||
CallCallee(ParseNode* pn)
|
||||
{
|
||||
MOZ_ASSERT(pn->isKind(PNK_CALL));
|
||||
return ListHead(pn);
|
||||
return BinaryLeft(pn);
|
||||
}
|
||||
|
||||
static inline unsigned
|
||||
CallArgListLength(ParseNode* pn)
|
||||
{
|
||||
MOZ_ASSERT(pn->isKind(PNK_CALL));
|
||||
MOZ_ASSERT(ListLength(pn) >= 1);
|
||||
return ListLength(pn) - 1;
|
||||
return ListLength(BinaryRight(pn));
|
||||
}
|
||||
|
||||
static inline ParseNode*
|
||||
CallArgList(ParseNode* pn)
|
||||
{
|
||||
MOZ_ASSERT(pn->isKind(PNK_CALL));
|
||||
return NextNode(ListHead(pn));
|
||||
return ListHead(BinaryRight(pn));
|
||||
}
|
||||
|
||||
static inline ParseNode*
|
||||
|
|
@ -3433,9 +3432,11 @@ IsArrayViewCtorName(ModuleValidator& m, PropertyName* name, Scalar::Type* type)
|
|||
}
|
||||
|
||||
static bool
|
||||
CheckNewArrayViewArgs(ModuleValidator& m, ParseNode* ctorExpr, PropertyName* bufferName)
|
||||
CheckNewArrayViewArgs(ModuleValidator& m, ParseNode* newExpr, PropertyName* bufferName)
|
||||
{
|
||||
ParseNode* bufArg = NextNode(ctorExpr);
|
||||
ParseNode* ctorExpr = BinaryLeft(newExpr);
|
||||
ParseNode* ctorArgs = BinaryRight(newExpr);
|
||||
ParseNode* bufArg = ListHead(ctorArgs);
|
||||
if (!bufArg || NextNode(bufArg) != nullptr)
|
||||
return m.fail(ctorExpr, "array view constructor takes exactly one argument");
|
||||
|
||||
|
|
@ -3456,7 +3457,7 @@ CheckNewArrayView(ModuleValidator& m, PropertyName* varName, ParseNode* newExpr)
|
|||
if (!bufferName)
|
||||
return m.fail(newExpr, "cannot create array view without an asm.js heap parameter");
|
||||
|
||||
ParseNode* ctorExpr = ListHead(newExpr);
|
||||
ParseNode* ctorExpr = BinaryLeft(newExpr);
|
||||
|
||||
PropertyName* field;
|
||||
Scalar::Type type;
|
||||
|
|
@ -3485,7 +3486,7 @@ CheckNewArrayView(ModuleValidator& m, PropertyName* varName, ParseNode* newExpr)
|
|||
type = global->viewType();
|
||||
}
|
||||
|
||||
if (!CheckNewArrayViewArgs(m, ctorExpr, bufferName))
|
||||
if (!CheckNewArrayViewArgs(m, newExpr, bufferName))
|
||||
return false;
|
||||
|
||||
return m.addArrayView(varName, type, field);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue