This implicitly assumes that if the script tl is non empty then also the lang tl. But actually it can happen that a non empty \l__fontspec_script_tl exists e.g. after a \fontspec_if_language:nTF call.
\l__fontspec_pre_feat_sclist then contains an empty language= and luaotfload doesn't like this ...
Description
In the definition of
\l__fontspec_pre_feat_sclist
script and language are combined and set depending on the current value of\l__fontspec_script_tl
:This implicitly assumes that if the script tl is non empty then also the lang tl. But actually it can happen that a non empty
\l__fontspec_script_tl
exists e.g. after a\fontspec_if_language:nTF
call.\l__fontspec_pre_feat_sclist
then contains an emptylanguage=
and luaotfload doesn't like this ...Check/indicate
Minimal example demonstrating the issue
Further details
I discovered the problem as polyglossia uses
\fontspec_if_language:nTF
and\addfontfeature
suddently failed:I don't know if the non empty
\l__fontspec_script_tl
from the fontspec test has some other side effects.