For js code like:
with({}) { with({}) { with({}) { import x.x; } } }
the import statement can cause an exception, the import-exception is generated (but not fired) before it executes the other code.
The With-statement has 2 operations to push and pop the new scope it should be used with.
As the pre-generated Exception is already present, PushScope checks that and does not Push a new Scope.
But PopScope does not check that, and tries to pop, which leads us to a crash.
The Scope should be cleared by the Exceptionhandler on exception case, and PopScope should do nothing.
NOTE: I must admit I am unsure if this is the best solution, a review by a experienced kjs developer would be super helpful
|