mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 832094 - make the top-level function ParseNode always be a PNK_FUNCTION (r=jorendorff)
--HG-- extra : rebase_source : f6af6da88e185ccc62152ef1013dfeba1418cbc7
This commit is contained in:
parent
eddfaf40ed
commit
9e1aa92b57
@ -275,11 +275,12 @@ frontend::CompileFunctionBody(JSContext *cx, HandleFunction fun, CompileOptions
|
||||
fun->setArgCount(formals.length());
|
||||
|
||||
/* FIXME: make Function format the source for a function definition. */
|
||||
ParseNode *fn = FunctionNode::create(PNK_NAME, &parser);
|
||||
ParseNode *fn = FunctionNode::create(PNK_FUNCTION, &parser);
|
||||
if (!fn)
|
||||
return false;
|
||||
|
||||
fn->pn_body = NULL;
|
||||
fn->pn_funbox = NULL;
|
||||
fn->pn_cookie.makeFree();
|
||||
|
||||
ParseNode *argsbody = ListNode::create(PNK_ARGSBODY, &parser);
|
||||
|
@ -712,6 +712,8 @@ Parser::standaloneFunctionBody(HandleFunction fun, const AutoNameVector &formals
|
||||
if (!funbox)
|
||||
return NULL;
|
||||
|
||||
fn->pn_funbox = *funbox;
|
||||
|
||||
ParseContext funpc(this, *funbox, 0, /* staticLevel = */ 0);
|
||||
if (!funpc.init())
|
||||
return NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user