The C# function is global, so the compiled Javascript function is global. Feels to me like the most correct compilation of the C# code.
(Consider: the C# code has no main function, so, if we hid the GetBestMove definition from the rest of the webpage, it would never get called. The optimal Javascript compilation would be an empty string, and that's clearly not valuable.)