diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /js/src/tests/test262/ch12/12.6/12.6.4 | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'js/src/tests/test262/ch12/12.6/12.6.4')
18 files changed, 591 insertions, 0 deletions
diff --git a/js/src/tests/test262/ch12/12.6/12.6.4/12.6.4-1.js b/js/src/tests/test262/ch12/12.6/12.6.4/12.6.4-1.js new file mode 100644 index 000000000..3929b0a23 --- /dev/null +++ b/js/src/tests/test262/ch12/12.6/12.6.4/12.6.4-1.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch12/12.6/12.6.4/12.6.4-1.js
+ * @description The for-in Statement - a property name must not be visited more than once in any enumeration.
+ */
+
+
+function testcase() {
+ var obj = { prop1: "abc", prop2: "bbc", prop3: "cnn" };
+
+ var countProp1 = 0;
+ var countProp2 = 0;
+ var countProp3 = 0;
+
+ for (var p in obj) {
+ if (obj.hasOwnProperty(p)) {
+ if (p === "prop1") {
+ countProp1++;
+ }
+ if (p === "prop2") {
+ countProp2++;
+ }
+ if (p === "prop3") {
+ countProp3++;
+ }
+ }
+ }
+ return countProp1 === 1 && countProp2 === 1 && countProp3 === 1;
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch12/12.6/12.6.4/12.6.4-2.js b/js/src/tests/test262/ch12/12.6/12.6.4/12.6.4-2.js new file mode 100644 index 000000000..dca36c1ff --- /dev/null +++ b/js/src/tests/test262/ch12/12.6/12.6.4/12.6.4-2.js @@ -0,0 +1,52 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch12/12.6/12.6.4/12.6.4-2.js
+ * @description The for-in Statement - the values of [[Enumerable]] attributes are not considered when determining if a property of a prototype object is shadowed by a previous object on the prototype chain
+ */
+
+
+function testcase() {
+ var obj = {};
+
+ var proto = {};
+
+ Object.defineProperty(proto, "prop", {
+ value: "inheritedValue",
+ enumerable: false,
+ configurable: true,
+ writable: true
+ });
+
+ var ConstructFun = function () { };
+ ConstructFun.prototype = proto;
+
+ var child = new ConstructFun();
+
+ Object.defineProperty(child, "prop1", {
+ value: "overridedValue1",
+ enumerable: false
+ });
+ Object.defineProperty(child, "prop2", {
+ value: "overridedValue2",
+ enumerable: true
+ });
+ var accessedProp1 = false;
+ var accessedProp2 = false;
+
+ for (var p in child) {
+ if (child.hasOwnProperty(p)) {
+ if (p === "prop1") {
+ accessedProp1 = true;
+ }
+ if (p === "prop2") {
+ accessedProp2 = true;
+ }
+ }
+ }
+ return !accessedProp1 && accessedProp2 && child.prop1 === "overridedValue1" && child.prop2 === "overridedValue2";
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch12/12.6/12.6.4/S12.6.4_A1.js b/js/src/tests/test262/ch12/12.6/12.6.4/S12.6.4_A1.js new file mode 100644 index 000000000..fd8c754bf --- /dev/null +++ b/js/src/tests/test262/ch12/12.6/12.6.4/S12.6.4_A1.js @@ -0,0 +1,33 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * "for(key in undefined)" Statement is allowed + * + * @path ch12/12.6/12.6.4/S12.6.4_A1.js + * @description Checking if execution of "for(key in undefined)" passes + */ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +try { + for(__key in undefined){ + var key=__key; + }; +} catch (e) { + $ERROR('#1: "for(key in undefined){}" does not lead to throwing exception'); +} +// +////////////////////////////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (key!==undefined) { + $ERROR('#2: key === undefined. Actual: key === '+key); +} +// +////////////////////////////////////////////////////////////////////////////// + + + diff --git a/js/src/tests/test262/ch12/12.6/12.6.4/S12.6.4_A14_T2.js b/js/src/tests/test262/ch12/12.6/12.6.4/S12.6.4_A14_T2.js new file mode 100644 index 000000000..b90e3e99b --- /dev/null +++ b/js/src/tests/test262/ch12/12.6/12.6.4/S12.6.4_A14_T2.js @@ -0,0 +1,26 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * FunctionExpession within a "for-in" Expression is allowed + * + * @path ch12/12.6/12.6.4/S12.6.4_A14_T2.js + * @description Using "function __func(){return {a:1};}()" as Expession + */ + +////////////////////////////////////////////////////////////////////////////// +//CHECK# +for(x in function __func(){return {a:1};}()){ + var __reached = x; +}; +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__reached !== "a") { + $ERROR('#2: function expession inside of for-in expression allowed'); +} +// +////////////////////////////////////////////////////////////////////////////// + diff --git a/js/src/tests/test262/ch12/12.6/12.6.4/S12.6.4_A15.js b/js/src/tests/test262/ch12/12.6/12.6.4/S12.6.4_A15.js new file mode 100644 index 000000000..c19908904 --- /dev/null +++ b/js/src/tests/test262/ch12/12.6/12.6.4/S12.6.4_A15.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. + +/** + * Block within a "for-in" Expression is not allowed + * + * @path ch12/12.6/12.6.4/S12.6.4_A15.js + * @description Using block within "for-in" Expression + * @negative + */ + +var __arr=[1,2,3]; + +////////////////////////////////////////////////////////////////////////////// +//CHECK# +for(x in {__arr}){ + break ; +}; +// +////////////////////////////////////////////////////////////////////////////// + diff --git a/js/src/tests/test262/ch12/12.6/12.6.4/S12.6.4_A2.js b/js/src/tests/test262/ch12/12.6/12.6.4/S12.6.4_A2.js new file mode 100644 index 000000000..e8db640c0 --- /dev/null +++ b/js/src/tests/test262/ch12/12.6/12.6.4/S12.6.4_A2.js @@ -0,0 +1,33 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * "for(key in null)" Expression is allowed + * + * @path ch12/12.6/12.6.4/S12.6.4_A2.js + * @description Checking if execution of "for(key in null)" passes + */ + +////////////////////////////////////////////////////////////////////////////// +//CHECK# +try { + for(__key in null){ + var key=__key; + }; +} catch (e) { + $ERROR('#1: "for(__key in null){}" does not lead to throwing exception'); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (key!==undefined) { + $ERROR('#2: key === undefined. Actual: key ==='+key); +} +// +////////////////////////////////////////////////////////////////////////////// + + + + diff --git a/js/src/tests/test262/ch12/12.6/12.6.4/S12.6.4_A3.1.js b/js/src/tests/test262/ch12/12.6/12.6.4/S12.6.4_A3.1.js new file mode 100644 index 000000000..d232fe48d --- /dev/null +++ b/js/src/tests/test262/ch12/12.6/12.6.4/S12.6.4_A3.1.js @@ -0,0 +1,33 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * The production IterationStatement: "for (var VariableDeclarationNoIn in Expression) Statement" + * + * @path ch12/12.6/12.6.4/S12.6.4_A3.1.js + * @description Using an array as an Expression is appropriate. Here Expression is an array of numbers + */ + +__str=""; + +__evaluated = eval("for(var 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)'); +} +// +////////////////////////////////////////////////////////////////////////////// + + + + diff --git a/js/src/tests/test262/ch12/12.6/12.6.4/S12.6.4_A3.js b/js/src/tests/test262/ch12/12.6/12.6.4/S12.6.4_A3.js new file mode 100644 index 000000000..2b34c38c7 --- /dev/null +++ b/js/src/tests/test262/ch12/12.6/12.6.4/S12.6.4_A3.js @@ -0,0 +1,33 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * The production IterationStatement: "for (var VariableDeclarationNoIn in Expression) Statement" + * + * @path ch12/12.6/12.6.4/S12.6.4_A3.js + * @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)'); +} +// +////////////////////////////////////////////////////////////////////////////// + + + + diff --git a/js/src/tests/test262/ch12/12.6/12.6.4/S12.6.4_A4.1.js b/js/src/tests/test262/ch12/12.6/12.6.4/S12.6.4_A4.1.js new file mode 100644 index 000000000..a491b3f34 --- /dev/null +++ b/js/src/tests/test262/ch12/12.6/12.6.4/S12.6.4_A4.1.js @@ -0,0 +1,34 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * The production IterationStatement: "for (var VariableDeclarationNoIn in Expression) Statement" + * + * @path ch12/12.6/12.6.4/S12.6.4_A4.1.js + * @description Using Object as an Expression is appropriate. Eval is used + */ + +__str=""; + +__evaluated = eval("for(var ind in (hash={2:'b',1:'a',4:'d',3:'c'}))__str+=hash[ind]"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if ( !( (__evaluated.indexOf("a")!==-1)& (__evaluated.indexOf("b")!==-1)& (__evaluated.indexOf("c")!==-1)&(__evaluated.indexOf("d")!==-1) ) ) { + $ERROR('#1: (__evaluated.indexOf("a")!==-1)& (__evaluated.indexOf("b")!==-1)& (__evaluated.indexOf("c")!==-1)&(__evaluated.indexOf("d")!==-1)'); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__str !== __evaluated) { + $ERROR('#2: __str === __evaluated. Actual: __str ==='+ __str ); +} +// +////////////////////////////////////////////////////////////////////////////// + + + + + diff --git a/js/src/tests/test262/ch12/12.6/12.6.4/S12.6.4_A4.js b/js/src/tests/test262/ch12/12.6/12.6.4/S12.6.4_A4.js new file mode 100644 index 000000000..79f496b8c --- /dev/null +++ b/js/src/tests/test262/ch12/12.6/12.6.4/S12.6.4_A4.js @@ -0,0 +1,34 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * The production IterationStatement: "for (var VariableDeclarationNoIn in Expression) Statement" + * + * @path ch12/12.6/12.6.4/S12.6.4_A4.js + * @description Using Object as an Expression is appropriate. Eval is used + */ + +__str=""; + +__evaluated = eval("for(ind in (hash={2:'b',1:'a',4:'d',3:'c'}))__str+=hash[ind]"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if ( !( (__evaluated.indexOf("a")!==-1)& (__evaluated.indexOf("b")!==-1)& (__evaluated.indexOf("c")!==-1)&(__evaluated.indexOf("d")!==-1) ) ) { + $ERROR('#1: (__evaluated.indexOf("a")!==-1)& (__evaluated.indexOf("b")!==-1)& (__evaluated.indexOf("c")!==-1)&(__evaluated.indexOf("d")!==-1)'); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__str !== __evaluated) { + $ERROR('#2: __str === __evaluated. Actual: __str ==='+ __str ); +} +// +////////////////////////////////////////////////////////////////////////////// + + + + + diff --git a/js/src/tests/test262/ch12/12.6/12.6.4/S12.6.4_A5.1.js b/js/src/tests/test262/ch12/12.6/12.6.4/S12.6.4_A5.1.js new file mode 100644 index 000000000..37992e1dd --- /dev/null +++ b/js/src/tests/test262/ch12/12.6/12.6.4/S12.6.4_A5.1.js @@ -0,0 +1,42 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * The production IterationStatement: "for (var VariableDeclarationNoIn in Expression) Statement" + * + * @path ch12/12.6/12.6.4/S12.6.4_A5.1.js + * @description Using hierarchical Object as an Expression is appropriate. The depth is two + */ + +__hash__map={a:{aa:1,ab:2,ac:3,ad:4},b:{ba:1,bb:2,bc:3,bd:4},c:{ca:1,cb:2,cc:3,cd:4},d:{da:1,db:2,dc:3,dd:4}}; + +__arr = ""; + +for(var __key in __hash__map){ + for (var __ind in __hash__map[__key]){ + __arr+=("" + __ind + __hash__map[__key][__ind]); + } +} + +if(!( +(__arr.indexOf("aa1")!==-1)& +(__arr.indexOf("ab2")!==-1)& +(__arr.indexOf("ac3")!==-1)& +(__arr.indexOf("ad4")!==-1)& +(__arr.indexOf("ba1")!==-1)& +(__arr.indexOf("bb2")!==-1)& +(__arr.indexOf("bc3")!==-1)& +(__arr.indexOf("bd4")!==-1)& +(__arr.indexOf("ca1")!==-1)& +(__arr.indexOf("cb2")!==-1)& +(__arr.indexOf("cc3")!==-1)& +(__arr.indexOf("cd4")!==-1)& +(__arr.indexOf("da1")!==-1)& +(__arr.indexOf("db2")!==-1)& +(__arr.indexOf("dc3")!==-1)& +(__arr.indexOf("dd4")!==-1) +)) $ERROR('#1: The nested for-in Statement applied to hierarchial object works properly as described in the Standard'); + + + + diff --git a/js/src/tests/test262/ch12/12.6/12.6.4/S12.6.4_A5.js b/js/src/tests/test262/ch12/12.6/12.6.4/S12.6.4_A5.js new file mode 100644 index 000000000..974659f10 --- /dev/null +++ b/js/src/tests/test262/ch12/12.6/12.6.4/S12.6.4_A5.js @@ -0,0 +1,42 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * The production IterationStatement: "for (var VariableDeclarationNoIn in Expression) Statement" + * + * @path ch12/12.6/12.6.4/S12.6.4_A5.js + * @description Using hierarchical Object as an Expression is appropriate. The depth is two + */ + +__hash__map={a:{aa:1,ab:2,ac:3,ad:4},b:{ba:1,bb:2,bc:3,bd:4},c:{ca:1,cb:2,cc:3,cd:4},d:{da:1,db:2,dc:3,dd:4}}; + +__arr = ""; + +for(__key in __hash__map){ + for (__ind in __hash__map[__key]){ + __arr+=("" + __ind + __hash__map[__key][__ind]); + } +} + +if(!( +(__arr.indexOf("aa1")!==-1)& +(__arr.indexOf("ab2")!==-1)& +(__arr.indexOf("ac3")!==-1)& +(__arr.indexOf("ad4")!==-1)& +(__arr.indexOf("ba1")!==-1)& +(__arr.indexOf("bb2")!==-1)& +(__arr.indexOf("bc3")!==-1)& +(__arr.indexOf("bd4")!==-1)& +(__arr.indexOf("ca1")!==-1)& +(__arr.indexOf("cb2")!==-1)& +(__arr.indexOf("cc3")!==-1)& +(__arr.indexOf("cd4")!==-1)& +(__arr.indexOf("da1")!==-1)& +(__arr.indexOf("db2")!==-1)& +(__arr.indexOf("dc3")!==-1)& +(__arr.indexOf("dd4")!==-1) +)) $ERROR('#1: The nested for-in Statement applied to hierarchial object works properly as described in the Standard'); + + + + diff --git a/js/src/tests/test262/ch12/12.6/12.6.4/S12.6.4_A6.1.js b/js/src/tests/test262/ch12/12.6/12.6.4/S12.6.4_A6.1.js new file mode 100644 index 000000000..78cc2e842 --- /dev/null +++ b/js/src/tests/test262/ch12/12.6/12.6.4/S12.6.4_A6.1.js @@ -0,0 +1,38 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * The production IterationStatement: "for (var VariableDeclarationNoIn in Expression) Statement" + * + * @path ch12/12.6/12.6.4/S12.6.4_A6.1.js + * @description Using Object with custom prototype as an Expression is appropriate. The prototype is "{feat:2,hint:"protohint"}" + */ + +function FACTORY(){this.prop=1;this.hint="hinted"}; + +FACTORY.prototype = {feat:2,hint:"protohint"}; + +var __instance = new FACTORY; + +__accum=""; + +for (var key in __instance){ + __accum+=(key + __instance[key]); +} + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (!((__accum.indexOf("prop1")!==-1)&&(__accum.indexOf("feat2")!==-1)&&(__accum.indexOf("hinthinted")!==-1))) { + $ERROR('#1: (__accum.indexOf("prop1")!==-1)&&(__accum.indexOf("feat2")!==-1)&&(__accum.indexOf("hinthinted")!==-1)'); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__accum.indexOf("hintprotohint")!==-1) { + $ERROR('#2: __accum.indexOf("hintprotohint") === -1. Actual: __accum.indexOf("hintprotohint") ==='+ __accum.indexOf("hintprotohint") ); +} +// +////////////////////////////////////////////////////////////////////////////// + diff --git a/js/src/tests/test262/ch12/12.6/12.6.4/S12.6.4_A6.js b/js/src/tests/test262/ch12/12.6/12.6.4/S12.6.4_A6.js new file mode 100644 index 000000000..5a1f8d9c2 --- /dev/null +++ b/js/src/tests/test262/ch12/12.6/12.6.4/S12.6.4_A6.js @@ -0,0 +1,38 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * The production IterationStatement: "for (var VariableDeclarationNoIn in Expression) Statement" + * + * @path ch12/12.6/12.6.4/S12.6.4_A6.js + * @description Using Object with custom prototype as an Expression is appropriate. The prototype is "{feat:2,hint:"protohint"}" + */ + +function FACTORY(){this.prop=1;this.hint="hinted"}; + +FACTORY.prototype = {feat:2,hint:"protohint"}; + +var __instance = new FACTORY; + +__accum=""; + +for (key in __instance){ + __accum+=(key + __instance[key]); +} + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (!((__accum.indexOf("prop1")!==-1)&&(__accum.indexOf("feat2")!==-1)&&(__accum.indexOf("hinthinted")!==-1))) { + $ERROR('#1: (__accum.indexOf("prop1")!==-1)&&(__accum.indexOf("feat2")!==-1)&&(__accum.indexOf("hinthinted")!==-1)'); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__accum.indexOf("hintprotohint")!==-1) { + $ERROR('#2: __accum.indexOf("hintprotohint") === -1. Actual: __accum.indexOf("hintprotohint") ==='+ __accum.indexOf("hintprotohint") ); +} +// +////////////////////////////////////////////////////////////////////////////// + diff --git a/js/src/tests/test262/ch12/12.6/12.6.4/S12.6.4_A7_T1.js b/js/src/tests/test262/ch12/12.6/12.6.4/S12.6.4_A7_T1.js new file mode 100644 index 000000000..1105b7ff2 --- /dev/null +++ b/js/src/tests/test262/ch12/12.6/12.6.4/S12.6.4_A7_T1.js @@ -0,0 +1,49 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Properties of the object being enumerated may be deleted during enumeration + * + * @path ch12/12.6/12.6.4/S12.6.4_A7_T1.js + * @description Checking "for (LeftHandSideExpression in Expression) Statement" case + */ + +__obj={aa:1,ba:2,ca:3}; + +__accum=""; + +for (__key in __obj){ + + erasator_T_1000(__obj,"b"); + + __accum+=(__key+__obj[__key]); + +} + + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (!((__accum.indexOf("aa1")!==-1)&&(__accum.indexOf("ca3")!==-1))) { + $ERROR('#1: (__accum.indexOf("aa1")!==-1)&&(__accum.indexOf("ca3")!==-1)'); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__accum.indexOf("ba2")!==-1) { + $ERROR('#2: __accum.indexOf("ba2") === -1. Actual: __accum.indexOf("ba2") ==='+ __accum.indexOf("ba2") ); +} +// +////////////////////////////////////////////////////////////////////////////// + + +// erasator is the hash map terminator +function erasator_T_1000(hash_map, charactr){ + for (key in hash_map){ + if (key.indexOf(charactr)===0) { + delete hash_map[key]; + }; + } +} + diff --git a/js/src/tests/test262/ch12/12.6/12.6.4/S12.6.4_A7_T2.js b/js/src/tests/test262/ch12/12.6/12.6.4/S12.6.4_A7_T2.js new file mode 100644 index 000000000..48be196ab --- /dev/null +++ b/js/src/tests/test262/ch12/12.6/12.6.4/S12.6.4_A7_T2.js @@ -0,0 +1,49 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Properties of the object being enumerated may be deleted during enumeration + * + * @path ch12/12.6/12.6.4/S12.6.4_A7_T2.js + * @description Checking "for (var VariableDeclarationNoIn in Expression) Statement" case + */ + +__obj={aa:1,ba:2,ca:3}; + +__accum=""; + +for (var __key in __obj){ + + erasator_T_1000(__obj,"b"); + + __accum+=(__key+__obj[__key]); + +} + + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (!((__accum.indexOf("aa1")!==-1)&&(__accum.indexOf("ca3")!==-1))) { + $ERROR('#1: (__accum.indexOf("aa1")!==-1)&&(__accum.indexOf("ca3")!==-1)'); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__accum.indexOf("ba2")!==-1) { + $ERROR('#2: __accum.indexOf("ba2") === -1. Actual: __accum.indexOf("ba2") ==='+ __accum.indexOf("ba2") ); +} +// +////////////////////////////////////////////////////////////////////////////// + + +// erasator is the hash map terminator +function erasator_T_1000(hash_map, charactr){ + for (key in hash_map){ + if (key.indexOf(charactr)===0) { + delete hash_map[key]; + }; + } +} + diff --git a/js/src/tests/test262/ch12/12.6/12.6.4/browser.js b/js/src/tests/test262/ch12/12.6/12.6.4/browser.js new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/js/src/tests/test262/ch12/12.6/12.6.4/browser.js diff --git a/js/src/tests/test262/ch12/12.6/12.6.4/shell.js b/js/src/tests/test262/ch12/12.6/12.6.4/shell.js new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/js/src/tests/test262/ch12/12.6/12.6.4/shell.js |