correctly handle module that only set package.loaded - #6
Conversation
tst2005
commented
Oct 1, 2015
Hello, You fixed the |
tst2005
commented
Oct 2, 2015
I start to make a full require behavior tests ... |
boucman
commented
Oct 2, 2015
i'll have a look, but I only use 5.2 on a regular basis... |
boucman
commented
Oct 3, 2015
ok, fixed |
pygy
commented
Oct 3, 2015
Thanks, this is a very good catch, quite embarrassing, to be honest :-) The test suite most welcome. You may want to add I'll review it all tomorrow. |
boucman
commented
Oct 6, 2015
@pygy are you waiting for a new patch for me with the fix ? i'm not sure what you want
Of course, if you think that's important I can add it, but i'm not 100% convinced... |
pygy
commented
Oct 7, 2015
@boucman that was about the test suite, not your patch. At first glance, it looks fine, but I'll have to review it more thoroughly. I've had a hectic week (baby born earlier today after a problematic pregnancy for my gf. All's fine now :-)), which left me little time for this. Hopefully I'll have time tomorrow evening. |
boucman
commented
Oct 8, 2015
no worries, take your time... this is already fixed in the local copy of darktable, so we are not blocked by this bug my question was more because of the first part : i.e did you expect anything from me.... since that's not the case, I'll just wait. No problem |
boucman
commented
Oct 31, 2015
any news ? (I don't mind, I have a local fix, but other users might get bitten by this bug) |
pygy
commented
Oct 31, 2015
via email
I'll look into this later today. |
boucman
commented
Oct 31, 2015
awesome, thx |
correctly handle module that only set package.loaded
pygy
commented
Nov 1, 2015
Thanks a lot. Now I must do the Luarocks dance :-) |
pygy
commented
Nov 1, 2015
@tst2005 could you send a pull request with your test suite so that you're correctly credited in the Git log and project stats? |
running these two scripts yield different results
(these assume you have luasec installed, apt-get install lua-sec under debian)
will print table: 0x25ef070 (or similar)
will print nil
This is because ssl.https uses the "module" function and that function sets package.loaded["ssl.https"] which, in turn, means the function doesn't have to return anything.
According to lua documentation (and the way the original require works) this is a legal thing to do and require should return the value of package.loaded["ssl.https"] in that case