Overview
| Artifact ID: | 2a40899de0f829afa806a65d210671c7d0770c33051426876a0685e48ffd880b |
|---|---|
| Ticket: | 910d67a229fe7f653d28c00e470f2c256e3628ce
NS-qualified invocations of command evade [namespace unknown] |
| User & Date: | sebres on 2024-03-05 15:55:58 |
Changes
- assignee changed to: "nobody"
- closer changed to: "nobody"
- cmimetype changed to: "text/x-fossil-wiki"
- comment changed to:
The implementation of <code>[namespace unknown]</code> has a small bug - it works if command is invoked from the frame inside the namespace for which it was set, but it is completely evaded if command is called fully-qualified outside of NS. Here a diff illustrating proper implementation: <code><pre style="padding-left:10pt"> % namespace eval ::tcl::xxx { proc unknown args {puts "XXX: [uplevel {namespace current}] $args"}; namespace unknown ::tcl::xxx::unknown } ::tcl::xxx::unknown % namespace inscope ::tcl::xxx { test } XXX: ::tcl::xxx test % ::tcl::xxx::test <b style="color:red">- invalid command name "::tcl::xxx::test"</b> <b style="color:green">+ XXX: :: ::tcl::xxx::test</b> % namespace inscope ::tcl { xxx::test } <b style="color:red">- invalid command name "xxx::test"</b> <b style="color:green">+ XXX: ::tcl xxx::test</b> </pre></code> The issue that specified handler doesn't work everywhere prevents many possible usecases like dynamic NS/ensemble commands or fallbacks, or for instance an implementation of NS-based auto-loading by setting of unknown handler for an NS (instead it forces to call slowly global "::unknown" for known/loaded namespaces with registered unknown handler, which normally should be invoked as first). Because it is already fixed in my fork, it can be relative fast backported here, just must check against NRE (which is different on my side). - foundin changed to: "any"
- is_private changed to: "0"
- login: "sebres"
- priority changed to: "5 Medium"
- private_contact changed to: "50e9528765c18296566374b3fde2df942c394efd"
- resolution changed to: "None"
- severity changed to: "Severe"
- status changed to: "Open"
- submitter changed to: "sebres"
- subsystem changed to: "21. [namespace]"
- title changed to:
NS-qualified invocations of command evade [namespace unknown]
- type changed to: "Bug"