Singleton methods leak into global variable
-------------------------------------------
Key: JRUBY-5819
URL: http://jira.codehaus.org/browse/JRUBY-5819
Project: JRuby
Issue Type: Bug
Affects Versions: JRuby 1.5.6
Environment: OS X Snow Leopard 10.6.7
Darwin Kernel Version 10.7.0: Sat Jan 29 15:17:16 PST 2011;
root:xnu-1504.9.37~1/RELEASE_I386 i386
Reporter: Daniel Vydra
Assignee: Thomas E Enebo
Fix For: JRuby 1.6
Attachments: jira_example.rb
When an object is extended with new methods, those methods "leak" into the
global variables.
I can only reproduce this in jruby 1.5.6, it works correctly under mri 1.8.7,
mri 1.9.1 and jruby 1.6.0 & 1.6.2
# because the global variable has the extended to_i method as a
singleton_method, confused somehow from when the str instance was extended.
see attachment for example
Expected result: 2, 1, []
Actual result under jruby 1.5.6: 2, 2, ["to_i"]
--
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