source-academy / js-slang

Implementations of sublanguages of JavaScript, TypeScript, Scheme and Python
https://source-academy.github.io/source/
Apache License 2.0
70 stars 104 forks source link

Full JavaScript: promises are unpacked automatically by REPL #1536

Open martin-henz opened 9 months ago

martin-henz commented 9 months ago

When a Full JavaScript program evaluates to a promise, it is automatically unpacked by the REPL.

Screenshot 2024-02-15 at 9 44 11 AM

The display function correctly displays the promise object in orange. The REPL should also display the promise object.

The program:

let promise = new Promise(
    (resolve, reject) => resolve("done"));
promise;