From d9e409ac1bf86d3d7bba85e9be2d5663de11b1a1 Mon Sep 17 00:00:00 2001 From: David Fugate Date: Fri, 24 Feb 2012 14:28:50 -0800 Subject: https://bugs.ecmascript.org/show_bug.cgi?id=269 Extension clause permits function declarations more or less anywhere. Moved four such negative test cases to best practices directory. --- test/suite/bestPractice/Sbp_12.5_A9_T3.js | 21 +++++++++++++++++++++ test/suite/bestPractice/Sbp_12.6.1_A13_T3.js | 19 +++++++++++++++++++ test/suite/bestPractice/Sbp_12.6.2_A13_T3.js | 19 +++++++++++++++++++ test/suite/bestPractice/Sbp_12.6.4_A13_T3.js | 19 +++++++++++++++++++ test/suite/ch12/12.5/S12.5_A9_T3.js | 21 --------------------- test/suite/ch12/12.6/12.6.1/S12.6.1_A13_T3.js | 19 ------------------- test/suite/ch12/12.6/12.6.2/S12.6.2_A13_T3.js | 19 ------------------- test/suite/ch12/12.6/12.6.4/S12.6.4_A13_T3.js | 19 ------------------- 8 files changed, 78 insertions(+), 78 deletions(-) create mode 100644 test/suite/bestPractice/Sbp_12.5_A9_T3.js create mode 100644 test/suite/bestPractice/Sbp_12.6.1_A13_T3.js create mode 100644 test/suite/bestPractice/Sbp_12.6.2_A13_T3.js create mode 100644 test/suite/bestPractice/Sbp_12.6.4_A13_T3.js delete mode 100644 test/suite/ch12/12.5/S12.5_A9_T3.js delete mode 100644 test/suite/ch12/12.6/12.6.1/S12.6.1_A13_T3.js delete mode 100644 test/suite/ch12/12.6/12.6.2/S12.6.2_A13_T3.js delete mode 100644 test/suite/ch12/12.6/12.6.4/S12.6.4_A13_T3.js (limited to 'test') diff --git a/test/suite/bestPractice/Sbp_12.5_A9_T3.js b/test/suite/bestPractice/Sbp_12.5_A9_T3.js new file mode 100644 index 000000000..e9cbb0eb3 --- /dev/null +++ b/test/suite/bestPractice/Sbp_12.5_A9_T3.js @@ -0,0 +1,21 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Function declaration within an "if" statement is not allowed + * + * @path bestPractice/Sbp_12.5_A9_T3.js + * @description Declaring function within an "if" statement that is declared within the function declaration + * @negative + */ + +function(){ + +if (true) { + function __func(){}; +} else { + function __func(){}; +} + +}; + diff --git a/test/suite/bestPractice/Sbp_12.6.1_A13_T3.js b/test/suite/bestPractice/Sbp_12.6.1_A13_T3.js new file mode 100644 index 000000000..943aa2182 --- /dev/null +++ b/test/suite/bestPractice/Sbp_12.6.1_A13_T3.js @@ -0,0 +1,19 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * FunctionDeclaration within a "do-while" Block is not allowed + * + * @path bestPractice/Sbp_12.6.1_A13_T3.js + * @description Declaring a function within a "do-while" loop that is within a function declaration itself + * @negative + */ + +function(){ + +do{ + function __func(){}; +}while(0); + +}; + diff --git a/test/suite/bestPractice/Sbp_12.6.2_A13_T3.js b/test/suite/bestPractice/Sbp_12.6.2_A13_T3.js new file mode 100644 index 000000000..17bfdab66 --- /dev/null +++ b/test/suite/bestPractice/Sbp_12.6.2_A13_T3.js @@ -0,0 +1,19 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * FunctionDeclaration within a "while" Statement is not allowed + * + * @path bestPractice/Sbp_12.6.2_A13_T3.js + * @description Checking if declaring a function within a "while" Statement that is in a function body leads to an exception + * @negative + */ + +function(){ + +while(0){ + function __func(){}; +}; + +}; + diff --git a/test/suite/bestPractice/Sbp_12.6.4_A13_T3.js b/test/suite/bestPractice/Sbp_12.6.4_A13_T3.js new file mode 100644 index 000000000..f76366167 --- /dev/null +++ b/test/suite/bestPractice/Sbp_12.6.4_A13_T3.js @@ -0,0 +1,19 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * FunctionDeclaration within a "for-in" Statement is not allowed + * + * @path bestPractice/Sbp_12.6.4_A13_T3.js + * @description Declaring function within a "for-in" Statement that is within function declaration + * @negative + */ + +function(){ + +for(x in this){ + function __func(){}; +}; + +}; + diff --git a/test/suite/ch12/12.5/S12.5_A9_T3.js b/test/suite/ch12/12.5/S12.5_A9_T3.js deleted file mode 100644 index c2cce81cd..000000000 --- a/test/suite/ch12/12.5/S12.5_A9_T3.js +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/** - * Function declaration within an "if" statement is not allowed - * - * @path ch12/12.5/S12.5_A9_T3.js - * @description Declaring function within an "if" statement that is declared within the function declaration - * @negative - */ - -function(){ - -if (true) { - function __func(){}; -} else { - function __func(){}; -} - -}; - diff --git a/test/suite/ch12/12.6/12.6.1/S12.6.1_A13_T3.js b/test/suite/ch12/12.6/12.6.1/S12.6.1_A13_T3.js deleted file mode 100644 index 29bf80ac9..000000000 --- a/test/suite/ch12/12.6/12.6.1/S12.6.1_A13_T3.js +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/** - * FunctionDeclaration within a "do-while" Block is not allowed - * - * @path ch12/12.6/12.6.1/S12.6.1_A13_T3.js - * @description Declaring a function within a "do-while" loop that is within a function declaration itself - * @negative - */ - -function(){ - -do{ - function __func(){}; -}while(0); - -}; - diff --git a/test/suite/ch12/12.6/12.6.2/S12.6.2_A13_T3.js b/test/suite/ch12/12.6/12.6.2/S12.6.2_A13_T3.js deleted file mode 100644 index 294781037..000000000 --- a/test/suite/ch12/12.6/12.6.2/S12.6.2_A13_T3.js +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/** - * FunctionDeclaration within a "while" Statement is not allowed - * - * @path ch12/12.6/12.6.2/S12.6.2_A13_T3.js - * @description Checking if declaring a function within a "while" Statement that is in a function body leads to an exception - * @negative - */ - -function(){ - -while(0){ - function __func(){}; -}; - -}; - diff --git a/test/suite/ch12/12.6/12.6.4/S12.6.4_A13_T3.js b/test/suite/ch12/12.6/12.6.4/S12.6.4_A13_T3.js deleted file mode 100644 index 86cd5d401..000000000 --- a/test/suite/ch12/12.6/12.6.4/S12.6.4_A13_T3.js +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/** - * FunctionDeclaration within a "for-in" Statement is not allowed - * - * @path ch12/12.6/12.6.4/S12.6.4_A13_T3.js - * @description Declaring function within a "for-in" Statement that is within function declaration - * @negative - */ - -function(){ - -for(x in this){ - function __func(){}; -}; - -}; - -- cgit v1.2.3