@@ -86,20 +86,6 @@ public Object run(final Context cx) {
8686 */
8787 @ Test
8888 public void stackNewErrorWithoutThrow () throws Exception {
89- stackNewErrorWithoutThrow (true , "string" );
90- stackNewErrorWithoutThrow (false , "undefined" );
91- }
92-
93- private static void stackNewErrorWithoutThrow (final boolean hasFeature , final String expected ) throws Exception {
94- final ContextFactory cf = new ContextFactory () {
95- @ Override
96- protected boolean hasFeature (Context cx , int featureIndex ) {
97- if (Context .FEATURE_HTMLUNIT_ERROR_STACK == featureIndex ) {
98- return hasFeature ;
99- }
100- return super .hasFeature (cx , featureIndex );
101- }
102- };
10389 final String script = "function test() {\n "
10490 + " var e = new Error();\n "
10591 + " if (e.stack)\n "
@@ -116,12 +102,12 @@ protected boolean hasFeature(Context cx, int featureIndex) {
116102 public Object run (final Context cx ) {
117103 final Scriptable scope = cx .initSafeStandardObjects ();
118104 final Object result = cx .evaluateString (scope , script , "test.js" , 1 , null );
119- assertEquals (expected , result );
105+ assertEquals ("string" , result );
120106 return null ;
121107 }
122108 };
123109
124- Utils .runWithAllOptimizationLevels (cf , action );
110+ Utils .runWithAllOptimizationLevels (action );
125111 }
126112
127113}
0 commit comments