Ysangkok has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/139822

Change subject: This makes it possible to invoke a module without a frame, 
which is useful since frames are optional. This is needed for my 
modules-as-images prototype.
......................................................................

This makes it possible to invoke a module without a frame, which is useful 
since frames are optional. This is needed for my modules-as-images prototype.

Change-Id: I8a1526a2fe9c3e95c0eb77b174a1f47eeec8cb3f
---
M engines/LuaCommon/LuaCommon.php
1 file changed, 5 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Scribunto 
refs/changes/22/139822/1

diff --git a/engines/LuaCommon/LuaCommon.php b/engines/LuaCommon/LuaCommon.php
index 55eb5a5..1d38c3d 100644
--- a/engines/LuaCommon/LuaCommon.php
+++ b/engines/LuaCommon/LuaCommon.php
@@ -674,7 +674,11 @@
                        throw $this->engine->newException( 
'scribunto-common-notafunction', array( 'args' => array( $name ) ) );
                }
 
-               $result = $this->engine->executeFunctionChunk( $ret, $frame );
+               if ( $frame ) {
+                       $result = $this->engine->executeFunctionChunk( $ret, 
$frame );
+               } else {
+                       $result = $this->engine->executeModule( $ret );
+               }
                if ( isset( $result[0] ) ) {
                        return $result[0];
                } else {

-- 
To view, visit https://gerrit.wikimedia.org/r/139822
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8a1526a2fe9c3e95c0eb77b174a1f47eeec8cb3f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Scribunto
Gerrit-Branch: master
Gerrit-Owner: Ysangkok <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to