diff options
Diffstat (limited to 'js/scripting-lang/scratch_tests/test_run_function.js')
-rw-r--r-- | js/scripting-lang/scratch_tests/test_run_function.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/js/scripting-lang/scratch_tests/test_run_function.js b/js/scripting-lang/scratch_tests/test_run_function.js new file mode 100644 index 0000000..c79f5e8 --- /dev/null +++ b/js/scripting-lang/scratch_tests/test_run_function.js @@ -0,0 +1,24 @@ +/** + * Test the run function directly + */ + +import { run } from '../lang.js'; + +const scriptContent = ` +/* Simple test script */ + +/* Get current state */ +state : ..listen; + +/* Emit the state */ +..emit state; +`; + +try { + console.log('Testing run function...'); + const result = run(scriptContent, {}, null); + console.log('Result:', result); +} catch (error) { + console.error('Error:', error); + console.error('Stack:', error.stack); +} \ No newline at end of file |