Skip to content

Commit 79b2727

Browse files
authored
Remove NoFallthroughCasesInSwitch from SourceFileAffectingCompilerOptions (#1206)
1 parent 48fa6e4 commit 79b2727

File tree

2 files changed

+11
-13
lines changed

2 files changed

+11
-13
lines changed

internal/binder/binder.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2173,7 +2173,7 @@ func (b *Binder) bindCaseBlock(node *ast.Node) {
21732173
clause := clauses[i]
21742174
b.bind(clause)
21752175
fallthroughFlow = b.currentFlow
2176-
if b.currentFlow.Flags&ast.FlowFlagsUnreachable == 0 && i != len(clauses)-1 && b.options().NoFallthroughCasesInSwitch == core.TSTrue {
2176+
if b.currentFlow.Flags&ast.FlowFlagsUnreachable == 0 && i != len(clauses)-1 {
21772177
clause.AsCaseOrDefaultClause().FallthroughFlowNode = b.currentFlow
21782178
}
21792179
}

internal/core/compileroptions.go

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -352,23 +352,21 @@ func (options *CompilerOptions) GetPathsBasePath(currentDirectory string) string
352352
// SourceFileAffectingCompilerOptions are the precomputed CompilerOptions values which
353353
// affect the parse and bind of a source file.
354354
type SourceFileAffectingCompilerOptions struct {
355-
AllowUnreachableCode Tristate
356-
AllowUnusedLabels Tristate
357-
BindInStrictMode bool
358-
EmitScriptTarget ScriptTarget
359-
NoFallthroughCasesInSwitch Tristate
360-
ShouldPreserveConstEnums bool
355+
AllowUnreachableCode Tristate
356+
AllowUnusedLabels Tristate
357+
BindInStrictMode bool
358+
EmitScriptTarget ScriptTarget
359+
ShouldPreserveConstEnums bool
361360
}
362361

363362
func (options *CompilerOptions) SourceFileAffecting() SourceFileAffectingCompilerOptions {
364363
options.sourceFileAffectingCompilerOptionsOnce.Do(func() {
365364
options.sourceFileAffectingCompilerOptions = SourceFileAffectingCompilerOptions{
366-
AllowUnreachableCode: options.AllowUnreachableCode,
367-
AllowUnusedLabels: options.AllowUnusedLabels,
368-
BindInStrictMode: options.AlwaysStrict.IsTrue() || options.Strict.IsTrue(),
369-
EmitScriptTarget: options.GetEmitScriptTarget(),
370-
NoFallthroughCasesInSwitch: options.NoFallthroughCasesInSwitch,
371-
ShouldPreserveConstEnums: options.ShouldPreserveConstEnums(),
365+
AllowUnreachableCode: options.AllowUnreachableCode,
366+
AllowUnusedLabels: options.AllowUnusedLabels,
367+
BindInStrictMode: options.AlwaysStrict.IsTrue() || options.Strict.IsTrue(),
368+
EmitScriptTarget: options.GetEmitScriptTarget(),
369+
ShouldPreserveConstEnums: options.ShouldPreserveConstEnums(),
372370
}
373371
})
374372
return options.sourceFileAffectingCompilerOptions

0 commit comments

Comments
 (0)