From: Francis De Brabandere <francisdb@gmail.com> Native VBScript distinguishes bare member access from with-parens access and rejects the latter on non-callable values: 5 (Invalid procedure call) on a class variant property, 13 (Type mismatch) on a Dim scalar, and 9 (Subscript out of range) on a Dim array. Wine currently returns the value silently in all three cases; mark with todo_wine pending the fix. --- dlls/vbscript/tests/lang.vbs | 39 ++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/dlls/vbscript/tests/lang.vbs b/dlls/vbscript/tests/lang.vbs index 2d93d4940f6..7bfd91e24af 100644 --- a/dlls/vbscript/tests/lang.vbs +++ b/dlls/vbscript/tests/lang.vbs @@ -1779,6 +1779,22 @@ x = obj.publicArrayProp(2) Call ok(getVT(x) = "VT_EMPTY*", "getVT(x) = " & getVT(x)) Call ok(obj.publicArrayProp("0") = 1, "obj.publicArrayProp(0) = " & obj.publicArrayProp("0")) +' Empty parens on a variant-typed public property: native raises 5 on get +' (not callable). Set with empty parens succeeds — the source-level () adds +' no positional args, so DISPATCH_PROPERTYPUT receives just the value. +On Error Resume Next +Err.Clear +x = obj.publicProp() +Call todo_wine_ok(Err.number = 5, "obj.publicProp() Err.number = " & Err.number) +Err.Clear +x = obj.publicArrayProp() +Call todo_wine_ok(Err.number = 5, "obj.publicArrayProp() Err.number = " & Err.number) +Err.Clear +obj.publicProp() = 7 +Call ok(Err.number = 0, "obj.publicProp() = 7 Err.number = " & Err.number) +Err.Clear +On Error Goto 0 + x = (New testclass).publicProp Class TermTest @@ -2739,6 +2755,29 @@ sub test_index_non_array x(0, 1) = 1 call ok(err.number = 13, "assign int(0,1): err.number = " & err.number) + ' empty parens on a non-array Dim variable: native raises 13. + x = 42 + err.clear + tmp = x() + call todo_wine_ok(err.number = 13, "read int(): err.number = " & err.number) + + x = "hello" + err.clear + tmp = x() + call todo_wine_ok(err.number = 13, "read str(): err.number = " & err.number) + + x = Empty + err.clear + tmp = x() + call todo_wine_ok(err.number = 13, "read empty(): err.number = " & err.number) + + ' empty parens on a Dim array: native raises 9 (subscript out of range, + ' since () supplies zero indices for a multi-dim access). + Dim arr(2) + err.clear + tmp = arr() + call todo_wine_ok(err.number = 9, "read arr(): err.number = " & err.number) + on error goto 0 end sub call test_index_non_array -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10783