Skip to content

Fix #14: Playground is too persistent, errors are not explained#15

Open
leftibot wants to merge 1 commit intoChaiScript:masterfrom
leftibot:fix/issue-14-playground-is-too-persistent-errors-are-
Open

Fix #14: Playground is too persistent, errors are not explained#15
leftibot wants to merge 1 commit intoChaiScript:masterfrom
leftibot:fix/issue-14-playground-is-too-persistent-errors-are-

Conversation

@leftibot
Copy link
Copy Markdown
Contributor

Automated fix by @leftibot.

What changed

Fix #14: Reset playground engine between runs and display errors
The ChaiScript WASM engine accumulated state (variables, functions) across
script executions, causing confusing errors when editing code. Additionally,
if the engine aborted due to an unhandled exception, no meaningful error was
shown and subsequent runs silently failed.
Each run now reloads the WASM module via resetEngine() to guarantee a clean
engine state. An onAbort handler catches WASM crashes and displays the error
message. Exception formatting handles string, Error, and unknown throw types.
Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com

Files

 playground.html    | 96 ++++++++++++++++++++++++++++++++++++++++++------------
 test_playground.sh | 10 +++++-
 2 files changed, 85 insertions(+), 21 deletions(-)

Closes #14

Triggered by @lefticus.

…rrors

The ChaiScript WASM engine accumulated state (variables, functions) across
script executions, causing confusing errors when editing code. Additionally,
if the engine aborted due to an unhandled exception, no meaningful error was
shown and subsequent runs silently failed.

Each run now reloads the WASM module via resetEngine() to guarantee a clean
engine state. An onAbort handler catches WASM crashes and displays the error
message. Exception formatting handles string, Error, and unknown throw types.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Playground is too persistent, errors are not explained

1 participant