summaryrefslogtreecommitdiff
path: root/external/contributions/Google/sputnik_conformance_modified/12_Statement/12.6_Iteration_Statements/12.6.4_The_for_in_Statement/S12.6.4_A3.js
diff options
context:
space:
mode:
Diffstat (limited to 'external/contributions/Google/sputnik_conformance_modified/12_Statement/12.6_Iteration_Statements/12.6.4_The_for_in_Statement/S12.6.4_A3.js')
-rw-r--r--external/contributions/Google/sputnik_conformance_modified/12_Statement/12.6_Iteration_Statements/12.6.4_The_for_in_Statement/S12.6.4_A3.js32
1 files changed, 32 insertions, 0 deletions
diff --git a/external/contributions/Google/sputnik_conformance_modified/12_Statement/12.6_Iteration_Statements/12.6.4_The_for_in_Statement/S12.6.4_A3.js b/external/contributions/Google/sputnik_conformance_modified/12_Statement/12.6_Iteration_Statements/12.6.4_The_for_in_Statement/S12.6.4_A3.js
new file mode 100644
index 000000000..198a38ff3
--- /dev/null
+++ b/external/contributions/Google/sputnik_conformance_modified/12_Statement/12.6_Iteration_Statements/12.6.4_The_for_in_Statement/S12.6.4_A3.js
@@ -0,0 +1,32 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+* @name: S12.6.4_A3;
+* @section: 12.6.4;
+* @assertion: The production IterationStatement: "for (var VariableDeclarationNoIn in Expression) Statement";
+* @description: Using an array as an Expression is appropriate. Here Expression is an array of numbers. Eval is used;
+*/
+
+__str="";
+
+__evaluated = eval("for(ind in (arr=[2,1,4,3]))__str+=arr[ind]");
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#1
+if (__evaluated !== __str) {
+ $ERROR('#1: __evaluated === __str. Actual: __evaluated ==='+ __evaluated );
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#2
+if (!( (__str.indexOf("2")!==-1)&&(__str.indexOf("1")!==-1)&&(__str.indexOf("4")!==-1)&&(__str.indexOf("3")!==-1) )) {
+ $ERROR('#2: (__str.indexOf("2")!==-1)&&(__str.indexOf("1")!==-1)&&(__str.indexOf("4")!==-1)&&(__str.indexOf("3")!==-1)');
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
+
+