本文整理汇总了Java中com.google.javascript.rhino.jstype.StaticScope.getTypeOfThis方法的典型用法代码示例。如果您正苦于以下问题:Java StaticScope.getTypeOfThis方法的具体用法?Java StaticScope.getTypeOfThis怎么用?Java StaticScope.getTypeOfThis使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.javascript.rhino.jstype.StaticScope
的用法示例。
在下文中一共展示了StaticScope.getTypeOfThis方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createScopeFrom
import com.google.javascript.rhino.jstype.StaticScope; //导入方法依赖的package包/类
/**
* Given a scope from another symbol table, returns the {@code SymbolScope}
* rooted at the same node. Creates one if it doesn't exist yet.
*/
private SymbolScope createScopeFrom(StaticScope<JSType> otherScope) {
Node otherScopeRoot = otherScope.getRootNode();
SymbolScope myScope = scopes.get(otherScopeRoot);
if (myScope == null) {
StaticScope<JSType> otherScopeParent = otherScope.getParentScope();
// If otherScope is a global scope, and we already have a global scope,
// then something has gone seriously wrong.
//
// Not all symbol tables are rooted at the same global node, and
// we do not want to mix and match symbol tables that are rooted
// differently.
if (otherScopeParent == null) {
// The global scope must be created before any local scopes.
Preconditions.checkState(
globalScope == null, "Global scopes found at different roots");
}
myScope = new SymbolScope(
otherScopeRoot,
otherScopeParent == null ? null : createScopeFrom(otherScopeParent),
otherScope.getTypeOfThis(),
null);
scopes.put(otherScopeRoot, myScope);
if (myScope.isGlobalScope()) {
globalScope = myScope;
}
}
return myScope;
}