Skip to content

Commit

Permalink
Clean up testcase
Browse files Browse the repository at this point in the history
  • Loading branch information
Raimund Jacob authored and gbrail committed Jan 22, 2018
1 parent 72c7aad commit 059434a
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions testsrc/org/mozilla/javascript/tests/DynamicScopeTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,9 @@ public void testInitStandardObjectsSealed()
cx.setLanguageVersion(Context.VERSION_ES6);
cx.setOptimizationLevel(0);

// Case 1: Fails with org.mozilla.javascript.EvaluatorException: Cannot modify a property of a sealed object: iterator.
final ScriptableObject scope = cx.initStandardObjects(new TopLevel(), true); //
// Used to fail with org.mozilla.javascript.EvaluatorException: Cannot modify a property of a sealed object: iterator.
final ScriptableObject scope = cx.initStandardObjects(new TopLevel(), true);

// Case 2: Workaround attempt: works
// final ScriptableObject scope = cx.initStandardObjects(new TopLevel(), false);

Object result = cx.evaluateString(scope, "42", "source", 1, null);
assertEquals(42, result);
} finally {
Expand All @@ -79,11 +76,9 @@ public void testInitStandardObjectsSealed()
cx2.setLanguageVersion(Context.VERSION_ES6);
cx2.setOptimizationLevel(0);

// Case 2: Fails with org.mozilla.javascript.EvaluatorException: Cannot modify a property of a sealed object: iterator.
// Used to fail with org.mozilla.javascript.EvaluatorException: Cannot modify a property of a sealed object: iterator.
final ScriptableObject scope = cx.initStandardObjects(new TopLevel(), true);

// Case 3: Workaround attempt: works
// final ScriptableObject scope = cx.initStandardObjects(new TopLevel(), false);
Object result = cx.evaluateString(scope, "23", "source", 1, null);
assertEquals(23, result);
} finally {
Expand Down

0 comments on commit 059434a

Please sign in to comment.