diff options
author | dgp <dgp@users.sourceforge.net> | 2013-05-16 13:24:28 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2013-05-16 13:24:28 (GMT) |
commit | abe2d748971526df4beda6bdf4f59bef33e6e1c5 (patch) | |
tree | f7cae97691eb3d67ccee6c69ec181c9c2ca0b905 | |
parent | 6a8e707f9e6b7d108220a53ab44030604a690801 (diff) | |
download | tcl-abe2d748971526df4beda6bdf4f59bef33e6e1c5.zip tcl-abe2d748971526df4beda6bdf4f59bef33e6e1c5.tar.gz tcl-abe2d748971526df4beda6bdf4f59bef33e6e1c5.tar.bz2 |
Confirmed that every caller of TclProcCompileProc() arranges for the
procPtr and nsPtr arguments: nsPtr == procPtr->cmdPtr->nsPtr.
This makes the test in TclCompileScript() useless. TCS() will always
compile in the current namespace of the interp. Remove the code that
obfuscates that fact.
-rw-r--r-- | generic/tclCompile.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/generic/tclCompile.c b/generic/tclCompile.c index 8891d3f..cb1f806 100644 --- a/generic/tclCompile.c +++ b/generic/tclCompile.c @@ -1855,7 +1855,6 @@ TclCompileScript( * code. Init. to avoid compiler warning. */ unsigned char *entryCodeNext = envPtr->codeNext; const char *p, *next; - Namespace *cmdNsPtr = NULL; Command *cmdPtr; Tcl_Token *tokenPtr; int bytesLeft, isFirstCmd, wordIdx, currCmdIndex, commandLength, objIndex; @@ -1874,14 +1873,6 @@ TclCompileScript( Tcl_ResetResult(interp); isFirstCmd = 1; -#if 0 - if (envPtr->procPtr != NULL) { - cmdNsPtr = envPtr->procPtr->cmdPtr->nsPtr; - } else { - cmdNsPtr = NULL; /* use current NS */ - } -#endif - /* * Each iteration through the following loop compiles the next command * from the script. @@ -1988,7 +1979,7 @@ TclCompileScript( if (expand) { cmdPtr = FindCommandFromToken(interp, parsePtr->tokenPtr, - (Tcl_Namespace *) cmdNsPtr); + (Tcl_Namespace *) NULL); if (cmdPtr && (cmdPtr->flags & CMD_COMPILES_EXPANDED)) { expand = 0; } @@ -2058,7 +2049,7 @@ TclCompileScript( if ((wordIdx == 0) && !expand) { cmdPtr = FindCommandFromToken(interp, tokenPtr, - (Tcl_Namespace *) cmdNsPtr); + (Tcl_Namespace *) NULL); if ((cmdPtr != NULL) && !(iPtr->flags & DONT_COMPILE_CMDS_INLINE)) { |