Tcl Source Code

Check-in [27603c3b06]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:* tests/interp.test: * generic/tclInterp.c (AliasObjCmd): Changed so aliases are invoked at current scope in the target interpreter instead of at the global scope. This was an incompatibility introduced in 8.1 that is being removed. [Bug: 1153, 1556]
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | core-8-1-branch-old
Files: files | file ages | folders
SHA1: 27603c3b069d07d206fd8ed3627634a3c0c17550
User & Date: stanton 1999-03-26 02:24:45
Context
1999-03-26
19:13
-now all test files that skip tests by returning early (which ideally they shouldn't do) call ::t... check-in: 4c4431ec5e user: hershey tags: core-8-1-branch-old
02:24
* tests/interp.test: * generic/tclInterp.c (AliasObjCmd): Changed so aliases are invoked at current ... check-in: 27603c3b06 user: stanton tags: core-8-1-branch-old
00:29
"genWinImage.tcl" is now a bit more informative about what it created. Minor tweak to "tcl.wse.in" t... check-in: c7c062771e user: suresh tags: core-8-1-branch-old
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to generic/tclInterp.c.

     5      5    *	and manipulation of Tcl interpreters from within Tcl scripts.
     6      6    *
     7      7    * Copyright (c) 1995-1997 Sun Microsystems, Inc.
     8      8    *
     9      9    * See the file "license.terms" for information on usage and redistribution
    10     10    * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
    11     11    *
    12         - * RCS: @(#) $Id: tclInterp.c,v 1.1.2.10 1999/03/14 18:56:20 stanton Exp $
           12  + * RCS: @(#) $Id: tclInterp.c,v 1.1.2.11 1999/03/26 02:24:45 stanton Exp $
    13     13    */
    14     14   
    15     15   #include <stdio.h>
    16     16   #include "tclInt.h"
    17     17   #include "tclPort.h"
    18     18   
    19     19   /*
................................................................................
  1402   1402        * in the target interp's global namespace.
  1403   1403        */
  1404   1404        
  1405   1405       Tcl_ListObjGetElements(NULL, aliasPtr->prefixPtr, &prefc, &prefv);
  1406   1406       cmdPtr = Tcl_NewListObj(prefc, prefv);
  1407   1407       Tcl_ListObjReplace(NULL, cmdPtr, prefc, 0, objc - 1, objv + 1);
  1408   1408       Tcl_ListObjGetElements(NULL, cmdPtr, &cmdc, &cmdv);
  1409         -    result = TclObjInvokeGlobal(targetInterp, cmdc, cmdv,
         1409  +    result = TclObjInvoke(targetInterp, cmdc, cmdv,
  1410   1410   	    TCL_INVOKE_NO_TRACEBACK);
  1411   1411       Tcl_DecrRefCount(cmdPtr);
  1412   1412   
  1413   1413       ((Interp *) targetInterp)->numLevels--;
  1414   1414       
  1415   1415       /*
  1416   1416        * Check if we are at the bottom of the stack for the target interpreter.

Changes to tests/interp.test.

     6      6   #
     7      7   # Copyright (c) 1995-1996 Sun Microsystems, Inc.
     8      8   # Copyright (c) 1998-1999 by Scriptics Corporation.
     9      9   #
    10     10   # See the file "license.terms" for information on usage and redistribution
    11     11   # of this file, and for a DISCLAIMER OF ALL WARRANTIES.
    12     12   #
    13         -# RCS: @(#) $Id: interp.test,v 1.1.2.8 1999/03/24 02:49:17 hershey Exp $
           13  +# RCS: @(#) $Id: interp.test,v 1.1.2.9 1999/03/26 02:24:46 stanton Exp $
    14     14   
    15     15   if {[lsearch [namespace children] ::tcltest] == -1} {
    16     16       source [file join [pwd] [file dirname [info script]] defs.tcl]
    17     17   }
    18     18   
    19     19   # The set of hidden commands is platform dependent:
    20     20   
................................................................................
  2324   2324   
  2325   2325   # This test dumps core in Tcl 8.0.3!
  2326   2326   test interp-30.1 {deletion of aliases inside namespaces} {
  2327   2327       set i [interp create]
  2328   2328       $i alias ns::cmd list
  2329   2329       $i alias ns::cmd {}
  2330   2330   } {}
         2331  +
         2332  +test interp-31.1 {alias invocation scope} {
         2333  +    proc mySet {varName value} {
         2334  +	upvar 1 $varName localVar
         2335  +	set localVar $value
         2336  +    }
         2337  +
         2338  +    interp alias {} myNewSet {} mySet
         2339  +    proc testMyNewSet {value} {
         2340  +	myNewSet a $value
         2341  +	return $a
         2342  +    }
         2343  +    catch {unset a}
         2344  +    set result [testMyNewSet "ok"]
         2345  +    rename testMyNewSet {}
         2346  +    rename mySet {}
         2347  +    set result
         2348  +} ok
  2331   2349   
  2332   2350   # cleanup
  2333   2351   foreach i [interp slaves] {
  2334   2352     interp delete $i
  2335   2353   }
  2336   2354   ::tcltest::cleanupTests
  2337   2355   return
  2338         -
  2339         -
  2340         -
  2341         -
  2342         -
  2343         -
  2344         -
  2345         -
  2346         -
  2347         -
  2348         -
  2349         -