Skip to content

Commit

Permalink
Merge pull request #1618 from DanielXMoore/playground-js
Browse files Browse the repository at this point in the history
Playground shows IIFE failures only when clicking Run
edemaine authored Nov 22, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents 264c74b + bda0aea commit e26785a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions civet.dev/public/playground.worker.js
Original file line number Diff line number Diff line change
@@ -61,8 +61,10 @@ onmessage = async (e) => {
if (errors.length) {
// Rerun with SourceMap to get error location
errors = []
tsCode = Civet.generate(ast, { js: true, errors, sourceMap: Civet.SourceMap(code) });
return postError(errors[0])
jsCode = Civet.generate(ast, { js: true, errors, sourceMap: Civet.SourceMap(code) });
// Don't postError(errors[0]) here so that we still display TypeScript
// transpilation; only show error when trying to Run code
throw errors[0]
}

if (ast.topLevelAwait) {

0 comments on commit e26785a

Please sign in to comment.