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
6 changes: 4 additions & 2 deletions .github/workflows/lint-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ jobs:
- name: Check formatting
run: npm run format:check
- name: Check Rust formatting
run: cd instrumentation-wasm && cargo fmt --check
run: cargo fmt --check
working-directory: ./instrumentation-wasm
- name: Run Rust Linter
run: cd instrumentation-wasm && cargo clippy
run: cargo clippy -- -D warnings
working-directory: ./instrumentation-wasm
100 changes: 50 additions & 50 deletions instrumentation-wasm/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions instrumentation-wasm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ name = "node_code_instrumentation"
crate-type = ["cdylib", "rlib"]

[dependencies]
oxc_allocator = "0.96.0"
oxc_ast = "0.96.0"
oxc_codegen = "0.96.0"
oxc_parser = "0.96.0"
oxc_semantic = "0.96.0"
oxc_span = "0.96.0"
oxc_traverse = "0.96.0"
oxc_allocator = "0.102.0"
oxc_ast = "0.102.0"
oxc_codegen = "0.102.0"
oxc_parser = "0.102.0"
oxc_semantic = "0.102.0"
oxc_span = "0.102.0"
oxc_traverse = "0.102.0"
serde = "1.0.228"
serde_json = "1.0.145"
wasm-bindgen = "0.2.105"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,7 @@ fn transform_statement<'a>(
.take()
.unwrap_or_else(|| builder.expression_identifier(SPAN, "undefined"));

let needs_await = match arg_expr {
Expression::AwaitExpression(_) => true,
_ => false,
};
let needs_await = matches!(arg_expr, Expression::AwaitExpression(_));

instrument_args.push(arg_expr.into());

Expand Down
6 changes: 3 additions & 3 deletions instrumentation-wasm/src/js_transformer/transformer_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ impl<'a> Traverse<'a, TraverseState> for Transformer<'a> {

// We need to collect the arg names before we make the body mutable
let arg_names = if instruction.modify_args {
get_function_or_method_arg_names(&function_args)
get_function_or_method_arg_names(function_args)
} else {
Vec::new()
};
Expand Down Expand Up @@ -194,7 +194,7 @@ impl<'a> Traverse<'a, TraverseState> for Transformer<'a> {
node: &mut oxc_ast::ast::VariableDeclarator<'a>,
_ctx: &mut TraverseCtx<'a, TraverseState>,
) {
if !node.id.kind.is_binding_identifier() || !node.init.is_some() {
if !node.id.kind.is_binding_identifier() || node.init.is_none() {
return;
}

Expand Down Expand Up @@ -226,7 +226,7 @@ impl<'a> Traverse<'a, TraverseState> for Transformer<'a> {

// We need to collect the arg names before we make the body mutable
let arg_names = if instruction.modify_args {
get_function_or_method_arg_names(&function_args)
get_function_or_method_arg_names(function_args)
} else {
Vec::new()
};
Expand Down