Code simplification in the environment, remove old incompatible flags

Remove --incompatible_static_name_resolution and --incompatible_package_name_is_a_function

#5827
#5637

RELNOTES: None.
PiperOrigin-RevId: 224140026
diff --git a/src/test/java/com/google/devtools/build/lib/syntax/SkylarkEvaluationTest.java b/src/test/java/com/google/devtools/build/lib/syntax/SkylarkEvaluationTest.java
index e2325ce..e7f3861 100644
--- a/src/test/java/com/google/devtools/build/lib/syntax/SkylarkEvaluationTest.java
+++ b/src/test/java/com/google/devtools/build/lib/syntax/SkylarkEvaluationTest.java
@@ -1807,7 +1807,7 @@
 
   @Test
   public void testShadowisNotInitialized() throws Exception {
-    new SkylarkTest("--incompatible_static_name_resolution=true")
+    new SkylarkTest()
         .testIfErrorContains(
             /* error message */ "local variable 'gl' is referenced before assignment",
             "gl = 5",
@@ -1818,22 +1818,8 @@
   }
 
   @Test
-  public void testLegacyGlobalVariableNotShadowed() throws Exception {
-    new SkylarkTest("--incompatible_static_name_resolution=false")
-        .setUp(
-            "gl = 5",
-            "def foo():",
-            "    if False: gl = 2",
-            // The legacy behavior is that the global variable is returned.
-            // With --incompatible_static_name_resolution set to true, this becomes an error.
-            "    return gl",
-            "res = foo()")
-        .testLookup("res", 5);
-  }
-
-  @Test
   public void testShadowBuiltin() throws Exception {
-    new SkylarkTest("--incompatible_static_name_resolution=true")
+    new SkylarkTest()
         .testIfErrorContains(
             "global variable 'len' is referenced before assignment",
             "x = len('abc')",
@@ -1842,13 +1828,6 @@
   }
 
   @Test
-  public void testLegacyShadowBuiltin() throws Exception {
-    new SkylarkTest("--incompatible_static_name_resolution=false")
-        .setUp("x = len('abc')", "len = 2", "y = x + len")
-        .testLookup("y", 5);
-  }
-
-  @Test
   public void testFunctionCallRecursion() throws Exception {
     new SkylarkTest().testIfErrorContains("Recursion was detected when calling 'f' from 'g'",
         "def main():",