From e4aebe55c79821904b75d8415f592d0ca96be826 Mon Sep 17 00:00:00 2001 From: Mark Miller Date: Sun, 25 Sep 2011 15:11:03 -0700 Subject: [PATCH] Regenerated from last bug fixed to pre-converted sources. --- .../S7.5.3_A1.15.js | 2 ++ .../7.8.4_String_Literals/S7.8.4_A4.3_T1.js | 3 +++ .../7.8.4_String_Literals/S7.8.4_A4.3_T2.js | 3 +++ .../9.9_ToObject/S9.9_A1.js | 22 ----------------- .../9.9_ToObject/S9.9_A2.js | 22 ----------------- .../11.4.1_The_delete_Operator/S11.4.1_A5.js | 24 +++++++++++++------ .../S11.8.2_A2.3_T1.js | 12 +++++----- .../S11.8.3_A2.3_T1.js | 12 +++++----- .../chapter11/11.4/11.4.1/11.4.1-5-a-26-s.js | 5 +++- 9 files changed, 41 insertions(+), 64 deletions(-) diff --git a/test/suite/07_Lexical_Conventions/7.5_Tokens/7.5.3_Future_Reserved_Words/S7.5.3_A1.15.js b/test/suite/07_Lexical_Conventions/7.5_Tokens/7.5.3_Future_Reserved_Words/S7.5.3_A1.15.js index 409a757eb1..1ec2881355 100644 --- a/test/suite/07_Lexical_Conventions/7.5_Tokens/7.5.3_Future_Reserved_Words/S7.5.3_A1.15.js +++ b/test/suite/07_Lexical_Conventions/7.5_Tokens/7.5.3_Future_Reserved_Words/S7.5.3_A1.15.js @@ -10,4 +10,6 @@ * @negative */ +"use strict"; + var implements = 1; diff --git a/test/suite/07_Lexical_Conventions/7.8_Literals/7.8.4_String_Literals/S7.8.4_A4.3_T1.js b/test/suite/07_Lexical_Conventions/7.8_Literals/7.8.4_String_Literals/S7.8.4_A4.3_T1.js index 009c7914c4..d18a678298 100644 --- a/test/suite/07_Lexical_Conventions/7.8_Literals/7.8.4_String_Literals/S7.8.4_A4.3_T1.js +++ b/test/suite/07_Lexical_Conventions/7.8_Literals/7.8.4_String_Literals/S7.8.4_A4.3_T1.js @@ -6,9 +6,12 @@ * * @path 07_Lexical_Conventions/7.8_Literals/7.8.4_String_Literals/S7.8.4_A4.3_T1.js * @description EscapeCharacter :: DecimalDigits :: 1 + * @onlyStrict * @negative */ +"use strict"; + //CHECK#1 "\1" diff --git a/test/suite/07_Lexical_Conventions/7.8_Literals/7.8.4_String_Literals/S7.8.4_A4.3_T2.js b/test/suite/07_Lexical_Conventions/7.8_Literals/7.8.4_String_Literals/S7.8.4_A4.3_T2.js index c85850f51a..5ca8a01fd1 100644 --- a/test/suite/07_Lexical_Conventions/7.8_Literals/7.8.4_String_Literals/S7.8.4_A4.3_T2.js +++ b/test/suite/07_Lexical_Conventions/7.8_Literals/7.8.4_String_Literals/S7.8.4_A4.3_T2.js @@ -6,9 +6,12 @@ * * @path 07_Lexical_Conventions/7.8_Literals/7.8.4_String_Literals/S7.8.4_A4.3_T2.js * @description EscapeCharacter :: DecimalDigits :: 7 + * @onlyStrict * @negative */ +"use strict"; + //CHECK#1 "\7" diff --git a/test/suite/09_Type_Conversion/9.9_ToObject/S9.9_A1.js b/test/suite/09_Type_Conversion/9.9_ToObject/S9.9_A1.js index 8c7f2e594c..c7f2819077 100644 --- a/test/suite/09_Type_Conversion/9.9_ToObject/S9.9_A1.js +++ b/test/suite/09_Type_Conversion/9.9_ToObject/S9.9_A1.js @@ -31,25 +31,3 @@ catch(e){ } } -// CHECK#3 -try{ - for(var y in undefined) y = 2; - $ERROR('#3.1: for(var y in undefined) y = 2 must throw TypeError. Actual: y === ' + (y)); -} -catch(e){ - if((e instanceof TypeError) !== true){ - $ERROR('#3.2: for(var y in undefined) y = 2 must throw TypeError. Actual: ' + (e)); - } -} - -// CHECK#4 -try{ - for(var z in this.foo) z = 2; - $ERROR('#4.1: for(var z in this.foo) z = 2 must throw TypeError. Actual: z === ' + (z)); -} -catch(e){ - if((e instanceof TypeError) !== true){ - $ERROR('#4.2: for(var z in this.foo) z = 2 must throw TypeError. Actual: ' + (e)); - } -} - diff --git a/test/suite/09_Type_Conversion/9.9_ToObject/S9.9_A2.js b/test/suite/09_Type_Conversion/9.9_ToObject/S9.9_A2.js index d27ed93715..4e9647c603 100644 --- a/test/suite/09_Type_Conversion/9.9_ToObject/S9.9_A2.js +++ b/test/suite/09_Type_Conversion/9.9_ToObject/S9.9_A2.js @@ -31,25 +31,3 @@ catch(e){ } } -// CHECK#3 -try{ - for(var y in null) y = 2; - $ERROR('#3.1: for(var y in null) y = 2 must throw TypeError. Actual: y === . Actual: ' + (y)); -} -catch(e){ - if((e instanceof TypeError) !== true){ - $ERROR('#3.2: for(var y in null) y = 2 must throw TypeError. Actual: ' + (e)); - } -} - -// CHECK#4 -try{ - for(var z in 'bbb'.match(/aaa/)) z = 2; - $ERROR('#4.1: for(var z in \'bbb\'.match(/aaa/)) z = 2 must throw TypeError. Actual: z === . Actual: ' + (z)); -} -catch(e){ - if((e instanceof TypeError) !== true){ - $ERROR('#4.2: for(var z in \'bbb\'.match(/aaa/)) z = 2 must throw TypeError. Actual: ' + (e)); - } -} - diff --git a/test/suite/11_Expressions/11.4_Unary_Operators/11.4.1_The_delete_Operator/S11.4.1_A5.js b/test/suite/11_Expressions/11.4_Unary_Operators/11.4.1_The_delete_Operator/S11.4.1_A5.js index 7cd8d9d902..15854417bf 100644 --- a/test/suite/11_Expressions/11.4_Unary_Operators/11.4.1_The_delete_Operator/S11.4.1_A5.js +++ b/test/suite/11_Expressions/11.4_Unary_Operators/11.4.1_The_delete_Operator/S11.4.1_A5.js @@ -13,13 +13,23 @@ */ "use strict"; -var deleted = 'unassigned'; -try { - deleted = delete RegExp.leftContext; -} catch (err) { -} -if (deleted === false) { - $ERROR('Strict delete returned false'); +var reNames = Object.getOwnPropertyNames(RegExp); +for (var i = 0, len = reNames.length; i < len; i++) { + var reName = reNames[i]; + if (reName !== 'prototype') { + var deleted = 'unassigned'; + try { + deleted = delete RegExp[reName]; + } catch (err) { + if (!(err instanceof TypeError)) { + $ERROR('#1: strict delete threw a non-TypeError: ' + err); + } + // fall through + } + if (deleted === false) { + $ERROR('#2: Strict delete returned false'); + } + } } diff --git a/test/suite/11_Expressions/11.8_Relational_Operators/11.8.2_The_Greater_than_Operator/S11.8.2_A2.3_T1.js b/test/suite/11_Expressions/11.8_Relational_Operators/11.8.2_The_Greater_than_Operator/S11.8.2_A2.3_T1.js index 260c112a5b..12bf4791bd 100644 --- a/test/suite/11_Expressions/11.8_Relational_Operators/11.8.2_The_Greater_than_Operator/S11.8.2_A2.3_T1.js +++ b/test/suite/11_Expressions/11.8_Relational_Operators/11.8.2_The_Greater_than_Operator/S11.8.2_A2.3_T1.js @@ -2,7 +2,7 @@ // This code is governed by the BSD license found in the LICENSE file. /** - * ToNumber(second expression) is called first, and then ToNumber(first expression) + * In ES5, First expression should be evaluated first. * * @path 11_Expressions/11.8_Relational_Operators/11.8.2_The_Greater_than_Operator/S11.8.2_A2.3_T1.js * @description Checking with "throw" @@ -13,13 +13,13 @@ var x = { valueOf: function () { throw "x"; } }; var y = { valueOf: function () { throw "y"; } }; try { x > y; - $ERROR('#1.1: var x = { valueOf: function () { throw "x"; } }; var y = { valueOf: function () { throw "y"; } }; x > y throw "y". Actual: ' + (x > y)); + $ERROR('#1.1: Should have thrown'); } catch (e) { - if (e === "x") { - $ERROR('#1.2: ToNumber(second expression) is called first, and then ToNumber(first expression)'); + if (e === "y") { + $ERROR('#1.2: First expression should be evaluated first'); } else { - if (e !== "y") { - $ERROR('#1.3: var x = { valueOf: function () { throw "x"; } }; var y = { valueOf: function () { throw "y"; } }; x > y throw "y". Actual: ' + (e)); + if (e !== "x") { + $ERROR('#1.3: Failed with: ' + e); } } } diff --git a/test/suite/11_Expressions/11.8_Relational_Operators/11.8.3_The_Less_than_or_equal_Operator/S11.8.3_A2.3_T1.js b/test/suite/11_Expressions/11.8_Relational_Operators/11.8.3_The_Less_than_or_equal_Operator/S11.8.3_A2.3_T1.js index 8afb6919d2..b8bc9130ac 100644 --- a/test/suite/11_Expressions/11.8_Relational_Operators/11.8.3_The_Less_than_or_equal_Operator/S11.8.3_A2.3_T1.js +++ b/test/suite/11_Expressions/11.8_Relational_Operators/11.8.3_The_Less_than_or_equal_Operator/S11.8.3_A2.3_T1.js @@ -2,7 +2,7 @@ // This code is governed by the BSD license found in the LICENSE file. /** - * ToNumber(second expression) is called first, and then ToNumber(first expression) + * In ES5, First expression should be evaluated first. * * @path 11_Expressions/11.8_Relational_Operators/11.8.3_The_Less_than_or_equal_Operator/S11.8.3_A2.3_T1.js * @description Checking with "throw" @@ -13,13 +13,13 @@ var x = { valueOf: function () { throw "x"; } }; var y = { valueOf: function () { throw "y"; } }; try { x <= y; - $ERROR('#1.1: var x = { valueOf: function () { throw "x"; } }; var y = { valueOf: function () { throw "y"; } }; x <= y throw "y". Actual: ' + (x <= y)); + $ERROR('#1.1: Should have thrown'); } catch (e) { - if (e === "x") { - $ERROR('#1.2: ToNumber(second expression) is called first, and then ToNumber(first expression)'); + if (e === "y") { + $ERROR('#1.2: First expression should be evaluated first'); } else { - if (e !== "y") { - $ERROR('#1.3: var x = { valueOf: function () { throw "x"; } }; var y = { valueOf: function () { throw "y"; } }; x <= y throw "y". Actual: ' + (e)); + if (e !== "x") { + $ERROR('#1.3: Failed with: ' + e); } } } diff --git a/test/suite/chapter11/11.4/11.4.1/11.4.1-5-a-26-s.js b/test/suite/chapter11/11.4/11.4.1/11.4.1-5-a-26-s.js index 2bac0322ce..5f50568eeb 100644 --- a/test/suite/chapter11/11.4/11.4.1/11.4.1-5-a-26-s.js +++ b/test/suite/chapter11/11.4/11.4.1/11.4.1-5-a-26-s.js @@ -27,12 +27,15 @@ function testcase() { "use strict"; - + var errorBackup = Error; try { eval("delete Error;"); return false; } catch (e) { return e instanceof SyntaxError; + } finally { + Error = errorBackup; } + } runTestCase(testcase);