@@ -86,20 +86,6 @@ public Object run(final Context cx) {
86
86
*/
87
87
@ Test
88
88
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
- };
103
89
final String script = "function test() {\n "
104
90
+ " var e = new Error();\n "
105
91
+ " if (e.stack)\n "
@@ -116,12 +102,12 @@ protected boolean hasFeature(Context cx, int featureIndex) {
116
102
public Object run (final Context cx ) {
117
103
final Scriptable scope = cx .initSafeStandardObjects ();
118
104
final Object result = cx .evaluateString (scope , script , "test.js" , 1 , null );
119
- assertEquals (expected , result );
105
+ assertEquals ("string" , result );
120
106
return null ;
121
107
}
122
108
};
123
109
124
- Utils .runWithAllOptimizationLevels (cf , action );
110
+ Utils .runWithAllOptimizationLevels (action );
125
111
}
126
112
127
113
}
0 commit comments