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 badges2 Answers
Reset to default 7Apps 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