diff options
Diffstat (limited to 'test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14')
50 files changed, 2488 insertions, 0 deletions
diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-0-1.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-0-1.js new file mode 100644 index 000000000..55b98c35a --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-0-1.js @@ -0,0 +1,35 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.2.3.14-0-1",
+
+path: "TestCases/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-0-1.js",
+
+description: "Object.keys must exist as a function",
+
+test: function testcase() {
+ var f = Object.keys;
+ if (typeof(f) === "function") {
+ return true;
+ }
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-0-2.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-0-2.js new file mode 100644 index 000000000..9f0ffb317 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-0-2.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.2.3.14-0-2",
+
+path: "TestCases/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-0-2.js",
+
+description: "Object.keys must exist as a function taking 1 parameter",
+
+test: function testcase() {
+ if (Object.keys.length === 1) {
+ return true;
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(Object.keys);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-1-1.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-1-1.js new file mode 100644 index 000000000..f2ce6fea0 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-1-1.js @@ -0,0 +1,43 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.2.3.14-1-1",
+
+path: "TestCases/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-1-1.js",
+
+description: "Object.keys throws TypeError if type of first param is not Object",
+
+test: function testcase() {
+ try {
+ Object.keys(0);
+ }
+ catch (e) {
+ if (e instanceof TypeError) {
+ return true;
+ }
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(Object.keys);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-1-2.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-1-2.js new file mode 100644 index 000000000..27b273730 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-1-2.js @@ -0,0 +1,43 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.2.3.14-1-2",
+
+path: "TestCases/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-1-2.js",
+
+description: "Object.keys throws TypeError if type of first param is not Object (boolean)",
+
+test: function testcase() {
+ try {
+ Object.keys(true);
+ }
+ catch (e) {
+ if (e instanceof TypeError) {
+ return true;
+ }
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(Object.keys);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-1-3.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-1-3.js new file mode 100644 index 000000000..64c41f6b4 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-1-3.js @@ -0,0 +1,43 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.2.3.14-1-3",
+
+path: "TestCases/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-1-3.js",
+
+description: "Object.keys throws TypeError if type of first param is not Object (string)",
+
+test: function testcase() {
+ try {
+ Object.keys('abc');
+ }
+ catch (e) {
+ if (e instanceof TypeError) {
+ return true;
+ }
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(Object.keys);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-1-4.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-1-4.js new file mode 100644 index 000000000..8a4ac3640 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-1-4.js @@ -0,0 +1,43 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.2.3.14-1-4",
+
+path: "TestCases/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-1-4.js",
+
+description: "Object.keys throws TypeError if type of first param is not Object (null)",
+
+test: function testcase() {
+ try {
+ Object.keys(null);
+ }
+ catch (e) {
+ if (e instanceof TypeError) {
+ return true;
+ }
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(Object.keys);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-1-5.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-1-5.js new file mode 100644 index 000000000..12f662399 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-1-5.js @@ -0,0 +1,43 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.2.3.14-1-5",
+
+path: "TestCases/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-1-5.js",
+
+description: "Object.keys throws TypeError if type of first param is not Object (undefined)",
+
+test: function testcase() {
+ try {
+ Object.keys(undefined);
+ }
+ catch (e) {
+ if (e instanceof TypeError) {
+ return true;
+ }
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(Object.keys);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-2-1.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-2-1.js new file mode 100644 index 000000000..b6aad9f54 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-2-1.js @@ -0,0 +1,41 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.2.3.14-2-1",
+
+path: "TestCases/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-2-1.js",
+
+description: "Object.keys returns the standard built-in Array",
+
+test: function testcase() {
+ var o = { x: 1, y: 2};
+
+ var a = Object.keys(o);
+ if (Array.isArray(a) === true) {
+ return true;
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(Object.keys) && fnExists(Array.isArray);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-2-2.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-2-2.js new file mode 100644 index 000000000..f0c1898c1 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-2-2.js @@ -0,0 +1,42 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.2.3.14-2-2",
+
+path: "TestCases/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-2-2.js",
+
+description: "Object.keys returns the standard built-in Array (check [[Class]]",
+
+test: function testcase() {
+ var o = { x: 1, y: 2};
+
+ var a = Object.keys(o);
+ var s = Object.prototype.toString.call(a);
+ if (s === '[object Array]') {
+ return true;
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(Object.keys);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-2-3.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-2-3.js new file mode 100644 index 000000000..7695ecf58 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-2-3.js @@ -0,0 +1,45 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.2.3.14-2-3",
+
+path: "TestCases/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-2-3.js",
+
+description: "Object.keys returns the standard built-in Array (Array overridden)",
+
+test: function testcase() {
+ function Array() { alert("helloe"); }
+
+ var o = { x: 1, y: 2};
+
+ var a = Object.keys(o);
+
+ var s = Object.prototype.toString.call(a);
+ if (s === '[object Array]') {
+ return true;
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(Object.keys);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-2-4.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-2-4.js new file mode 100644 index 000000000..07d22dda5 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-2-4.js @@ -0,0 +1,41 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.2.3.14-2-4",
+
+path: "TestCases/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-2-4.js",
+
+description: "Object.keys returns the standard built-in Array that is extensible",
+
+test: function testcase() {
+ var o = { x: 1, y: 2};
+
+ var a = Object.keys(o);
+ if (Object.isExtensible(a) === true) {
+ return true;
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(Object.keys) && fnExists(Object.isExtensible);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-2-5.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-2-5.js new file mode 100644 index 000000000..778f40a52 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-2-5.js @@ -0,0 +1,41 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.2.3.14-2-5",
+
+path: "TestCases/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-2-5.js",
+
+description: "Object.keys returns the standard built-in Array that is not sealed",
+
+test: function testcase() {
+ var o = { x: 1, y: 2};
+
+ var a = Object.keys(o);
+ if (Object.isSealed(a) === false) {
+ return true;
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(Object.keys) && fnExists(Object.isSealed);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-2-6.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-2-6.js new file mode 100644 index 000000000..36a7bec35 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-2-6.js @@ -0,0 +1,41 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.2.3.14-2-6",
+
+path: "TestCases/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-2-6.js",
+
+description: "Object.keys returns the standard built-in Array that is not frozen",
+
+test: function testcase() {
+ var o = { x: 1, y: 2};
+
+ var a = Object.keys(o);
+ if (Object.isFrozen(a) === false) {
+ return true;
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(Object.keys) && fnExists(Object.isFrozen);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-2-7.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-2-7.js new file mode 100644 index 000000000..623cd26dc --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-2-7.js @@ -0,0 +1,54 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.2.3.14-2-7",
+
+ path: "TestCases/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-2-7.js",
+
+ description: "Object.keys - 'n' is 0 when 'O' doesn't contain own enumerable data or accessor properties",
+
+ test: function testcase() {
+ var obj = {};
+
+ Object.defineProperty(obj, "prop1", {
+ value: 1001,
+ enumerable: false,
+ configurable: true
+ });
+
+ Object.defineProperty(obj, "prop2", {
+ get: function () {
+ return 1002;
+ },
+ enumerable: false,
+ configurable: true
+ });
+
+ var arr = Object.keys(obj);
+
+ return arr.length === 0;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Object.keys) && fnExists(Object.defineProperty);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-2-8.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-2-8.js new file mode 100644 index 000000000..9c8cca870 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-2-8.js @@ -0,0 +1,59 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.2.3.14-2-8",
+
+ path: "TestCases/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-2-8.js",
+
+ description: "Object.keys - 'n' is the correct value when enumerable properties exist in 'O'",
+
+ test: function testcase() {
+ var obj = {
+ prop1: 1001,
+ prop2: function () {
+ return 1002;
+ }
+ };
+
+ Object.defineProperty(obj, "prop3", {
+ value: 1003,
+ enumerable: false,
+ configurable: true
+ });
+
+ Object.defineProperty(obj, "prop4", {
+ get: function () {
+ return 1004;
+ },
+ enumerable: false,
+ configurable: true
+ });
+
+ var arr = Object.keys(obj);
+
+ return (arr.length === 2) && (arr[0] === "prop1") && (arr[1] === "prop2");
+ },
+
+ precondition: function prereq() {
+ return fnExists(Object.keys) && fnExists(Object.defineProperty);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-3-1.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-3-1.js new file mode 100644 index 000000000..41be9b0dd --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-3-1.js @@ -0,0 +1,43 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.2.3.14-3-1",
+
+path: "TestCases/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-3-1.js",
+
+description: "Object.keys returns the standard built-in Array containing own enumerable properties",
+
+test: function testcase() {
+ var o = { x: 1, y: 2};
+
+ var a = Object.keys(o);
+ if (a.length === 2 &&
+ a[0] === 'x' &&
+ a[1] === 'y') {
+ return true;
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(Object.keys);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-3-2.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-3-2.js new file mode 100644 index 000000000..0743e79b5 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-3-2.js @@ -0,0 +1,43 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.2.3.14-3-2",
+
+path: "TestCases/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-3-2.js",
+
+description: "Object.keys returns the standard built-in Array containing own enumerable properties (function)",
+
+test: function testcase() {
+ function foo() {}
+ foo.x = 1;
+
+ var a = Object.keys(foo);
+ if (a.length === 1 &&
+ a[0] === 'x') {
+ return true;
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(Object.keys);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-3-3.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-3-3.js new file mode 100644 index 000000000..06f07e951 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-3-3.js @@ -0,0 +1,42 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.2.3.14-3-3",
+
+path: "TestCases/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-3-3.js",
+
+description: "Object.keys returns the standard built-in Array containing own enumerable properties (array)",
+
+test: function testcase() {
+ var o = [1, 2];
+ var a = Object.keys(o);
+ if (a.length === 2 &&
+ a[0] === '0' &&
+ a[1] === '1') {
+ return true;
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(Object.keys);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-3-4.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-3-4.js new file mode 100644 index 000000000..24ea1602c --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-3-4.js @@ -0,0 +1,54 @@ +// Copyright (c) 2009 Google, Inc. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+// that the following conditions are met:
+// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+// the following disclaimer.
+// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+// the following disclaimer in the documentation and/or other materials provided with the distribution.
+// * Neither the name of Microsoft nor the names of its contributors may be used to
+// endorse or promote products derived from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.2.3.14-3-4",
+
+path: "TestCases/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-3-4.js",
+
+description: "Object.keys of an arguments object returns the indices of the given arguments",
+
+test: function testcase() {
+ function testArgs2(x, y, z) {
+ // Properties of the arguments object are enumerable.
+ var a = Object.keys(arguments);
+ if (a.length === 2 && a[0] === "0" && a[1] === "1")
+ return true;
+ }
+ function testArgs3(x, y, z) {
+ // Properties of the arguments object are enumerable.
+ var a = Object.keys(arguments);
+ if (a.length === 3 && a[0] === "0" && a[1] === "1" && a[2] === "2")
+ return true;
+ }
+ function testArgs4(x, y, z) {
+ // Properties of the arguments object are enumerable.
+ var a = Object.keys(arguments);
+ if (a.length === 4 && a[0] === "0" && a[1] === "1" && a[2] === "2" && a[3] === "3")
+ return true;
+ }
+ return testArgs2(1, 2) && testArgs3(1, 2, 3) && testArgs4(1, 2, 3, 4);
+ },
+
+precondition: function prereq() {
+ return fnExists(Object.keys);
+ }
+});
\ No newline at end of file diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-3-5.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-3-5.js new file mode 100644 index 000000000..69c9dc27d --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-3-5.js @@ -0,0 +1,41 @@ +// Copyright (c) 2009 Google, Inc. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+// that the following conditions are met:
+// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+// the following disclaimer.
+// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+// the following disclaimer in the documentation and/or other materials provided with the distribution.
+// * Neither the name of Microsoft nor the names of its contributors may be used to
+// endorse or promote products derived from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.2.3.14-3-5",
+
+path: "TestCases/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-3-5.js",
+
+description: "Object.keys must return a fresh array on each invocation",
+
+test: function testcase() {
+ var literal = {a: 1};
+ var keysBefore = Object.keys(literal);
+ if (keysBefore[0] != 'a') return false;
+ keysBefore[0] = 'x';
+ var keysAfter = Object.keys(literal);
+ return (keysBefore[0] == 'x') && (keysAfter[0] == 'a');
+ },
+
+precondition: function prereq() {
+ return fnExists(Object.keys);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-3-6.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-3-6.js new file mode 100644 index 000000000..e4dd434d9 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-3-6.js @@ -0,0 +1,40 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.2.3.14-3-6",
+
+ path: "TestCases/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-3-6.js",
+
+ description: "Object.keys - returns the standard built-in Array (instanceof Array)",
+
+ test: function testcase() {
+ var obj = {};
+
+ var arr = Object.keys(obj);
+
+ return arr instanceof Array;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Object.keys);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-3-7.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-3-7.js new file mode 100644 index 000000000..4e0f9239a --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-3-7.js @@ -0,0 +1,54 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.2.3.14-3-7",
+
+ path: "TestCases/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-3-7.js",
+
+ description: "Object.keys - length of the returned array equals the number of own enumerable properties of 'O'",
+
+ test: function testcase() {
+ var obj = { prop1: 1001, prop2: 1002 };
+
+ Object.defineProperty(obj, "prop3", {
+ value: 1003,
+ enumerable: true,
+ configurable: true
+ });
+
+ Object.defineProperty(obj, "prop4", {
+ get: function () {
+ return 1003;
+ },
+ enumerable: false,
+ configurable: true
+ });
+
+ var arr = Object.keys(obj);
+
+ return arr.length === 3;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Object.keys) && fnExists(Object.defineProperty);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-4-1.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-4-1.js new file mode 100644 index 000000000..8bca72d87 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-4-1.js @@ -0,0 +1,54 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.2.3.14-4-1",
+
+ path: "TestCases/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-4-1.js",
+
+ description: "Object.keys - elements of the returned array start from index 0",
+
+ test: function testcase() {
+ var obj = { prop1: 1001, prop2: 1002 };
+
+ Object.defineProperty(obj, "prop3", {
+ value: 1003,
+ enumerable: true,
+ configurable: true
+ });
+
+ Object.defineProperty(obj, "prop4", {
+ get: function () {
+ return 1003;
+ },
+ enumerable: true,
+ configurable: true
+ });
+
+ var arr = Object.keys(obj);
+
+ return arr.hasOwnProperty(0) && arr[0] === "prop1";
+ },
+
+ precondition: function prereq() {
+ return fnExists(Object.keys) && fnExists(Object.defineProperty);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-1.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-1.js new file mode 100644 index 000000000..7ca106d2a --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-1.js @@ -0,0 +1,46 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.2.3.14-5-1",
+
+ path: "TestCases/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-1.js",
+
+ description: "Object.keys - own enumerable data property of 'O' is defined in returned array",
+
+ test: function testcase() {
+ var obj = { };
+
+ Object.defineProperty(obj, "prop", {
+ value: 1003,
+ enumerable: true,
+ configurable: true
+ });
+
+ var arr = Object.keys(obj);
+
+ return arr.hasOwnProperty(0) && arr[0] === "prop";
+ },
+
+ precondition: function prereq() {
+ return fnExists(Object.keys) && fnExists(Object.defineProperty);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-10.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-10.js new file mode 100644 index 000000000..9e3d73341 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-10.js @@ -0,0 +1,60 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.2.3.14-5-10",
+
+ path: "TestCases/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-10.js",
+
+ description: "Object.keys - inherted enumerable accessor property that is over-ridden by non-enumerable own accessor property is not defined in returned array",
+
+ test: function testcase() {
+ var proto = {};
+ Object.defineProperty(proto, "prop", {
+ get: function () { },
+ enumerable: true,
+ configurable: true
+ });
+ var Con = function () { };
+ Con.prototype = proto;
+
+ var obj = new Con();
+ Object.defineProperty(obj, "prop", {
+ get: function () { },
+ enumerable: false,
+ configurable: true
+ });
+
+ var arr = Object.keys(obj);
+
+ for (var p in arr) {
+ if (arr[p] === "prop") {
+ return false;
+ }
+ }
+
+ return true;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Object.keys) && fnExists(Object.defineProperty);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-11.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-11.js new file mode 100644 index 000000000..46b52b641 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-11.js @@ -0,0 +1,50 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.2.3.14-5-11",
+
+ path: "TestCases/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-11.js",
+
+ description: "Object.keys - own enumerable indexed data property of dense array 'O' is defined in returned array",
+
+ test: function testcase() {
+ var obj = [1, 2, 3, 4, 5];
+
+ var arr = Object.keys(obj);
+
+ var initValue = 0;
+ for (var p in arr) {
+ if (arr.hasOwnProperty(p)) {
+ if (arr[p] !== initValue.toString()) {
+ return false;
+ }
+ initValue++;
+ }
+ }
+
+ return true;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Object.keys);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-12.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-12.js new file mode 100644 index 000000000..117e7aa0e --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-12.js @@ -0,0 +1,56 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.2.3.14-5-12",
+
+ path: "TestCases/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-12.js",
+
+ description: "Object.keys - own enumerable indexed accessor property of dense array 'O' is defined in returned array",
+
+ test: function testcase() {
+ var obj = [2, 3, 4, 5];
+
+ Object.defineProperty(obj, "prop", {
+ get: function () {
+ return 6;
+ },
+ enumerable: true,
+ configurable: true
+ });
+
+ var arr = Object.keys(obj);
+
+ for (var p in arr) {
+ if (arr.hasOwnProperty(p)) {
+ if (arr[p] === "prop") {
+ return true;
+ }
+ }
+ }
+
+ return false;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Object.keys) && fnExists(Object.defineProperty);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-13.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-13.js new file mode 100644 index 000000000..4ffe4ee0c --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-13.js @@ -0,0 +1,65 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.2.3.14-5-13",
+
+ path: "TestCases/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-13.js",
+
+ description: "Object.keys - own enumerable indexed data property of sparse array 'O' is defined in returned array",
+
+ test: function testcase() {
+ var obj = [1, , 3, , 5];
+
+ Object.defineProperty(obj, 5, {
+ value: 7,
+ enumerable: false,
+ configurable: true
+ });
+
+ Object.defineProperty(obj, 10000, {
+ value: "ElementWithLargeIndex",
+ enumerable: true,
+ configurable: true
+ });
+
+ var arr = Object.keys(obj);
+
+ var index;
+ var initValue = 0;
+ for (index = 0; index < 3; index++) {
+ if (arr[index] !== initValue.toString()) {
+ return false;
+ }
+ initValue += 2;
+ }
+
+ if (arr.length !== 4 || arr[3] !== "10000") {
+ return false;
+ }
+
+ return true;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Object.keys) && fnExists(Object.defineProperty);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-14.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-14.js new file mode 100644 index 000000000..16192849f --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-14.js @@ -0,0 +1,54 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.2.3.14-5-14",
+
+ path: "TestCases/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-14.js",
+
+ description: "Object.keys - own enumerable indexed accessor property of sparse array 'O' is defined in returned array",
+
+ test: function testcase() {
+ var obj = [1, , 3, , 5];
+
+ Object.defineProperty(obj, "10000", {
+ get: function () {
+ return "ElementWithLargeIndex";
+ },
+ enumerable: true,
+ configurable: true
+ });
+
+ var arr = Object.keys(obj);
+
+ for (var p in arr) {
+ if (arr[p] === "10000") {
+ return true;
+ }
+ }
+
+ return false;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Object.keys) && fnExists(Object.defineProperty);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-15.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-15.js new file mode 100644 index 000000000..04ab7a71e --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-15.js @@ -0,0 +1,54 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.2.3.14-5-15",
+
+ path: "TestCases/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-15.js",
+
+ description: "Object.keys - own enumerable indexed data property of String object 'O' is defined in returned array",
+
+ test: function testcase() {
+ var obj = new String("xyz");
+ obj[-20] = -20;
+ obj[20] = 20;
+
+ Object.defineProperty(obj, "prop", {
+ value: 1003,
+ enumerable: false,
+ configurable: true
+ });
+
+ var arr = Object.keys(obj);
+
+ for (var i = 0; i < arr.length; i++) {
+ if (!obj.hasOwnProperty(arr[i])) {
+ return false;
+ }
+ }
+
+ return true;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Object.keys) && fnExists(Object.defineProperty);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-16.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-16.js new file mode 100644 index 000000000..db825d4e4 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-16.js @@ -0,0 +1,59 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.2.3.14-5-16",
+
+ path: "TestCases/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-16.js",
+
+ description: "Object.keys - own enumerable indexed accessor property of String object 'O' is defined in returned array",
+
+ test: function testcase() {
+ var obj = new String("xyz");
+ obj[-20] = -20;
+ obj[20] = 20;
+
+ Object.defineProperty(obj, "prop1", {
+ get: function () { },
+ enumerable: true,
+ configurable: true
+ });
+ Object.defineProperty(obj, "prop2", {
+ get: function () { },
+ enumerable: false,
+ configurable: true
+ });
+
+ var arr = Object.keys(obj);
+
+ for (var i = 0; i < arr.length; i++) {
+ if (!obj.hasOwnProperty(arr[i])) {
+ return false;
+ }
+ }
+
+ return true;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Object.keys) && fnExists(Object.defineProperty);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-2.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-2.js new file mode 100644 index 000000000..0449050f6 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-2.js @@ -0,0 +1,48 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.2.3.14-5-2",
+
+ path: "TestCases/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-2.js",
+
+ description: "Object.keys - own enumerable accessor property of 'O' is defined in returned array",
+
+ test: function testcase() {
+ var obj = { };
+
+ Object.defineProperty(obj, "prop", {
+ get: function () {
+ return 1003;
+ },
+ enumerable: true,
+ configurable: true
+ });
+
+ var arr = Object.keys(obj);
+
+ return arr.hasOwnProperty(0) && arr[0] === "prop";
+ },
+
+ precondition: function prereq() {
+ return fnExists(Object.keys) && fnExists(Object.defineProperty);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-3.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-3.js new file mode 100644 index 000000000..bfa943593 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-3.js @@ -0,0 +1,60 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.2.3.14-5-3",
+
+ path: "TestCases/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-3.js",
+
+ description: "Object.keys - non-enumerable own data property of 'O' is not defined in returned array",
+
+ test: function testcase() {
+ var obj = { prop1: 1001, prop2: 1002 };
+
+ Object.defineProperty(obj, "prop3", {
+ value: 1003,
+ enumerable: true,
+ configurable: true
+ });
+
+ Object.defineProperty(obj, "prop4", {
+ value: 1004,
+ enumerable: false,
+ configurable: true
+ });
+
+ var arr = Object.keys(obj);
+
+ for (var p in arr) {
+ if (arr.hasOwnProperty(p)) {
+ if (arr[p] === "prop4") {
+ return false;
+ }
+ }
+ }
+
+ return true;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Object.keys) && fnExists(Object.defineProperty);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-4.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-4.js new file mode 100644 index 000000000..86fabae00 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-4.js @@ -0,0 +1,64 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.2.3.14-5-4",
+
+ path: "TestCases/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-4.js",
+
+ description: "Object.keys - non-enumerable own accessor property of 'O' is not defined in returned array",
+
+ test: function testcase() {
+ var obj = {};
+
+ Object.defineProperty(obj, "prop1", {
+ get: function () { },
+ enumerable: true,
+ configurable: true
+ });
+ Object.defineProperty(obj, "prop2", {
+ get: function () { },
+ enumerable: false,
+ configurable: true
+ });
+ Object.defineProperty(obj, "prop3", {
+ get: function () { },
+ enumerable: true,
+ configurable: true
+ });
+
+ var arr = Object.keys(obj);
+
+ for (var p in arr) {
+ if (arr.hasOwnProperty(p)) {
+ if (arr[p] === "prop2") {
+ return false;
+ }
+ }
+ }
+
+ return true;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Object.keys) && fnExists(Object.defineProperty);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-5.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-5.js new file mode 100644 index 000000000..5d72ff105 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-5.js @@ -0,0 +1,56 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.2.3.14-5-5",
+
+ path: "TestCases/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-5.js",
+
+ description: "Object.keys - inherited enumerable data property of 'O' is not defined in returned array",
+
+ test: function testcase() {
+ var proto = {};
+ Object.defineProperty(proto, "inheritedProp", {
+ value: 1003,
+ enumerable: true,
+ configurable: true
+ });
+ var Con = function () { };
+ Con.prototype = proto;
+
+ var obj = new Con();
+ obj.prop = 1004;
+
+ var arr = Object.keys(obj);
+
+ for (var p in arr) {
+ if (arr[p] === "inheritedProp") {
+ return false;
+ }
+ }
+
+ return true;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Object.keys) && fnExists(Object.defineProperty);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-6.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-6.js new file mode 100644 index 000000000..c3703232e --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-6.js @@ -0,0 +1,64 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.2.3.14-5-6",
+
+ path: "TestCases/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-6.js",
+
+ description: "Object.keys - inherited enumerable accessor property of 'O' is not defined in returned array",
+
+ test: function testcase() {
+ var proto = {};
+ Object.defineProperty(proto, "inheritedProp", {
+ get: function () {
+ return 1003;
+ },
+ enumerable: true,
+ configurable: true
+ });
+ var Con = function () { };
+ Con.prototype = proto;
+
+ var obj = new Con();
+ Object.defineProperty(obj, "prop", {
+ get: function () {
+ return 1004;
+ },
+ enumerable: true,
+ configurable: true
+ });
+
+ var arr = Object.keys(obj);
+
+ for (var p in arr) {
+ if (arr[p] === "inheritedProp") {
+ return false;
+ }
+ }
+
+ return true;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Object.keys) && fnExists(Object.defineProperty);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-7.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-7.js new file mode 100644 index 000000000..ec4074900 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-7.js @@ -0,0 +1,60 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.2.3.14-5-7",
+
+ path: "TestCases/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-7.js",
+
+ description: "Object.keys - inherted enumerable data property that is over-ridden by non-enumerable own data property is not defined in returned array",
+
+ test: function testcase() {
+ var proto = {};
+ Object.defineProperty(proto, "prop", {
+ value: 1003,
+ enumerable: true,
+ configurable: true
+ });
+ var Con = function () { };
+ Con.prototype = proto;
+
+ var obj = new Con();
+ Object.defineProperty(obj, "prop", {
+ value: 1004,
+ enumerable: false,
+ configurable: true
+ });
+
+ var arr = Object.keys(obj);
+
+ for (var p in arr) {
+ if (arr[p] === "prop") {
+ return false;
+ }
+ }
+
+ return true;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Object.keys) && fnExists(Object.defineProperty);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-8.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-8.js new file mode 100644 index 000000000..99b50bb0d --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-8.js @@ -0,0 +1,60 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.2.3.14-5-8",
+
+ path: "TestCases/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-8.js",
+
+ description: "Object.keys - inherted enumerable data property that is over-ridden by non-enumerable own accessor property is not defined in returned array",
+
+ test: function testcase() {
+ var proto = {};
+ Object.defineProperty(proto, "prop", {
+ value: 1003,
+ enumerable: true,
+ configurable: true
+ });
+ var Con = function () { };
+ Con.prototype = proto;
+
+ var obj = new Con();
+ Object.defineProperty(obj, "prop", {
+ get: function () { },
+ enumerable: false,
+ configurable: true
+ });
+
+ var arr = Object.keys(obj);
+
+ for (var p in arr) {
+ if (arr[p] === "prop") {
+ return false;
+ }
+ }
+
+ return true;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Object.keys) && fnExists(Object.defineProperty);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-9.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-9.js new file mode 100644 index 000000000..dcbcf3dd8 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-9.js @@ -0,0 +1,60 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.2.3.14-5-9",
+
+ path: "TestCases/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-9.js",
+
+ description: "Object.keys - inherted enumerable accessor property that is over-ridden by non-enumerable own data property is not defined in returned array",
+
+ test: function testcase() {
+ var proto = {};
+ Object.defineProperty(proto, "prop", {
+ get: function () { },
+ enumerable: true,
+ configurable: true
+ });
+ var Con = function () { };
+ Con.prototype = proto;
+
+ var obj = new Con();
+ Object.defineProperty(obj, "prop", {
+ value: 1003,
+ enumerable: false,
+ configurable: true
+ });
+
+ var arr = Object.keys(obj);
+
+ for (var p in arr) {
+ if (arr[p] === "prop") {
+ return false;
+ }
+ }
+
+ return true;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Object.keys) && fnExists(Object.defineProperty);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-a-1.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-a-1.js new file mode 100644 index 000000000..5b2578f39 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-a-1.js @@ -0,0 +1,42 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.2.3.14-5-a-1",
+
+ path: "TestCases/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-a-1.js",
+
+ description: "Object.keys - 'value' attribute of element in returned array is correct.",
+
+ test: function testcase() {
+ var obj = { prop1: 1 };
+
+ var array = Object.keys(obj);
+
+ var desc = Object.getOwnPropertyDescriptor(array, "0");
+
+ return desc.hasOwnProperty("value") && desc.value === "prop1";
+ },
+
+ precondition: function prereq() {
+ return fnExists(Object.keys);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-a-2.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-a-2.js new file mode 100644 index 000000000..3992709ec --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-a-2.js @@ -0,0 +1,48 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.2.3.14-5-a-2",
+
+ path: "TestCases/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-a-2.js",
+
+ description: "Object.keys - 'writable' attribute of element of returned array is correct",
+
+ test: function testcase() {
+ var obj = { prop1: 100 };
+
+ var array = Object.keys(obj);
+
+ try {
+ array[0] = "isWritable";
+
+ var desc = Object.getOwnPropertyDescriptor(array, "0");
+
+ return array[0] === "isWritable" && desc.hasOwnProperty("writable") && desc.writable === true;
+ } catch (e) {
+ return false;
+ }
+ },
+
+ precondition: function prereq() {
+ return fnExists(Object.keys);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-a-3.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-a-3.js new file mode 100644 index 000000000..9ee843cb4 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-a-3.js @@ -0,0 +1,47 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.2.3.14-5-a-3",
+
+ path: "TestCases/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-a-3.js",
+
+ description: "Object.keys - 'enumerable' attribute of element of returned array is correct",
+
+ test: function testcase() {
+ var obj = { prop1: 100 };
+
+ var array = Object.keys(obj);
+ var desc = Object.getOwnPropertyDescriptor(array, "0");
+ var result = false;
+ for (var index in array) {
+ if (obj.hasOwnProperty(array[index]) && array[index] === "prop1") {
+ result = true;
+ }
+ }
+
+ return result && desc.hasOwnProperty("enumerable") && desc.enumerable === true;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Object.keys);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-a-4.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-a-4.js new file mode 100644 index 000000000..e9de32138 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-a-4.js @@ -0,0 +1,43 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.2.3.14-5-a-4",
+
+ path: "TestCases/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-a-4.js",
+
+ description: "Object.keys - Verify that 'configurable' attribute of element of returned array is correct",
+
+ test: function testcase() {
+ var obj = { prop1: 100 };
+
+ var array = Object.keys(obj);
+ var desc = Object.getOwnPropertyDescriptor(array, "0");
+
+ delete array[0];
+
+ return typeof array[0] === "undefined" && desc.hasOwnProperty("configurable") && desc.configurable === true;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Object.keys);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-b-1.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-b-1.js new file mode 100644 index 000000000..ed655f4ea --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-b-1.js @@ -0,0 +1,50 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.2.3.14-5-b-1",
+
+ path: "TestCases/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-5-b-1.js",
+
+ description: "Object.keys - Verify that 'index' of returned array is ascend by 1",
+
+ test: function testcase() {
+ var obj = { prop1: 100, prop2: 200, prop3: 300 };
+
+ var array = Object.keys(obj);
+
+ var idx = 0;
+ for (var index in array) {
+ if (array.hasOwnProperty(index)) {
+ if (index !== idx.toString()) {
+ return false;
+ }
+ idx++;
+ }
+ }
+
+ return true;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Object.keys);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-6-1.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-6-1.js new file mode 100644 index 000000000..dd6404e79 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-6-1.js @@ -0,0 +1,53 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.2.3.14-6-1",
+
+ path: "TestCases/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-6-1.js",
+
+ description: "Object.keys - the order of elements in returned array is the same with the order of properties in 'O' (dense array)",
+
+ test: function testcase() {
+ var denseArray = [1, 2, 3];
+
+ var tempArray = [];
+ for (var p in denseArray) {
+ if (denseArray.hasOwnProperty(p)) {
+ tempArray.push(p);
+ }
+ }
+
+ var returnedArray = Object.keys(denseArray);
+
+ for (var index in returnedArray) {
+ if (tempArray[index] !== returnedArray[index]) {
+ return false;
+ }
+ }
+ return true;
+
+ },
+
+ precondition: function prereq() {
+ return fnExists(Object.keys);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-6-2.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-6-2.js new file mode 100644 index 000000000..3859f9b85 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-6-2.js @@ -0,0 +1,52 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.2.3.14-6-2",
+
+ path: "TestCases/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-6-2.js",
+
+ description: "Object.keys - the order of elements in returned array is the same with the order of properties in 'O' (sparse array)",
+
+ test: function testcase() {
+ var sparseArray = [1, 2, , 4, , 6];
+
+ var tempArray = [];
+ for (var p in sparseArray) {
+ if (sparseArray.hasOwnProperty(p)) {
+ tempArray.push(p);
+ }
+ }
+
+ var returnedArray = Object.keys(sparseArray);
+
+ for (var index in returnedArray) {
+ if (tempArray[index] !== returnedArray[index]) {
+ return false;
+ }
+ }
+ return true;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Object.keys);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-6-3.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-6-3.js new file mode 100644 index 000000000..98f9c2b9b --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-6-3.js @@ -0,0 +1,52 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.2.3.14-6-3",
+
+ path: "TestCases/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-6-3.js",
+
+ description: "Object.keys - the order of elements in returned array is the same with the order of properties in 'O' (String object)",
+
+ test: function testcase() {
+ var str = new String("abc");
+
+ var tempArray = [];
+ for (var p in str) {
+ if (str.hasOwnProperty(p)) {
+ tempArray.push(p);
+ }
+ }
+
+ var returnedArray = Object.keys(str);
+
+ for (var index in returnedArray) {
+ if (tempArray[index] !== returnedArray[index]) {
+ return false;
+ }
+ }
+ return true;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Object.keys);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-6-4.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-6-4.js new file mode 100644 index 000000000..a9d899ada --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-6-4.js @@ -0,0 +1,56 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.2.3.14-6-4",
+
+ path: "TestCases/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-6-4.js",
+
+ description: "Object.keys - the order of elements in returned array is the same with the order of properties in 'O' (Arguments object)",
+
+ test: function testcase() {
+ var func = function (a, b, c) {
+ return arguments;
+ };
+
+ var args = func(1, "b", false);
+
+ var tempArray = [];
+ for (var p in args) {
+ if (args.hasOwnProperty(p)) {
+ tempArray.push(p);
+ }
+ }
+
+ var returnedArray = Object.keys(args);
+
+ for (var index in returnedArray) {
+ if (tempArray[index] !== returnedArray[index]) {
+ return false;
+ }
+ }
+ return true;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Object.keys);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-6-5.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-6-5.js new file mode 100644 index 000000000..707eb93d0 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-6-5.js @@ -0,0 +1,54 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.2.3.14-6-5",
+
+ path: "TestCases/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-6-5.js",
+
+ description: "Object.keys - the order of elements in returned array is the same with the order of properties in 'O' (any other built-in object)",
+
+ test: function testcase() {
+ var obj = new Date();
+ obj.prop1 = 100;
+ obj.prop2 = "prop2";
+
+ var tempArray = [];
+ for (var p in obj) {
+ if (obj.hasOwnProperty(p)) {
+ tempArray.push(p);
+ }
+ }
+
+ var returnedArray = Object.keys(obj);
+
+ for (var index in returnedArray) {
+ if (tempArray[index] !== returnedArray[index]) {
+ return false;
+ }
+ }
+ return true;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Object.keys);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-6-6.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-6-6.js new file mode 100644 index 000000000..2c0ecf9e6 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-6-6.js @@ -0,0 +1,52 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.2.3.14-6-6",
+
+ path: "TestCases/chapter15/15.2/15.2.3/15.2.3.14/15.2.3.14-6-6.js",
+
+ description: "Object.keys - the order of elements in returned array is the same with the order of properties in 'O' (global Object)",
+
+ test: function testcase() {
+ var obj = fnGlobalObject();
+
+ var tempArray = [];
+ for (var p in obj) {
+ if (obj.hasOwnProperty(p)) {
+ tempArray.push(p);
+ }
+ }
+
+ var returnedArray = Object.keys(obj);
+
+ for (var index in returnedArray) {
+ if (tempArray[index] !== returnedArray[index]) {
+ return false;
+ }
+ }
+ return true;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Object.keys);
+ }
+});
|