It seems that both osavargen and osaparser have no support for the AppleScript "missing value".
osavargen translates JS null into an empty string, potentially cause syntax errors (e.g. JS [11,null] => AS {11,} which is an error in Applescript;
osavargen translates JS undefined into AS null, but
osaparser parses AS null to JS string 'null', and
osaparser parses AS missing value to JS string missing value.
It seems more reasonable and useful to me to have AS null parse to JS null and AS missing value parse to JS undefined, and have osavargen behave accordingly (But the test-scripts require osavargen to translate JS null to nothing).
I'm making a fork that handles null, missing value and undefined in this way, but this would be a breaking change. Do you want a pull-request?
It seems that both osavargen and osaparser have no support for the AppleScript "missing value".
null
into an empty string, potentially cause syntax errors (e.g. JS[11,null]
=> AS{11,}
which is an error in Applescript;undefined
into ASnull
, butnull
to JS string'null'
, andmissing value
to JS stringmissing value
.It seems more reasonable and useful to me to have AS
null
parse to JSnull
and ASmissing value
parse to JSundefined
, and have osavargen behave accordingly (But the test-scripts require osavargen to translate JSnull
to nothing).I'm making a fork that handles
null
,missing value
andundefined
in this way, but this would be a breaking change. Do you want a pull-request?