Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions crates/oxc_transformer/src/es2017/async_to_generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@

use std::mem;

use oxc_allocator::Box;
use oxc_allocator::Box as ArenaBox;
use oxc_ast::{ast::*, Visit, NONE};
use oxc_semantic::{ReferenceFlags, ScopeFlags, ScopeId, SymbolFlags};
use oxc_span::{Atom, GetSpan, SPAN};
Expand Down Expand Up @@ -467,8 +467,8 @@ impl<'a, 'ctx> AsyncToGenerator<'a, 'ctx> {
#[inline]
fn create_function(
id: Option<BindingIdentifier<'a>>,
params: Box<'a, FormalParameters<'a>>,
body: Box<'a, FunctionBody<'a>>,
params: ArenaBox<'a, FormalParameters<'a>>,
body: ArenaBox<'a, FunctionBody<'a>>,
scope_id: ScopeId,
ctx: &mut TraverseCtx<'a>,
) -> Function<'a> {
Expand Down Expand Up @@ -536,8 +536,8 @@ impl<'a, 'ctx> AsyncToGenerator<'a, 'ctx> {
/// ```
fn create_async_to_generator_call(
&self,
params: Box<'a, FormalParameters<'a>>,
body: Box<'a, FunctionBody<'a>>,
params: ArenaBox<'a, FormalParameters<'a>>,
body: ArenaBox<'a, FunctionBody<'a>>,
scope_id: ScopeId,
ctx: &mut TraverseCtx<'a>,
) -> Expression<'a> {
Expand All @@ -560,8 +560,8 @@ impl<'a, 'ctx> AsyncToGenerator<'a, 'ctx> {
fn create_async_to_generator_declaration(
&self,
bound_ident: &BoundIdentifier<'a>,
params: Box<'a, FormalParameters<'a>>,
body: Box<'a, FunctionBody<'a>>,
params: ArenaBox<'a, FormalParameters<'a>>,
body: ArenaBox<'a, FunctionBody<'a>>,
scope_id: ScopeId,
ctx: &mut TraverseCtx<'a>,
) -> Statement<'a> {
Expand Down Expand Up @@ -592,8 +592,8 @@ impl<'a, 'ctx> AsyncToGenerator<'a, 'ctx> {
fn create_async_to_generator_assignment(
&self,
bound: &BoundIdentifier<'a>,
params: Box<'a, FormalParameters<'a>>,
body: Box<'a, FunctionBody<'a>>,
params: ArenaBox<'a, FormalParameters<'a>>,
body: ArenaBox<'a, FunctionBody<'a>>,
scope_id: ScopeId,
ctx: &mut TraverseCtx<'a>,
) -> Statement<'a> {
Expand All @@ -613,7 +613,7 @@ impl<'a, 'ctx> AsyncToGenerator<'a, 'ctx> {
params: &FormalParameters<'a>,
scope_id: ScopeId,
ctx: &mut TraverseCtx<'a>,
) -> Box<'a, FormalParameters<'a>> {
) -> ArenaBox<'a, FormalParameters<'a>> {
let mut parameters = ctx.ast.vec_with_capacity(params.items.len());
for param in &params.items {
if param.pattern.kind.is_assignment_pattern() {
Expand All @@ -636,7 +636,7 @@ impl<'a, 'ctx> AsyncToGenerator<'a, 'ctx> {

/// Creates an empty [FormalParameters] with [FormalParameterKind::FormalParameter].
#[inline]
fn create_empty_params(ctx: &mut TraverseCtx<'a>) -> Box<'a, FormalParameters<'a>> {
fn create_empty_params(ctx: &mut TraverseCtx<'a>) -> ArenaBox<'a, FormalParameters<'a>> {
ctx.ast.alloc_formal_parameters(
SPAN,
FormalParameterKind::FormalParameter,
Expand Down
4 changes: 2 additions & 2 deletions crates/oxc_transformer/src/jsx/display_name.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
//!
//! * Babel plugin implementation: <https://github.com/babel/babel/blob/main/packages/babel-plugin-transform-react-display-name/src/index.ts>

use oxc_allocator::Box;
use oxc_allocator::Box as ArenaBox;
use oxc_ast::ast::*;
use oxc_span::{Atom, SPAN};
use oxc_traverse::{Ancestor, Traverse, TraverseCtx};
Expand Down Expand Up @@ -133,7 +133,7 @@ impl<'a, 'ctx> ReactDisplayName<'a, 'ctx> {
/// Get the object from `React.createClass({})` or `createReactClass({})`
fn get_object_from_create_class<'b>(
call_expr: &'b mut CallExpression<'a>,
) -> Option<&'b mut Box<'a, ObjectExpression<'a>>> {
) -> Option<&'b mut ArenaBox<'a, ObjectExpression<'a>>> {
if match &call_expr.callee {
callee @ match_member_expression!(Expression) => {
!callee.to_member_expression().is_specific_member_access("React", "createClass")
Expand Down
4 changes: 2 additions & 2 deletions crates/oxc_transformer/src/typescript/module.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use oxc_allocator::Box;
use oxc_allocator::Box as ArenaBox;
use oxc_ast::{ast::*, NONE};
use oxc_span::SPAN;
use oxc_syntax::reference::ReferenceFlags;
Expand Down Expand Up @@ -51,7 +51,7 @@ impl<'a, 'ctx> Traverse<'a> for TypeScriptModule<'a, 'ctx> {
impl<'a, 'ctx> TypeScriptModule<'a, 'ctx> {
fn transform_ts_import_equals(
&self,
decl: &mut Box<'a, TSImportEqualsDeclaration<'a>>,
decl: &mut ArenaBox<'a, TSImportEqualsDeclaration<'a>>,
ctx: &mut TraverseCtx<'a>,
) -> Declaration<'a> {
let kind = VariableDeclarationKind::Var;
Expand Down
4 changes: 2 additions & 2 deletions crates/oxc_transformer/src/typescript/namespace.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use rustc_hash::FxHashSet;

use oxc_allocator::{Box, Vec as ArenaVec};
use oxc_allocator::{Box as ArenaBox, Vec as ArenaVec};
use oxc_ast::{ast::*, NONE};
use oxc_ecmascript::BoundNames;
use oxc_span::{Atom, CompactStr, SPAN};
Expand Down Expand Up @@ -446,7 +446,7 @@ impl<'a, 'ctx> TypeScriptNamespace<'a, 'ctx> {
/// Convert `export const foo = 1` to `Namespace.foo = 1`;
#[allow(clippy::needless_pass_by_value)]
fn handle_variable_declaration(
mut var_decl: Box<'a, VariableDeclaration<'a>>,
mut var_decl: ArenaBox<'a, VariableDeclaration<'a>>,
name: Atom<'a>,
ctx: &TraverseCtx<'a>,
) -> ArenaVec<'a, Statement<'a>> {
Expand Down