MCPcopy Index your code
hub / github.com/clojure/clojure / maybeResolveIn

Method maybeResolveIn

src/jvm/clojure/lang/Compiler.java:8010–8043  ·  view source on GitHub ↗
(Namespace n, Symbol sym)

Source from the content-addressed store, hash-verified

8008
8009
8010static public Object maybeResolveIn(Namespace n, Symbol sym) {
8011 //note - ns-qualified vars must already exist
8012 if(sym.ns != null)
8013 {
8014 Namespace ns = namespaceFor(n, sym);
8015 if(ns == null)
8016 return HostExpr.maybeArrayClass(sym);
8017 Var v = ns.findInternedVar(Symbol.intern(sym.name));
8018 if(v == null)
8019 return null;
8020 return v;
8021 }
8022 else if(sym.name.indexOf('.') > 0 && !sym.name.endsWith(".")
8023 || sym.name.charAt(0) == '[')
8024 {
8025 try {
8026 return RT.classForName(sym.name);
8027 } catch (Exception e) {
8028 if (e instanceof ClassNotFoundException)
8029 return null;
8030 else
8031 return Util.sneakyThrow(e);
8032 }
8033 }
8034 else if(sym.equals(NS))
8035 return RT.NS_VAR;
8036 else if(sym.equals(IN_NS))
8037 return RT.IN_NS_VAR;
8038 else
8039 {
8040 Object o = n.getMapping(sym);
8041 return o;
8042 }
8043}
8044
8045
8046static Var lookupVar(Symbol sym, boolean internNew, boolean registerMacro) {

Callers 1

invokeMethod · 0.95

Calls 9

namespaceForMethod · 0.95
maybeArrayClassMethod · 0.95
findInternedVarMethod · 0.95
internMethod · 0.95
classForNameMethod · 0.95
sneakyThrowMethod · 0.95
getMappingMethod · 0.80
indexOfMethod · 0.45
equalsMethod · 0.45

Tested by

no test coverage detected