Closed Wiktry closed 1 year ago
Good catch!
This is due to incompatibilities in the Rhino scripting engine. You can fix this by updating your tsconfig.json to
{
"compilerOptions": {
"target": "ES5"
...
}
}
I will update the provided tsconfig to address this...
Thanks for a quick answer. I'm guessing Issue 83 will have the same solution, then. But I'm leaving it up for posterity.
Yes! #83 will be solved by the same fix!
Thanks you for your reports!
Description
When declaring a
const
variable inside a looped scope that variable will not update during loops beyond the first. This issue does not occur when using normal JavaScript.Example code
This code should print 0 to 9, but currently prints 10 zeros.
Using
Sitevision 2022.11.1.1 sitevision api: 2023.2.1 sitevision-scripts: 3.1.5
Additional
The same issue occurs when creating a script module directly on a Sitevision page using the following code: