Skip to content

Commit

Permalink
chore: comment
Browse files Browse the repository at this point in the history
  • Loading branch information
hi-ogawa committed Jun 23, 2024
1 parent fda8899 commit b73e45e
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions oxc-rsc/src/hoist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ impl<'a> Traverse<'a> for HoistTransformer<'a> {
// collect references which are neither global nor in own scope
//
let mut bind_vars: Vec<String> = vec![];
// TODO: should loop only references inside the function
for reference in &ctx.symbols().references {
// filter used inside (TODO: probably shouldn't rely on span?)
let ref_span = reference.span();
Expand Down Expand Up @@ -190,18 +191,8 @@ impl<'a> Traverse<'a> for HoistTransformer<'a> {
Modifiers::empty(),
);

// TODO
// sourcemap is broken when body count changes?
// for example, when inserting hoisted function here,
// hoisted function's sourcemap is correct,
// but the last statement misses sourcemap,
// program.body.insert(1, Statement::ExportNamedDeclaration(
// ctx.ast.plain_export_named_declaration_declaration(
// node.span,
// Declaration::FunctionDeclaration(new_func),
// ),
// ));

// TODO: source map missing when mixing up ast nodes
// https://github.com/oxc-project/oxc/issues/3843
program.body.push(Statement::ExportNamedDeclaration(
ctx.ast.plain_export_named_declaration_declaration(
node.span,
Expand Down

0 comments on commit b73e45e

Please sign in to comment.