Permalink
Browse files

Apply [5811] to RC

git-svn-id: http://svn-commit.rubyonrails.org/rails/branches/1-2-pre-release@5812 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 7269ee2 commit 0ff4ede7ca3fae4b1ee65354d37440603d2fa8bc @seckar seckar committed Dec 31, 2006
View
@@ -1,5 +1,7 @@
*1.4.0 RC2*
+* Fix Dependencies.autoloaded? to ignore anonymous modules. Closes #6561. [Nicholas Seckar]
+
* Update load once paths to prevent nested once constants from being detected and claimed by an external non-once load. [Nicholas Seckar]
* Deprecation: silence warnings when reporting test errors. [Jeremy Kemper]
@@ -278,6 +278,7 @@ def remove_unloadable_constants!
# Determine if the given constant has been automatically loaded.
def autoloaded?(desc)
+ return false if desc.is_a?(Module) && desc.name.empty? # Empty name => anonymous module.
name = to_constant_name desc
return false unless qualified_const_defined? name
return autoloaded_constants.include?(name)
@@ -305,6 +305,8 @@ def test_autoloaded?
assert Dependencies.autoloaded?("::ModuleFolder")
assert Dependencies.autoloaded?(:ModuleFolder)
+ assert ! Dependencies.autoloaded?(Module.new)
+
Object.send :remove_const, :ModuleFolder
end
end
@@ -705,7 +707,7 @@ def test_remove_constant_handles_double_colon_at_start
def test_load_once_constants_should_not_be_unloaded
with_loading 'autoloading_fixtures' do
Dependencies.load_once_paths = Dependencies.load_paths
- ::A
+ ::A.to_s
assert defined?(A)
Dependencies.clear
assert defined?(A)

0 comments on commit 0ff4ede

Please sign in to comment.