I don't know why (perhaps the "strict mode" is always active with Qt?), but you
to use 0o11 to force octal encoding to avoid confusion with binary encoding
(0b11).
QJSEngine eng;
auto jsv = eng.evaluate("(function(){return 0o11;})()");
qDebug() << jsv.isError() << jsv.toString() <<
I have the following test code to evaluate an octal literal which I'm
running on Qt 5.12 and 5.15;
QJSEngine eng;
auto jsv = eng.evaluate("(function(){return 011;})()");
qDebug() << jsv.isError() << jsv.toString() << jsv.toVariant();
This outputs:
true