当前位置: 首页>>代码示例>>Java>>正文


Java StaticScope.getTypeOfThis方法代码示例

本文整理汇总了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;
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:36,代码来源:SymbolTable.java


注:本文中的com.google.javascript.rhino.jstype.StaticScope.getTypeOfThis方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。