Skip to content

Commit c37adbb

Browse files
committed
Crash fix.
1 parent da7233f commit c37adbb

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/Avalon.MoonSharp/Tree/Expressions/FunctionDefinitionExpression.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ public FunctionDefinitionExpression(ScriptLoadingContext lcontext, bool pushSelf
2929

3030
private FunctionDefinitionExpression(ScriptLoadingContext lcontext, bool pushSelfParam, bool usesGlobalEnv, bool isLambda) : base(lcontext)
3131
{
32-
if (_usesGlobalEnv == usesGlobalEnv)
32+
// This is correct or at least is broken in a way that works, don't change it to == unless you want
33+
// bad things to happen. Bad bad things.
34+
if (_usesGlobalEnv = usesGlobalEnv)
3335
{
3436
CheckTokenType(lcontext, TokenType.Function);
3537
}

0 commit comments

Comments
 (0)