Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Playground "Run" button now supports:
1+2
now outputs[EVAL] 3
, without the need for wrapping inconsole.log
. Like most REPLs, outputs nothing if the eval'd value isundefined
.console.error
,console.warn
, etc. (prefixing output with[ERROR]
,[WARN]
, etc.).console.timeEnd
etc. don't currently work well (but they still work in the actual console); this could be fixed later.console
commands now work fromasync
functions too (fixes civet.dev/playground - Displaying console output from async functions #938). This is done by modifying the output AST to replace allconsole
identifiers withcivetconsole
. (Note: if you run async code twice in rapid succession, you may get output from the first run in the second run.)await
, by wrapping the Civet code in anasync do
block (ordo ->
block in CoffeeScript mode). I did this at the Civet level so that we still get implicit return of the last value, which (once resolved) gets printed with[EVAL]
prefix like the sync case.