Index: TODO =================================================================== diff -u -r3e0565bde9f6f02b2145aecc8c1756c28d8ae507 -ra695cb72c6594bae8b7abb49b76c0ee7b5367b7f --- TODO (.../TODO) (revision 3e0565bde9f6f02b2145aecc8c1756c28d8ae507) +++ TODO (.../TODO) (revision a695cb72c6594bae8b7abb49b76c0ee7b5367b7f) @@ -3364,6 +3364,7 @@ * added "nsf::object::disapatch /obj/ -local ..." similar to "/obj/ -local ..." * extended regression test (next from -local, fully qualified names, private methods, "...dispatch -local") + * provide error message for "/obj/ -system" - nx.tcl: * make calls from "protected", "public", and "private" system calls, Index: generic/nsf.c =================================================================== diff -u -rb1b90edd0eda80223fa49ac604a3b38e63df01fb -ra695cb72c6594bae8b7abb49b76c0ee7b5367b7f --- generic/nsf.c (.../nsf.c) (revision b1b90edd0eda80223fa49ac604a3b38e63df01fb) +++ generic/nsf.c (.../nsf.c) (revision a695cb72c6594bae8b7abb49b76c0ee7b5367b7f) @@ -9388,10 +9388,13 @@ } else { shift = 1; } + if (shift >= objc) { + return NsfPrintError(interp, "no method name specified"); + } methodObj = objv[shift]; methodName = ObjStr(methodObj); if (FOR_COLON_RESOLVER(methodName)) { - return NsfPrintError(interp, "%s: methodname '%s' must not start with a colon", + return NsfPrintError(interp, "%s: method name '%s' must not start with a colon", ObjectName(object), methodName); } } Index: tests/methods.test =================================================================== diff -u -r50b5699927f9d34e2ab7a14e29ccf8dc1f569095 -ra695cb72c6594bae8b7abb49b76c0ee7b5367b7f --- tests/methods.test (.../methods.test) (revision 50b5699927f9d34e2ab7a14e29ccf8dc1f569095) +++ tests/methods.test (.../methods.test) (revision a695cb72c6594bae8b7abb49b76c0ee7b5367b7f) @@ -183,9 +183,9 @@ #:public method foo args {;} :public method bar args {;} } - ? {o :bar} "::o: methodname ':bar' must not start with a colon" + ? {o :bar} "::o: method name ':bar' must not start with a colon" ? {o eval :bar} "" - ? {o :foo} "::o: methodname ':foo' must not start with a colon" + ? {o :foo} "::o: method name ':foo' must not start with a colon" ? {o eval :foo} "::o: unable to dispatch method 'foo'" } Index: tests/protected.test =================================================================== diff -u -r3e0565bde9f6f02b2145aecc8c1756c28d8ae507 -ra695cb72c6594bae8b7abb49b76c0ee7b5367b7f --- tests/protected.test (.../protected.test) (revision 3e0565bde9f6f02b2145aecc8c1756c28d8ae507) +++ tests/protected.test (.../protected.test) (revision a695cb72c6594bae8b7abb49b76c0ee7b5367b7f) @@ -233,6 +233,8 @@ ? {o1 -system info vars} "v" ? {nsf::object::dispatch o1 -system info vars} "v" + ? {o1 -system} "no method name specified" + ? {o1 method foo {} {return foo}} "overloads method method" ? {o1 -system public method foo {} {return foo}} "::o1::foo"