code: @Override
    public JSType getTypeOfThis() {
      Node root = getRootNode();
      if (isGlobal()) {
        return ObjectType.cast(root.getJSType());
      } else if (NodeUtil.isNonArrowFunction(root)) {
        JSType nodeType = root.getJSType();
        if (nodeType != null && nodeType.isFunctionType()) {
          return nodeType.toMaybeFunctionType().getTypeOfThis();
        } else {
          // Executed when the current scope has not been typechecked.
          return null;
        }
      } else {
        return getParent().getTypeOfThis();
      }
    }
docs: Gets the type of {@code this} in the current scope.