aboutsummaryrefslogtreecommitdiffstats
path: root/test/suite/bestPractice/Sbp_12.5_A9_T3.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/suite/bestPractice/Sbp_12.5_A9_T3.js')
-rw-r--r--test/suite/bestPractice/Sbp_12.5_A9_T3.js21
1 files changed, 21 insertions, 0 deletions
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(){};
+}
+
+};
+