1075 |
.expectParseError = true // assigning final to a non-final variable not allowed |
.expectParseError = true // assigning final to a non-final variable not allowed |
1076 |
}); |
}); |
1077 |
|
|
1078 |
|
// exit() acting as return statement ... |
1079 |
|
|
1080 |
|
runScript({ |
1081 |
|
.code = R"NKSP_CODE( |
1082 |
|
function doFoo |
1083 |
|
exit(2) { just return from this user function, i.e. don't stop init handler } |
1084 |
|
end function |
1085 |
|
|
1086 |
|
on init |
1087 |
|
call doFoo |
1088 |
|
exit(3) |
1089 |
|
end on |
1090 |
|
)NKSP_CODE", |
1091 |
|
.expectIntExitResult = 3 |
1092 |
|
}); |
1093 |
|
|
1094 |
|
runScript({ |
1095 |
|
.code = R"NKSP_CODE( |
1096 |
|
function doFoo1 |
1097 |
|
exit(2) { just return from this user function, i.e. don't stop init handler } |
1098 |
|
end function |
1099 |
|
|
1100 |
|
function doFoo2 |
1101 |
|
call doFoo1 |
1102 |
|
exit(3) { just return from this user function, i.e. don't stop init handler } |
1103 |
|
end function |
1104 |
|
|
1105 |
|
on init |
1106 |
|
call doFoo2 |
1107 |
|
exit(4) |
1108 |
|
end on |
1109 |
|
)NKSP_CODE", |
1110 |
|
.expectIntExitResult = 4 |
1111 |
|
}); |
1112 |
|
|
1113 |
|
runScript({ |
1114 |
|
.code = R"NKSP_CODE( |
1115 |
|
function doFoo |
1116 |
|
exit(2) { just return from this user function, i.e. don't stop init handler } |
1117 |
|
end function |
1118 |
|
|
1119 |
|
on init |
1120 |
|
call doFoo |
1121 |
|
exit(3) |
1122 |
|
{ dead code ... } |
1123 |
|
call doFoo |
1124 |
|
exit(4) |
1125 |
|
end on |
1126 |
|
)NKSP_CODE", |
1127 |
|
.expectIntExitResult = 3 |
1128 |
|
}); |
1129 |
|
|
1130 |
|
runScript({ |
1131 |
|
.code = R"NKSP_CODE( |
1132 |
|
function doFoo |
1133 |
|
exit(2) { just return from this user function, i.e. don't stop init handler } |
1134 |
|
end function |
1135 |
|
|
1136 |
|
on init |
1137 |
|
call doFoo |
1138 |
|
exit(3) |
1139 |
|
{ dead code ... } |
1140 |
|
call doFoo |
1141 |
|
end on |
1142 |
|
)NKSP_CODE", |
1143 |
|
.expectIntExitResult = 3 |
1144 |
|
}); |
1145 |
|
|
1146 |
#if !SILENT_TEST |
#if !SILENT_TEST |
1147 |
std::cout << std::endl; |
std::cout << std::endl; |
1148 |
#endif |
#endif |