-
a2c0f5c9
by Francis De Brabandere at 2026-05-03T17:22:57+02:00
vbscript/tests: Add coverage for BSTR vs numeric comparison.
Add assertions for locale-invariant numeric-string forms ("+5",
"-0", "05", " 5", "5 ", "5e0") and for type-mismatch errors
raised when an unparseable BSTR ("abc", "", " ") is compared to
a number with =, <> or a relational operator.
-
ba65ac00
by Francis De Brabandere at 2026-05-03T17:23:00+02:00
vbscript/tests: Cover BSTR comparison with VT_BYREF and additional numeric VTs.
ByRef parameter holding a BSTR still coerces to numeric for
comparison ("5" = 5 is True). For VT_UI1/VT_CY operands, Windows
string-compares against CStr(numeric) rather than numeric-coercing,
so non-numeric BSTRs return False with no error and relational
operators use lex order. Hex ("&hff") and scientific ("1e2") BSTRs
parse as numeric. The VT_UI1/VT_CY divergences are marked
todo_wine pending the var_cmp fix.
-
a4a61340
by Francis De Brabandere at 2026-05-03T17:23:02+02:00
vbscript/tests: Cover BSTR comparison literal vs non-literal dispatch.
Numeric literals raise type-mismatch (error 13) on unparseable
BSTR; variables, arithmetic, C-coercion, function returns and
parameters use string-compare instead. Cases needing the
var_cmp rework are marked todo_wine.
-
67deef7f
by Francis De Brabandere at 2026-05-03T17:23:03+02:00
vbscript: Match native BSTR-vs-numeric and BSTR-vs-Boolean comparison.
The compiler tags each comparison operand at the source-AST level: a bare
numeric literal (EXPR_INT / EXPR_DOUBLE / EXPR_DATE, parens transparent)
sets a flag bit on the comparison opcode, and var_cmp dispatches on that
flag so BSTR vs literal numeric goes through numeric coercion (error 13
on parse failure) while BSTR vs non-literal numeric uses string compare
against CStr(numeric). VT_BOOL is handled in the same branch with
hardcoded "True"/"False" since VarBstrFromBool yields "-1"/"0".
Const references compile to an EXPR_MEMBER node, so they are correctly
tagged non-literal even though the value is inlined at compile time.
-
95dc492c
by Francis De Brabandere at 2026-05-03T17:23:05+02:00
vbscript/tests: Cover BSTR comparison with dispatch-only numeric VTs.
VT_I8/UI8/I1/UI2/UI4/UINT cannot be produced by VBScript natively; they
arrive only via COM dispatch. Extend testobj with read-only properties
returning each of these VTs and exercise BSTR-vs-numeric comparison
against them. The non-literal dispatch path goes through string compare
against CStr(numeric), so all six cases should behave like VT_UI1/VT_CY.
-
92eb7336
by Francis De Brabandere at 2026-05-03T17:23:07+02:00
vbscript: Reject Automation types not supported in VBScript on compare.
Native VBScript raises error 458 (VBSE_INVALID_TYPELIB_VARIABLE) when
an expression involves a Variant whose type is one of VT_UI2/VT_UI4/
VT_UI8/VT_UINT, on both 32-bit and 64-bit. Add a script-level type
gate at the entry of var_cmp so BSTR-vs-{UI2,UI4,UI8,UINT} comparisons
match.