premake / premake-core

Premake
https://premake.github.io/
BSD 3-Clause "New" or "Revised" License
3.22k stars 620 forks source link

Global variables leakage #1210

Open mingodad opened 5 years ago

mingodad commented 5 years ago

Hello ! I did a port of premake to LJS https://github.com/mingodad/premake-core/tree/ljs and in doing so I noticed that there is variables leaking as globals like here:

modules/vstudio/vs2010_vcxproj.ljs:2268

    function m.precompiledHeader(cfg, condition)
        prjcfg, filecfg = p.config.normalize(cfg)  --??? missing local
        if filecfg then

Cheers !

tdesveauxPKFX commented 5 years ago

Thanks for the info!

Looks like it is indeed missing a local. Did you spot other places like this or do you think you might spot more going forward?

samsinsane commented 5 years ago

It would probably be easier for us to just modify the global metatable to emit warnings/errors when this kind of thing occurs during the unit test execution. It won't catch everything, but it should catch more than enough.

samsinsane commented 5 years ago

Reopening this, while the missing local was resolved, we haven't done anything to verify that this was the only one or will be the only one. I'd like to see a proactive solution, rather than just reactionary fixes.