From ea0f793e4949e14f93495677b4cd5e047d6d5c0b Mon Sep 17 00:00:00 2001 From: liuly Date: Fri, 26 Apr 2024 06:46:29 +0800 Subject: [PATCH] style: small update --- src/ast/nodes/shared/FunctionBase.ts | 4 ++-- src/ast/variables/ParameterVariable.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ast/nodes/shared/FunctionBase.ts b/src/ast/nodes/shared/FunctionBase.ts index 76b48c7bb4f..e6fc3fb83b7 100644 --- a/src/ast/nodes/shared/FunctionBase.ts +++ b/src/ast/nodes/shared/FunctionBase.ts @@ -79,8 +79,8 @@ export default abstract class FunctionBase extends NodeBase { private deoptimizeParameterVariableValues() { for (const parameter of this.params) { if (parameter instanceof Identifier) { - const parameterVariable = parameter.variable as ParameterVariable | null; - parameterVariable?.markReassigned(); + const parameterVariable = parameter.variable as ParameterVariable; + parameterVariable.markReassigned(); } } } diff --git a/src/ast/variables/ParameterVariable.ts b/src/ast/variables/ParameterVariable.ts index 2115048dc9a..a17bf3b1152 100644 --- a/src/ast/variables/ParameterVariable.ts +++ b/src/ast/variables/ParameterVariable.ts @@ -143,7 +143,7 @@ export default class ParameterVariable extends LocalVariable { * The optimization can be undone by calling `markReassigned`. * @returns the frozen value */ - getKnownValue(): ExpressionEntity { + private getKnownValue(): ExpressionEntity { if (this.frozenValue === null) { this.frozenValue = this.knownValue || UNKNOWN_EXPRESSION; }