Followup to change a no-longer-passed-by-us test after the last push for bug 497869. r=orange
authorJeff Walden <jwalden@mit.edu>
Wed, 26 Jan 2011 16:46:25 -0800
changeset 61447 53dea513311e6b915b229cf2f8d784b3cc482559
parent 61446 b5ca98debed07f8bf861c23cb80e49c0323bc5de
child 61448 9ac5cb7a9aeea5bdeb8782cb87a1c5e6d68311fd
push idunknown
push userunknown
push dateunknown
reviewersorange
bugs497869
milestone2.0b10pre
Followup to change a no-longer-passed-by-us test after the last push for bug 497869. r=orange
js/src/tests/ecma_5/misc/future-reserved-words.js
--- a/js/src/tests/ecma_5/misc/future-reserved-words.js
+++ b/js/src/tests/ecma_5/misc/future-reserved-words.js
@@ -38,29 +38,32 @@ var strictFutureReservedWords =
   ];
 
 function testWord(word, expectNormal, expectStrict)
 {
   var actual, status;
 
   // USE IN VARIABLE DECLARATION
 
-  actual = "";
-  status = summary + ", normal var: " + word;
-  try
+  if (expectNormal !== "skip")
   {
-    eval("var " + word + ";");
-    actual = "no error";
+    actual = "";
+    status = summary + ", normal var: " + word;
+    try
+    {
+      eval("var " + word + ";");
+      actual = "no error";
+    }
+    catch (e)
+    {
+      actual = "error";
+      status +=  ", " + e.name + ": " + e.message + " ";
+    }
+    reportCompare(expectNormal, actual, status);
   }
-  catch (e)
-  {
-    actual = "error";
-    status +=  ", " + e.name + ": " + e.message + " ";
-  }
-  reportCompare(expectNormal, actual, status);
 
   actual = "";
   status = summary + ", strict var: " + word;
   try
   {
     eval("'use strict'; var " + word + ";");
     actual = "no error";
   }
@@ -69,29 +72,32 @@ function testWord(word, expectNormal, ex
     actual = "error";
     status +=  ", " + e.name + ": " + e.message + " ";
   }
   reportCompare(expectStrict, actual, status);
 
 
   // USE AS LHS FOR ASSIGNMENT
 
-  actual = "";
-  status = summary + ", normal assignment: " + word;
-  try
+  if (expectNormal !== "skip")
   {
-    eval(word + " = 'foo';");
-    actual = "no error";
+    actual = "";
+    status = summary + ", normal assignment: " + word;
+    try
+    {
+      eval(word + " = 'foo';");
+      actual = "no error";
+    }
+    catch(e)
+    {
+      actual = "error";
+      status +=  ", " + e.name + ": " + e.message + " ";
+    }
+    reportCompare(expectNormal, actual, status);
   }
-  catch(e)
-  {
-    actual = "error";
-    status +=  ", " + e.name + ": " + e.message + " ";
-  }
-  reportCompare(expectNormal, actual, status);
 
   actual = "";
   status = summary + ", strict assignment: " + word;
   try
   {
     eval("'use strict'; " + word + " = 'foo';");
     actual = "no error";
   }
@@ -100,17 +106,17 @@ function testWord(word, expectNormal, ex
     actual = "error";
     status +=  ", " + e.name + ": " + e.message + " ";
   }
   reportCompare(expectStrict, actual, status);
 }
 
 function testFutureReservedWord(word)
 {
-  testWord(word, "error", "error");
+  testWord(word, "skip", "error");
 }
 
 function testStrictFutureReservedWord(word)
 {
   testWord(word, "no error", "error");
 }
 
 futureReservedWords.forEach(testFutureReservedWord);