refactor(transformer): use NONE in AST builder calls (#7751)

Pure refactor. `NONE` is shorter than `None::<TSThisParameter<'a>>`.
This commit is contained in:
overlookmotel 2024-12-09 16:30:26 +00:00
parent 7e0f7eb67b
commit 75ba4a9e7a
3 changed files with 10 additions and 19 deletions

View file

@ -565,7 +565,7 @@ impl<'a> ArrowFunctionConverter<'a> {
arrow_function_expr.r#async,
false,
arrow_function_expr.type_parameters,
None::<TSThisParameter<'a>>,
NONE,
arrow_function_expr.params,
arrow_function_expr.return_type,
Some(body),

View file

@ -71,7 +71,10 @@ use rustc_hash::FxHashMap;
use serde::Deserialize;
use oxc_allocator::{String as ArenaString, Vec as ArenaVec};
use oxc_ast::ast::{Argument, CallExpression, Expression, TSTypeParameterInstantiation};
use oxc_ast::{
ast::{Argument, CallExpression, Expression},
NONE,
};
use oxc_semantic::{ReferenceFlags, SymbolFlags};
use oxc_span::{Atom, Span, SPAN};
use oxc_traverse::{BoundIdentifier, TraverseCtx};
@ -210,13 +213,7 @@ impl<'a> TransformCtx<'a> {
ctx: &mut TraverseCtx<'a>,
) -> CallExpression<'a> {
let callee = self.helper_load(helper, ctx);
ctx.ast.call_expression(
span,
callee,
None::<TSTypeParameterInstantiation<'a>>,
arguments,
false,
)
ctx.ast.call_expression(span, callee, NONE, arguments, false)
}
/// Same as [`TransformCtx::helper_call`], but returns a `CallExpression` wrapped in an `Expression`.
@ -228,13 +225,7 @@ impl<'a> TransformCtx<'a> {
ctx: &mut TraverseCtx<'a>,
) -> Expression<'a> {
let callee = self.helper_load(helper, ctx);
ctx.ast.expression_call(
span,
callee,
None::<TSTypeParameterInstantiation<'a>>,
arguments,
false,
)
ctx.ast.expression_call(span, callee, NONE, arguments, false)
}
/// Load a helper function and return a callee expression.

View file

@ -106,10 +106,10 @@ impl<'a> TypeScriptEnum<'a> {
false,
false,
false,
None::<TSTypeParameterDeclaration>,
None::<TSThisParameter>,
NONE,
NONE,
params,
None::<TSTypeAnnotation>,
NONE,
Some(body),
func_scope_id,
));