为什么 google Apps 脚本不支持可选链接等最新的 javascript 功能,即使它运行在 Chrome V8 上?使用可选链接时,clasp 会抛出错误。
GaxiosError:语法错误:ParseError:意外的标记。
运行时环境已经在 list 文件 appsscript.json
中提到为:
{
...
"runtimeVersion": "V8",
...
}
最佳答案
可选链接现在可用。
目前不支持此功能(可选链接)。 A bug report被提出并被谷歌拒绝:
Status: Won't Fix (Infeasible) Hello, Currently this operator does not work on Apps Script. V8 allows you to run modern syntax, but not all of the newly released features. You can check the information in V8 Runtime Overview To sum up, apps script v8 is not javascript. Regards.
然而,您可以提出 feature request同样(这不是错误报告)。
关于javascript - Google Apps 脚本 - 可选的链接抛出 ParseError,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64346245/