From a23061829155a73e9d782c9fdc8f0f32144fa0b6 Mon Sep 17 00:00:00 2001 From: Mark Miller Date: Mon, 27 Jun 2011 08:52:25 -0600 Subject: Updating Google contribution to r97 of sputniktests. --- .../12.10_The_with_Statement/S12.10_A3.3_T4.js | 38 ++++++++++++---------- .../12.14_The_try_Statement/S12.14_A14.js | 7 ++-- .../12.14_The_try_Statement/S12.14_A4.js | 7 ++-- .../12_Statement/12.1_Block/S12.1_A1.js | 9 +++-- .../12_Statement/12.5_The_if_Statement/S12.5_A7.js | 4 +-- .../12.5_The_if_Statement/S12.5_A9_T1.js | 8 +++-- .../12.5_The_if_Statement/S12.5_A9_T2.js | 11 ++++--- .../12.6.1_The_do_while_Statement/S12.6.1_A1.js | 2 ++ .../S12.6.1_A13_T1.js | 8 +++-- .../S12.6.1_A13_T2.js | 12 ++++--- .../S15.2.4.4_A12.js | 2 +- .../S15.2.4.4_A13.js | 2 +- .../S15.3.4.2_A10.js | 2 +- .../S15.3.4.2_A1_T1.js | 4 +-- 14 files changed, 70 insertions(+), 46 deletions(-) (limited to 'external/contributions') diff --git a/external/contributions/Google/sputniktests/tests/Conformance/12_Statement/12.10_The_with_Statement/S12.10_A3.3_T4.js b/external/contributions/Google/sputniktests/tests/Conformance/12_Statement/12.10_The_with_Statement/S12.10_A3.3_T4.js index fdc91b41a..9932f9d9b 100644 --- a/external/contributions/Google/sputniktests/tests/Conformance/12_Statement/12.10_The_with_Statement/S12.10_A3.3_T4.js +++ b/external/contributions/Google/sputniktests/tests/Conformance/12_Statement/12.10_The_with_Statement/S12.10_A3.3_T4.js @@ -4,37 +4,39 @@ /** * @name: S12.10_A3.3_T4; * @section: 12.10; - * @assertion: No matter how control leaves the embedded 'Statement', - * the scope chain is always restored to its former state; - * @description: Declaring "with" statement within a function constructor, leading to completion by exception; + * @assertion: No matter how control leaves the embedded 'Statement', + * the scope chain is always restored to its former state; + * @description: Declaring "with" statement within a function + * constructor, leading to completion by exception; * @strict_mode_negative */ - + this.p1 = 1; var result = "result"; var myObj = { - p1: 'a', - value: 'myObj_value', - valueOf : function(){return 'obj_valueOf';} + p1: 'a', + value: 'myObj_value', + valueOf : function(){return 'obj_valueOf';} +}; + +function __FACTORY(){ + with(myObj){ + var p1 = 'x1'; + throw value; + } } try { - function __FACTORY(){ - with(myObj){ - p1 = 'x1'; - throw value; - } - } - var obj = new __FACTORY(); + var obj = new __FACTORY(); } catch(e){ - result = p1; + result = p1; } ////////////////////////////////////////////////////////////////////////////// //CHECK#1 -if(result !== 1){ +if (result !== 1) { $ERROR('#1: result === 1. Actual: result ==='+ result ); } // @@ -42,7 +44,7 @@ if(result !== 1){ ////////////////////////////////////////////////////////////////////////////// //CHECK#2 -if(p1 !== 1){ +if (p1 !== 1) { $ERROR('#2: p1 === 1. Actual: p1 ==='+ p1 ); } // @@ -50,7 +52,7 @@ if(p1 !== 1){ ////////////////////////////////////////////////////////////////////////////// //CHECK#3 -if(myObj.p1 !== "x1"){ +if (myObj.p1 !== "x1") { $ERROR('#3: myObj.p1 === "x1". Actual: myObj.p1 ==='+ myObj.p1 ); } // diff --git a/external/contributions/Google/sputniktests/tests/Conformance/12_Statement/12.14_The_try_Statement/S12.14_A14.js b/external/contributions/Google/sputniktests/tests/Conformance/12_Statement/12.14_The_try_Statement/S12.14_A14.js index f9b39088f..d6b9298d4 100644 --- a/external/contributions/Google/sputniktests/tests/Conformance/12_Statement/12.14_The_try_Statement/S12.14_A14.js +++ b/external/contributions/Google/sputniktests/tests/Conformance/12_Statement/12.14_The_try_Statement/S12.14_A14.js @@ -6,10 +6,11 @@ * @section: 12.14; * @assertion: Using "try" with "catch" or "finally" statement within/without a "with" statement; * @description: Using try/catch/finally in With and With in try/catch/finally; + * @strict_mode_negative SyntaxError; */ -var myObj = {p1: 'a', - p2: 'b', +var myObj = {p1: 'a', + p2: 'b', p3: 'c', value: 'myObj_value', valueOf : function(){return 'obj_valueOf';}, @@ -29,7 +30,7 @@ try{ } } catch(e){ - if (e!=="ex") $ERROR('#1: Exception ==="ex". Actual: Exception ==='+ e ); + if (e!=="ex") $ERROR('#1: Exception ==="ex". Actual: Exception ==='+ e ); } // CHECK#2 diff --git a/external/contributions/Google/sputniktests/tests/Conformance/12_Statement/12.14_The_try_Statement/S12.14_A4.js b/external/contributions/Google/sputniktests/tests/Conformance/12_Statement/12.14_The_try_Statement/S12.14_A4.js index 96ff264b5..e76809232 100644 --- a/external/contributions/Google/sputniktests/tests/Conformance/12_Statement/12.14_The_try_Statement/S12.14_A4.js +++ b/external/contributions/Google/sputniktests/tests/Conformance/12_Statement/12.14_The_try_Statement/S12.14_A4.js @@ -6,11 +6,12 @@ * @section: 12.14; * @assertion: Sanity test for "catch(Indetifier) statement"; * @description: Checking if deleting an exception fails; - */ + * @strict_mode_negative SyntaxError; + */ // CHECK#1 try { - throw "catchme"; + throw "catchme"; $ERROR('#1.1: throw "catchme" lead to throwing exception'); } catch (e) { @@ -24,7 +25,7 @@ catch (e) { // CHECK#2 try { - throw "catchme"; + throw "catchme"; $ERROR('#2.1: throw "catchme" lead to throwing exception'); } catch(e){} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/12_Statement/12.1_Block/S12.1_A1.js b/external/contributions/Google/sputniktests/tests/Conformance/12_Statement/12.1_Block/S12.1_A1.js index ce1c5eb0c..e9f3f79e2 100644 --- a/external/contributions/Google/sputniktests/tests/Conformance/12_Statement/12.1_Block/S12.1_A1.js +++ b/external/contributions/Google/sputniktests/tests/Conformance/12_Statement/12.1_Block/S12.1_A1.js @@ -4,10 +4,15 @@ /** * @name: S12.1_A1; * @section: 12.1; -* @assertion: The production Block { } can't contain function declaration; +* @assertion: The production Block { } in strict code can't contain +* function declaration; * @description: Trying to declare function at the Block statement; -* @negative; +* @negative SyntaxError; */ + +"use strict"; +if (!strict_mode) { throw new SyntaxError('unspecified case'); } + { function __func(){} } diff --git a/external/contributions/Google/sputniktests/tests/Conformance/12_Statement/12.5_The_if_Statement/S12.5_A7.js b/external/contributions/Google/sputniktests/tests/Conformance/12_Statement/12.5_The_if_Statement/S12.5_A7.js index c27483e86..7d213f3c6 100644 --- a/external/contributions/Google/sputniktests/tests/Conformance/12_Statement/12.5_The_if_Statement/S12.5_A7.js +++ b/external/contributions/Google/sputniktests/tests/Conformance/12_Statement/12.5_The_if_Statement/S12.5_A7.js @@ -12,11 +12,11 @@ ////////////////////////////////////////////////////////////////////////////// //CHECK#1 try { - __evaluated = eval("if(1);"); + var __evaluated = eval("if(1);"); if (__evaluated !== undefined) { $ERROR('#1: __evaluated === undefined. Actual: __evaluated ==='+ __evaluated ); } - + } catch (e) { $ERROR('#1.1: "__evaluated = eval("if(1);")" does not lead to throwing exception'); diff --git a/external/contributions/Google/sputniktests/tests/Conformance/12_Statement/12.5_The_if_Statement/S12.5_A9_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/12_Statement/12.5_The_if_Statement/S12.5_A9_T1.js index a22fc11c2..498bd3578 100644 --- a/external/contributions/Google/sputniktests/tests/Conformance/12_Statement/12.5_The_if_Statement/S12.5_A9_T1.js +++ b/external/contributions/Google/sputniktests/tests/Conformance/12_Statement/12.5_The_if_Statement/S12.5_A9_T1.js @@ -4,11 +4,15 @@ /** * @name: S12.5_A9_T1; * @section: 12.5; -* @assertion: Function declaration within an "if" statement is not allowed; +* @assertion: Function declaration within an "if" statement in strict +* code is not allowed; * @description: Declaring function within an "if" statement; -* @negative; +* @negative SyntaxError; */ +"use strict"; +if (!strict_mode) { throw new SyntaxError('unspecified case'); } + if (true) { function __func(){}; } else { diff --git a/external/contributions/Google/sputniktests/tests/Conformance/12_Statement/12.5_The_if_Statement/S12.5_A9_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/12_Statement/12.5_The_if_Statement/S12.5_A9_T2.js index 72fffae94..ae979d8f7 100644 --- a/external/contributions/Google/sputniktests/tests/Conformance/12_Statement/12.5_The_if_Statement/S12.5_A9_T2.js +++ b/external/contributions/Google/sputniktests/tests/Conformance/12_Statement/12.5_The_if_Statement/S12.5_A9_T2.js @@ -4,12 +4,15 @@ /** * @name: S12.5_A9_T2; * @section: 12.5; -* @assertion: Function declaration within an "if" statement is not allowed; -* @description: Declaring function within and "if" that is declared within the function call; -* @negative; +* @assertion: Function declaration within an "if" statement in strict +* code is not allowed; +* @description: Declaring function within an "if" that is declared +* within the strict function; +* @negative SyntaxError; */ (function(){ +"use strict"; if (true) { function __func(){}; @@ -17,4 +20,4 @@ if (true) { function __func(){}; } -})(); +}); diff --git a/external/contributions/Google/sputniktests/tests/Conformance/12_Statement/12.6_Iteration_Statements/12.6.1_The_do_while_Statement/S12.6.1_A1.js b/external/contributions/Google/sputniktests/tests/Conformance/12_Statement/12.6_Iteration_Statements/12.6.1_The_do_while_Statement/S12.6.1_A1.js index 7e603dc15..e0436e37a 100644 --- a/external/contributions/Google/sputniktests/tests/Conformance/12_Statement/12.6_Iteration_Statements/12.6.1_The_do_while_Statement/S12.6.1_A1.js +++ b/external/contributions/Google/sputniktests/tests/Conformance/12_Statement/12.6_Iteration_Statements/12.6.1_The_do_while_Statement/S12.6.1_A1.js @@ -8,6 +8,8 @@ * @description: Evaluating various Expressions; */ +var __in__do; + do __in__do=1; while ( false ); ////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/12_Statement/12.6_Iteration_Statements/12.6.1_The_do_while_Statement/S12.6.1_A13_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/12_Statement/12.6_Iteration_Statements/12.6.1_The_do_while_Statement/S12.6.1_A13_T1.js index ac7bb5f8c..28e118c87 100644 --- a/external/contributions/Google/sputniktests/tests/Conformance/12_Statement/12.6_Iteration_Statements/12.6.1_The_do_while_Statement/S12.6.1_A13_T1.js +++ b/external/contributions/Google/sputniktests/tests/Conformance/12_Statement/12.6_Iteration_Statements/12.6.1_The_do_while_Statement/S12.6.1_A13_T1.js @@ -4,11 +4,15 @@ /** * @name: S12.6.1_A13_T1; * @section: 12.6.1, 13; -* @assertion: FunctionDeclaration within a "do-while" Block is not allowed; +* @assertion: FunctionDeclaration within a "do-while" Block in strict +* code is not allowed; * @description: Declaring function within a "do-while" loop; -* @negative; +* @negative SyntaxError; */ +"use strict"; +if (!strict_mode) { throw new SyntaxError('unspecified case'); } + do{ function __func(){}; } while(0); diff --git a/external/contributions/Google/sputniktests/tests/Conformance/12_Statement/12.6_Iteration_Statements/12.6.1_The_do_while_Statement/S12.6.1_A13_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/12_Statement/12.6_Iteration_Statements/12.6.1_The_do_while_Statement/S12.6.1_A13_T2.js index 8f75c01b1..78cd75881 100644 --- a/external/contributions/Google/sputniktests/tests/Conformance/12_Statement/12.6_Iteration_Statements/12.6.1_The_do_while_Statement/S12.6.1_A13_T2.js +++ b/external/contributions/Google/sputniktests/tests/Conformance/12_Statement/12.6_Iteration_Statements/12.6.1_The_do_while_Statement/S12.6.1_A13_T2.js @@ -4,15 +4,17 @@ /** * @name: S12.6.1_A13_T2; * @section: 12.6.1, 13; -* @assertion: FunctionDeclaration within a "do-while" Block is not allowed; -* @description: Declaring a function within a "do-while" loop that is within a function call; -* @negative; +* @assertion: FunctionDeclaration within a "do-while" Block in strict +* code is not allowed; +* @description: Declaring a function within a "do-while" loop that is +* within a strict function; +* @negative SyntaxError; */ (function(){ - +"use strict"; do{ function __func(){}; }while(0); -})(); +}); diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.2_Object_Objects/15.2.4_Properties_of_the_Object_Prototype_Object/15.2.4.4_Object.prototype.valueOf/S15.2.4.4_A12.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.2_Object_Objects/15.2.4_Properties_of_the_Object_Prototype_Object/15.2.4.4_Object.prototype.valueOf/S15.2.4.4_A12.js index 41f87fbd7..fa1de95ec 100644 --- a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.2_Object_Objects/15.2.4_Properties_of_the_Object_Prototype_Object/15.2.4.4_Object.prototype.valueOf/S15.2.4.4_A12.js +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.2_Object_Objects/15.2.4_Properties_of_the_Object_Prototype_Object/15.2.4.4_Object.prototype.valueOf/S15.2.4.4_A12.js @@ -9,4 +9,4 @@ * @negative */ -Object.prototype.toLocaleString.call(undefined); +Object.prototype.valueOf.call(undefined); diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.2_Object_Objects/15.2.4_Properties_of_the_Object_Prototype_Object/15.2.4.4_Object.prototype.valueOf/S15.2.4.4_A13.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.2_Object_Objects/15.2.4_Properties_of_the_Object_Prototype_Object/15.2.4.4_Object.prototype.valueOf/S15.2.4.4_A13.js index fceb7609f..5094fed61 100644 --- a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.2_Object_Objects/15.2.4_Properties_of_the_Object_Prototype_Object/15.2.4.4_Object.prototype.valueOf/S15.2.4.4_A13.js +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.2_Object_Objects/15.2.4_Properties_of_the_Object_Prototype_Object/15.2.4.4_Object.prototype.valueOf/S15.2.4.4_A13.js @@ -9,4 +9,4 @@ * @negative */ -Object.prototype.toLocaleString.call(null); +Object.prototype.valueOf.call(null); diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.2_Function.prototype.toString/S15.3.4.2_A10.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.2_Function.prototype.toString/S15.3.4.2_A10.js index 8cbbd5ca1..f44729e95 100644 --- a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.2_Function.prototype.toString/S15.3.4.2_A10.js +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.2_Function.prototype.toString/S15.3.4.2_A10.js @@ -13,7 +13,7 @@ if (!(Function.prototype.toString.hasOwnProperty('length'))) { $FAIL('#1: the Function.prototype.toString has length property.'); } -obj = Function.prototype.toString.length; +var obj = Function.prototype.toString.length; Function.prototype.toString.length = function(){return "shifted";}; diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.2_Function.prototype.toString/S15.3.4.2_A1_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.2_Function.prototype.toString/S15.3.4.2_A1_T1.js index d2b7a5e43..7cc0d5bf8 100644 --- a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.2_Function.prototype.toString/S15.3.4.2_A1_T1.js +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.2_Function.prototype.toString/S15.3.4.2_A1_T1.js @@ -8,9 +8,9 @@ * @description: For testing use Function.prototype.toString() function; */ -f = function(x) { +var f = function(x) { return x*x; -} +}; //CHECK#1 if (eval(f.toString())(10) !== f(10)) { -- cgit v1.2.3