Skip to content

Commit

Permalink
Use Expr provided method
Browse files Browse the repository at this point in the history
  • Loading branch information
iunanua committed Sep 4, 2024
1 parent 3ed7ef0 commit 947c75b
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/transform/function_prototype_transform.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,5 @@ fn all_args_are_literal(args: &[ExprOrSpread]) -> bool {
}

fn is_undefined_or_null(expr: &Expr) -> bool {
if expr.is_ident() {
let ident = expr.as_ident().unwrap();
return ident.sym == "undefined" || ident.sym == "null";
}

false
expr.is_ident_ref_to("undefined") || expr.is_ident_ref_to("null")
}

0 comments on commit 947c75b

Please sign in to comment.