@@ -11,13 +11,13 @@ let rp;
1111
1212// A dependency graph that contains any wasm must be imported asynchronously.
1313import ( 'rustpython' )
14- . then ( rustpy => {
14+ . then ( ( rustpy ) => {
1515 rp = rustpy ;
1616 // so people can play around with it
1717 window . rp = rustpy ;
1818 onReady ( ) ;
1919 } )
20- . catch ( e => {
20+ . catch ( ( e ) => {
2121 console . error ( 'Error importing `rustpython`:' , e ) ;
2222 document . getElementById ( 'error' ) . textContent = e ;
2323 } ) ;
@@ -29,15 +29,15 @@ const editor = CodeMirror.fromTextArea(document.getElementById('code'), {
2929 'Shift-Tab' : 'indentLess' ,
3030 'Ctrl-/' : 'toggleComment' ,
3131 'Cmd-/' : 'toggleComment' ,
32- Tab : editor => {
32+ Tab : ( editor ) => {
3333 var spaces = Array ( editor . getOption ( 'indentUnit' ) + 1 ) . join ( ' ' ) ;
3434 editor . replaceSelection ( spaces ) ;
35- }
35+ } ,
3636 } ,
3737 lineNumbers : true ,
3838 mode : 'text/x-python' ,
3939 indentUnit : 4 ,
40- autofocus : true
40+ autofocus : true ,
4141} ) ;
4242
4343const consoleElement = document . getElementById ( 'console' ) ;
@@ -51,15 +51,15 @@ function runCodeFromTextarea() {
5151 const code = editor . getValue ( ) ;
5252 try {
5353 rp . pyExec ( code , {
54- stdout : output => {
54+ stdout : ( output ) => {
5555 const shouldScroll =
5656 consoleElement . scrollHeight - consoleElement . scrollTop ===
5757 consoleElement . clientHeight ;
5858 consoleElement . value += output ;
5959 if ( shouldScroll ) {
6060 consoleElement . scrollTop = consoleElement . scrollHeight ;
6161 }
62- }
62+ } ,
6363 } ) ;
6464 } catch ( err ) {
6565 if ( err instanceof WebAssembly . RuntimeError ) {
@@ -79,7 +79,7 @@ function updateSnippet() {
7979 // dynamically.
8080 // https://webpack.js.org/guides/dependency-management/
8181 const {
82- default : snippet
82+ default : snippet ,
8383 } = require ( `raw-loader!../snippets/${ selected } .py` ) ;
8484
8585 editor . setValue ( snippet ) ;
@@ -148,8 +148,8 @@ function onReady() {
148148 runCodeFromTextarea ( ) ;
149149
150150 terminalVM = rp . vmStore . init ( 'term_vm' ) ;
151- terminalVM . setStdout ( data => localEcho . print ( data ) ) ;
152- readPrompts ( ) . catch ( err => console . error ( err ) ) ;
151+ terminalVM . setStdout ( ( data ) => localEcho . print ( data ) ) ;
152+ readPrompts ( ) . catch ( ( err ) => console . error ( err ) ) ;
153153
154154 // so that the test knows that we're ready
155155 const readyElement = document . createElement ( 'div' ) ;
0 commit comments