File tree 1 file changed +3
-6
lines changed
1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -787,19 +787,16 @@ void MJLuaDealloc(void) {
787
787
_lua_stackguard_entry (skin.L );
788
788
789
789
[skin pushLuaRef: refTable ref: completionsForWordFn];
790
- if (!lua_isfunction (skin.L , -1 )) {
791
- HSNSLOG (@" ERROR: MJLuaCompletionsForWord doesn't seem to have a completionsForWordFn" );
792
- _lua_stackguard_exit (skin.L );
793
- return @[];
794
- }
795
790
[skin pushNSObject: completionWord];
796
791
if ([skin protectedCallAndError: @" MJLuaCompletionsForWord" nargs: 1 nresults: 1 ] == NO ) {
797
792
_lua_stackguard_exit (skin.L );
798
793
return @[];
799
794
}
800
795
796
+ NSArray *completions = [skin toNSObjectAtIndex: -1 ];
797
+ lua_pop (skin.L , 1 );
801
798
_lua_stackguard_exit (skin.L );
802
- return [skin toNSObjectAtIndex: - 1 ] ;
799
+ return completions ;
803
800
}
804
801
805
802
// C-Code helper to return current active LuaState. Useful for callbacks to
You can’t perform that action at this time.
0 commit comments