Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
7 changes: 0 additions & 7 deletions internal/compiler/fileloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ type processedFiles struct {
importHelpersImportSpecifiers map[tspath.Path]*ast.Node
libFiles map[tspath.Path]*LibFile
// List of present unsupported extensions
unsupportedExtensions []string
sourceFilesFoundSearchingNodeModules collections.Set[tspath.Path]
includeProcessor *includeProcessor
// if file was included using source file and its output is actually part of program
Expand Down Expand Up @@ -152,7 +151,6 @@ func processAllProgramFiles(
sourceFileMetaDatas := make(map[tspath.Path]ast.SourceFileMetaData, totalFileCount)
var jsxRuntimeImportSpecifiers map[tspath.Path]*jsxRuntimeImportSpecifier
var importHelpersImportSpecifiers map[tspath.Path]*ast.Node
var unsupportedExtensions []string
var sourceFilesFoundSearchingNodeModules collections.Set[tspath.Path]
libFilesMap := make(map[tspath.Path]*LibFile, libFileCount)

Expand Down Expand Up @@ -217,10 +215,6 @@ func processAllProgramFiles(
}
importHelpersImportSpecifiers[path] = task.importHelpersImportSpecifier
}
extension := tspath.TryGetExtensionFromPath(file.FileName())
if slices.Contains(tspath.SupportedJSExtensionsFlat, extension) {
unsupportedExtensions = core.AppendIfUnique(unsupportedExtensions, extension)
}
if task.fromExternalLibrary {
sourceFilesFoundSearchingNodeModules.Add(path)
}
Expand Down Expand Up @@ -251,7 +245,6 @@ func processAllProgramFiles(
sourceFileMetaDatas: sourceFileMetaDatas,
jsxRuntimeImportSpecifiers: jsxRuntimeImportSpecifiers,
importHelpersImportSpecifiers: importHelpersImportSpecifiers,
unsupportedExtensions: unsupportedExtensions,
sourceFilesFoundSearchingNodeModules: sourceFilesFoundSearchingNodeModules,
libFiles: libFilesMap,
missingFiles: missingFiles,
Expand Down
6 changes: 0 additions & 6 deletions internal/compiler/program.go
Original file line number Diff line number Diff line change
Expand Up @@ -1605,12 +1605,6 @@ func (p *Program) IsSourceFileFromExternalLibrary(file *ast.SourceFile) bool {
return p.sourceFilesFoundSearchingNodeModules.Has(file.Path())
}

// UnsupportedExtensions returns a list of all present "unsupported" extensions,
// e.g. extensions that are not yet supported by the port.
func (p *Program) UnsupportedExtensions() []string {
return p.unsupportedExtensions
}

func (p *Program) GetJSXRuntimeImportSpecifier(path tspath.Path) (moduleReference string, specifier *ast.Node) {
if result := p.jsxRuntimeImportSpecifiers[path]; result != nil {
return result.moduleReference, result.specifier
Expand Down
36 changes: 2 additions & 34 deletions internal/testrunner/compiler_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,6 @@ func (r *CompilerBaselineRunner) runSingleConfigTest(t *testing.T, testName stri
compilerTest.verifySourceMapRecord(t, r.testSuitName, r.isSubmodule)
compilerTest.verifyTypesAndSymbols(t, r.testSuitName, r.isSubmodule)
compilerTest.verifyModuleResolution(t, r.testSuitName, r.isSubmodule)
// !!! Verify all baselines

compilerTest.verifyUnionOrdering(t)
compilerTest.verifyParentPointers(t)
}
Expand Down Expand Up @@ -368,9 +366,8 @@ func (c *compilerTest) verifyDiagnostics(t *testing.T, suiteName string, isSubmo
defer testutil.RecoverAndFail(t, "Panic on creating error baseline for test "+c.filename)
files := core.Concatenate(c.tsConfigFiles, core.Concatenate(c.toBeCompiled, c.otherFiles))
tsbaseline.DoErrorBaseline(t, c.configuredName, files, c.result.Diagnostics, c.result.Options.Pretty.IsTrue(), baseline.Options{
Subfolder: suiteName,
IsSubmodule: isSubmodule,
IsSubmoduleAccepted: c.containsUnsupportedOptionsForDiagnostics(),
Subfolder: suiteName,
IsSubmodule: isSubmodule,
DiffFixupOld: func(old string) string {
var sb strings.Builder
sb.Grow(len(old))
Expand Down Expand Up @@ -410,11 +407,6 @@ func (c *compilerTest) verifyJavaScriptOutput(t *testing.T, suiteName string, is
return
}

if c.options.OutFile != "" {
// Just return, no t.Skip; this is unsupported so testing them is not helpful.
return
}

t.Run("output", func(t *testing.T) {
if msg, ok := skippedEmitTests[c.basename]; ok {
t.Skip(msg)
Expand Down Expand Up @@ -442,11 +434,6 @@ func (c *compilerTest) verifyJavaScriptOutput(t *testing.T, suiteName string, is
}

func (c *compilerTest) verifySourceMapOutput(t *testing.T, suiteName string, isSubmodule bool) {
if c.options.OutFile != "" {
// Just return, no t.Skip; this is unsupported so testing them is not helpful.
return
}

t.Run("sourcemap", func(t *testing.T) {
defer testutil.RecoverAndFail(t, "Panic on creating source map output for test "+c.filename)
headerComponents := tspath.GetPathComponentsRelativeTo(repo.TestDataPath, c.filename, tspath.ComparePathsOptions{})
Expand All @@ -467,11 +454,6 @@ func (c *compilerTest) verifySourceMapOutput(t *testing.T, suiteName string, isS
}

func (c *compilerTest) verifySourceMapRecord(t *testing.T, suiteName string, isSubmodule bool) {
if c.options.OutFile != "" {
// Just return, no t.Skip; this is unsupported so testing them is not helpful.
return
}

t.Run("sourcemap record", func(t *testing.T) {
defer testutil.RecoverAndFail(t, "Panic on creating source map record for test "+c.filename)
headerComponents := tspath.GetPathComponentsRelativeTo(repo.TestDataPath, c.filename, tspath.ComparePathsOptions{})
Expand Down Expand Up @@ -601,17 +583,3 @@ func (c *compilerTest) verifyParentPointers(t *testing.T) {
}
})
}

func (c *compilerTest) containsUnsupportedOptionsForDiagnostics() bool {
if len(c.result.Program.UnsupportedExtensions()) != 0 {
return true
}
if c.options.BaseUrl != "" {
return true
}
if c.options.OutFile != "" {
return true
}

return false
}
1 change: 0 additions & 1 deletion internal/testutil/tsbaseline/type_symbol_baseline.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ func DoTypeAndSymbolBaseline(

return sb.String()[:sb.Len()-1]
}
typesOpts.IsSubmoduleAccepted = len(program.UnsupportedExtensions()) != 0 // TODO(jakebailey): read submoduleAccepted.txt

checkBaselines(t, baselinePath, allFiles, fullWalker, header, typesOpts, false /*isSymbolBaseline*/)
})
Expand Down
Loading
Loading