提交 26bdcf72 编写于 作者: R Rafael Mendonça França

Merge pull request #6395 from kennyj/fix_warning_20120519-2

Fix warning: shadowing outer local variable - constant.
......@@ -212,10 +212,10 @@ def constantize(camel_cased_word)
# Go down the ancestors to check it it's owned
# directly before we reach Object or the end of ancestors.
constant = constant.ancestors.inject do |constant, ancestor|
break constant if ancestor == Object
constant = constant.ancestors.inject do |const, ancestor|
break const if ancestor == Object
break ancestor if ancestor.const_defined?(name, false)
constant
const
end
# owner is in Object, so raise
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册