From 2fc5f002e08f9207a959a82b66931f1a5bb991db Mon Sep 17 00:00:00 2001 From: George Kalpakas Date: Sat, 22 Dec 2018 13:40:13 +0200 Subject: [PATCH] refactor(ivy): re-use the `ForeignFunctionResolver` interface when appropriate (#27697) This makes the types (and intentions) more explicit and clear. PR Close #27697 --- .../compiler-cli/src/ngtsc/annotations/src/ng_module.ts | 7 ++++--- .../src/ngtsc/partial_evaluator/src/interface.ts | 4 ++-- .../src/ngtsc/partial_evaluator/src/interpreter.ts | 7 +++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/compiler-cli/src/ngtsc/annotations/src/ng_module.ts b/packages/compiler-cli/src/ngtsc/annotations/src/ng_module.ts index 2de2260e2b..53aa832b04 100644 --- a/packages/compiler-cli/src/ngtsc/annotations/src/ng_module.ts +++ b/packages/compiler-cli/src/ngtsc/annotations/src/ng_module.ts @@ -188,11 +188,12 @@ export class NgModuleDecoratorHandler implements DecoratorHandler, args: ts.Expression[]) => - ts.Expression | null; + (node: Reference, + args: ReadonlyArray) => ts.Expression | null; export class PartialEvaluator { constructor( diff --git a/packages/compiler-cli/src/ngtsc/partial_evaluator/src/interpreter.ts b/packages/compiler-cli/src/ngtsc/partial_evaluator/src/interpreter.ts index f38b1df8e2..b172def528 100644 --- a/packages/compiler-cli/src/ngtsc/partial_evaluator/src/interpreter.ts +++ b/packages/compiler-cli/src/ngtsc/partial_evaluator/src/interpreter.ts @@ -13,6 +13,7 @@ import {Declaration, ReflectionHost} from '../../reflection'; import {ArraySliceBuiltinFn} from './builtin'; import {DynamicValue} from './dynamic'; +import {ForeignFunctionResolver} from './interface'; import {BuiltinFn, EnumValue, ResolvedValue, ResolvedValueArray, ResolvedValueMap} from './result'; @@ -73,9 +74,7 @@ interface Context { */ resolutionContext: string; scope: Scope; - foreignFunctionResolver? - (ref: Reference, - args: ReadonlyArray): ts.Expression|null; + foreignFunctionResolver?: ForeignFunctionResolver; } export class StaticInterpreter { @@ -542,4 +541,4 @@ function joinModuleContext(existing: Context, node: ts.Node, decl: Declaration): } else { return EMPTY; } -} \ No newline at end of file +}