@@ -3,7 +3,7 @@ import { extension as eval_ext, cursor_node_string, top_level_string } from '@ne
33import { EditorView , drawSelection , keymap } from '@codemirror/view' ;
44import { EditorState } from '@codemirror/state' ;
55import { syntaxHighlighting , defaultHighlightStyle , foldGutter } from '@codemirror/language' ;
6- import { compileString } from 'squint-cljs' ;
6+ import { compileStringEx } from 'squint-cljs' ;
77
88let theme = EditorView . theme ( {
99 ".cm-content" : { whitespace : "pre-wrap" ,
@@ -24,11 +24,12 @@ let theme = EditorView.theme({
2424 ".cm-cursor" : { visibility : "hidden" } ,
2525 "&.cm-focused .cm-cursor" : { visibility : "visible" }
2626} ) ;
27-
27+ let compilerState = null ;
2828let evalCode = async function ( code ) {
29- let js = compileString ( `(do ${ code } )` , { repl : true ,
30- context : 'return' ,
31- "elide-exports" : true } )
29+ compilerState = compileStringEx ( `(do ${ code } )` , { repl : true ,
30+ context : 'return' ,
31+ "elide-exports" : true } , compilerState )
32+ let js = compilerState . javascript ;
3233 let result ;
3334 try {
3435 result = { value : await eval ( `(async function() { ${ js } })()` ) } ;
0 commit comments