Permalink
Browse files

Add anonymous functions before other statements.

  • Loading branch information...
crabmusket committed Dec 29, 2014
1 parent 412247c commit 170a4ea08fab58f11b62701fe89b08735e4c0629
Showing with 8 additions and 2 deletions.
  1. +8 −2 Engine/source/console/codeBlock.cpp
@@ -482,7 +482,10 @@ bool CodeBlock::compile(const char *codeFileName, StringTableEntry fileName, con
{
if (gAnonFunctionList)
{
gStatementList->append(gAnonFunctionList);
// Prepend anonymous functions to statement list, so they're defined already when
// the statements run.
gAnonFunctionList->append(gStatementList);
gStatementList = gAnonFunctionList;
}
}
@@ -622,7 +625,10 @@ const char *CodeBlock::compileExec(StringTableEntry fileName, const char *inStri
{
if (gAnonFunctionList)
{
gStatementList->append(gAnonFunctionList);
// Prepend anonymous functions to statement list, so they're defined already when
// the statements run.
gAnonFunctionList->append(gStatementList);
gStatementList = gAnonFunctionList;
}
}

0 comments on commit 170a4ea

Please sign in to comment.