MCPcopy Create free account
hub / github.com/mozilla/rhino / joinScopes

Method joinScopes

rhino/src/main/java/org/mozilla/javascript/ast/Scope.java:129–140  ·  view source on GitHub ↗

Copies all symbols from source scope to dest scope.

(Scope source, Scope dest)

Source from the content-addressed store, hash-verified

127
128 /** Copies all symbols from source scope to dest scope. */
129 public static void joinScopes(Scope source, Scope dest) {
130 Map<String, Symbol> src = source.ensureSymbolTable();
131 Map<String, Symbol> dst = dest.ensureSymbolTable();
132 if (!Collections.disjoint(src.keySet(), dst.keySet())) {
133 codeBug();
134 }
135 for (Map.Entry<String, Symbol> entry : src.entrySet()) {
136 Symbol sym = entry.getValue();
137 sym.setContainingTable(dest);
138 dst.put(entry.getKey(), sym);
139 }
140 }
141
142 /**
143 * Returns the scope in which this name is defined

Callers 2

visitLetMethod · 0.95
replaceWithMethod · 0.95

Calls 8

setContainingTableMethod · 0.95
ensureSymbolTableMethod · 0.80
keySetMethod · 0.80
entrySetMethod · 0.80
getValueMethod · 0.65
putMethod · 0.65
codeBugMethod · 0.45
getKeyMethod · 0.45

Tested by

no test coverage detected