private static Environment.Frame createConstantsGlobals() { try (Mutability mutability = Mutability.create("CONSTANTS")) { Environment env = Environment.builder(mutability).build(); Runtime.setupConstants(env); return env.getGlobals(); } }
private static Environment.Frame createSkylarkGlobals() { try (Mutability mutability = Mutability.create("SKYLARK")) { Environment env = Environment.builder(mutability).setSkylark().build(); Runtime.setupConstants(env); Runtime.setupMethodEnvironment(env, MethodLibrary.skylarkGlobalFunctions); return env.getGlobals(); } }