Closed schoel-bis closed 7 years ago
@schoel-bis Which v8js version you're using?
The one that came with Bitnami's distribution of DF 2.4 and 2.5. 2.4.1 apparently came with V8 4.6.76 which is roughly equivalent to Chrome 46. According to MDN (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/let) let was supported in Chrome since 41. All my scripts use strict mode.
I was able to run this code as a V8js script on DF 2.7.0 (Bitnami). Can you try that version?
function test() {
"use strict";
let x=1234;
var_dump(x);
}
test();
php -i shows
V8 Javascript Engine => enabled
V8 Engine Compiled Version => 4.9.99
V8 Engine Linked Version => 4.9.99
I can confirm it works in 2.7.
If a V8js or Node.js event script contains the keyword
let
it will fail.To reproduce, add a script (I am using files.{folder_path}.post.post_process), make it V8js or Node.js, type in
let x = 0;
or similar, activate, and hit the endpoint. It will fail with an error message (which will vary depending on what type of script you selected before).Changing
let
tovar
orconst
makes the error disappear.Testet with DSP 2.4.1 and 2.5.0.