@@ -4,13 +4,11 @@ import {
44 Bundle ,
55 chainBundle ,
66 CompilerOptions ,
7- CoreEmitResolver ,
87 createEmitHelperFactory ,
98 CustomTransformer ,
109 CustomTransformerFactory ,
1110 CustomTransformers ,
1211 Debug ,
13- Diagnostic ,
1412 DiagnosticWithLocation ,
1513 disposeEmitNodes ,
1614 EmitFlags ,
@@ -32,7 +30,6 @@ import {
3230 getUseDefineForClassFields ,
3331 Identifier ,
3432 isBundle ,
35- IsolatedTransformationContext ,
3633 isSourceFile ,
3734 LexicalEnvironmentFlags ,
3835 map ,
@@ -42,7 +39,6 @@ import {
4239 NodeFactory ,
4340 NodeFlags ,
4441 noop ,
45- notImplemented ,
4642 NullTransformationContext ,
4743 returnUndefined ,
4844 ScriptTarget ,
@@ -668,51 +664,22 @@ export function transformNodes<T extends Node>(resolver: EmitResolver | undefine
668664 }
669665 }
670666}
667+
671668/** @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