JS-Interpreter
JS-Interpreter copied to clipboard
Adding test harness to current implementation
To run the tests:
npm install -g mocha
npm install chai
mocha tests/
Just to be clear with the current implementation of try/catch/finally. The following tests fail:
- Should handle the exception in the outer try catch exception, and finish inner finally
- Should handle rethrowing the error, and catching in the outer (infinite loop)
- Should not catch if returning early in a finally block (infinite loop)
- It should not leave undone finally statements for uncaught exceptions
- return should respect finally
- return should respect catch and finally
- try/catch/finally should respect continue statements