@@ -3,7 +3,7 @@ import { extension as eval_ext, cursor_node_string, top_level_string } from '@ne
3
3
import { EditorView , drawSelection , keymap } from '@codemirror/view' ;
4
4
import { EditorState } from '@codemirror/state' ;
5
5
import { syntaxHighlighting , defaultHighlightStyle , foldGutter } from '@codemirror/language' ;
6
- import { compileString } from 'squint-cljs' ;
6
+ import { compileStringEx } from 'squint-cljs' ;
7
7
8
8
let theme = EditorView . theme ( {
9
9
".cm-content" : { whitespace : "pre-wrap" ,
@@ -24,11 +24,12 @@ let theme = EditorView.theme({
24
24
".cm-cursor" : { visibility : "hidden" } ,
25
25
"&.cm-focused .cm-cursor" : { visibility : "visible" }
26
26
} ) ;
27
-
27
+ let compilerState = null ;
28
28
let 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 ;
32
33
let result ;
33
34
try {
34
35
result = { value : await eval ( `(async function() { ${ js } })()` ) } ;
0 commit comments