Skip to content
Snippets Groups Projects
Commit bd72486f authored by Mark Miller's avatar Mark Miller
Browse files

Fixed a very large number of bad test case sources, especially

gratuitous strict mode incompatibility. Too many to continue fixing
manually this way. Don't know what to do about that.
parent 9f7d9f6a
Branches
No related tags found
No related merge requests found
Showing
with 129 additions and 127 deletions
...@@ -9,20 +9,20 @@ ...@@ -9,20 +9,20 @@
*/ */
//CHECK //CHECK
errorCount = 0; var errorCount = 0;
count = 0; var count = 0;
var hex = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F"]; var hex = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F"];
for (i1 = 0; i1 < 16; i1++) { for (var i1 = 0; i1 < 16; i1++) {
for (i2 = 0; i2 < 16; i2++) { for (var i2 = 0; i2 < 16; i2++) {
for (i3 = 0; i3 < 16; i3++) { for (var i3 = 0; i3 < 16; i3++) {
for (i4 = 0; i4 < 16; i4++) { for (var i4 = 0; i4 < 16; i4++) {
try { try {
var uu = hex[i1] + hex[i2] + hex[i3] + hex[i4]; var uu = hex[i1] + hex[i2] + hex[i3] + hex[i4];
var xx = String.fromCharCode("0x" + uu); var xx = String.fromCharCode("0x" + uu);
var LineTerminators = ((uu === "000A") || (uu === "000D") || (uu === "2028") || (uu === "2029")); var LineTerminators = ((uu === "000A") || (uu === "000D") || (uu === "2028") || (uu === "2029"));
var yy = 0; var yy = 0;
eval("//var " + xx + "yy = -1"); eval("//var " + xx + "yy = -1");
if (LineTerminators !== true) { if (LineTerminators !== true) {
if (yy !== 0) { if (yy !== 0) {
$ERROR('#' + uu + ' '); $ERROR('#' + uu + ' ');
errorCount++; errorCount++;
...@@ -38,11 +38,11 @@ for (i1 = 0; i1 < 16; i1++) { ...@@ -38,11 +38,11 @@ for (i1 = 0; i1 < 16; i1++) {
errorCount++; errorCount++;
} }
count++; count++;
} }
} }
} }
} }
if (errorCount > 0) { if (errorCount > 0) {
$ERROR('Total error: ' + errorCount + ' bad Unicode character in ' + count); $ERROR('Total error: ' + errorCount + ' bad Unicode character in ' + count);
} }
...@@ -5,29 +5,29 @@ ...@@ -5,29 +5,29 @@
* @name: S7.4_A6; * @name: S7.4_A6;
* @section: 7.4; * @section: 7.4;
* @assertion: If multi line comments csn not nest, they can contain any Unicode character; * @assertion: If multi line comments csn not nest, they can contain any Unicode character;
* @description: "var"+ yy+ "xx = 1", insert instead of yy all Unicode characters; * @description: "var"+ yy+ "xx = 1", insert instead of yy all Unicode characters;
*/ */
//CHECK //CHECK
errorCount = 0; var errorCount = 0;
count = 0; var count = 0;
for (indexI = 0; indexI <= 65535; indexI++) { for (var indexI = 0; indexI <= 65535; indexI++) {
try { try {
var xx = 0; var xx = 0;
eval("/*var " + String.fromCharCode(indexI) + "xx = 1*/"); eval("/*var " + String.fromCharCode(indexI) + "xx = 1*/");
var hex = decimalToHexString(indexI); var hex = decimalToHexString(indexI);
if (xx !== 0) { if (xx !== 0) {
$ERROR('#' + hex + ' '); $ERROR('#' + hex + ' ');
errorCount++; errorCount++;
} }
} catch (e){ } catch (e){
$ERROR('#' + hex + ' '); $ERROR('#' + hex + ' ');
errorCount++; errorCount++;
} }
count++; count++;
} }
if (errorCount > 0) { if (errorCount > 0) {
$ERROR('Total error: ' + errorCount + ' bad Unicode character in ' + count); $ERROR('Total error: ' + errorCount + ' bad Unicode character in ' + count);
} }
......
...@@ -4,118 +4,117 @@ ...@@ -4,118 +4,117 @@
/** /**
* @name: S7.5.1_A2; * @name: S7.5.1_A2;
* @section: 7.5.1; * @section: 7.5.1;
* @assertion: List of words that are not reserved; * @assertion: List of words that are not reserved;
* @description: Try assign 1 for not reserved words; * @description: Try assign 1 for not reserved words;
*/ */
// a // a
and = 1; var and = 1;
and_eq = 1; var and_eq = 1;
as = 1; var as = 1;
asm = 1; var asm = 1;
assert = 1; var assert = 1;
auto = 1; var auto = 1;
// b // b
base = 1; var base = 1;
bitand = 1; var bitand = 1;
bitor = 1; var bitor = 1;
bool = 1; var bool = 1;
byvalue = 1; var byvalue = 1;
// c // c
checked = 1; var checked = 1;
clone = 1; var clone = 1;
comment = 1; var comment = 1;
compl = 1; var compl = 1;
const_cast = 1; var const_cast = 1;
// d // d
decimal = 1; var decimal = 1;
delegate = 1; var delegate = 1;
dynamic_cast = 1; var dynamic_cast = 1;
// e // e
explicit = 1; var explicit = 1;
extern = 1; var extern = 1;
equals = 1; var equals = 1;
event = 1; var event = 1;
// f // f
finalize = 1; var finalize = 1;
fixed = 1; var fixed = 1;
friend = 1; var friend = 1;
foreach = 1; var foreach = 1;
future = 1; var future = 1;
// g // g
getClass = 1; var getClass = 1;
generic = 1; var generic = 1;
// h // h
hashCode = 1; var hashCode = 1;
// i // i
implicit = 1; var implicit = 1;
infinity = 1; var infinity = 1;
inline = 1; var inline = 1;
inner = 1; var inner = 1;
internal = 1; var internal = 1;
is = 1; var is = 1;
// j // j
// k // k
// l // l
lock = 1; var lock = 1;
// m // m
mutable = 1; var mutable = 1;
// n // n
NaN = 1; var namespace = 1;
namespace = 1; var not = 1;
not = 1; var notify = 1;
notify = 1; var notifyAll = 1;
notifyAll = 1; var not_eq = 1;
not_eq = 1;
// o // o
object = 1; var object = 1;
operator = 1; var operator = 1;
or = 1; var or = 1;
or_eq = 1; var or_eq = 1;
out = 1; var out = 1;
outer = 1; var outer = 1;
override = 1; var override = 1;
// p // p
params = 1; var params = 1;
// q // q
// r // r
readonly = 1; var readonly = 1;
reinterpret_cast = 1; var reinterpret_cast = 1;
ref = 1; var ref = 1;
register = 1; var register = 1;
// s // s
sbyte = 1; var sbyte = 1;
signed = 1; var signed = 1;
sizeof = 1; var sizeof = 1;
stackalloc = 1; var stackalloc = 1;
static_cast = 1; var static_cast = 1;
string = 1; var string = 1;
strictfp = 1; var strictfp = 1;
struct = 1; var struct = 1;
// t // t
template = 1; var template = 1;
toString = 1; var toString = 1;
typedef = 1; var typedef = 1;
typeid = 1; var typeid = 1;
// u // u
uint = 1; var uint = 1;
unchecked = 1; var unchecked = 1;
undefiend = 1; var undefiend = 1;
union = 1; var union = 1;
unsafe = 1; var unsafe = 1;
unsigned = 1; var unsigned = 1;
use = 1; var use = 1;
using = 1; var using = 1;
ushort = 1; var ushort = 1;
// v // v
valueOf = 1; var valueOf = 1;
virtual = 1; var virtual = 1;
// w // w
wait = 1; var wait = 1;
wchar_t = 1; var wchar_t = 1;
// x // x
xor = 1; var xor = 1;
xor_eq = 1; var xor_eq = 1;
// y // y
// z // z
...@@ -8,4 +8,4 @@ ...@@ -8,4 +8,4 @@
* @description: Checking if execution of "abstract=1" succeeds; * @description: Checking if execution of "abstract=1" succeeds;
*/ */
abstract = 1; var abstract = 1;
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
* @name: S7.5.3_A1.10; * @name: S7.5.3_A1.10;
* @section: 7.5.3; * @section: 7.5.3;
* @assertion: The "export" token can not be used as identifier; * @assertion: The "export" token can not be used as identifier;
* @description: Checking if execution of "export=1" fails; * @description: Checking if execution of "export=1" fails;
* @negative * @negative
*/ */
export = 1; var export = 1;
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
* @name: S7.5.3_A1.11; * @name: S7.5.3_A1.11;
* @section: 7.5.3; * @section: 7.5.3;
* @assertion: The "extends" token can not be used as identifier; * @assertion: The "extends" token can not be used as identifier;
* @description: Checking if execution of "extends=1" fails; * @description: Checking if execution of "extends=1" fails;
* @negative * @negative
*/ */
extends = 1; var extends = 1;
...@@ -8,4 +8,4 @@ ...@@ -8,4 +8,4 @@
* @description: Checking if execution of "final=1" succeeds; * @description: Checking if execution of "final=1" succeeds;
*/ */
final = 1; var final = 1;
...@@ -8,4 +8,4 @@ ...@@ -8,4 +8,4 @@
* @description: Checking if execution of "float=1" succeeds; * @description: Checking if execution of "float=1" succeeds;
*/ */
float = 1; var float = 1;
...@@ -8,4 +8,4 @@ ...@@ -8,4 +8,4 @@
* @description: Checking if execution of "goto=1" succeeds; * @description: Checking if execution of "goto=1" succeeds;
*/ */
goto = 1; var goto = 1;
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* @assertion: The "implements" token can not be used as identifier in strict code; * @assertion: The "implements" token can not be used as identifier in strict code;
* @description: Checking if execution of "implements=1" fails in strict code; * @description: Checking if execution of "implements=1" fails in strict code;
* @negative * @negative
* @strict_only
*/ */
"use strict"; var implements = 1;
implements = 1; \ No newline at end of file
\ No newline at end of file
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
* @section: 7.5.3; * @section: 7.5.3;
* @assertion: The "implements" token can be used as identifier in non-strict code; * @assertion: The "implements" token can be used as identifier in non-strict code;
* @description: Checking if execution of "implements=1" succeeds in non-strict code; * @description: Checking if execution of "implements=1" succeeds in non-strict code;
* @non_strict_only
*/ */
new Function('implements = 1'); var implements = 1;
\ No newline at end of file
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
/** /**
* @name: S7.5.3_A1.16; * @name: S7.5.3_A1.16;
* @section: 7.5.3; * @section: 7.5.3;
* @assertion: The "import" token can not be used as identifier; * @assertion: The "import" token can not be used as identifier;
* @description: Checking if execution of "import=1" fails; * @description: Checking if execution of "import=1" fails;
* @negative * @negative
*/ */
import = 1; var import = 1;
...@@ -8,4 +8,4 @@ ...@@ -8,4 +8,4 @@
* @description: Checking if execution of "int=1" succeeds; * @description: Checking if execution of "int=1" succeeds;
*/ */
int = 1; var int = 1;
...@@ -11,4 +11,4 @@ ...@@ -11,4 +11,4 @@
*/ */
"use strict"; "use strict";
interface = 1; var interface = 1;
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
* non-strict code; * non-strict code;
* @description: Checking if execution of "interface = 1" succeeds in * @description: Checking if execution of "interface = 1" succeeds in
* non-strict code; * non-strict code;
* @non_strict_only
*/ */
new Function('interface = 1'); var interface = 1;
...@@ -8,4 +8,4 @@ ...@@ -8,4 +8,4 @@
* @description: Checking if execution of "long=1" succeeds; * @description: Checking if execution of "long=1" succeeds;
*/ */
long = 1; var long = 1;
...@@ -8,4 +8,4 @@ ...@@ -8,4 +8,4 @@
* @description: Checking if execution of "boolean=1" succeeds; * @description: Checking if execution of "boolean=1" succeeds;
*/ */
boolean = 1; var boolean = 1;
...@@ -8,4 +8,4 @@ ...@@ -8,4 +8,4 @@
* @description: Checking if execution of "native=1" succeeds; * @description: Checking if execution of "native=1" succeeds;
*/ */
native = 1; var native = 1;
...@@ -10,4 +10,4 @@ ...@@ -10,4 +10,4 @@
*/ */
"use strict"; "use strict";
package = 1; var package = 1;
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
* @section: 7.5.3; * @section: 7.5.3;
* @assertion: The "package" token can be used as identifier in non-strict code; * @assertion: The "package" token can be used as identifier in non-strict code;
* @description: Checking if execution of "package=1" succeeds in non-strict code; * @description: Checking if execution of "package=1" succeeds in non-strict code;
* @non_strict_only
*/ */
new Function('package = 1'); var package = 1;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment