mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 795625 - Don't push StmtInfo for Parser::functionBody; r=jorendorff on irc
This commit is contained in:
parent
ff53cbaba5
commit
335dd478e2
@ -22,7 +22,7 @@ ParseContext::blockid()
|
||||
inline bool
|
||||
ParseContext::atBodyLevel()
|
||||
{
|
||||
return !topStmt || topStmt->isFunctionBodyBlock;
|
||||
return !topStmt;
|
||||
}
|
||||
|
||||
inline
|
||||
|
@ -114,7 +114,6 @@ PushStatementPC(ParseContext *pc, StmtInfoPC *stmt, StmtType type)
|
||||
{
|
||||
stmt->blockid = pc->blockid();
|
||||
PushStatement(pc, stmt, type);
|
||||
stmt->isFunctionBodyBlock = false;
|
||||
}
|
||||
|
||||
// See comment on member function declaration.
|
||||
@ -711,11 +710,6 @@ ParseNode *
|
||||
Parser::functionBody(FunctionBodyType type)
|
||||
{
|
||||
JS_ASSERT(pc->sc->isFunction);
|
||||
|
||||
StmtInfoPC stmtInfo(context);
|
||||
PushStatementPC(pc, &stmtInfo, STMT_BLOCK);
|
||||
stmtInfo.isFunctionBodyBlock = true;
|
||||
|
||||
JS_ASSERT(!pc->funHasReturnExpr && !pc->funHasReturnVoid);
|
||||
|
||||
ParseNode *pn;
|
||||
@ -751,9 +745,6 @@ Parser::functionBody(FunctionBodyType type)
|
||||
if (!pn)
|
||||
return NULL;
|
||||
|
||||
JS_ASSERT(!pc->topStmt->isBlockScope);
|
||||
FinishPopStatement(pc);
|
||||
|
||||
/* Check for falling off the end of a function that returns a value. */
|
||||
if (context->hasStrictOption() && pc->funHasReturnExpr &&
|
||||
!CheckFinalReturn(context, this, pn))
|
||||
@ -3584,7 +3575,7 @@ Parser::letStatement()
|
||||
if (stmt && stmt->isBlockScope) {
|
||||
JS_ASSERT(pc->blockChain == stmt->blockObj);
|
||||
} else {
|
||||
if (!stmt || stmt->isFunctionBodyBlock) {
|
||||
if (pc->atBodyLevel()) {
|
||||
/*
|
||||
* ES4 specifies that let at top level and at body-block scope
|
||||
* does not shadow var, so convert back to var.
|
||||
|
@ -31,10 +31,7 @@ struct StmtInfoPC : public StmtInfoBase {
|
||||
|
||||
uint32_t blockid; /* for simplified dominance computation */
|
||||
|
||||
/* True if type == STMT_BLOCK and this block is a function body. */
|
||||
bool isFunctionBodyBlock;
|
||||
|
||||
StmtInfoPC(JSContext *cx) : StmtInfoBase(cx), isFunctionBodyBlock(false) {}
|
||||
StmtInfoPC(JSContext *cx) : StmtInfoBase(cx) {}
|
||||
};
|
||||
|
||||
typedef HashSet<JSAtom *> FuncStmtSet;
|
||||
|
Loading…
Reference in New Issue
Block a user