<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -384,7 +384,7 @@ module Dependencies #:nodoc:
     return new_constants
   ensure
     # Remove the stack frames that we added.
-    if defined?(watch_frames) &amp;&amp; ! watch_frames.empty?
+    if defined?(watch_frames) &amp;&amp; ! watch_frames.blank?
       frame_ids = watch_frames.collect(&amp;:object_id)
       constant_watch_stack.delete_if do |watch_frame|
         frame_ids.include? watch_frame.object_id</diff>
      <filename>activesupport/lib/active_support/dependencies.rb</filename>
    </modified>
    <modified>
      <diff>@@ -584,6 +584,12 @@ class DependenciesTest &lt; Test::Unit::TestCase
     assert_equal [], m
   end
 
+  def test_new_constants_in_with_illegal_module_name_raises_correct_error
+    assert_raises(NameError) do
+      Dependencies.new_constants_in(&quot;Illegal-Name&quot;) {}
+    end
+  end
+
   def test_file_with_multiple_constants_and_require_dependency
     with_loading 'autoloading_fixtures' do
       assert ! defined?(MultipleConstantFile)</diff>
      <filename>activesupport/test/dependencies_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>089251581137b041828a7e6dcbf75ecbef55b4a3</id>
    </parent>
  </parents>
  <author>
    <name>Tom Ward</name>
    <email>tom@popdog.net</email>
  </author>
  <url>http://github.com/rails/rails/commit/ebb642fa3a2b1a4e31abf9610ca634e6bb5d57d3</url>
  <id>ebb642fa3a2b1a4e31abf9610ca634e6bb5d57d3</id>
  <committed-date>2008-05-20T03:44:23-07:00</committed-date>
  <authored-date>2008-04-29T05:21:51-07:00</authored-date>
  <message>Fix Dependencies watch_frames collection. [#24 state:resolved]

Previously, the code collecting watch_frames could fail leaving
watch_frames defined but nil. The cleanup code checks watch_frames
is defined, but not that it holds a value, raising an undefined method
on NilClass error rather than the original cause.  This can make
debugging the underlying cause a total pain.

Signed-off-by: Pratik Naik &lt;pratiknaik@gmail.com&gt;</message>
  <tree>d62b969fa48509a4bd8f228950ad9ce4627be518</tree>
  <committer>
    <name>Pratik Naik</name>
    <email>pratiknaik@gmail.com</email>
  </committer>
</commit>
