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

@@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
- Fix regression while using localdocs with server API ([#3410](https://github.com/nomic-ai/gpt4all/pull/3410))
- Don't show system messages in server chat view ([#3411](https://github.com/nomic-ai/gpt4all/pull/3411))
- Fix `codesign --verify` failure on macOS ([#3413](https://github.com/nomic-ai/gpt4all/pull/3413))
- Code Interpreter: Fix console.log not accepting a single string after v3.7.0 ([#3426](https://github.com/nomic-ai/gpt4all/pull/3426))
## [3.7.0] - 2025-01-21

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) {