зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1479659 - Part 6: Add accessors to NullaryNode and change LoopControlStatement arity to PN_LOOP. r=jwalden
This commit is contained in:
Родитель
5019874155
Коммит
7793683fdc
|
@ -1043,7 +1043,7 @@ BytecodeEmitter::checkSideEffects(ParseNode* pn, bool* answer)
|
|||
case ParseNodeKind::RawUndefined:
|
||||
case ParseNodeKind::Elision:
|
||||
case ParseNodeKind::Generator:
|
||||
MOZ_ASSERT(pn->isArity(PN_NULLARY));
|
||||
MOZ_ASSERT(pn->is<NullaryNode>());
|
||||
*answer = false;
|
||||
return true;
|
||||
|
||||
|
@ -1081,9 +1081,17 @@ BytecodeEmitter::checkSideEffects(ParseNode* pn, bool* answer)
|
|||
}
|
||||
|
||||
case ParseNodeKind::Break:
|
||||
MOZ_ASSERT(pn->is<BreakStatement>());
|
||||
*answer = true;
|
||||
return true;
|
||||
|
||||
case ParseNodeKind::Continue:
|
||||
MOZ_ASSERT(pn->is<ContinueStatement>());
|
||||
*answer = true;
|
||||
return true;
|
||||
|
||||
case ParseNodeKind::Debugger:
|
||||
MOZ_ASSERT(pn->isArity(PN_NULLARY));
|
||||
MOZ_ASSERT(pn->is<DebuggerStatement>());
|
||||
*answer = true;
|
||||
return true;
|
||||
|
||||
|
|
|
@ -105,8 +105,12 @@ ContainsHoistedDeclaration(JSContext* cx, ParseNode* node, bool* result)
|
|||
|
||||
// Statements with no sub-components at all.
|
||||
case ParseNodeKind::EmptyStatement:
|
||||
MOZ_ASSERT(node->is<NullaryNode>());
|
||||
*result = false;
|
||||
return true;
|
||||
|
||||
case ParseNodeKind::Debugger:
|
||||
MOZ_ASSERT(node->isArity(PN_NULLARY));
|
||||
MOZ_ASSERT(node->is<DebuggerStatement>());
|
||||
*result = false;
|
||||
return true;
|
||||
|
||||
|
@ -1604,13 +1608,22 @@ Fold(JSContext* cx, ParseNode** pnp, PerHandlerParser<FullParseHandler>& parser)
|
|||
case ParseNodeKind::Null:
|
||||
case ParseNodeKind::RawUndefined:
|
||||
case ParseNodeKind::Elision:
|
||||
case ParseNodeKind::Debugger:
|
||||
case ParseNodeKind::Break:
|
||||
case ParseNodeKind::Continue:
|
||||
case ParseNodeKind::Generator:
|
||||
case ParseNodeKind::ExportBatchSpec:
|
||||
case ParseNodeKind::PosHolder:
|
||||
MOZ_ASSERT(pn->isArity(PN_NULLARY));
|
||||
MOZ_ASSERT(pn->is<NullaryNode>());
|
||||
return true;
|
||||
|
||||
case ParseNodeKind::Debugger:
|
||||
MOZ_ASSERT(pn->is<DebuggerStatement>());
|
||||
return true;
|
||||
|
||||
case ParseNodeKind::Break:
|
||||
MOZ_ASSERT(pn->is<BreakStatement>());
|
||||
return true;
|
||||
|
||||
case ParseNodeKind::Continue:
|
||||
MOZ_ASSERT(pn->is<ContinueStatement>());
|
||||
return true;
|
||||
|
||||
case ParseNodeKind::ObjectPropertyName:
|
||||
|
|
|
@ -131,7 +131,7 @@ FOR_EACH_PARSENODE_SUBCLASS(DECLARE_AS)
|
|||
return new_<NumericLiteral>(value, decimalPoint, pos);
|
||||
}
|
||||
|
||||
ParseNode* newBooleanLiteral(bool cond, const TokenPos& pos) {
|
||||
BooleanLiteralType newBooleanLiteral(bool cond, const TokenPos& pos) {
|
||||
return new_<BooleanLiteral>(cond, pos);
|
||||
}
|
||||
|
||||
|
@ -177,11 +177,11 @@ FOR_EACH_PARSENODE_SUBCLASS(DECLARE_AS)
|
|||
return new_<ThisLiteral>(pos, thisName);
|
||||
}
|
||||
|
||||
ParseNode* newNullLiteral(const TokenPos& pos) {
|
||||
NullLiteralType newNullLiteral(const TokenPos& pos) {
|
||||
return new_<NullLiteral>(pos);
|
||||
}
|
||||
|
||||
ParseNode* newRawUndefinedLiteral(const TokenPos& pos) {
|
||||
RawUndefinedLiteralType newRawUndefinedLiteral(const TokenPos& pos) {
|
||||
return new_<RawUndefinedLiteral>(pos);
|
||||
}
|
||||
|
||||
|
@ -262,7 +262,7 @@ FOR_EACH_PARSENODE_SUBCLASS(DECLARE_AS)
|
|||
MOZ_MUST_USE bool addElision(ListNodeType literal, const TokenPos& pos) {
|
||||
MOZ_ASSERT(literal->isKind(ParseNodeKind::Array));
|
||||
|
||||
ParseNode* elision = new_<NullaryNode>(ParseNodeKind::Elision, pos);
|
||||
NullaryNode* elision = new_<NullaryNode>(ParseNodeKind::Elision, pos);
|
||||
if (!elision) {
|
||||
return false;
|
||||
}
|
||||
|
@ -321,10 +321,10 @@ FOR_EACH_PARSENODE_SUBCLASS(DECLARE_AS)
|
|||
ClassNamesType newClassNames(Node outer, Node inner, const TokenPos& pos) {
|
||||
return new_<ClassNames>(outer, inner, pos);
|
||||
}
|
||||
BinaryNodeType newNewTarget(Node newHolder, Node targetHolder) {
|
||||
BinaryNodeType newNewTarget(NullaryNodeType newHolder, NullaryNodeType targetHolder) {
|
||||
return new_<BinaryNode>(ParseNodeKind::NewTarget, JSOP_NOP, newHolder, targetHolder);
|
||||
}
|
||||
ParseNode* newPosHolder(const TokenPos& pos) {
|
||||
NullaryNodeType newPosHolder(const TokenPos& pos) {
|
||||
return new_<NullaryNode>(ParseNodeKind::PosHolder, pos);
|
||||
}
|
||||
UnaryNodeType newSuperBase(Node thisName, const TokenPos& pos) {
|
||||
|
@ -496,7 +496,7 @@ FOR_EACH_PARSENODE_SUBCLASS(DECLARE_AS)
|
|||
MOZ_ASSERT(stmtList->isKind(ParseNodeKind::StatementList));
|
||||
|
||||
TokenPos yieldPos(stmtList->pn_pos.begin, stmtList->pn_pos.begin + 1);
|
||||
ParseNode* makeGen = new_<NullaryNode>(ParseNodeKind::Generator, yieldPos);
|
||||
NullaryNode* makeGen = new_<NullaryNode>(ParseNodeKind::Generator, yieldPos);
|
||||
if (!makeGen) {
|
||||
return false;
|
||||
}
|
||||
|
@ -524,7 +524,7 @@ FOR_EACH_PARSENODE_SUBCLASS(DECLARE_AS)
|
|||
return newBinary(ParseNodeKind::SetThis, thisName, value);
|
||||
}
|
||||
|
||||
ParseNode* newEmptyStatement(const TokenPos& pos) {
|
||||
NullaryNodeType newEmptyStatement(const TokenPos& pos) {
|
||||
return new_<NullaryNode>(ParseNodeKind::EmptyStatement, pos);
|
||||
}
|
||||
|
||||
|
@ -566,15 +566,15 @@ FOR_EACH_PARSENODE_SUBCLASS(DECLARE_AS)
|
|||
return newBinary(ParseNodeKind::ExportSpec, bindingName, exportName);
|
||||
}
|
||||
|
||||
ParseNode* newExportBatchSpec(const TokenPos& pos) {
|
||||
NullaryNodeType newExportBatchSpec(const TokenPos& pos) {
|
||||
return new_<NullaryNode>(ParseNodeKind::ExportBatchSpec, JSOP_NOP, pos);
|
||||
}
|
||||
|
||||
BinaryNodeType newImportMeta(Node importHolder, Node metaHolder) {
|
||||
BinaryNodeType newImportMeta(NullaryNodeType importHolder, NullaryNodeType metaHolder) {
|
||||
return new_<BinaryNode>(ParseNodeKind::ImportMeta, JSOP_NOP, importHolder, metaHolder);
|
||||
}
|
||||
|
||||
BinaryNodeType newCallImport(Node importHolder, Node singleArg) {
|
||||
BinaryNodeType newCallImport(NullaryNodeType importHolder, Node singleArg) {
|
||||
return new_<BinaryNode>(ParseNodeKind::CallImport, JSOP_NOP, importHolder, singleArg);
|
||||
}
|
||||
|
||||
|
@ -629,11 +629,11 @@ FOR_EACH_PARSENODE_SUBCLASS(DECLARE_AS)
|
|||
return new_<CaseClause>(expr, body, begin);
|
||||
}
|
||||
|
||||
ParseNode* newContinueStatement(PropertyName* label, const TokenPos& pos) {
|
||||
ContinueStatementType newContinueStatement(PropertyName* label, const TokenPos& pos) {
|
||||
return new_<ContinueStatement>(label, pos);
|
||||
}
|
||||
|
||||
ParseNode* newBreakStatement(PropertyName* label, const TokenPos& pos) {
|
||||
BreakStatementType newBreakStatement(PropertyName* label, const TokenPos& pos) {
|
||||
return new_<BreakStatement>(label, pos);
|
||||
}
|
||||
|
||||
|
@ -667,7 +667,7 @@ FOR_EACH_PARSENODE_SUBCLASS(DECLARE_AS)
|
|||
return new_<TernaryNode>(ParseNodeKind::Try, body, catchScope, finallyBlock, pos);
|
||||
}
|
||||
|
||||
ParseNode* newDebuggerStatement(const TokenPos& pos) {
|
||||
DebuggerStatementType newDebuggerStatement(const TokenPos& pos) {
|
||||
return new_<DebuggerStatement>(pos);
|
||||
}
|
||||
|
||||
|
|
|
@ -429,12 +429,21 @@ class NameResolver
|
|||
case ParseNodeKind::RawUndefined:
|
||||
case ParseNodeKind::Elision:
|
||||
case ParseNodeKind::Generator:
|
||||
case ParseNodeKind::Break:
|
||||
case ParseNodeKind::Continue:
|
||||
case ParseNodeKind::Debugger:
|
||||
case ParseNodeKind::ExportBatchSpec:
|
||||
case ParseNodeKind::PosHolder:
|
||||
MOZ_ASSERT(cur->isArity(PN_NULLARY));
|
||||
MOZ_ASSERT(cur->is<NullaryNode>());
|
||||
break;
|
||||
|
||||
case ParseNodeKind::Debugger:
|
||||
MOZ_ASSERT(cur->is<DebuggerStatement>());
|
||||
break;
|
||||
|
||||
case ParseNodeKind::Break:
|
||||
MOZ_ASSERT(cur->is<BreakStatement>());
|
||||
break;
|
||||
|
||||
case ParseNodeKind::Continue:
|
||||
MOZ_ASSERT(cur->is<ContinueStatement>());
|
||||
break;
|
||||
|
||||
case ParseNodeKind::ObjectPropertyName:
|
||||
|
@ -857,7 +866,7 @@ class NameResolver
|
|||
ListNode* list = &cur->as<ListNode>();
|
||||
ParseNode* item = list->head();
|
||||
if (!isImport && item && item->isKind(ParseNodeKind::ExportBatchSpec)) {
|
||||
MOZ_ASSERT(item->isArity(PN_NULLARY));
|
||||
MOZ_ASSERT(item->is<NullaryNode>());
|
||||
break;
|
||||
}
|
||||
for (ParseNode* item : list->contents()) {
|
||||
|
|
|
@ -146,7 +146,7 @@ ParseNode::dump(GenericPrinter& out, int indent)
|
|||
{
|
||||
switch (ParseNodeArity(pn_arity)) {
|
||||
case PN_NULLARY:
|
||||
((NullaryNode*) this)->dump(out);
|
||||
as<NullaryNode>().dump(out);
|
||||
return;
|
||||
case PN_UNARY:
|
||||
as<UnaryNode>().dump(out, indent);
|
||||
|
@ -172,6 +172,9 @@ ParseNode::dump(GenericPrinter& out, int indent)
|
|||
case PN_REGEXP:
|
||||
as<RegExpLiteral>().dump(out, indent);
|
||||
return;
|
||||
case PN_LOOP:
|
||||
as<LoopControlStatement>().dump(out, indent);
|
||||
return;
|
||||
case PN_SCOPE:
|
||||
((LexicalScopeNode*) this)->dump(out, indent);
|
||||
return;
|
||||
|
@ -215,6 +218,18 @@ RegExpLiteral::dump(GenericPrinter& out, int indent)
|
|||
out.printf("(%s)", parseNodeNames[size_t(getKind())]);
|
||||
}
|
||||
|
||||
void
|
||||
LoopControlStatement::dump(GenericPrinter& out, int indent)
|
||||
{
|
||||
const char* name = parseNodeNames[size_t(getKind())];
|
||||
out.printf("(%s", name);
|
||||
if (label()) {
|
||||
out.printf(" ");
|
||||
label()->dumpCharsNoNewline(out);
|
||||
}
|
||||
out.printf(")");
|
||||
}
|
||||
|
||||
void
|
||||
UnaryNode::dump(GenericPrinter& out, int indent)
|
||||
{
|
||||
|
|
|
@ -346,7 +346,8 @@ IsTypeofKind(ParseNodeKind kind)
|
|||
* kid: expr
|
||||
* prologue: true if Directive Prologue member in original source, not
|
||||
* introduced via constant folding or other tree rewriting
|
||||
* EmptyStatement nullary (no fields)
|
||||
* EmptyStatement (NullaryNode)
|
||||
* (no fields)
|
||||
* Label (NameNode)
|
||||
* atom: label
|
||||
* expr: labeled statement
|
||||
|
@ -482,10 +483,12 @@ IsTypeofKind(ParseNodeKind kind)
|
|||
* regexp: RegExp model object
|
||||
* Number (NumericLiteral)
|
||||
* value: double value of numeric literal
|
||||
* True, nullary pn_op: JSOp bytecode
|
||||
* False,
|
||||
* Null,
|
||||
* RawUndefined
|
||||
* True, False (BooleanLiteral)
|
||||
* pn_op: JSOp bytecode
|
||||
* Null (NullLiteral)
|
||||
* pn_op: JSOp bytecode
|
||||
* RawUndefined (RawUndefinedLiteral)
|
||||
* pn_op: JSOp bytecode
|
||||
*
|
||||
* This (UnaryNode)
|
||||
* kid: '.this' Name if function `this`, else nullptr
|
||||
|
@ -500,12 +503,12 @@ IsTypeofKind(ParseNodeKind kind)
|
|||
*
|
||||
* LexicalScope scope pn_u.scope.bindings: scope bindings
|
||||
* pn_u.scope.body: scope body
|
||||
* Generator nullary
|
||||
* Generator (NullaryNode)
|
||||
* InitialYield (UnaryNode)
|
||||
* kid: generator object
|
||||
* Yield, YieldStar, Await (UnaryNode)
|
||||
* kid: expr or null
|
||||
* Nop nullary
|
||||
* Nop (NullaryNode)
|
||||
*/
|
||||
enum ParseNodeArity
|
||||
{
|
||||
|
@ -518,6 +521,7 @@ enum ParseNodeArity
|
|||
PN_NAME, /* name, label, string */
|
||||
PN_NUMBER, /* numeric literal */
|
||||
PN_REGEXP, /* regexp literal */
|
||||
PN_LOOP, /* loop control (break/continue) */
|
||||
PN_SCOPE /* lexical scope */
|
||||
};
|
||||
|
||||
|
@ -537,9 +541,19 @@ enum ParseNodeArity
|
|||
macro(ListNode, ListNodeType, asList) \
|
||||
macro(CallSiteNode, CallSiteNodeType, asCallSite) \
|
||||
\
|
||||
macro(LoopControlStatement, LoopControlStatementType, asLoopControlStatement) \
|
||||
macro(BreakStatement, BreakStatementType, asBreakStatement) \
|
||||
macro(ContinueStatement, ContinueStatementType, asContinueStatement) \
|
||||
\
|
||||
macro(NameNode, NameNodeType, asName) \
|
||||
macro(LabeledStatement, LabeledStatementType, asLabeledStatement) \
|
||||
\
|
||||
macro(NullaryNode, NullaryNodeType, asNullary) \
|
||||
macro(BooleanLiteral, BooleanLiteralType, asBooleanLiteral) \
|
||||
macro(DebuggerStatement, DebuggerStatementType, asDebuggerStatement) \
|
||||
macro(NullLiteral, NullLiteralType, asNullLiteral) \
|
||||
macro(RawUndefinedLiteral, RawUndefinedLiteralType, asRawUndefinedLiteral) \
|
||||
\
|
||||
macro(NumericLiteral, NumericLiteralType, asNumericLiteral) \
|
||||
\
|
||||
macro(RegExpLiteral, RegExpLiteralType, asRegExpLiteral) \
|
||||
|
@ -550,10 +564,6 @@ enum ParseNodeArity
|
|||
macro(UnaryNode, UnaryNodeType, asUnary) \
|
||||
macro(ThisLiteral, ThisLiteralType, asThisLiteral)
|
||||
|
||||
class LoopControlStatement;
|
||||
class BreakStatement;
|
||||
class ContinueStatement;
|
||||
|
||||
#define DECLARE_CLASS(typeName, longTypeName, asMethodName) \
|
||||
class typeName;
|
||||
FOR_EACH_PARSENODE_SUBCLASS(DECLARE_CLASS)
|
||||
|
@ -796,13 +806,19 @@ class ParseNode
|
|||
#endif
|
||||
};
|
||||
|
||||
struct NullaryNode : public ParseNode
|
||||
class NullaryNode : public ParseNode
|
||||
{
|
||||
public:
|
||||
NullaryNode(ParseNodeKind kind, const TokenPos& pos)
|
||||
: ParseNode(kind, JSOP_NOP, PN_NULLARY, pos) {}
|
||||
|
||||
NullaryNode(ParseNodeKind kind, JSOp op, const TokenPos& pos)
|
||||
: ParseNode(kind, op, PN_NULLARY, pos) {}
|
||||
|
||||
static bool test(const ParseNode& node) {
|
||||
return node.isArity(PN_NULLARY);
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
void dump(GenericPrinter& out);
|
||||
#endif
|
||||
|
@ -1559,7 +1575,7 @@ class LoopControlStatement : public ParseNode
|
|||
{
|
||||
protected:
|
||||
LoopControlStatement(ParseNodeKind kind, PropertyName* label, const TokenPos& pos)
|
||||
: ParseNode(kind, JSOP_NOP, PN_NULLARY, pos)
|
||||
: ParseNode(kind, JSOP_NOP, PN_LOOP, pos)
|
||||
{
|
||||
MOZ_ASSERT(kind == ParseNodeKind::Break || kind == ParseNodeKind::Continue);
|
||||
pn_u.loopControl.label = label;
|
||||
|
@ -1571,9 +1587,13 @@ class LoopControlStatement : public ParseNode
|
|||
return pn_u.loopControl.label;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
void dump(GenericPrinter& out, int indent);
|
||||
#endif
|
||||
|
||||
static bool test(const ParseNode& node) {
|
||||
bool match = node.isKind(ParseNodeKind::Break) || node.isKind(ParseNodeKind::Continue);
|
||||
MOZ_ASSERT_IF(match, node.isArity(PN_NULLARY));
|
||||
MOZ_ASSERT_IF(match, node.isArity(PN_LOOP));
|
||||
MOZ_ASSERT_IF(match, node.isOp(JSOP_NOP));
|
||||
return match;
|
||||
}
|
||||
|
@ -1588,7 +1608,7 @@ class BreakStatement : public LoopControlStatement
|
|||
|
||||
static bool test(const ParseNode& node) {
|
||||
bool match = node.isKind(ParseNodeKind::Break);
|
||||
MOZ_ASSERT_IF(match, node.isArity(PN_NULLARY));
|
||||
MOZ_ASSERT_IF(match, node.is<LoopControlStatement>());
|
||||
MOZ_ASSERT_IF(match, node.isOp(JSOP_NOP));
|
||||
return match;
|
||||
}
|
||||
|
@ -1603,18 +1623,24 @@ class ContinueStatement : public LoopControlStatement
|
|||
|
||||
static bool test(const ParseNode& node) {
|
||||
bool match = node.isKind(ParseNodeKind::Continue);
|
||||
MOZ_ASSERT_IF(match, node.isArity(PN_NULLARY));
|
||||
MOZ_ASSERT_IF(match, node.is<LoopControlStatement>());
|
||||
MOZ_ASSERT_IF(match, node.isOp(JSOP_NOP));
|
||||
return match;
|
||||
}
|
||||
};
|
||||
|
||||
class DebuggerStatement : public ParseNode
|
||||
class DebuggerStatement : public NullaryNode
|
||||
{
|
||||
public:
|
||||
explicit DebuggerStatement(const TokenPos& pos)
|
||||
: ParseNode(ParseNodeKind::Debugger, JSOP_NOP, PN_NULLARY, pos)
|
||||
: NullaryNode(ParseNodeKind::Debugger, JSOP_NOP, pos)
|
||||
{ }
|
||||
|
||||
static bool test(const ParseNode& node) {
|
||||
bool match = node.isKind(ParseNodeKind::Debugger);
|
||||
MOZ_ASSERT_IF(match, node.is<NullaryNode>());
|
||||
return match;
|
||||
}
|
||||
};
|
||||
|
||||
class ConditionalExpression : public TernaryNode
|
||||
|
@ -1669,6 +1695,12 @@ class NullLiteral : public NullaryNode
|
|||
explicit NullLiteral(const TokenPos& pos)
|
||||
: NullaryNode(ParseNodeKind::Null, JSOP_NULL, pos)
|
||||
{ }
|
||||
|
||||
static bool test(const ParseNode& node) {
|
||||
bool match = node.isKind(ParseNodeKind::Null);
|
||||
MOZ_ASSERT_IF(match, node.is<NullaryNode>());
|
||||
return match;
|
||||
}
|
||||
};
|
||||
|
||||
// This is only used internally, currently just for tagged templates.
|
||||
|
@ -1679,6 +1711,12 @@ class RawUndefinedLiteral : public NullaryNode
|
|||
public:
|
||||
explicit RawUndefinedLiteral(const TokenPos& pos)
|
||||
: NullaryNode(ParseNodeKind::RawUndefined, JSOP_UNDEFINED, pos) { }
|
||||
|
||||
static bool test(const ParseNode& node) {
|
||||
bool match = node.isKind(ParseNodeKind::RawUndefined);
|
||||
MOZ_ASSERT_IF(match, node.is<NullaryNode>());
|
||||
return match;
|
||||
}
|
||||
};
|
||||
|
||||
class BooleanLiteral : public NullaryNode
|
||||
|
@ -1688,6 +1726,12 @@ class BooleanLiteral : public NullaryNode
|
|||
: NullaryNode(b ? ParseNodeKind::True : ParseNodeKind::False,
|
||||
b ? JSOP_TRUE : JSOP_FALSE, pos)
|
||||
{ }
|
||||
|
||||
static bool test(const ParseNode& node) {
|
||||
bool match = node.isKind(ParseNodeKind::True) || node.isKind(ParseNodeKind::False);
|
||||
MOZ_ASSERT_IF(match, node.is<NullaryNode>());
|
||||
return match;
|
||||
}
|
||||
};
|
||||
|
||||
class RegExpLiteral : public ParseNode
|
||||
|
|
|
@ -6218,7 +6218,7 @@ GeneralParser<ParseHandler, CharT>::exportBatch(uint32_t begin)
|
|||
|
||||
// Handle the form |export *| by adding a special export batch
|
||||
// specifier to the list.
|
||||
Node exportSpec = handler.newExportBatchSpec(pos());
|
||||
NullaryNodeType exportSpec = handler.newExportBatchSpec(pos());
|
||||
if (!exportSpec) {
|
||||
return null();
|
||||
}
|
||||
|
@ -7394,7 +7394,7 @@ GeneralParser<ParseHandler, CharT>::switchStatement(YieldHandling yieldHandling)
|
|||
}
|
||||
|
||||
template <class ParseHandler, typename CharT>
|
||||
typename ParseHandler::Node
|
||||
typename ParseHandler::ContinueStatementType
|
||||
GeneralParser<ParseHandler, CharT>::continueStatement(YieldHandling yieldHandling)
|
||||
{
|
||||
MOZ_ASSERT(anyChars.isCurrentTokenType(TokenKind::Continue));
|
||||
|
@ -7426,7 +7426,7 @@ GeneralParser<ParseHandler, CharT>::continueStatement(YieldHandling yieldHandlin
|
|||
}
|
||||
|
||||
template <class ParseHandler, typename CharT>
|
||||
typename ParseHandler::Node
|
||||
typename ParseHandler::BreakStatementType
|
||||
GeneralParser<ParseHandler, CharT>::breakStatement(YieldHandling yieldHandling)
|
||||
{
|
||||
MOZ_ASSERT(anyChars.isCurrentTokenType(TokenKind::Break));
|
||||
|
@ -7918,7 +7918,7 @@ GeneralParser<ParseHandler, CharT>::catchBlockStatement(YieldHandling yieldHandl
|
|||
}
|
||||
|
||||
template <class ParseHandler, typename CharT>
|
||||
typename ParseHandler::Node
|
||||
typename ParseHandler::DebuggerStatementType
|
||||
GeneralParser<ParseHandler, CharT>::debuggerStatement()
|
||||
{
|
||||
TokenPos p;
|
||||
|
@ -10832,7 +10832,7 @@ GeneralParser<ParseHandler, CharT>::tryNewTarget(BinaryNodeType* newTarget)
|
|||
|
||||
*newTarget = null();
|
||||
|
||||
Node newHolder = handler.newPosHolder(pos());
|
||||
NullaryNodeType newHolder = handler.newPosHolder(pos());
|
||||
if (!newHolder) {
|
||||
return false;
|
||||
}
|
||||
|
@ -10864,7 +10864,7 @@ GeneralParser<ParseHandler, CharT>::tryNewTarget(BinaryNodeType* newTarget)
|
|||
return false;
|
||||
}
|
||||
|
||||
Node targetHolder = handler.newPosHolder(pos());
|
||||
NullaryNodeType targetHolder = handler.newPosHolder(pos());
|
||||
if (!targetHolder) {
|
||||
return false;
|
||||
}
|
||||
|
@ -10879,7 +10879,7 @@ GeneralParser<ParseHandler, CharT>::importExpr(YieldHandling yieldHandling)
|
|||
{
|
||||
MOZ_ASSERT(anyChars.isCurrentTokenType(TokenKind::Import));
|
||||
|
||||
Node importHolder = handler.newPosHolder(pos());
|
||||
NullaryNodeType importHolder = handler.newPosHolder(pos());
|
||||
if (!importHolder) {
|
||||
return null();
|
||||
}
|
||||
|
@ -10903,7 +10903,7 @@ GeneralParser<ParseHandler, CharT>::importExpr(YieldHandling yieldHandling)
|
|||
return null();
|
||||
}
|
||||
|
||||
Node metaHolder = handler.newPosHolder(pos());
|
||||
NullaryNodeType metaHolder = handler.newPosHolder(pos());
|
||||
if (!metaHolder) {
|
||||
return null();
|
||||
}
|
||||
|
|
|
@ -1037,14 +1037,14 @@ FOR_EACH_PARSENODE_SUBCLASS(DECLARE_TYPE)
|
|||
Node expressionAfterForInOrOf(ParseNodeKind forHeadKind, YieldHandling yieldHandling);
|
||||
|
||||
SwitchStatementType switchStatement(YieldHandling yieldHandling);
|
||||
Node continueStatement(YieldHandling yieldHandling);
|
||||
Node breakStatement(YieldHandling yieldHandling);
|
||||
ContinueStatementType continueStatement(YieldHandling yieldHandling);
|
||||
BreakStatementType breakStatement(YieldHandling yieldHandling);
|
||||
UnaryNodeType returnStatement(YieldHandling yieldHandling);
|
||||
BinaryNodeType withStatement(YieldHandling yieldHandling);
|
||||
UnaryNodeType throwStatement(YieldHandling yieldHandling);
|
||||
TernaryNodeType tryStatement(YieldHandling yieldHandling);
|
||||
Node catchBlockStatement(YieldHandling yieldHandling, ParseContext::Scope& catchParamScope);
|
||||
Node debuggerStatement();
|
||||
DebuggerStatementType debuggerStatement();
|
||||
|
||||
Node variableStatement(YieldHandling yieldHandling);
|
||||
|
||||
|
|
|
@ -208,7 +208,7 @@ FOR_EACH_PARSENODE_SUBCLASS(DECLARE_AS)
|
|||
return NodeGeneric;
|
||||
}
|
||||
|
||||
Node newBooleanLiteral(bool cond, const TokenPos& pos) { return NodeGeneric; }
|
||||
BooleanLiteralType newBooleanLiteral(bool cond, const TokenPos& pos) { return NodeGeneric; }
|
||||
|
||||
NameNodeType newStringLiteral(JSAtom* atom, const TokenPos& pos) {
|
||||
lastAtom = atom;
|
||||
|
@ -227,8 +227,8 @@ FOR_EACH_PARSENODE_SUBCLASS(DECLARE_AS)
|
|||
void addToCallSiteObject(CallSiteNodeType callSiteObj, Node rawNode, Node cookedNode) {}
|
||||
|
||||
ThisLiteralType newThisLiteral(const TokenPos& pos, Node thisName) { return NodeGeneric; }
|
||||
Node newNullLiteral(const TokenPos& pos) { return NodeGeneric; }
|
||||
Node newRawUndefinedLiteral(const TokenPos& pos) { return NodeGeneric; }
|
||||
NullLiteralType newNullLiteral(const TokenPos& pos) { return NodeGeneric; }
|
||||
RawUndefinedLiteralType newRawUndefinedLiteral(const TokenPos& pos) { return NodeGeneric; }
|
||||
|
||||
template <class Boxer>
|
||||
RegExpLiteralType newRegExp(Node reobj, const TokenPos& pos, Boxer& boxer) {
|
||||
|
@ -285,8 +285,10 @@ FOR_EACH_PARSENODE_SUBCLASS(DECLARE_AS)
|
|||
}
|
||||
ClassNodeType newClass(Node name, Node heritage, Node methodBlock, const TokenPos& pos) { return NodeGeneric; }
|
||||
|
||||
BinaryNodeType newNewTarget(Node newHolder, Node targetHolder) { return NodeGeneric; }
|
||||
Node newPosHolder(const TokenPos& pos) { return NodeGeneric; }
|
||||
BinaryNodeType newNewTarget(NullaryNodeType newHolder, NullaryNodeType targetHolder) {
|
||||
return NodeGeneric;
|
||||
}
|
||||
NullaryNodeType newPosHolder(const TokenPos& pos) { return NodeGeneric; }
|
||||
UnaryNodeType newSuperBase(Node thisName, const TokenPos& pos) { return NodeSuperBase; }
|
||||
|
||||
MOZ_MUST_USE bool addPrototypeMutation(ListNodeType literal, uint32_t begin, Node expr) { return true; }
|
||||
|
@ -315,7 +317,7 @@ FOR_EACH_PARSENODE_SUBCLASS(DECLARE_AS)
|
|||
void setListEndPosition(ListNodeType list, const TokenPos& pos) {}
|
||||
void addCaseStatementToList(ListNodeType list, CaseClauseType caseClause) {}
|
||||
MOZ_MUST_USE bool prependInitialYield(ListNodeType stmtList, Node genName) { return true; }
|
||||
Node newEmptyStatement(const TokenPos& pos) { return NodeEmptyStatement; }
|
||||
NullaryNodeType newEmptyStatement(const TokenPos& pos) { return NodeEmptyStatement; }
|
||||
|
||||
UnaryNodeType newExportDeclaration(Node kid, const TokenPos& pos) {
|
||||
return NodeGeneric;
|
||||
|
@ -329,13 +331,13 @@ FOR_EACH_PARSENODE_SUBCLASS(DECLARE_AS)
|
|||
BinaryNodeType newExportSpec(Node bindingName, Node exportName) {
|
||||
return NodeGeneric;
|
||||
}
|
||||
Node newExportBatchSpec(const TokenPos& pos) {
|
||||
NullaryNodeType newExportBatchSpec(const TokenPos& pos) {
|
||||
return NodeGeneric;
|
||||
}
|
||||
BinaryNodeType newImportMeta(Node importHolder, Node metaHolder) {
|
||||
BinaryNodeType newImportMeta(NullaryNodeType importHolder, NullaryNodeType metaHolder) {
|
||||
return NodeGeneric;
|
||||
}
|
||||
BinaryNodeType newCallImport(Node importHolder, Node singleArg) {
|
||||
BinaryNodeType newCallImport(NullaryNodeType importHolder, Node singleArg) {
|
||||
return NodeGeneric;
|
||||
}
|
||||
|
||||
|
@ -358,8 +360,8 @@ FOR_EACH_PARSENODE_SUBCLASS(DECLARE_AS)
|
|||
return NodeGeneric;
|
||||
}
|
||||
CaseClauseType newCaseOrDefault(uint32_t begin, Node expr, Node body) { return NodeGeneric; }
|
||||
Node newContinueStatement(PropertyName* label, const TokenPos& pos) { return NodeGeneric; }
|
||||
Node newBreakStatement(PropertyName* label, const TokenPos& pos) { return NodeBreak; }
|
||||
ContinueStatementType newContinueStatement(PropertyName* label, const TokenPos& pos) { return NodeGeneric; }
|
||||
BreakStatementType newBreakStatement(PropertyName* label, const TokenPos& pos) { return NodeBreak; }
|
||||
UnaryNodeType newReturnStatement(Node expr, const TokenPos& pos) { return NodeReturn; }
|
||||
UnaryNodeType newExpressionBody(Node expr) { return NodeReturn; }
|
||||
BinaryNodeType newWithStatement(uint32_t begin, Node expr, Node body) { return NodeGeneric; }
|
||||
|
@ -372,7 +374,7 @@ FOR_EACH_PARSENODE_SUBCLASS(DECLARE_AS)
|
|||
TernaryNodeType newTryStatement(uint32_t begin, Node body, Node catchScope, Node finallyBlock) {
|
||||
return NodeGeneric;
|
||||
}
|
||||
Node newDebuggerStatement(const TokenPos& pos) { return NodeGeneric; }
|
||||
DebuggerStatementType newDebuggerStatement(const TokenPos& pos) { return NodeGeneric; }
|
||||
|
||||
NameNodeType newPropertyName(PropertyName* name, const TokenPos& pos) {
|
||||
lastAtom = name;
|
||||
|
|
|
@ -594,7 +594,6 @@ static inline PropertyName*
|
|||
LoopControlMaybeLabel(ParseNode* pn)
|
||||
{
|
||||
MOZ_ASSERT(pn->isKind(ParseNodeKind::Break) || pn->isKind(ParseNodeKind::Continue));
|
||||
MOZ_ASSERT(pn->isArity(PN_NULLARY));
|
||||
return pn->as<LoopControlStatement>().label();
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче