mediawiki-extensions-Scribunto/tests/phpunit/engines/LuaCommon
Brad Jorsch 1617bb3deb Return correct frame from mw.getCurrentFrame in certain edge cases
When an #invoke is passed as an argument to another #invoke,
mw.getCurrentFrame() at module scope will return the wrong frame.

On the PHP side, we need to always reset the frame when processing
an #invoke, not just when there's no frame already. I don't remember why
I82dde43e wasn't done that way, but changing it doesn't make any tests
fail and Scribunto tends to have good tests.

On the Lua side, we need to do the same. The logic wih mw.getCurrentFrame()
using a global that gets stored, modified, and reset in several places
was getting confusing, so this patch reworks the logic to inject a
globalless mw.getCurrentFrame() into each #invoke's cloned environment
instead.

Bug: T234368
Change-Id: I8cb5bc4dc14c9b448c9f267e0539daa75e72af4c
2019-10-14 02:39:13 +00:00
..
CommonTest.php Return correct frame from mw.getCurrentFrame in certain edge cases 2019-10-14 02:39:13 +00:00
CommonTests-data-fail1.lua Move tests into tests/phpunit and remove UnitTestsList hook 2017-07-07 13:50:39 -07:00
CommonTests-data-fail2.lua Move tests into tests/phpunit and remove UnitTestsList hook 2017-07-07 13:50:39 -07:00
CommonTests-data-fail3.lua Move tests into tests/phpunit and remove UnitTestsList hook 2017-07-07 13:50:39 -07:00
CommonTests-data-fail4.lua Move tests into tests/phpunit and remove UnitTestsList hook 2017-07-07 13:50:39 -07:00
CommonTests-data-fail5.lua Move tests into tests/phpunit and remove UnitTestsList hook 2017-07-07 13:50:39 -07:00
CommonTests-data.lua Move tests into tests/phpunit and remove UnitTestsList hook 2017-07-07 13:50:39 -07:00
CommonTests-lib.lua Move tests into tests/phpunit and remove UnitTestsList hook 2017-07-07 13:50:39 -07:00
CommonTests.lua Move tests into tests/phpunit and remove UnitTestsList hook 2017-07-07 13:50:39 -07:00
HashLibraryTest.php Split LuaEngineTestBase to LuaEngineUnitTestBase and LuaEngineTestBase 2019-08-31 10:51:26 +02:00
HashLibraryTests.lua Move tests into tests/phpunit and remove UnitTestsList hook 2017-07-07 13:50:39 -07:00
HtmlLibraryTest.php build: Upgrade mediawiki-codesniffer to v28.0.0 2019-10-11 11:31:29 -07:00
HtmlLibraryTests.lua Move tests into tests/phpunit and remove UnitTestsList hook 2017-07-07 13:50:39 -07:00
LanguageLibraryTest.php Split LuaEngineTestBase to LuaEngineUnitTestBase and LuaEngineTestBase 2019-08-31 10:51:26 +02:00
LanguageLibraryTests.lua Move tests into tests/phpunit and remove UnitTestsList hook 2017-07-07 13:50:39 -07:00
LibraryUtilTest.php Split LuaEngineTestBase to LuaEngineUnitTestBase and LuaEngineTestBase 2019-08-31 10:51:26 +02:00
LibraryUtilTests.lua Move tests into tests/phpunit and remove UnitTestsList hook 2017-07-07 13:50:39 -07:00
LuaDataProvider.php Disable Squiz.Classes.ValidClassName.NotCamelCaps globally 2018-05-24 22:26:11 -07:00
LuaEngineTestBase.php build: Upgrade mediawiki-codesniffer to v28.0.0 2019-10-11 11:31:29 -07:00
LuaEngineTestHelper.php Update to use PHPUnit 6 class names 2019-10-05 20:17:05 -07:00
LuaEngineUnitTestBase.php build: Upgrade mediawiki-codesniffer to v28.0.0 2019-10-11 11:31:29 -07:00
LuaEnvironmentComparisonTest.php build: Upgrade mediawiki-codesniffer to v28.0.0 2019-10-11 11:31:29 -07:00
LuaInterpreterTest.php build: Upgrade mediawiki-codesniffer to v28.0.0 2019-10-11 11:31:29 -07:00
MessageLibraryTest.php Split LuaEngineTestBase to LuaEngineUnitTestBase and LuaEngineTestBase 2019-08-31 10:51:26 +02:00
MessageLibraryTests.lua Move tests into tests/phpunit and remove UnitTestsList hook 2017-07-07 13:50:39 -07:00
SiteLibraryTest.php Split LuaEngineTestBase to LuaEngineUnitTestBase and LuaEngineTestBase 2019-08-31 10:51:26 +02:00
SiteLibraryTests.lua Move tests into tests/phpunit and remove UnitTestsList hook 2017-07-07 13:50:39 -07:00
TestFramework.lua Move tests into tests/phpunit and remove UnitTestsList hook 2017-07-07 13:50:39 -07:00
TextLibraryTest.php build: Upgrade mediawiki-codesniffer to v28.0.0 2019-10-11 11:31:29 -07:00
TextLibraryTests.lua Move tests into tests/phpunit and remove UnitTestsList hook 2017-07-07 13:50:39 -07:00
TitleLibraryTest.php build: Upgrade mediawiki-codesniffer to v28.0.0 2019-10-11 11:31:29 -07:00
TitleLibraryTests.lua Move tests into tests/phpunit and remove UnitTestsList hook 2017-07-07 13:50:39 -07:00
UriLibraryTest.php build: Upgrade mediawiki-codesniffer to v28.0.0 2019-10-11 11:31:29 -07:00
UriLibraryTests.lua mw.uri: Support IP-Literal syntax 2019-05-19 07:55:29 +00:00
UstringLibraryNormalizationTests.lua Move tests into tests/phpunit and remove UnitTestsList hook 2017-07-07 13:50:39 -07:00
UstringLibraryPureLuaTest.php build: Upgrade mediawiki-codesniffer to v28.0.0 2019-10-11 11:31:29 -07:00
UstringLibraryTest.php build: Upgrade mediawiki-codesniffer to v28.0.0 2019-10-11 11:31:29 -07:00
UstringLibraryTests.lua ustring: Match undocumented string.gsub behavior 2018-11-01 03:59:35 +00:00