}
}
}
static ManyVarsDynamicScope getManyVarsDynamicScope(ScriptingContainer container, int depth) {
ManyVarsDynamicScope scope;
// root our parsing scope with a dummy scope
StaticScope topStaticScope = new LocalStaticScope(null);
topStaticScope.setModule(container.getProvider().getRuntime().getObject());
DynamicScope currentScope = new ManyVarsDynamicScope(topStaticScope, null);
String[] names4Injection = container.getVarMap().getLocalVarNames();
if (names4Injection == null || names4Injection.length == 0) {
scope =
new ManyVarsDynamicScope(new EvalStaticScope(currentScope.getStaticScope()), currentScope);
} else {
scope =
new ManyVarsDynamicScope(new EvalStaticScope(currentScope.getStaticScope(), names4Injection), currentScope);
}
// JRUBY-5501: ensure we've set up a cref for the scope too
scope.getStaticScope().determineModule();