node-osascript icon indicating copy to clipboard operation
node-osascript copied to clipboard

missing value

Open rbrtrbrt opened this issue 8 years ago • 0 comments

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?

rbrtrbrt avatar Feb 23 '17 16:02 rbrtrbrt