Since Google introduced the V8 engine, I'm migrating some code to the new engine. ES6 allows to define private classes but, when running on Google App Script, I'm getting an error.
Example:
class IncreasingCounter {
#count = 0;
get value() {
console.log('Getting the current value!');
return this.#count;
}
increment() {
this.#count++;
}
}
When saving the file, I get the following error:
Error: Line 2: Unexpected token ILLEGAL (line 5075, file "esprima.browser.js-bundle.js")
Any suggestion on how to create a class with Private properties on Google Apps Script (engine V8)?