Skip to content

Commit

Permalink
Expand a lil bit on the note
Browse files Browse the repository at this point in the history
  • Loading branch information
caspervonb committed Sep 20, 2020
1 parent 0a34603 commit 1fc75d3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cli/rt/40_repl.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@
// Returns false if error is recoverable
function evaluate(code) {
// It is a bit unexpected that { "foo": "bar" } is interpreted as a block
// statement rather than an object literal so we interpret it as an expression statement.
// statement rather than an object literal so we interpret it as an expression statement
// to match the behavior found in a typical prompt including browser developer tools.
if (code.startsWith("{") && code.endsWith("}")) {
code = `(${code.trim()})`;
}
Expand Down

0 comments on commit 1fc75d3

Please sign in to comment.