codeinterpreter: permit console.log with single string arg (#3426)

Signed-off-by: Jared Van Bortel <jared@nomic.ai>
This commit is contained in:
Jared Van Bortel
2025-01-27 15:22:20 -05:00
committed by GitHub
parent 4fbc20ced9
commit 0d974297a5
2 changed files with 4 additions and 1 deletions

View File

@@ -102,7 +102,9 @@ void CodeInterpreterWorker::request(const QString &code)
auto consoleObject = m_engine.evaluate(uR"(
class Console {
log(...args) {
if (args.length && typeof args[0] === 'string')
if (args.length == 0)
return;
if (args.length >= 2 && typeof args[0] === 'string')
throw new Error('console.log string formatting not supported');
let cat = '';
for (const arg of args) {