Permalink
Browse files

Fix $_ handling in binder.

Gets S02-names/pseudo.t working, and probably more.
  • Loading branch information...
1 parent 51d0246 commit ea421602a32dea070fda1f6696804fc40465bfd8 @jnthn jnthn committed Jun 21, 2013
Showing with 8 additions and 1 deletion.
  1. +8 −1 src/vm/jvm/runtime/org/perl6/rakudo/Binder.java
@@ -482,7 +482,14 @@ private static SixModelObject handleOptional(ThreadContext tc, Ops.GlobalExt gcx
if ((flags & SIG_ELEM_DEFAULT_FROM_OUTER) != 0) {
param.get_attribute_native(tc, gcx.Parameter, "$!variable_name", HINT_variable_name);
String varName = tc.native_s;
- return cf.outer.oLex[cf.outer.codeRef.staticInfo.oTryGetLexicalIdx(varName)];
+ CallFrame curOuter = cf.outer;
+ while (curOuter != null) {
+ Integer idx = curOuter.codeRef.staticInfo.oTryGetLexicalIdx(varName);
+ if (idx != null)
+ return curOuter.oLex[idx];
+ curOuter = curOuter.outer;
+ }
+ return null;
}
/* Do we have a default value or value closure? */

0 comments on commit ea42160

Please sign in to comment.