code: private Es6SyntacticScopeCreator createScopeCreator() {
      if (validityCheck) {
        return new Es6SyntacticScopeCreator(compiler);
      } else {
        dupHandler = new RedeclarationCheckHandler();
        return new Es6SyntacticScopeCreator(compiler, dupHandler);
      }
    }
docs: Creates the scope creator used by this pass. If not in validity check mode, use a {@link
  RedeclarationCheckHandler} to check var redeclarations.