Last modified: 2013-01-10 19:55:33 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 39494 - Shared global scope + implicit globals are a bad fit for wiki templates
Shared global scope + implicit globals are a bad fit for wiki templates
Status: RESOLVED DUPLICATE of bug 39610
Product: MediaWiki extensions
Classification: Unclassified
Scribunto (Other open bugs)
All All
: Low normal (vote)
: ---
Assigned To: Nobody - You can work on this!
Depends on:
  Show dependency treegraph
Reported: 2012-08-20 06:53 UTC by Ori Livneh
Modified: 2013-01-10 19:55 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Description Ori Livneh 2012-08-20 06:53:05 UTC
It's inelegant to have to explicitly export things when there is already a "local" keyword. Why not export everything non-local by default?

If that is not possible for some reason, why not initialize an empty table for each module, assign it a reserved name, and export it implicitly? I imagine something like this implicitly wrapping each module:

local module = {};
<<module code>>
return module;
Comment 1 Ori Livneh 2012-08-22 10:37:05 UTC
If you called the default module object "this", it'd behave exactly like a JavaScript constructor. I'd still prefer the former option, though (i.e., relying on the local keyword to assign to module or global scope).
Comment 2 Ori Livneh 2013-01-10 19:55:33 UTC
I did not articulate myself clearly in this report and bug 39610 has meanwhile become the locus of the conversation about scoping, so I'm closing this as a duplicate of that bug.

*** This bug has been marked as a duplicate of bug 39610 ***

Note You need to log in before you can comment on or make changes to this bug.