use of com.google.javascript.jscomp.SymbolTable.SymbolScope in project closure-compiler by google.
the class SymbolTableTest method testLocalVarInExterns.
@Test
public void testLocalVarInExterns() {
SymbolTable table = createSymbolTable("", "function customExternFn(customExternArg) {}");
Symbol arg = getLocalVar(table, "customExternArg");
List<Reference> refs = table.getReferenceList(arg);
assertThat(refs).hasSize(1);
Symbol fn = getGlobalVar(table, "customExternFn");
SymbolScope scope = table.getEnclosingScope(refs.get(0).getNode());
assertThat(scope.isGlobalScope()).isFalse();
assertThat(table.getSymbolForScope(scope)).isEqualTo(fn);
}
Aggregations