Actions
Backport #6578
closed(Ruby 1.9.2-p290) Built-in JSON library fails if "Parser" is defined at top level
Status:
Rejected
Assignee:
-
Description
To duplicate:
class Parser
end
require 'json'
The culprit is line 27 of common/json.rb:
remove_const :Parser if const_defined? :Parser
#const_defined? returns true even if Parser is defined at the top level, not within JSON. In this case, #remove_const fails with an exception. A possible fix would be:
remove_const :Parser if constants.include? :Parser
Actions
Like0
Like0Like0Like0Like0