Skip to content

Commit

Permalink
Automated rollback of commit 73fbe6d.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 556726604
  • Loading branch information
tsjs-language-eng authored and copybara-github committed Aug 14, 2023
1 parent 73fbe6d commit e13fabf
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/externs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ const EXTERNS_HEADER = `/**
* to this root.
*/
export function getGeneratedExterns(
externs: {[fileName: string]: {output: string, moduleNamespace: string}},
externs: {[fileName: string]: {output: string, rootNamespace: string}},
rootDir: string): string {
let allExterns = EXTERNS_HEADER;
for (const fileName of Object.keys(externs)) {
Expand Down Expand Up @@ -159,7 +159,7 @@ function isInGlobalAugmentation(declaration: ts.Declaration): boolean {
export function generateExterns(
typeChecker: ts.TypeChecker, sourceFile: ts.SourceFile,
host: AnnotatorHost&GoogModuleProcessorHost):
{output: string, diagnostics: ts.Diagnostic[], moduleNamespace: string} {
{output: string, diagnostics: ts.Diagnostic[], rootNamespace: string} {
let output = '';
const diagnostics: ts.Diagnostic[] = [];
const isDts = isDtsFileName(sourceFile.fileName);
Expand Down Expand Up @@ -282,7 +282,7 @@ export function generateExterns(
}
}

return {output, diagnostics, moduleNamespace};
return {output, diagnostics, rootNamespace};

function emit(str: string) {
output += str;
Expand Down
10 changes: 5 additions & 5 deletions src/tsickle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export function mergeEmitResults(emitResults: EmitResult[]): EmitResult {
let emitSkipped = true;
const emittedFiles: string[] = [];
const externs:
{[fileName: string]: {output: string, moduleNamespace: string}} = {};
{[fileName: string]: {output: string, rootNamespace: string}} = {};
const modulesManifest = new ModulesManifest();
const tsMigrationExportsShimFiles = new Map<string, string>();
for (const er of emitResults) {
Expand Down Expand Up @@ -120,7 +120,7 @@ export interface EmitResult extends ts.EmitResult {
* externs.js files produced by tsickle, if any. module IDs are relative paths
* from fileNameToModuleId.
*/
externs: {[moduleId: string]: {output: string, moduleNamespace: string}};
externs: {[moduleId: string]: {output: string, rootNamespace: string}};

/**
* Content for the generated files, keyed by their intended filename.
Expand Down Expand Up @@ -247,7 +247,7 @@ export function emit(
tsTransformers);

const externs:
{[fileName: string]: {output: string, moduleNamespace: string}} = {};
{[fileName: string]: {output: string, rootNamespace: string}} = {};
if (host.transformTypesToClosure) {
const sourceFiles =
targetSourceFile ? [targetSourceFile] : program.getSourceFiles();
Expand All @@ -256,10 +256,10 @@ export function emit(
if (isDts && host.shouldSkipTsickleProcessing(sourceFile.fileName)) {
continue;
}
const {output, diagnostics, moduleNamespace} =
const {output, diagnostics, rootNamespace} =
generateExterns(typeChecker, sourceFile, host);
if (output) {
externs[sourceFile.fileName] = {output, moduleNamespace};
externs[sourceFile.fileName] = {output, rootNamespace};
}
if (diagnostics) {
tsickleDiagnostics.push(...diagnostics);
Expand Down
2 changes: 1 addition & 1 deletion test/golden_tsickle_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ testFn('golden tests', () => {
if (!test.name.endsWith('.no_externs')) {
// Concatenate externs for the files that are in this tests sources (but
// not other, shared .d.ts files).
const filteredExterns: {[k: string]: { output: string; moduleNamespace: string; }} = {};
const filteredExterns: {[k: string]: { output: string; rootNamespace: string; }} = {};
let anyExternsGenerated = false;
for (const fileName of tsSources.keys()) {
if (externs[fileName]) {
Expand Down

0 comments on commit e13fabf

Please sign in to comment.