code: void regenerateGlobalTypedScope(AbstractCompiler compiler, Node root) {
      typedScopeCreator = new TypedScopeCreator(compiler);
      topScope = typedScopeCreator.createScope(root, null);
    }
docs: Regenerates the top scope from scratch.
  
  @param compiler The compiler for which the global scope is regenerated.
  @param root The root of the AST.