public static void checkForLJE(ThreadContext context, DynamicScope dynScope, boolean maybeLambda, Block.Type blockType) {
if (IRRuntimeHelpers.inLambda(blockType)) return;
StaticScope scope = dynScope.getStaticScope();
IRScopeType scopeType = scope.getScopeType();
boolean inDefineMethod = false;
while (dynScope != null) {
StaticScope ss = dynScope.getStaticScope();
// SSS FIXME: Why is scopeType empty? Looks like this static-scope
// was not associated with the AST scope that got converted to IR.
//
// Ruby code: lambda { Thread.new { return }.join }.call
//
// To be investigated.
IRScopeType ssType = ss.getScopeType();
if (ssType != null) {
if (ssType.isMethodType()) {
break;
} else if (ss.isArgumentScope() && ssType.isClosureType() && ssType != IRScopeType.EVAL_SCRIPT) {
inDefineMethod = true;
break;
}
}
dynScope = dynScope.getParentScope();