diff --git a/src/Avalon.MoonSharp/Tree/Expressions/FunctionDefinitionExpression.cs b/src/Avalon.MoonSharp/Tree/Expressions/FunctionDefinitionExpression.cs index 7ebc874..88d1cac 100644 --- a/src/Avalon.MoonSharp/Tree/Expressions/FunctionDefinitionExpression.cs +++ b/src/Avalon.MoonSharp/Tree/Expressions/FunctionDefinitionExpression.cs @@ -29,7 +29,9 @@ public FunctionDefinitionExpression(ScriptLoadingContext lcontext, bool pushSelf private FunctionDefinitionExpression(ScriptLoadingContext lcontext, bool pushSelfParam, bool usesGlobalEnv, bool isLambda) : base(lcontext) { - if (_usesGlobalEnv == usesGlobalEnv) + // This is correct or at least is broken in a way that works, don't change it to == unless you want + // bad things to happen. Bad bad things. + if (_usesGlobalEnv = usesGlobalEnv) { CheckTokenType(lcontext, TokenType.Function); }