diff options
author | dgp <dgp@users.sourceforge.net> | 2016-05-26 17:27:56 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2016-05-26 17:27:56 (GMT) |
commit | 05d072329e0a598e85eae4e081b6ea129a13c0d3 (patch) | |
tree | bcc590086d6e13d86b8ccac5f7e9334f5d9b676e /generic | |
parent | fc6928c19cf817f90924816477e7646e3ab9ccb0 (diff) | |
download | tcl-05d072329e0a598e85eae4e081b6ea129a13c0d3.zip tcl-05d072329e0a598e85eae4e081b6ea129a13c0d3.tar.gz tcl-05d072329e0a598e85eae4e081b6ea129a13c0d3.tar.bz2 |
constructor invocation ensemble rewrite shenanigans also fit into the
refactored routines.
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclOO.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/generic/tclOO.c b/generic/tclOO.c index 9df5029..0454bfe 100644 --- a/generic/tclOO.c +++ b/generic/tclOO.c @@ -1687,7 +1687,7 @@ Tcl_NewObjectInstance( TclOOGetCallContext(oPtr, NULL, CONSTRUCTOR, NULL); if (contextPtr != NULL) { - int result; + int isRoot, result; Tcl_InterpState state; state = Tcl_SaveInterpState(interp, TCL_OK); @@ -1698,13 +1698,14 @@ Tcl_NewObjectInstance( * Adjust the ensmble tracking record if necessary. [Bug 3514761] */ - if (((Interp*) interp)->ensembleRewrite.sourceObjs) { - ((Interp*) interp)->ensembleRewrite.numInsertedObjs += skip-1; - ((Interp*) interp)->ensembleRewrite.numRemovedObjs += skip-1; - } + isRoot = TclInitRewriteEnsemble(interp, skip, skip, objv); result = Tcl_NRCallObjProc(interp, TclOOInvokeContext, contextPtr, objc, objv); + if (isRoot) { + TclResetRewriteEnsemble(interp, 1); + } + /* * It's an error if the object was whacked in the constructor. * Force this if it isn't already an error (don't want to lose @@ -1827,9 +1828,8 @@ TclNRNewObjectInstance( * Adjust the ensmble tracking record if necessary. [Bug 3514761] */ - if (((Interp *) interp)->ensembleRewrite.sourceObjs) { - ((Interp *) interp)->ensembleRewrite.numInsertedObjs += skip - 1; - ((Interp *) interp)->ensembleRewrite.numRemovedObjs += skip - 1; + if (TclInitRewriteEnsemble(interp, skip, skip, objv)) { + TclNRAddCallback(interp, TclClearRootEnsemble, NULL, NULL, NULL, NULL); } /* |