@@ -4,13 +4,11 @@ import {
4
4
Bundle ,
5
5
chainBundle ,
6
6
CompilerOptions ,
7
- CoreEmitResolver ,
8
7
createEmitHelperFactory ,
9
8
CustomTransformer ,
10
9
CustomTransformerFactory ,
11
10
CustomTransformers ,
12
11
Debug ,
13
- Diagnostic ,
14
12
DiagnosticWithLocation ,
15
13
disposeEmitNodes ,
16
14
EmitFlags ,
@@ -32,7 +30,6 @@ import {
32
30
getUseDefineForClassFields ,
33
31
Identifier ,
34
32
isBundle ,
35
- IsolatedTransformationContext ,
36
33
isSourceFile ,
37
34
LexicalEnvironmentFlags ,
38
35
map ,
@@ -42,7 +39,6 @@ import {
42
39
NodeFactory ,
43
40
NodeFlags ,
44
41
noop ,
45
- notImplemented ,
46
42
NullTransformationContext ,
47
43
returnUndefined ,
48
44
ScriptTarget ,
@@ -668,51 +664,22 @@ export function transformNodes<T extends Node>(resolver: EmitResolver | undefine
668
664
}
669
665
}
670
666
}
667
+
671
668
/** @internal */
672
- export function createTransformationContext ( kind : TransformationContextKind . NullContext ) : NullTransformationContext ;
673
- /** @internal */
674
- export function createTransformationContext (
675
- kind : TransformationContextKind . IsolatedContext ,
676
- options : CompilerOptions ,
677
- diagnostics : Diagnostic [ ] ,
678
- resolver : CoreEmitResolver ,
679
- ) : IsolatedTransformationContext ;
680
- export function createTransformationContext (
681
- kind : TransformationContextKind . IsolatedContext | TransformationContextKind . NullContext ,
682
- options : CompilerOptions = { } ,
683
- diagnostics ?: Diagnostic [ ] ,
684
- resolver ?: EmitResolver | CoreEmitResolver ,
685
- host ?: EmitHost ,
686
- ) : NullTransformationContext | IsolatedTransformationContext | TransformationContext {
687
- return {
688
- kind,
689
- factory : factory , // eslint-disable-line object-shorthand
690
- getCompilerOptions : ( ) => options ,
691
- getEmitResolver : ! resolver ? notImplemented : ( ) => resolver ,
692
- getEmitHost : ! host ? notImplemented : ( ) => host ,
693
- getEmitHelperFactory : notImplemented ,
694
- startLexicalEnvironment : noop ,
695
- resumeLexicalEnvironment : noop ,
696
- suspendLexicalEnvironment : noop ,
697
- endLexicalEnvironment : returnUndefined ,
698
- setLexicalEnvironmentFlags : noop ,
699
- getLexicalEnvironmentFlags : ( ) => 0 ,
700
- hoistVariableDeclaration : noop ,
701
- hoistFunctionDeclaration : noop ,
702
- addInitializationStatement : noop ,
703
- startBlockScope : noop ,
704
- endBlockScope : returnUndefined ,
705
- addBlockScopedVariable : noop ,
706
- requestEmitHelper : noop ,
707
- readEmitHelpers : notImplemented ,
708
- enableSubstitution : noop ,
709
- enableEmitNotification : noop ,
710
- isSubstitutionEnabled : notImplemented ,
711
- isEmitNotificationEnabled : notImplemented ,
712
- onSubstituteNode : noEmitSubstitution ,
713
- onEmitNode : noEmitNotification ,
714
- addDiagnostic : ! diagnostics ? noop : ( diag : Diagnostic ) => diagnostics . push ( diag ) ,
715
- } ;
716
- }
717
- /** @internal */
718
- export const nullTransformationContext : NullTransformationContext = createTransformationContext ( TransformationContextKind . NullContext ) ;
669
+ export const nullTransformationContext : NullTransformationContext = {
670
+ kind : TransformationContextKind . NullContext ,
671
+ factory : factory , // eslint-disable-line object-shorthand
672
+ getCompilerOptions : ( ) => ( { } ) ,
673
+ startLexicalEnvironment : noop ,
674
+ resumeLexicalEnvironment : noop ,
675
+ suspendLexicalEnvironment : noop ,
676
+ endLexicalEnvironment : returnUndefined ,
677
+ setLexicalEnvironmentFlags : noop ,
678
+ getLexicalEnvironmentFlags : ( ) => 0 ,
679
+ hoistVariableDeclaration : noop ,
680
+ hoistFunctionDeclaration : noop ,
681
+ addInitializationStatement : noop ,
682
+ startBlockScope : noop ,
683
+ endBlockScope : returnUndefined ,
684
+ addBlockScopedVariable : noop ,
685
+ } ;
0 commit comments