# File lib/puppet/parser/parser_support.rb, line 233
233:     def able_to_import?(classname,item,msg)
234:         unless @loaded.include?(item)
235:             begin
236:               case @loading.owner_of(item)
237:               when :this_thread
238:                   return
239:               when :another_thread
240:                   return able_to_import?(classname,item,msg)
241:               when :nobody
242:                   import(item)
243:                   Puppet.info "Autoloaded #{msg}"
244:                   @loaded << item
245:               end
246:             rescue Puppet::ImportError => detail
247:                 # We couldn't load the item
248:             ensure
249:                 @loading.done_with(item)
250:             end
251:         end
252:         # We don't know whether we're looking for a class or definition, so we have
253:         # to test for both.
254:         return @loaded_code.hostclass(classname) || @loaded_code.definition(classname)
255:     end