diff options
| author | dkf <donal.k.fellows@manchester.ac.uk> | 2024-09-16 14:39:12 (GMT) |
|---|---|---|
| committer | dkf <donal.k.fellows@manchester.ac.uk> | 2024-09-16 14:39:12 (GMT) |
| commit | 1f9cd9ee4b823286b09669350d78b4428ad7bd83 (patch) | |
| tree | 55674cef69cc3e24fc4f09d60ee549b6d82cb6db /generic/tclOOBasic.c | |
| parent | ccd91024213075307a8b1285eb9dfd374b14f09d (diff) | |
| download | tcl-1f9cd9ee4b823286b09669350d78b4428ad7bd83.zip tcl-1f9cd9ee4b823286b09669350d78b4428ad7bd83.tar.gz tcl-1f9cd9ee4b823286b09669350d78b4428ad7bd83.tar.bz2 | |
[680503]: Ensure we make the shadow delegate even if there is no argument to the class constructor.
Diffstat (limited to 'generic/tclOOBasic.c')
| -rw-r--r-- | generic/tclOOBasic.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/generic/tclOOBasic.c b/generic/tclOOBasic.c index 5f21203..5fab092 100644 --- a/generic/tclOOBasic.c +++ b/generic/tclOOBasic.c @@ -89,13 +89,14 @@ TclOO_Class_Constructor( Tcl_WrongNumArgs(interp, Tcl_ObjectContextSkippedArgs(context), objv, "?definitionScript?"); return TCL_ERROR; - } else if (objc == Tcl_ObjectContextSkippedArgs(context)) { - return TCL_OK; } /* * Make the class definition delegate. This is special; it doesn't reenter * here (and the class definition delegate doesn't run any constructors). + * + * This needs to be done before consideration of whether to pass the script + * argument to [oo::define]. [Bug 680503] */ nameObj = Tcl_NewStringObj(oPtr->namespacePtr->fullName, -1); @@ -105,6 +106,14 @@ TclOO_Class_Constructor( Tcl_DecrRefCount(nameObj); /* + * If there's nothing else to do, we're done. + */ + + if (objc == Tcl_ObjectContextSkippedArgs(context)) { + return TCL_OK; + } + + /* * Delegate to [oo::define] to do the work. */ |
