From e1fd3e82d42e7f1d45cede365da022cd112bea38 Mon Sep 17 00:00:00 2001 From: sapphi-red <49056869+sapphi-red@users.noreply.github.com> Date: Fri, 7 Feb 2025 23:57:08 +0000 Subject: [PATCH] test(ecmascript): add tests for `ValueType` for undetermined cases (#8960) --- crates/oxc_minifier/tests/ecmascript/value_type.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/crates/oxc_minifier/tests/ecmascript/value_type.rs b/crates/oxc_minifier/tests/ecmascript/value_type.rs index 9fb5528637926..25c9716ca56da 100644 --- a/crates/oxc_minifier/tests/ecmascript/value_type.rs +++ b/crates/oxc_minifier/tests/ecmascript/value_type.rs @@ -202,6 +202,14 @@ fn logical_tests() { #[test] fn undetermined_tests() { + test("foo++", ValueType::Undetermined); // can be number or bigint + test("foo--", ValueType::Undetermined); // can be number or bigint + + test("foo ||= 1", ValueType::Undetermined); + test("foo &&= 1", ValueType::Undetermined); + test("foo ??= 1", ValueType::Undetermined); + + test("this", ValueType::Undetermined); test("foo()", ValueType::Undetermined); test("''.foo", ValueType::Undetermined); test("foo.bar", ValueType::Undetermined);