https://bugzilla.wikimedia.org/show_bug.cgi?id=47089
Web browser: ---
Bug ID: 47089
Summary: Add a method of determining which Module was invoked
from within Lua
Product: MediaWiki extensions
Version: unspecified
Hardware: All
OS: All
Status: NEW
Severity: enhancement
Priority: Unprioritized
Component: Scribunto
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected],
[email protected]
Classification: Unclassified
Mobile Platform: ---
I'd like to request that a method be added to determine from within Lua what
Module name was present in the invoke instruction, i.e.
{{ #invoke: MyModule | test }}
I'd like the called function to be able to determine that MyModule is the
origin of the call.
My use case for this is being able to differentiate behavior for:
{{ #invoke: MyModule | test }} and
{{ #invoke: MyModule/sandbox | test }}
Where the sandbox is likely to contain near identical code to the main Module
but you might want it to do something different (e.g. add extra diagnostic
output, include the /sandbox version other modules rather than the main
version, etc.)
The most natural way that I can see to do this is to have the Lua function look
for "/sandbox" in the name of the invoked Module, but there doesn't seem to be
any way at present for Lua to know what Module was being invoked.
--
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l