You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The ftl2js function throws a TypeError for trying to "read properties of null" when a message has attributes but no pattern.
To Reproduce
letftl=`app = .name = Hello`;letdata=ftl2js(ftl);
The problem seems to be that the getTypeName function simply assumes that it will be passed a valid object and does no checks for null, and a message with no pattern parses to a null value. Having a message with no pattern but one or more attributes is valid fluent syntax.
🐛 Bug Report
The
ftl2js
function throws a TypeError for trying to "read properties of null" when a message has attributes but no pattern.To Reproduce
The problem seems to be that the
getTypeName
function simply assumes that it will be passed a valid object and does no checks fornull
, and a message with no pattern parses to anull
value. Having a message with no pattern but one or more attributes is valid fluent syntax.Expected behavior
An exception is not thrown.
Your Environment
The text was updated successfully, but these errors were encountered: