Bug 710932 - Create debugger statements using a constructor that doesn't examine the token stream. r=jorendorff

--HG--
extra : rebase_source : eb913a09cc70398e252c1c8914104c60f79073ab
This commit is contained in:
Jeff Walden 2011-12-09 20:26:12 -05:00
parent e5d91c8d73
commit 6e6818ff03
2 changed files with 8 additions and 1 deletions

View File

@ -1059,6 +1059,13 @@ ParseNode::asContinueStatement()
return *static_cast<ContinueStatement *>(this);
}
class DebuggerStatement : public ParseNode {
public:
DebuggerStatement(const TokenPos &pos)
: ParseNode(PNK_DEBUGGER, JSOP_NOP, PN_NULLARY, pos)
{ }
};
ParseNode *
CloneLeftHandSide(ParseNode *opn, TreeContext *tc);

View File

@ -4226,7 +4226,7 @@ Parser::statement()
return pn;
case TOK_DEBUGGER:
pn = NullaryNode::create(PNK_DEBUGGER, tc);
pn = tc->parser->new_<DebuggerStatement>(tokenStream.currentToken().pos);
if (!pn)
return NULL;
tc->flags |= TCF_FUN_HEAVYWEIGHT;