instance_eval not treated specially by ASTInspector, leads to bad eval framing
and scoping
------------------------------------------------------------------------------------------
Key: JRUBY-2130
URL: http://jira.codehaus.org/browse/JRUBY-2130
Project: JRuby
Issue Type: Bug
Components: Compiler
Affects Versions: JRuby 1.1RC2
Reporter: Charles Oliver Nutter
Assignee: Charles Oliver Nutter
Priority: Blocker
Fix For: JRuby 1.1
Major duh bug for this one. instance_eval was not included in the list of
"special" methods to watch for in ASTInspector. This led to any methods calling
instance_eval getting bad scoping/framing.
{noformat}
Index: src/org/jruby/compiler/ASTInspector.java
===================================================================
--- src/org/jruby/compiler/ASTInspector.java (revision 5960)
+++ src/org/jruby/compiler/ASTInspector.java (working copy)
@@ -104,6 +104,7 @@
FRAME_AWARE_METHODS.add("eval");
FRAME_AWARE_METHODS.add("module_eval");
FRAME_AWARE_METHODS.add("class_eval");
+ FRAME_AWARE_METHODS.add("i_eval");
FRAME_AWARE_METHODS.add("binding");
FRAME_AWARE_METHODS.add("public");
FRAME_AWARE_METHODS.add("private");
@@ -115,6 +116,7 @@
SCOPE_AWARE_METHODS.add("eval");
SCOPE_AWARE_METHODS.add("module_eval");
SCOPE_AWARE_METHODS.add("class_eval");
+ SCOPE_AWARE_METHODS.add("instance_eval");
SCOPE_AWARE_METHODS.add("binding");
SCOPE_AWARE_METHODS.add("local_variables");
}
{noformat}
Need to come up with a simple test case, but it's an easy fix.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email