You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tests/more-tests/delete.js
+4-3
Original file line number
Diff line number
Diff line change
@@ -1,17 +1,18 @@
1
1
2
2
// Testing the SyntaxError exception of the delete operator.
3
+
// If this test fails completely (without $ERROR) then the exception was non-catchable, and most likely it was detected at parse time rather than at run time as it should have been.
3
4
4
5
varfun=function(){
5
6
"use strict";
6
-
deletefundfd;// This should throw a SyntaxError exception at call time, not parsing time!
7
-
$ERROR("#1.1: This code should return a SyntaxError exception.")
7
+
deletex;// This should throw a SyntaxError exception at call time, not parsing time!
8
+
$ERROR("#1.1: This code should throw a (catchable) SyntaxError exception.")
8
9
};
9
10
10
11
try{
11
12
fun()
12
13
}catch(e){
13
14
if((einstanceofSyntaxError)!==true){
14
-
$ERROR("#1.2: This code should return a SyntaxError exception.");
15
+
$ERROR("#1.2: The exception thrown by this code should have been a SyntaxError exception.");
0 commit comments