diff --git a/rhino/src/test/java/org/mozilla/javascript/tests/DynamicScopeTest.java b/rhino/src/test/java/org/mozilla/javascript/tests/DynamicScopeTest.java index ca2a0352e5..f35d7d11be 100644 --- a/rhino/src/test/java/org/mozilla/javascript/tests/DynamicScopeTest.java +++ b/rhino/src/test/java/org/mozilla/javascript/tests/DynamicScopeTest.java @@ -3,6 +3,7 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertSame; +import org.junit.After; import org.junit.Test; import org.mozilla.javascript.Context; import org.mozilla.javascript.ContextFactory; @@ -49,6 +50,13 @@ public FreshContext(ContextFactory contextFactory) { } } + @After + public void tearDown() throws Exception { + while (Context.getCurrentContext() != null) { + Context.exit(); + } + } + @Test /** Sealed standard objects vs dynamic scopes. */ public void initStandardObjectsSealed() {