renoise / tools

Scripting tools written by the Renoise team
MIT License
285 stars 43 forks source link

Bundled Renoise `renoise.http.url` redefined _VERSION as "URL 1.0.1" #160

Closed leonnieuwoudt closed 7 months ago

leonnieuwoudt commented 10 months ago

Test

Executing the following script in TestPad.lua throws an error _VERSION is "URL 1.0.1"

TestPad.lua:

require("renoise.http.url")
assert("Lua 5.1" == _VERSION, '_VERSION is "' .. _VERSION .. '"')

Expected

_VERSION must remain as-is Lua 5.1 when require-ing renoise.http.url, thus no assertion failure should occur:

TestPad.lua:

require("renoise.http.url")
assert("Lua 5.1" == _VERSION, '_VERSION is "' .. _VERSION .. '"')
print("ok!", _VERSION)

Caused by

See renoise/xrnx/Libraries/renoise/http/url.lua line 17:

class 'URL'

-----------------------------------------------------------------------------
-- Module version
-----------------------------------------------------------------------------
_VERSION = "URL 1.0.1"  --[[ _G._VERSION is redefined here ]]--

Fix

emuell commented 7 months ago

Thanks for the detailed description and fix!