Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

delay backtrace scrubbing until we actually raise an exception. fixes #…

  • Loading branch information...
commit f85b9662699d7b77fd9ad4e1303565fdaaed0379 1 parent 4a74493
@tenderlove tenderlove authored fxn committed
Showing with 4 additions and 7 deletions.
  1. +4 −7 activesupport/lib/active_support/dependencies.rb
View
11 activesupport/lib/active_support/dependencies.rb
@@ -478,10 +478,6 @@ def load_missing_constant(from_mod, const_name)
qualified_name = qualified_name_for from_mod, const_name
path_suffix = qualified_name.underscore
- trace = caller.reject {|l| l.starts_with? __FILE__ }
- name_error = NameError.new("uninitialized constant #{qualified_name}")
- name_error.set_backtrace(trace)
-
file_path = search_for_file(path_suffix)
if file_path && ! loaded.include?(File.expand_path(file_path)) # We found a matching file to load
@@ -500,11 +496,12 @@ def load_missing_constant(from_mod, const_name)
return parent.const_missing(const_name)
rescue NameError => e
raise unless e.missing_name? qualified_name_for(parent, const_name)
- raise name_error
end
- else
- raise name_error
end
+
+ raise NameError,
+ "uninitialized constant #{qualified_name}",
+ caller.reject {|l| l.starts_with? __FILE__ }
end
# Remove the constants that have been autoloaded, and those that have been
Please sign in to comment.
Something went wrong with that request. Please try again.