base64.lua: correct daw_register self-registration guard (truthy check) #44
Labels
No labels
coordination/cross-repo
coordination/needed
effort
large
effort
medium
effort
small
meta/duplicate
meta/planning
meta/wontfix
priority
high
priority
low
priority
medium
session
blocker
session
handover
session
next
status
blocked
status
done
status
in-progress
status
review
status
to-go
type
admin
type
bug
type
config
type
deployment
type
docs
type
enhancement
type
feature
type
handover
type
infrastructure
type
installation
type
maintenance
type
migration
type
research
type
security
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
DAW/daw-lua-common#44
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Goal
Correct
base64.lua's self-registration guard fromtype(_G.daw_register) == "function"to the accepted simple truthycheck
if _G.daw_register then _G.daw_register(_NAME, M) end, matchingevery other production file in this repository.
Why
Found during the DAW/daw-lua-net 2.1.0 team review session, while
verifying a reviewer claim that daw-lua-net should revert its
daw_registerguard back to the type-check pattern. Cross-checkingagainst the actual daw-lua-common source showed:
24 of 25 production files already use the truthy check.
base64.luaisthe sole outlier -- a leftover from before the pattern was adopted
project-wide. This matches the accepted decision recorded in the
session findings (truthy check is the lived/correct pattern) and
DAW/daw-docs#18 (which corrects the standard document, not the code
-- the code in daw-lua-common is already right everywhere except here).
Scope
base64.lua: change the registration guard from toAcceptance criteria
base64.luauses the truthy_G.daw_registerguard, matchingthe other 24 production files in this repo.
base64.luachanged.make testpasses on Lua 5.1 and 5.4.fragjan code .clean.Cross-repository context
Related to DAW/daw-docs#18 (documentation correction for the same
pattern) and the daw-lua-net 2.1.0 migration session
(DAW/daw-lua-net#8, DAW/daw-lua-net#9), where this discrepancy
surfaced during team review.
Done
base64.lua now uses the accepted truthy guard
('if _G.daw_register then ... end'). The change went in with
f7d9df9(feat(i18n): add daw_i18n/v1 resources for base64 andconfig_parser). Verified on main: no 'type(_G.daw_register)' guard
remains in any production Lua file.