def ensure_loaded!(object, max_retries = 1)
return if object == Registry.root
unless parser.load_order_errors
if object.is_a?(Proxy)
raise NamespaceMissingError, object
else
nil
end
end
if RUBY_PLATFORM =~ /java/
log.warn "JRuby does not implement Kernel#callcc and cannot load files in order. You must specify the correct order manually."
raise NamespaceMissingError, object
end
retries = 0
context = callcc {|c| c }
retries += 1
if object.is_a?(Proxy)
if retries <= max_retries
log.debug "Missing object #{object} in file `#{parser.file}', moving it to the back of the line."
raise Parser::LoadOrderError, context
else
raise NamespaceMissingError, object
end
else
log.debug "Object #{object} successfully resolved. Adding children."
end
object
end