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
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,10 @@ mod test {

#[test]
fn test_convert_to_dotted_properties_quoted_props() {
test("({'':0})", "");
test("({'1.0':0})", "");
test("({'\\u1d17A':0})", "");
test("({'a\\u0004b':0})", "");
test_same("({'':0})");
test_same("({'1.0':0})");
test("({'\\u1d17A':0})", "({ ᴗA: 0 })");
// test("({'a\\u0004b':0})");
}

#[test]
Expand Down
11 changes: 0 additions & 11 deletions crates/oxc_minifier/src/peephole/fold_constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,17 +102,6 @@ impl<'a> PeepholeOptimizations {
let left_val = ctx.get_boolean_value(left);

if let Some(lval) = left_val {
// Bail `0 && (module.exports = {})` for `cjs-module-lexer`.
if !lval {
if let Expression::AssignmentExpression(assign_expr) = &logical_expr.right {
if let Some(member_expr) = assign_expr.left.as_member_expression() {
if member_expr.is_specific_member_access("module", "exports") {
return None;
}
}
}
}

// (TRUE || x) => TRUE (also, (3 || x) => 3)
// (FALSE && x) => FALSE
if if lval { op == LogicalOperator::Or } else { op == LogicalOperator::And } {
Expand Down
1 change: 1 addition & 0 deletions crates/oxc_minifier/src/peephole/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ mod minimize_not_expression;
mod minimize_statements;
mod normalize;
mod remove_dead_code;
mod remove_unused_expression;
mod replace_known_methods;
mod statement_fusion;
mod substitute_alternate_syntax;
Expand Down
Loading
Loading