From bb047ee778bad040f67a32c94e8f5978194ee5d2 Mon Sep 17 00:00:00 2001 From: sapphi-red <49056869+sapphi-red@users.noreply.github.com> Date: Sat, 28 Dec 2024 18:51:23 +0900 Subject: [PATCH] chore: fix tests --- .../peephole_substitute_alternate_syntax.rs | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/crates/oxc_minifier/src/ast_passes/peephole_substitute_alternate_syntax.rs b/crates/oxc_minifier/src/ast_passes/peephole_substitute_alternate_syntax.rs index 7cfcb22003af11..06e98791e46a08 100644 --- a/crates/oxc_minifier/src/ast_passes/peephole_substitute_alternate_syntax.rs +++ b/crates/oxc_minifier/src/ast_passes/peephole_substitute_alternate_syntax.rs @@ -1164,29 +1164,29 @@ mod test { #[test] fn test_fold_is_typeof_equals_undefined_resolved() { - test("var x; typeof x !== 'undefined'", "var x; x !== undefined"); - test("var x; typeof x != 'undefined'", "var x; x !== undefined"); - test("var x; 'undefined' !== typeof x", "var x; x !== undefined"); - test("var x; 'undefined' != typeof x", "var x; x !== undefined"); + test("var x; typeof x !== 'undefined'", "var x; x !== void 0"); + test("var x; typeof x != 'undefined'", "var x; x !== void 0"); + test("var x; 'undefined' !== typeof x", "var x; x !== void 0"); + test("var x; 'undefined' != typeof x", "var x; x !== void 0"); - test("var x; typeof x === 'undefined'", "var x; x === undefined"); - test("var x; typeof x == 'undefined'", "var x; x === undefined"); - test("var x; 'undefined' === typeof x", "var x; x === undefined"); - test("var x; 'undefined' == typeof x", "var x; x === undefined"); + test("var x; typeof x === 'undefined'", "var x; x === void 0"); + test("var x; typeof x == 'undefined'", "var x; x === void 0"); + test("var x; 'undefined' === typeof x", "var x; x === void 0"); + test("var x; 'undefined' == typeof x", "var x; x === void 0"); test( "var x; function foo() { typeof x !== 'undefined' }", - "var x; function foo() { x !== undefined }", + "var x; function foo() { x !== void 0 }", ); test( "typeof x !== 'undefined'; function foo() { var x }", "typeof x < 'u'; function foo() { var x }", ); - test("typeof x !== 'undefined'; { var x }", "x !== undefined; { var x }"); + test("typeof x !== 'undefined'; { var x }", "x !== void 0; { var x }"); test("typeof x !== 'undefined'; { let x }", "typeof x < 'u'; { let x }"); - test("typeof x !== 'undefined'; var x", "x !== undefined; var x"); + test("typeof x !== 'undefined'; var x", "x !== void 0; var x"); // input and output both errors with same TDZ error - test("typeof x !== 'undefined'; let x", "x !== undefined; let x"); + test("typeof x !== 'undefined'; let x", "x !== void 0; let x"); } /// Port from