最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Enforcing strict mode in google-apps-script files using Chrome on Chromebook - Stack Overflow

programmeradmin0浏览0评论

In google-apps-script script file is it possible to set 'use strict'? I've created a function to test this

function a () {  //logs - function a
  "use strict";
  Logger.log(arguments.callee);
}

If strict mode was being enforced, I would think this statement would throw a TypeError.

In google-apps-script script file is it possible to set 'use strict'? I've created a function to test this

function a () {  //logs - function a
  "use strict";
  Logger.log(arguments.callee);
}

If strict mode was being enforced, I would think this statement would throw a TypeError.

Share Improve this question edited Apr 26, 2019 at 21:50 Wicket 38.8k9 gold badges80 silver badges195 bronze badges asked Nov 17, 2012 at 16:38 user1472330user1472330 1331 silver badge11 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 7

Apps Script does not support strict mode on the server. If you use HtmlService, all client script code you write is implicitly strict mode whether or not you specify "use strict".

Not possible on the old runtime (Rhino) but it's possible on the new runtime (V8).

There are reports of scripts that used to work on the old runtime that are not working on the new runtime, so plan to do some tests before applying this change on "production".

Resources

  • https://developers.google./apps-script/guides/v8-runtime
  • https://developers.google./apps-script/guides/v8-runtime/migration
发布评论

评论列表(0)

  1. 暂无评论