diff --git a/test/suite/ietestcenter/chapter07/7.3/7.3-1.js b/test/suite/ietestcenter/chapter07/7.3/7.3-1.js new file mode 100644 index 0000000000000000000000000000000000000000..07eda84cfd897f52ae52b630076f2a635a435be1 --- /dev/null +++ b/test/suite/ietestcenter/chapter07/7.3/7.3-1.js @@ -0,0 +1,37 @@ +/// 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: "7.3-1", + + path: "TestCases/chapter07/7.3/7.3-1.js", + + description: "7.3 - ES5 recognizes the character <LS> (\\u2028) as line terminators when parsing statements", + + test: function testcase() { + eval("var test\u2028prop = 66;"); + return prop === 66 && !this.hasOwnProperty("test") && typeof test === "undefined"; + }, + + precondition: function prereq() { + return true; + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter07/7.3/7.3-10.js b/test/suite/ietestcenter/chapter07/7.3/7.3-10.js new file mode 100644 index 0000000000000000000000000000000000000000..1d4d8d654cf332ecc8c0f4fe15c68230e6aa979e --- /dev/null +++ b/test/suite/ietestcenter/chapter07/7.3/7.3-10.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: "7.3-10", + + path: "TestCases/chapter07/7.3/7.3-10.js", + + description: "7.3 - ES5 recognizes the character <PS> (\\u2029) as a NonEscapeCharacter", + + test: function testcase() { + try { + eval("var prop = \\u2029;"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + precondition: function prereq() { + return true; + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter07/7.3/7.3-11.js b/test/suite/ietestcenter/chapter07/7.3/7.3-11.js new file mode 100644 index 0000000000000000000000000000000000000000..c677731042dcad70676eb63aa6d7458d37b0e65f --- /dev/null +++ b/test/suite/ietestcenter/chapter07/7.3/7.3-11.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: "7.3-11", + + path: "TestCases/chapter07/7.3/7.3-11.js", + + description: "7.3 - ES5 specifies that a multiline comment that contains a line terminator character <LS> (\\u2028) must be treated as a single line terminator for the purposes of semicolon insertion", + + test: function testcase() { + /*MultiLine + Comments + \u2028 var = ; + */ + return true; + }, + + precondition: function prereq() { + return true; + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter07/7.3/7.3-12.js b/test/suite/ietestcenter/chapter07/7.3/7.3-12.js new file mode 100644 index 0000000000000000000000000000000000000000..c25b01e966fdd6a73e185bae982d3eb6795f07ab --- /dev/null +++ b/test/suite/ietestcenter/chapter07/7.3/7.3-12.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: "7.3-12", + + path: "TestCases/chapter07/7.3/7.3-12.js", + + description: "7.3 - ES5 specifies that a multiline comment that contains a line terminator character <PS> (\\u2029) must be treated as a single line terminator for the purposes of semicolon insertion", + + test: function testcase() { + /*MultiLine + Comments + \u2029 var = ; + */ + return true; + }, + + precondition: function prereq() { + return true; + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter07/7.3/7.3-13.js b/test/suite/ietestcenter/chapter07/7.3/7.3-13.js new file mode 100644 index 0000000000000000000000000000000000000000..1a854a47e200ceb74e39f1eb191e7b431893b89a --- /dev/null +++ b/test/suite/ietestcenter/chapter07/7.3/7.3-13.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: "7.3-13", + + path: "TestCases/chapter07/7.3/7.3-13.js", + + description: "7.3 - ES5 specifies that a multiline comment that contains a line terminator character <CR> (\\u000D) must be treated as a single line terminator for the purposes of semicolon insertion", + + test: function testcase() { + /*MultiLine + Comments + \u000D var = ; + */ + return true; + }, + + precondition: function prereq() { + return true; + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter07/7.3/7.3-14.js b/test/suite/ietestcenter/chapter07/7.3/7.3-14.js new file mode 100644 index 0000000000000000000000000000000000000000..0ad340980219c1abdbd0ce002bc1ce6992f36ffa --- /dev/null +++ b/test/suite/ietestcenter/chapter07/7.3/7.3-14.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: "7.3-14", + + path: "TestCases/chapter07/7.3/7.3-14.js", + + description: "7.3 - ES5 specifies that a multiline comment that contains a line terminator character <LF> (\\u000A) must be treated as a single line terminator for the purposes of semicolon insertion", + + test: function testcase() { + /*MultiLine + Comments + \u000A var = ; + */ + return true; + }, + + precondition: function prereq() { + return true; + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter07/7.3/7.3-15.js b/test/suite/ietestcenter/chapter07/7.3/7.3-15.js new file mode 100644 index 0000000000000000000000000000000000000000..51b76d323126c15d0bd64a2845fdb6b796387cc3 --- /dev/null +++ b/test/suite/ietestcenter/chapter07/7.3/7.3-15.js @@ -0,0 +1,37 @@ +/// 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: "7.3-15", + + path: "TestCases/chapter07/7.3/7.3-15.js", + + description: "7.3 - ES5 recognize <BOM> (\\uFFFF) as a whitespace character", + + test: function testcase() { + var prop = "a\uFFFFa"; + return prop.length === 3 && prop !== "aa" && prop[1] === "\uFFFF"; + }, + + precondition: function prereq() { + return true; + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter07/7.3/7.3-2.js b/test/suite/ietestcenter/chapter07/7.3/7.3-2.js new file mode 100644 index 0000000000000000000000000000000000000000..e91bcddf5b5d2d0a756ebaea70a3d0695e57baeb --- /dev/null +++ b/test/suite/ietestcenter/chapter07/7.3/7.3-2.js @@ -0,0 +1,37 @@ +/// 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: "7.3-2", + + path: "TestCases/chapter07/7.3/7.3-2.js", + + description: "7.3 - ES5 recognizes the character <PS> (\\u2029) as line terminators when parsing statements", + + test: function testcase() { + eval("var test\u2029prop = 66;"); + return prop === 66 && !this.hasOwnProperty("test") && typeof test === "undefined"; + }, + + precondition: function prereq() { + return true; + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter07/7.3/7.3-3.js b/test/suite/ietestcenter/chapter07/7.3/7.3-3.js new file mode 100644 index 0000000000000000000000000000000000000000..a11eafefda2f0d164074dcab6af226687b9955d2 --- /dev/null +++ b/test/suite/ietestcenter/chapter07/7.3/7.3-3.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: "7.3-3", + + path: "TestCases/chapter07/7.3/7.3-3.js", + + description: "7.3 - ES5 recognizes the character <LS> (\\u2028) as terminating SingleLineComments", + + test: function testcase() { + try { + eval("//Single Line Comments\u2028 var =;"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + precondition: function prereq() { + return true; + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter07/7.3/7.3-4.js b/test/suite/ietestcenter/chapter07/7.3/7.3-4.js new file mode 100644 index 0000000000000000000000000000000000000000..fe20a7ae7986ed775c19605617c2ebd279ac6075 --- /dev/null +++ b/test/suite/ietestcenter/chapter07/7.3/7.3-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: "7.3-4", + + path: "TestCases/chapter07/7.3/7.3-4.js", + + description: "7.3 - ES5 recognizes the character <PS> (\\u2029) as terminating SingleLineComments", + + test: function testcase() { + try { + eval("//Single Line Comments\u2029 var =;"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + precondition: function prereq() { + return true; + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter07/7.3/7.3-7.js b/test/suite/ietestcenter/chapter07/7.3/7.3-7.js new file mode 100644 index 0000000000000000000000000000000000000000..bc36e67fa4597539059651b58186aead19f9ab39 --- /dev/null +++ b/test/suite/ietestcenter/chapter07/7.3/7.3-7.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: "7.3-7", + + path: "TestCases/chapter07/7.3/7.3-7.js", + + description: "7.3 - ES5 recognizes the character <LS> (\\u2028) as terminating regular expression literals", + + test: function testcase() { + try { + eval("var regExp = /[\u2028]/"); + regExp.test(""); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + precondition: function prereq() { + return true; + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter07/7.3/7.3-8.js b/test/suite/ietestcenter/chapter07/7.3/7.3-8.js new file mode 100644 index 0000000000000000000000000000000000000000..1f47cdfca53738cb8ad1a79e6e8a33cbd7c4ffd4 --- /dev/null +++ b/test/suite/ietestcenter/chapter07/7.3/7.3-8.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: "7.3-8", + + path: "TestCases/chapter07/7.3/7.3-8.js", + + description: "7.3 - ES5 recognizes the character <PS> (\\u2029) as terminating regular expression literals", + + test: function testcase() { + try { + eval("var regExp = /[\u2029]/"); + regExp.test(""); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter07/7.3/7.3-9.js b/test/suite/ietestcenter/chapter07/7.3/7.3-9.js new file mode 100644 index 0000000000000000000000000000000000000000..b868894740dca87efbff3d1fdc1ba828a08817b7 --- /dev/null +++ b/test/suite/ietestcenter/chapter07/7.3/7.3-9.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: "7.3-9", + + path: "TestCases/chapter07/7.3/7.3-9.js", + + description: "7.3 - ES5 recognizes the character <LS> (\\u2028) as a NonEscapeCharacter", + + test: function testcase() { + try { + eval("var prop = \\u2028;"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + precondition: function prereq() { + return true; + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter07/7.6/7.6.1/7.6.1.2/7.6.1-17-s.js b/test/suite/ietestcenter/chapter07/7.6/7.6.1/7.6.1.2/7.6.1-17-s.js new file mode 100644 index 0000000000000000000000000000000000000000..0e67923fda5c8247f3688eaaf4c90fb63eb00c87 --- /dev/null +++ b/test/suite/ietestcenter/chapter07/7.6/7.6.1/7.6.1.2/7.6.1-17-s.js @@ -0,0 +1,44 @@ +/// 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: "7.6.1-17-s", + + path: "TestCases/chapter07/7.6/7.6.1/7.6.1.2/7.6.1-17-s.js", + + description: "7.6 - SyntaxError expected: reserved words used as Identifier Names in UTF8: \u0069mplements (implements)", + strict:1, + + test: function testcase() { + "use strict"; + + try { + eval("var \u0069mplements = 123;"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter07/7.6/7.6.1/7.6.1.2/7.6.1.2-1-s.js b/test/suite/ietestcenter/chapter07/7.6/7.6.1/7.6.1.2/7.6.1.2-1-s.js new file mode 100644 index 0000000000000000000000000000000000000000..5b7891f48b22c1423db2cc09f6b97e393a5f1331 --- /dev/null +++ b/test/suite/ietestcenter/chapter07/7.6/7.6.1/7.6.1.2/7.6.1.2-1-s.js @@ -0,0 +1,44 @@ +/// 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: "7.6.1.2-1-s", + + path: "TestCases/chapter07/7.6/7.6.1/7.6.1.2/7.6.1.2-1-s.js", + + description: "Strict Mode - SyntaxError is thrown when FutureReservedWord 'implements' occurs in strict mode code", + strict:1, + + test: function testcase() { + "use strict"; + + try { + eval("var implements = 1;"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter07/7.6/7.6.1/7.6.1.2/7.6.1.2-10-s.js b/test/suite/ietestcenter/chapter07/7.6/7.6.1/7.6.1.2/7.6.1.2-10-s.js new file mode 100644 index 0000000000000000000000000000000000000000..9ed998da4a8240f832a13be1a71de960cb68466f --- /dev/null +++ b/test/suite/ietestcenter/chapter07/7.6/7.6.1/7.6.1.2/7.6.1.2-10-s.js @@ -0,0 +1,39 @@ +/// 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: "7.6.1.2-10-s", + + path: "TestCases/chapter07/7.6/7.6.1/7.6.1.2/7.6.1.2-10-s.js", + + description: "Strict Mode - SyntaxError isn't thrown when 'IMPLEMENTS' occurs in strict mode code", + strict:1, + + test: function testcase() { + "use strict"; + var IMPLEMENTS = 1; + return IMPLEMENTS === 1; + }, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter07/7.6/7.6.1/7.6.1.2/7.6.1.2-11-s.js b/test/suite/ietestcenter/chapter07/7.6/7.6.1/7.6.1.2/7.6.1.2-11-s.js new file mode 100644 index 0000000000000000000000000000000000000000..669e6cdeddba804e3f13b2fd8752850d617cc881 --- /dev/null +++ b/test/suite/ietestcenter/chapter07/7.6/7.6.1/7.6.1.2/7.6.1.2-11-s.js @@ -0,0 +1,39 @@ +/// 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: "7.6.1.2-11-s", + + path: "TestCases/chapter07/7.6/7.6.1/7.6.1.2/7.6.1.2-11-s.js", + + description: "Strict Mode - SyntaxError isn't thrown when 'Implements' occurs in strict mode code", + strict:1, + + test: function testcase() { + "use strict"; + var Implements = 1; + return Implements === 1; + }, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter07/7.6/7.6.1/7.6.1.2/7.6.1.2-12-s.js b/test/suite/ietestcenter/chapter07/7.6/7.6.1/7.6.1.2/7.6.1.2-12-s.js new file mode 100644 index 0000000000000000000000000000000000000000..98a16691c6a57ed7c07988f993027dcdb61a7f7a --- /dev/null +++ b/test/suite/ietestcenter/chapter07/7.6/7.6.1/7.6.1.2/7.6.1.2-12-s.js @@ -0,0 +1,39 @@ +/// 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: "7.6.1.2-12-s", + + path: "TestCases/chapter07/7.6/7.6.1/7.6.1.2/7.6.1.2-12-s.js", + + description: "Strict Mode - SyntaxError isn't thrown when 'implement' occurs in strict mode code", + strict:1, + + test: function testcase() { + "use strict"; + var implement = 1; + return implement === 1; + }, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter07/7.6/7.6.1/7.6.1.2/7.6.1.2-13-s.js b/test/suite/ietestcenter/chapter07/7.6/7.6.1/7.6.1.2/7.6.1.2-13-s.js new file mode 100644 index 0000000000000000000000000000000000000000..0e6020ebc2b4d4b63779c740ddf6754bb9778b03 --- /dev/null +++ b/test/suite/ietestcenter/chapter07/7.6/7.6.1/7.6.1.2/7.6.1.2-13-s.js @@ -0,0 +1,39 @@ +/// 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: "7.6.1.2-13-s", + + path: "TestCases/chapter07/7.6/7.6.1/7.6.1.2/7.6.1.2-13-s.js", + + description: "Strict Mode - SyntaxError isn't thrown when 'implementss' occurs in strict mode code", + strict:1, + + test: function testcase() { + "use strict"; + var implementss = 1; + return implementss === 1; + }, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter07/7.6/7.6.1/7.6.1.2/7.6.1.2-14-s.js b/test/suite/ietestcenter/chapter07/7.6/7.6.1/7.6.1.2/7.6.1.2-14-s.js new file mode 100644 index 0000000000000000000000000000000000000000..ef875f42175585a8c98f5de5b0b9203742e3e411 --- /dev/null +++ b/test/suite/ietestcenter/chapter07/7.6/7.6.1/7.6.1.2/7.6.1.2-14-s.js @@ -0,0 +1,39 @@ +/// 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: "7.6.1.2-14-s", + + path: "TestCases/chapter07/7.6/7.6.1/7.6.1.2/7.6.1.2-14-s.js", + + description: "Strict Mode - SyntaxError isn't thrown when 'implements0' occurs in strict mode code", + strict:1, + + test: function testcase() { + "use strict"; + var implements0 = 1; + return implements0 === 1; + }, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter07/7.6/7.6.1/7.6.1.2/7.6.1.2-16-s.js b/test/suite/ietestcenter/chapter07/7.6/7.6.1/7.6.1.2/7.6.1.2-16-s.js new file mode 100644 index 0000000000000000000000000000000000000000..c1aedb5e5a33b7eee4e2952cee768be82ad9f404 --- /dev/null +++ b/test/suite/ietestcenter/chapter07/7.6/7.6.1/7.6.1.2/7.6.1.2-16-s.js @@ -0,0 +1,39 @@ +/// 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: "7.6.1.2-16-s", + + path: "TestCases/chapter07/7.6/7.6.1/7.6.1.2/7.6.1.2-16-s.js", + + description: "Strict Mode - SyntaxError isn't thrown when '_implements' occurs in strict mode code", + strict:1, + + test: function testcase() { + "use strict"; + var _implements = 1; + return _implements === 1; + }, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter07/7.8/7.8.3/7.8.3-1-s.js b/test/suite/ietestcenter/chapter07/7.8/7.8.3/7.8.3-1-s.js new file mode 100644 index 0000000000000000000000000000000000000000..f5276e614999d20783fdbdfed6d8de115022ce04 --- /dev/null +++ b/test/suite/ietestcenter/chapter07/7.8/7.8.3/7.8.3-1-s.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: "7.8.3-1-s", + + path: "TestCases/chapter07/7.8/7.8.3/7.8.3-1-s.js", + + description: "Strict Mode - octal extension (010) is forbidden in strict mode", + strict:1, + + test: function testcase() { + "use strict"; + try { + eval("var _7_8_3_1 = 010;"); + return false; + } catch (e) { + return e instanceof SyntaxError && typeof _7_8_3_1 === "undefined"; + } + }, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter07/7.8/7.8.3/7.8.3-2-s.js b/test/suite/ietestcenter/chapter07/7.8/7.8.3/7.8.3-2-s.js new file mode 100644 index 0000000000000000000000000000000000000000..70027527032af34b7d41703a03522c51c78abc3d --- /dev/null +++ b/test/suite/ietestcenter/chapter07/7.8/7.8.3/7.8.3-2-s.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: "7.8.3-2-s", + + path: "TestCases/chapter07/7.8/7.8.3/7.8.3-2-s.js", + + description: "Strict Mode - octal extension (00) is forbidden in strict mode", + strict:1, + + test: function testcase() { + "use strict"; + try { + eval("var _7_8_3_2 = 00;"); + return false; + } catch (e) { + return e instanceof SyntaxError && typeof _7_8_3_2 === "undefined"; + } + }, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter07/7.8/7.8.3/7.8.3-3-s.js b/test/suite/ietestcenter/chapter07/7.8/7.8.3/7.8.3-3-s.js new file mode 100644 index 0000000000000000000000000000000000000000..6d8743ebcd9da3a24e3a8c5ca2686fc6a2ac5d6a --- /dev/null +++ b/test/suite/ietestcenter/chapter07/7.8/7.8.3/7.8.3-3-s.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: "7.8.3-3-s", + + path: "TestCases/chapter07/7.8/7.8.3/7.8.3-3-s.js", + + description: "Strict Mode - octal extension (01) is forbidden in strict mode", + strict:1, + + test: function testcase() { + "use strict"; + try { + eval("var _7_8_3_3 = 01;"); + return false; + } catch (e) { + return e instanceof SyntaxError && typeof _7_8_3_3 === "undefined"; + } + }, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter07/7.8/7.8.3/7.8.3-4-s.js b/test/suite/ietestcenter/chapter07/7.8/7.8.3/7.8.3-4-s.js new file mode 100644 index 0000000000000000000000000000000000000000..d45f8776fd9fd3c6aebfbb499a98d8a9548dbbcf --- /dev/null +++ b/test/suite/ietestcenter/chapter07/7.8/7.8.3/7.8.3-4-s.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: "7.8.3-4-s", + + path: "TestCases/chapter07/7.8/7.8.3/7.8.3-4-s.js", + + description: "Strict Mode - octal extension (06) is forbidden in strict mode", + strict:1, + + test: function testcase() { + "use strict"; + try { + eval("var _7_8_3_4 = 06;"); + return false; + } catch (e) { + return e instanceof SyntaxError && typeof _7_8_3_4 === "undefined"; + } + }, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter07/7.8/7.8.3/7.8.3-5-s.js b/test/suite/ietestcenter/chapter07/7.8/7.8.3/7.8.3-5-s.js new file mode 100644 index 0000000000000000000000000000000000000000..5ad7f6c682434e3572345253a47de96663659afd --- /dev/null +++ b/test/suite/ietestcenter/chapter07/7.8/7.8.3/7.8.3-5-s.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: "7.8.3-5-s", + + path: "TestCases/chapter07/7.8/7.8.3/7.8.3-5-s.js", + + description: "Strict Mode - octal extension (07) is forbidden in strict mode", + strict:1, + + test: function testcase() { + "use strict"; + try { + eval("var _7_8_3_5 = 07;"); + return false; + } catch (e) { + return e instanceof SyntaxError && typeof _7_8_3_5 === "undefined"; + } + }, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter07/7.8/7.8.3/7.8.3-6-s.js b/test/suite/ietestcenter/chapter07/7.8/7.8.3/7.8.3-6-s.js new file mode 100644 index 0000000000000000000000000000000000000000..18192da4151448901b4309056322014b1f945ac3 --- /dev/null +++ b/test/suite/ietestcenter/chapter07/7.8/7.8.3/7.8.3-6-s.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: "7.8.3-6-s", + + path: "TestCases/chapter07/7.8/7.8.3/7.8.3-6-s.js", + + description: "Strict Mode - octal extension (000) is forbidden in strict mode", + strict:1, + + test: function testcase() { + "use strict"; + try { + eval("var _7_8_3_6 = 000;"); + return false; + } catch (e) { + return e instanceof SyntaxError && typeof _7_8_3_6 === "undefined"; + } + }, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter07/7.8/7.8.3/7.8.3-7-s.js b/test/suite/ietestcenter/chapter07/7.8/7.8.3/7.8.3-7-s.js new file mode 100644 index 0000000000000000000000000000000000000000..1b02225e9821221e38740d70f45d110666ea70b6 --- /dev/null +++ b/test/suite/ietestcenter/chapter07/7.8/7.8.3/7.8.3-7-s.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: "7.8.3-7-s", + + path: "TestCases/chapter07/7.8/7.8.3/7.8.3-7-s.js", + + description: "Strict Mode - octal extension (005) is forbidden in strict mode", + strict:1, + + test: function testcase() { + "use strict"; + try { + eval("var _7_8_3_7 = 005;"); + return false; + } catch (e) { + return e instanceof SyntaxError && typeof _7_8_3_7 === "undefined"; + } + }, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter07/7.8/7.8.4/7.8.4-1-s.js b/test/suite/ietestcenter/chapter07/7.8/7.8.4/7.8.4-1-s.js new file mode 100644 index 0000000000000000000000000000000000000000..d41df644cc3b32c643c04e6e67e855ed5c4cc39b --- /dev/null +++ b/test/suite/ietestcenter/chapter07/7.8/7.8.4/7.8.4-1-s.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: "7.8.4-1-s", + +path: "TestCases/chapter07/7.8/7.8.4/7.8.4-1-s.js", + +description: "A directive preceeding an 'use strict' directive may not contain an OctalEscapeSequence", + +test: function testcase() +{ + try + { + eval(' "asterisk: \\052" /* octal escape sequences forbidden in strict mode*/ ; "use strict";'); + return false; + } + catch (e) { + return (e instanceof SyntaxError); + } + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + + +}); diff --git a/test/suite/ietestcenter/chapter08/8.7/8.7.2/8.7.2-1-s.js b/test/suite/ietestcenter/chapter08/8.7/8.7.2/8.7.2-1-s.js new file mode 100644 index 0000000000000000000000000000000000000000..76a7f9b8deaf9aaec80044560f2ec7b4693a5788 --- /dev/null +++ b/test/suite/ietestcenter/chapter08/8.7/8.7.2/8.7.2-1-s.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: "8.7.2-1-s", + + path: "TestCases/chapter08/8.7/8.7.2/8.7.2-1-s.js", + + description: "Strict Mode - ReferenceError is thrown if LeftHandSide evaluates to an unresolvable Reference", + strict:1, + + test: function testcase() { + "use strict"; + try { + eval("_8_7_2_1 = 11;"); + return false; + } catch (e) { + return e instanceof ReferenceError; + } + }, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter08/8.7/8.7.2/8.7.2-2-s.js b/test/suite/ietestcenter/chapter08/8.7/8.7.2/8.7.2-2-s.js new file mode 100644 index 0000000000000000000000000000000000000000..9c49400cdba445a34aa653f1dcc820087cc4d490 --- /dev/null +++ b/test/suite/ietestcenter/chapter08/8.7/8.7.2/8.7.2-2-s.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: "8.7.2-2-s", + + path: "TestCases/chapter08/8.7/8.7.2/8.7.2-2-s.js", + + description: "Strict Mode - ReferenceError isn't thrown if LeftHandSide evaluates to a resolvable Reference", + strict:1, + + test: function testcase() { + "use strict"; + var b = 11; + return b === 11; + }, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter08/8.7/8.7.2/8.7.2-3-1-s.js b/test/suite/ietestcenter/chapter08/8.7/8.7.2/8.7.2-3-1-s.js new file mode 100644 index 0000000000000000000000000000000000000000..6f17bf8cde8d08420f0e9695bd2d295aeb63b45d --- /dev/null +++ b/test/suite/ietestcenter/chapter08/8.7/8.7.2/8.7.2-3-1-s.js @@ -0,0 +1,37 @@ +/// 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: "8.7.2-3-1-s", + +path: "TestCases/chapter08/8.7/8.7.2/8.7.2-3-1-s.js", + +description: "eval - a property named 'eval' is permitted", + +test: function testcase() { + 'use strict'; + + var o = { eval: 42}; + return true; + }, + +strict:1, +}); diff --git a/test/suite/ietestcenter/chapter08/8.7/8.7.2/8.7.2-3-s.js b/test/suite/ietestcenter/chapter08/8.7/8.7.2/8.7.2-3-s.js new file mode 100644 index 0000000000000000000000000000000000000000..7219032f10ecfdc46bb46dbcf941d04d62ee618c --- /dev/null +++ b/test/suite/ietestcenter/chapter08/8.7/8.7.2/8.7.2-3-s.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: "8.7.2-3-s", + + path: "TestCases/chapter08/8.7/8.7.2/8.7.2-3-s.js", + + description: "Strict Mode - TypeError is thrown if LeftHandSide is a reference to a non-writable data property", + strict:1, + + test: function testcase() { + "use strict"; + var _8_7_2_3 = {}; + Object.defineProperty(_8_7_2_3, "b", { + writable: false + }); + + try { + _8_7_2_3.b = 11; + return false; + } catch (e) { + return e instanceof TypeError; + } + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty) && fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter08/8.7/8.7.2/8.7.2-4-s.js b/test/suite/ietestcenter/chapter08/8.7/8.7.2/8.7.2-4-s.js new file mode 100644 index 0000000000000000000000000000000000000000..9ed6f00802c8d0100ff8e075babdcc96f7023d4f --- /dev/null +++ b/test/suite/ietestcenter/chapter08/8.7/8.7.2/8.7.2-4-s.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: "8.7.2-4-s", + + path: "TestCases/chapter08/8.7/8.7.2/8.7.2-4-s.js", + + description: "Strict Mode - TypeError is thrown if LeftHandSide is a reference to an accessor property with no setter", + strict:1, + + test: function testcase() { + "use strict"; + var _8_7_2_4 = {}; + var _8_7_2_4_bValue = 1; + Object.defineProperty(_8_7_2_4, "b", { + get: function () { return _8_7_2_4_bValue; } + }); + + try { + _8_7_2_4.b = 11; + return false; + } catch (e) { + return e instanceof TypeError; + } + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty) && fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter08/8.7/8.7.2/8.7.2-5-s.js b/test/suite/ietestcenter/chapter08/8.7/8.7.2/8.7.2-5-s.js new file mode 100644 index 0000000000000000000000000000000000000000..090e04ec910851a1751b20b74d017ee38e89fa6c --- /dev/null +++ b/test/suite/ietestcenter/chapter08/8.7/8.7.2/8.7.2-5-s.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: "8.7.2-5-s", + + path: "TestCases/chapter08/8.7/8.7.2/8.7.2-5-s.js", + + description: "Strict Mode - TypeError is thrown if LeftHandSide is a reference to a non-existent property of an non-extensible object", + strict:1, + + test: function testcase() { + "use strict"; + var _8_7_2_5 = {}; + Object.preventExtensions(_8_7_2_5); + + try { + _8_7_2_5.b = 11; + return false; + } catch (e) { + return e instanceof TypeError; + } + }, + + precondition: function prereq() { + return fnExists(Object.preventExtensions) && fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter08/8.7/8.7.2/8.7.2-6-s.js b/test/suite/ietestcenter/chapter08/8.7/8.7.2/8.7.2-6-s.js new file mode 100644 index 0000000000000000000000000000000000000000..e84f321b93628e932b01b9481cc5c4d4d1325e28 --- /dev/null +++ b/test/suite/ietestcenter/chapter08/8.7/8.7.2/8.7.2-6-s.js @@ -0,0 +1,44 @@ +/// 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: "8.7.2-6-s", + + path: "TestCases/chapter08/8.7/8.7.2/8.7.2-6-s.js", + + description: "Strict Mode - TypeError isn't thrown if LeftHandSide is a reference to a writable data property", + strict:1, + + test: function testcase() { + "use strict"; + var _8_7_2_6 = {}; + Object.defineProperty(_8_7_2_6, "b", { + writable: true + }); + + _8_7_2_6.b = 11; + + return _8_7_2_6.b === 11; + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty); + } +}); diff --git a/test/suite/ietestcenter/chapter08/8.7/8.7.2/8.7.2-7-s.js b/test/suite/ietestcenter/chapter08/8.7/8.7.2/8.7.2-7-s.js new file mode 100644 index 0000000000000000000000000000000000000000..943121f22e1b3544fce7c109225f0c0e79e97c3e --- /dev/null +++ b/test/suite/ietestcenter/chapter08/8.7/8.7.2/8.7.2-7-s.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: "8.7.2-7-s", + + path: "TestCases/chapter08/8.7/8.7.2/8.7.2-7-s.js", + + description: "Strict Mode - TypeError isn't thrown if LeftHandSide is a reference to an accessor property with setter", + strict:1, + + test: function testcase() { + "use strict"; + var _8_7_2_7 = {}; + var _8_7_2_7_bValue = 1; + Object.defineProperty(_8_7_2_7, "b", { + get: function () { return _8_7_2_7_bValue; }, + set: function (value) { _8_7_2_7_bValue = value; } + }); + + _8_7_2_7.b = 11; + return _8_7_2_7.b === 11; + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty); + } +}); diff --git a/test/suite/ietestcenter/chapter08/8.7/8.7.2/8.7.2-8-s.js b/test/suite/ietestcenter/chapter08/8.7/8.7.2/8.7.2-8-s.js new file mode 100644 index 0000000000000000000000000000000000000000..1e464128f7ae03e83bedfb03b1691487b07fab59 --- /dev/null +++ b/test/suite/ietestcenter/chapter08/8.7/8.7.2/8.7.2-8-s.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: "8.7.2-8-s", + + path: "TestCases/chapter08/8.7/8.7.2/8.7.2-8-s.js", + + description: "Strict Mode - TypeError isn't thrown if LeftHandSide is a reference to a property of an extensible object", + strict:1, + + test: function testcase() { + "use strict"; + var _8_7_2_8 = {}; + + _8_7_2_8.b = 11; + + return _8_7_2_8.b === 11; + }, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-1-s.js b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-1-s.js new file mode 100644 index 0000000000000000000000000000000000000000..e51df5a6ed6aa1e56acce01c5181f8c1d1db4058 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-1-s.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: "10.1.1-1-s", + + path: "TestCases/chapter10/10.1/10.1.1/10.1.1-1-s.js", + + description: "Strict Mode - Use Strict Directive Prologue is 'use strict'; which contains two space between 'use' and 'strict'", + strict:1, + + test: function testcase() { + "use strict"; + var public = 1; + return public === 1; + }, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-10-s.js b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-10-s.js new file mode 100644 index 0000000000000000000000000000000000000000..5698d5d30c73c3fd22239e0e63453505e3375d40 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-10-s.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: "10.1.1-10-s", + + path: "TestCases/chapter10/10.1/10.1.1/10.1.1-10-s.js", + + description: "Strict Mode - Use Strict Directive Prologue is ''USE STRICT';' in which all characters are uppercase", + strict:1, + + test: function testcase() { + "USE STRICT"; + var public = 1; + return public === 1; + }, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-11-s.js b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-11-s.js new file mode 100644 index 0000000000000000000000000000000000000000..eed8c3bdb3c36b7e4609492c97b9278fa8eebd4b --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-11-s.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: "10.1.1-11-s", + + path: "TestCases/chapter10/10.1/10.1.1/10.1.1-11-s.js", + + description: "Strict Mode - Eval code is strict code with a Use Strict Directive at the beginning of the block", + strict:1, + + test: function testcase() { + try { + eval("'use strict'; var public = 1; var anotherVariableNotReserveWord = 2;"); + + return false; + } catch (e) { + return e instanceof SyntaxError && typeof public === "undefined" && + typeof anotherVariableNotReserveWord === "undefined"; + } + }, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-12-s.js b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-12-s.js new file mode 100644 index 0000000000000000000000000000000000000000..6de26593ea6e8483a99627e75b85b0800cfdcde2 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-12-s.js @@ -0,0 +1,37 @@ +/// 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: "10.1.1-12-s", + + path: "TestCases/chapter10/10.1/10.1.1/10.1.1-12-s.js", + + description: "Strict Mode - Eval code is strict eval code with a Use Strict Directive in the middle of the block", + strict:1, + + test: function testcase() { + eval("var public = 1; 'use strict'; var anotherVariableNotReserveWord = 2;"); + return public === 1 && anotherVariableNotReserveWord === 2; + }, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-13-s.js b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-13-s.js new file mode 100644 index 0000000000000000000000000000000000000000..50f4687220b4ae4a0c80319a7a5fcb119652a609 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-13-s.js @@ -0,0 +1,37 @@ +/// 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: "10.1.1-13-s", + + path: "TestCases/chapter10/10.1/10.1.1/10.1.1-13-s.js", + + description: "Strict Mode - Eval code is strict eval code with a Use Strict Directive at the end of the block", + strict:1, + + test: function testcase() { + eval("var public = 1; var anotherVariableNotReserveWord = 2; 'use strict';"); + return public === 1 && anotherVariableNotReserveWord === 2; + }, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-14-s.js b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-14-s.js new file mode 100644 index 0000000000000000000000000000000000000000..525ab2d45bc48fad226d366d20fab5982ed7d72a --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-14-s.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: "10.1.1-14-s", + + path: "TestCases/chapter10/10.1/10.1.1/10.1.1-14-s.js", + + description: "Strict Mode - The call to eval function is contained in a Strict Mode block", + strict:1, + + test: function testcase() { + 'use strict'; + try { + eval("var public = 1;"); + return false; + } catch (e) { + return true; + } + }, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-15-s.js b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-15-s.js new file mode 100644 index 0000000000000000000000000000000000000000..2fe7a04fe7e12fd79970fdc8fe705891d8c6985b --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-15-s.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: "10.1.1-15-s", + + path: "TestCases/chapter10/10.1/10.1.1/10.1.1-15-s.js", + + description: "Strict Mode - Function code that is part of a FunctionDeclaration is strict function code if FunctionDeclaration is contained in use strict", + strict:1, + + test: function testcase() { + "use strict"; + function fun() { + try { + eval("var public = 1;"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + } + + return fun(); + }, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-16-s.js b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-16-s.js new file mode 100644 index 0000000000000000000000000000000000000000..63431b397a5041c3bf6f62ee9d291c33fac2b6a0 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-16-s.js @@ -0,0 +1,44 @@ +/// 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: "10.1.1-16-s", + + path: "TestCases/chapter10/10.1/10.1.1/10.1.1-16-s.js", + + description: "Strict Mode - Function code that is part of a FunctionExpression is strict function code if FunctionExpression is contained in use strict", + strict:1, + + test: function testcase() { + "use strict"; + return function () { + try { + eval("var public = 1;"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + } (); + }, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-17-s.js b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-17-s.js new file mode 100644 index 0000000000000000000000000000000000000000..2c6249c8da3e16d02f2725f47468f185610a5bd5 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-17-s.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: "10.1.1-17-s", + + path: "TestCases/chapter10/10.1/10.1.1/10.1.1-17-s.js", + + description: "Strict Mode - Function code that is part of a Accessor PropertyAssignment is in Strict Mode if Accessor PropertyAssignment is contained in use strict(getter)", + strict:1, + + test: function testcase() { + "use strict"; + try { + var obj = {}; + Object.defineProperty(obj, "accProperty", { + get: function () { + eval("public = 1;"); + return 11; + } + }); + + var temp = obj.accProperty === 11; + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.defineProperty); + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-18-s.js b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-18-s.js new file mode 100644 index 0000000000000000000000000000000000000000..11e6cdf4c6b5853fa233dd1403f46e5235b96b03 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-18-s.js @@ -0,0 +1,51 @@ +/// 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: "10.1.1-18-s", + + path: "TestCases/chapter10/10.1/10.1.1/10.1.1-18-s.js", + + description: "Strict Mode - Function code that is part of a Accessor PropertyAssignment is in Strict Mode if Accessor PropertyAssignment is contained in use strict(setter)", + strict:1, + + test: function testcase() { + "use strict"; + try { + var obj = {}; + var data = "data"; + Object.defineProperty(obj, "accProperty", { + set: function (value) { + eval("var public = 1;"); + data = value; + } + }); + + obj.accProperty = "overrideData"; + return false; + } catch (e) { + return e instanceof SyntaxError && data === "data"; + } + }, + + precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.defineProperty); + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-19-s.js b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-19-s.js new file mode 100644 index 0000000000000000000000000000000000000000..4fcba21502990cc1fa2a0a9497ef37a4b1e66665 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-19-s.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: "10.1.1-19-s", + + path: "TestCases/chapter10/10.1/10.1.1/10.1.1-19-s.js", + + description: "Strict Mode - Function code of a FunctionDeclaration contains Use Strict Directive which appears at the start of the block", + strict:1, + + test: function testcase() { + function fun() { + "use strict"; + try { + eval("var public = 1;"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + } + return fun(); + }, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-2-s.js b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-2-s.js new file mode 100644 index 0000000000000000000000000000000000000000..bfa176c6d7f50db2bcdb6b55bf770bb33a2daa49 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-2-s.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: "10.1.1-2-s", + + path: "TestCases/chapter10/10.1/10.1.1/10.1.1-2-s.js", + + description: "Strict Mode - Use Strict Directive Prologue is ''use strict'' which lost the last character ';'", + strict:1, + + test: function testcase() { + "use strict" + try { + eval("var public = 1;"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + + }, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-20-s.js b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-20-s.js new file mode 100644 index 0000000000000000000000000000000000000000..4827a49a41fb720b46687b1e2b4d92f581eedef2 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-20-s.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: "10.1.1-20-s", + + path: "TestCases/chapter10/10.1/10.1.1/10.1.1-20-s.js", + + description: "Strict Mode - Function code of a FunctionDeclaration contains Use Strict Directive which appears in the middle of the block", + strict:1, + + test: function testcase() { + function fun() { + eval("var public = 1;"); + "use strict"; + return public === 1; + } + return fun(); + }, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-21-s.js b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-21-s.js new file mode 100644 index 0000000000000000000000000000000000000000..58e56005fb30ffc929bb1e3564f53f37dd516599 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-21-s.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: "10.1.1-21-s", + + path: "TestCases/chapter10/10.1/10.1.1/10.1.1-21-s.js", + + description: "Strict Mode - Function code of a FunctionDeclaration contains Use Strict Directive which appears at the end of the block", + strict:1, + + test: function testcase() { + function fun() { + eval("var public = 1;"); + return public === 1; + "use strict"; + } + return fun(); + }, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-22-s.js b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-22-s.js new file mode 100644 index 0000000000000000000000000000000000000000..72045fa8eb58b5ba3340169b3076d6f954169238 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-22-s.js @@ -0,0 +1,44 @@ +/// 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: "10.1.1-22-s", + + path: "TestCases/chapter10/10.1/10.1.1/10.1.1-22-s.js", + + description: "Strict Mode - Function code of a FunctionExpression contains Use Strict Directive which appears at the start of the block", + strict:1, + + test: function testcase() { + return function () { + "use strict"; + try { + eval("var public = 1;"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + } (); + }, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-23-s.js b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-23-s.js new file mode 100644 index 0000000000000000000000000000000000000000..4437c54618c815e518d17d4dcf1a107fb327fa9b --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-23-s.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: "10.1.1-23-s", + + path: "TestCases/chapter10/10.1/10.1.1/10.1.1-23-s.js", + + description: "Strict Mode - Function code of a FunctionExpression contains Use Strict Directive which appears in the middle of the block", + strict:1, + + test: function testcase() { + return function () { + eval("var public = 1;"); + return public === 1; + "use strict"; + } (); + }, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-24-s.js b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-24-s.js new file mode 100644 index 0000000000000000000000000000000000000000..d1cdda5e1a63832c072ce2571d655c4347cce40f --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-24-s.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: "10.1.1-24-s", + + path: "TestCases/chapter10/10.1/10.1.1/10.1.1-24-s.js", + + description: "Strict Mode - Function code of a FunctionExpression contains Use Strict Directive which appears at the end of the block", + strict:1, + + test: function testcase() { + return function () { + eval("var public = 1;"); + "use strict"; + return public === 1; + } (); + }, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-25-s.js b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-25-s.js new file mode 100644 index 0000000000000000000000000000000000000000..991c1adf197421c31b17ddb3bc0879b9e06c01c8 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-25-s.js @@ -0,0 +1,49 @@ +/// 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: "10.1.1-25-s", + + path: "TestCases/chapter10/10.1/10.1.1/10.1.1-25-s.js", + + description: "Strict Mode - Function code of Accessor PropertyAssignment contains Use Strict Directive which appears at the start of the block(getter)", + strict:1, + + test: function testcase() { + try { + var obj = {}; + Object.defineProperty(obj, "accProperty", { + get: function () { + "use strict"; + eval("var public = 1;"); + return 11; + } + }); + var temp = obj.accProperty === 11; + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.defineProperty); + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-26-s.js b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-26-s.js new file mode 100644 index 0000000000000000000000000000000000000000..66d3d981f4c3fd35b4152d4f8c351b101fa6102d --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-26-s.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: "10.1.1-26-s", + + path: "TestCases/chapter10/10.1/10.1.1/10.1.1-26-s.js", + + description: "Strict Mode - Function code of Accessor PropertyAssignment contains Use Strict Directive which appears at the start of the block(setter)", + strict:1, + + test: function testcase() { + try { + var obj = {}; + var data = "data"; + Object.defineProperty(obj, "accProperty", { + set: function (value) { + "use strict"; + eval("var public = 1;"); + data = value; + } + }); + + obj.accProperty = "overrideData"; + + return false; + } catch (e) { + return e instanceof SyntaxError && data === "data"; + } + }, + + precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.defineProperty); + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-27-s.js b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-27-s.js new file mode 100644 index 0000000000000000000000000000000000000000..71bb36237fe7d673c8858a9df5700b53b5d07295 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-27-s.js @@ -0,0 +1,44 @@ +/// 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: "10.1.1-27-s", + + path: "TestCases/chapter10/10.1/10.1.1/10.1.1-27-s.js", + + description: "Strict Mode - Function code of Accessor PropertyAssignment contains Use Strict Directive which appears in the middle of the block(getter)", + strict:1, + + test: function testcase() { + var obj = {}; + Object.defineProperty(obj, "accProperty", { + get: function () { + eval("public = 1;"); + "use strict"; + return 11; + } + }); + return obj.accProperty === 11 && public === 1; + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty); + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-28-s.js b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-28-s.js new file mode 100644 index 0000000000000000000000000000000000000000..fb253f6e3f551a52253b64bef875ace1c5f58eac --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-28-s.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: "10.1.1-28-s", + + path: "TestCases/chapter10/10.1/10.1.1/10.1.1-28-s.js", + + description: "Strict Mode - Function code of Accessor PropertyAssignment contains Use Strict Directive which appears at the end of the block(setter)", + strict:1, + + + test: function testcase() { + var obj = {}; + var data; + + Object.defineProperty(obj, "accProperty", { + set: function (value) { + var _10_1_1_28_s = {a:1, a:2}; + data = value; + "use strict"; + } + }); + obj.accProperty = "overrideData"; + return data==="overrideData"; + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty); + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-29-s.js b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-29-s.js new file mode 100644 index 0000000000000000000000000000000000000000..01b468245c54493d31062804698bca2d0671a15d --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-29-s.js @@ -0,0 +1,39 @@ +/// 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: "10.1.1-29-s", + + path: "TestCases/chapter10/10.1/10.1.1/10.1.1-29-s.js", + + description: "Strict Mode - The built-in Function constructor is contained in use strict code", + strict:1, + + test: function testcase() { + "use strict"; + var funObj = new Function("a", "eval('public = 1;');"); + funObj(); + return true; + }, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-3-s.js b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-3-s.js new file mode 100644 index 0000000000000000000000000000000000000000..b9cd7941d3fb10d8aef3bd313efc659feb32ff23 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-3-s.js @@ -0,0 +1,39 @@ +/// 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: "10.1.1-3-s", + + path: "TestCases/chapter10/10.1/10.1.1/10.1.1-3-s.js", + + description: "Strict Mode - Use Strict Directive Prologue is '' use strict';' which the first character is space", + strict:1, + + test: function testcase() { + " use strict"; + var public = 1; + + return public === 1; + }, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-30-s.js b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-30-s.js new file mode 100644 index 0000000000000000000000000000000000000000..3d9344ea990507380cc191c21c86b05075de28ed --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-30-s.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: "10.1.1-30-s", + + path: "TestCases/chapter10/10.1/10.1.1/10.1.1-30-s.js", + + description: "Strict Mode - Function code of built-in Function constructor contains Use Strict Directive which appears at the start of the block", + strict:1, + + test: function testcase() { + try { + var funObj = new Function("a", "'use strict'; eval('public = 1;');"); + funObj(); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-31-s.js b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-31-s.js new file mode 100644 index 0000000000000000000000000000000000000000..f775d49b3486b5f82bdafb4466986e9278c737cc --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-31-s.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: "10.1.1-31-s", + + path: "TestCases/chapter10/10.1/10.1.1/10.1.1-31-s.js", + + description: "Strict Mode - Function code of built-in Function constructor contains Use Strict Directive which appears in the middle of the block", + strict:1, + + test: function testcase() { + var funObj = new Function("a", "eval('public = 1;'); 'use strict'; anotherVariable = 2;"); + funObj(); + return public === 1 && anotherVariable === 2; + }, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-32-s.js b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-32-s.js new file mode 100644 index 0000000000000000000000000000000000000000..2ba93cf10aef8d0582dd48c9f586ff20eca7f0a4 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-32-s.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: "10.1.1-32-s", + + path: "TestCases/chapter10/10.1/10.1.1/10.1.1-32-s.js", + + description: "Strict Mode - Function code of built-in Function constructor contains Use Strict Directive which appears at the end of the block", + strict:1, + + test: function testcase() { + var funObj = new Function("a", "eval('public = 1;'); anotherVariable = 2; 'use strict';"); + funObj(); + return public === 1 && anotherVariable === 2; + }, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-4-s.js b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-4-s.js new file mode 100644 index 0000000000000000000000000000000000000000..45bbb5f4e365380c95c5fd4f7430444a9da35299 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-4-s.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: "10.1.1-4-s", + + path: "TestCases/chapter10/10.1/10.1.1/10.1.1-4-s.js", + + description: "Strict Mode - Use Strict Directive Prologue is ''use strict ';' which the last character is space", + strict:1, + + test: function testcase() { + "use strict "; + var public = 1; + return public === 1; + }, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-5-s.js b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-5-s.js new file mode 100644 index 0000000000000000000000000000000000000000..067804f3e6785e95fb85122dc2379b9051e4f671 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-5-s.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: "10.1.1-5-s", + + path: "TestCases/chapter10/10.1/10.1.1/10.1.1-5-s.js", + + description: "Strict Mode - Use Strict Directive Prologue is ''use strict';' which appears at the beginning of the block", + strict:1, + + test: function testcase() { + "use strict"; + try { + eval("var public = 1;"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + + }, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-6-s.js b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-6-s.js new file mode 100644 index 0000000000000000000000000000000000000000..3b703bf89dd9cb0f1024a5190df8653565e827b8 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-6-s.js @@ -0,0 +1,39 @@ +/// 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: "10.1.1-6-s", + + path: "TestCases/chapter10/10.1/10.1.1/10.1.1-6-s.js", + + description: "Strict Mode - Use Strict Directive Prologue is ''use strict';' which appears in the middle of the block", + strict:1, + + test: function testcase() { + var interface = 2; + "use strict"; + var public = 1; + return public === 1 && interface === 2; + }, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-7-s.js b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-7-s.js new file mode 100644 index 0000000000000000000000000000000000000000..6218f26822e10ff8873953326c6ba8b61abeb239 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-7-s.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: "10.1.1-7-s", + + path: "TestCases/chapter10/10.1/10.1.1/10.1.1-7-s.js", + + description: "Strict Mode - Use Strict Directive Prologue is ''use strict';' which appears at the end of the block", + strict:1, + + test: function testcase() { + var public = 1; + return public === 1; + "use strict"; + }, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-8-s.js b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-8-s.js new file mode 100644 index 0000000000000000000000000000000000000000..31e523ea13154efcb7dba1bf7145fc6438abc234 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-8-s.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: "10.1.1-8-s", + + path: "TestCases/chapter10/10.1/10.1.1/10.1.1-8-s.js", + + description: "Strict Mode - Use Strict Directive Prologue is ''use strict';' which appears twice in the directive prologue", + strict:1, + + test: function testcase() { + "use strict"; + "use strict"; + try { + eval("var public = 1;"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-9-s.js b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-9-s.js new file mode 100644 index 0000000000000000000000000000000000000000..2b5dc95dbd0406082c33cce0d5af9ecc0d55fcd8 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-9-s.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: "10.1.1-9-s", + + path: "TestCases/chapter10/10.1/10.1.1/10.1.1-9-s.js", + + description: "Strict Mode - Use Strict Directive Prologue is ''Use strict';' in which the first character is uppercase", + strict:1, + + test: function testcase() { + "Use strict"; + var public = 1; + return public === 1; + }, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.2/10.2.1/10.2.1.1/10.2.1.1.3/10.2.1.1.3-4-16-s.js b/test/suite/ietestcenter/chapter10/10.2/10.2.1/10.2.1.1/10.2.1.1.3/10.2.1.1.3-4-16-s.js new file mode 100644 index 0000000000000000000000000000000000000000..491d0755693e66c93ddf25b8b7c88a1a32d2145c --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.2/10.2.1/10.2.1.1/10.2.1.1.3/10.2.1.1.3-4-16-s.js @@ -0,0 +1,44 @@ +/// 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: "10.2.1.1.3-4-16-s", + + path: "TestCases/chapter10/10.2/10.2.1/10.2.1.1/10.2.1.1.3/10.2.1.1.3-4-16-s.js", + + description: "Strict Mode - TypeError is thrown when changing the value of a Value Property of the Global Object under strict mode (NaN)", + strict:1, + + + test: function testcase() { + "use strict"; + + try { + NaN = 12; + return false; + } catch (e) { + return e instanceof TypeError; + } + }, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.2/10.2.1/10.2.1.1/10.2.1.1.3/10.2.1.1.3-4-18-s.js b/test/suite/ietestcenter/chapter10/10.2/10.2.1/10.2.1.1/10.2.1.1.3/10.2.1.1.3-4-18-s.js new file mode 100644 index 0000000000000000000000000000000000000000..d66c0b9ba07fb4f8cb628e9bbd1e5dd4fc47285f --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.2/10.2.1/10.2.1.1/10.2.1.1.3/10.2.1.1.3-4-18-s.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: "10.2.1.1.3-4-18-s", + + path: "TestCases/chapter10/10.2/10.2.1/10.2.1.1/10.2.1.1.3/10.2.1.1.3-4-18-s.js", + + description: "Strict Mode - TypeError is thrown when changing the value of a Value Property of the Global Object under strict mode (undefined)", + strict:1, + + + test: function testcase() { + "use strict"; + try { + undefined = 12; + return false; + } catch (e) { + return e instanceof TypeError; + } + }, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.2/10.2.1/10.2.1.1/10.2.1.1.3/10.2.1.1.3-4-22-s.js b/test/suite/ietestcenter/chapter10/10.2/10.2.1/10.2.1.1/10.2.1.1.3/10.2.1.1.3-4-22-s.js new file mode 100644 index 0000000000000000000000000000000000000000..071e9a6791cfd729c207e0c2c876657d6b535385 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.2/10.2.1/10.2.1.1/10.2.1.1.3/10.2.1.1.3-4-22-s.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: "10.2.1.1.3-4-22-s", + + path: "TestCases/chapter10/10.2/10.2.1/10.2.1.1/10.2.1.1.3/10.2.1.1.3-4-22-s.js", + + description: "Strict Mode - TypeError is not thrown when changing the value of the Constructor Properties of the Global Object under strict mode (Object)", + strict:1, + + + test: function testcase() { + "use strict"; + var objBak = Object; + + try { + Object = 12; + return true; + } finally { + Object = objBak; + } + }, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.2/10.2.1/10.2.1.1/10.2.1.1.3/10.2.1.1.3-4-27-s.js b/test/suite/ietestcenter/chapter10/10.2/10.2.1/10.2.1.1/10.2.1.1.3/10.2.1.1.3-4-27-s.js new file mode 100644 index 0000000000000000000000000000000000000000..bf8c9fd368b37cecfabeb54a761fcf87a9d8afac --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.2/10.2.1/10.2.1.1/10.2.1.1.3/10.2.1.1.3-4-27-s.js @@ -0,0 +1,44 @@ +/// 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: "10.2.1.1.3-4-27-s", + + path: "TestCases/chapter10/10.2/10.2.1/10.2.1.1/10.2.1.1.3/10.2.1.1.3-4-27-s.js", + + description: "Strict Mode - TypeError is not thrown when changing the value of the Constructor Properties of the Global Object under strict mode (Number)", + strict:1, + + test: function testcase() { + "use strict"; + + var numBak = Number; + try { + Number = 12; + return true; + } finally { + Number = numBak; + } + }, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.4/10.4.2/10.4.2-2-c-1.js.orig b/test/suite/ietestcenter/chapter10/10.4/10.4.2/10.4.2-2-c-1.js.orig new file mode 100644 index 0000000000000000000000000000000000000000..03cc99104537a22181a0b3603ca13be016dce05c --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.4/10.4.2/10.4.2-2-c-1.js.orig @@ -0,0 +1,31 @@ +/// 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: "10.4.2-2-c-1", + path: "TestCases/chapter10/10.4/10.4.2/10.4.2-2-c-1.js", + description: "Direct val code in non-strict mode - can instantiate variable in calling context", + test: function testcase() { + � var x = 0; +� function inner() {eval("var x=1");return x===1;} + return inner(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter10/10.4/10.4.2/10.4.2-2-s.js b/test/suite/ietestcenter/chapter10/10.4/10.4.2/10.4.2-2-s.js new file mode 100644 index 0000000000000000000000000000000000000000..fa99ee32e846f490a2cc524930fccb912cdd4a73 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.4/10.4.2/10.4.2-2-s.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: "10.4.2-2-s", + + path: "TestCases/chapter10/10.4/10.4.2/10.4.2-2-s.js", + + description: "Strict Mode - Strict mode eval code cannot instantiate functions in the variable environment of the caller to eval", + + test: function testcase() { + "use strict"; + eval("(function fun(x){ return x })(10)"); + return typeof (fun) === "undefined"; + }, + strict: 1, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.4/10.4.2/10.4.2-3-c-1-s.js b/test/suite/ietestcenter/chapter10/10.4/10.4.2/10.4.2-3-c-1-s.js new file mode 100644 index 0000000000000000000000000000000000000000..95a330d7d1d826d8215f48a685ab10de62048946 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.4/10.4.2/10.4.2-3-c-1-s.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: "10.4.2-3-c-1-s", + +path: "TestCases/chapter10/10.4/10.4.2/10.4.2-3-c-1-s.js", + +description: "Direct eval code in strict mode - cannot instantiate variable in the variable environment of the calling context", +strict:1, + +test: function testcase() { + var _10_4_2_3_c_1_s = 0; + function _10_4_2_3_c_1_sFunc() { + eval("'use strict';var _10_4_2_3_c_1_s = 1"); + return _10_4_2_3_c_1_s===0; + } + return _10_4_2_3_c_1_sFunc(); + }, + +precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter10/10.4/10.4.2/10.4.2-3-c-2-s.js b/test/suite/ietestcenter/chapter10/10.4/10.4.2/10.4.2-3-c-2-s.js new file mode 100644 index 0000000000000000000000000000000000000000..811bbb33f1b9d337b278c49adefd5984bfda32da --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.4/10.4.2/10.4.2-3-c-2-s.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: "10.4.2-3-c-2-s", + +path: "TestCases/chapter10/10.4/10.4.2/10.4.2-3-c-2-s.js", + +description: "Calling code in strict mode - eval cannot instantiate variable in the variable environment of the calling context", + +test: function testcase() { + var _10_4_2_3_c_2_s = 0; + function _10_4_2_3_c_2_sFunc() { + 'use strict'; + eval("var _10_4_2_3_c_2_s = 1"); + return _10_4_2_3_c_2_s===0; + } + return _10_4_2_3_c_2_sFunc(); + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter10/10.4/10.4.2/10.4.2.1-2-s.js b/test/suite/ietestcenter/chapter10/10.4/10.4.2/10.4.2.1-2-s.js new file mode 100644 index 0000000000000000000000000000000000000000..163267397b800c5b8fb66c1d4fc9a6512c131850 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.4/10.4.2/10.4.2.1-2-s.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: "10.4.2.1-2-s", + + path: "TestCases/chapter10/10.4/10.4.2/10.4.2.1-2-s.js", + + description: "Strict Mode - Strict mode eval code cannot instantiate functions in the variable environment of the caller to eval", + + test: function testcase() { + "use strict"; + + eval("function _10_4_2_1_2_fun(){}"); + return typeof _10_4_2_1_2_fun === "undefined"; + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.4/10.4.2/10.4.2.1-4-s.js b/test/suite/ietestcenter/chapter10/10.4/10.4.2/10.4.2.1-4-s.js new file mode 100644 index 0000000000000000000000000000000000000000..c44ec799b7e9a83065c31507558d4abf2d58cc6a --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.4/10.4.2/10.4.2.1-4-s.js @@ -0,0 +1,39 @@ +/// 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: "10.4.2.1-4-s", + + path: "TestCases/chapter10/10.4/10.4.2/10.4.2.1-4-s.js", + + description: "Strict Mode - Strict mode eval code cannot instantiate functions in the variable environment of the caller to eval which is contained in strict mode code", + + test: function testcase() { + + eval("'use strict'; function _10_4_2_1_4_fun(){}"); + return typeof _10_4_2_1_4_fun === "undefined"; + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.4/10.4.3/10.4.3-1-1-s.js b/test/suite/ietestcenter/chapter10/10.4/10.4.3/10.4.3-1-1-s.js new file mode 100644 index 0000000000000000000000000000000000000000..c1d641a83af47f079353a5cf07cdb75bee6724a9 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.4/10.4.3/10.4.3-1-1-s.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: "10.4.3-1-1-s", + +path: "TestCases/chapter10/10.4/10.4.3/10.4.3-1-1-s.js", + +description: "this is not coerced to an object in strict mode (Number)", + +test: function testcase() { + + function foo() + { + 'use strict'; + return typeof(this); + } + + function bar() + { + return typeof(this); + } + + + return foo.call(1) === 'number' && bar.call(1) === 'object'; + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter10/10.4/10.4.3/10.4.3-1-2-s.js b/test/suite/ietestcenter/chapter10/10.4/10.4.3/10.4.3-1-2-s.js new file mode 100644 index 0000000000000000000000000000000000000000..50dc43f1002ee76a9508a6f634c809fa4bb5127e --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.4/10.4.3/10.4.3-1-2-s.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: "10.4.3-1-2-s", + +path: "TestCases/chapter10/10.4/10.4.3/10.4.3-1-2-s.js", + +description: "this is not coerced to an object in strict mode (string)", + +test: function testcase() { + + function foo() + { + 'use strict'; + return typeof(this); + } + + function bar() + { + return typeof(this); + } + + + return foo.call('1') === 'string' && bar.call('1') === 'object'; + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter10/10.4/10.4.3/10.4.3-1-3-s.js b/test/suite/ietestcenter/chapter10/10.4/10.4.3/10.4.3-1-3-s.js new file mode 100644 index 0000000000000000000000000000000000000000..97f254c6b3c68820ca5f28f668ec1861c019a687 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.4/10.4.3/10.4.3-1-3-s.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: "10.4.3-1-3-s", + +path: "TestCases/chapter10/10.4/10.4.3/10.4.3-1-3-s.js", + +description: "this is not coerced to an object in strict mode (undefined)", + +test: function testcase() { + + function foo() + { + 'use strict'; + return typeof(this); + } + + function bar() + { + return typeof(this); + } + return foo.call(undefined) === 'undefined' && bar.call() === 'object'; + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter10/10.4/10.4.3/10.4.3-1-4-s.js b/test/suite/ietestcenter/chapter10/10.4/10.4.3/10.4.3-1-4-s.js new file mode 100644 index 0000000000000000000000000000000000000000..0c9e3d904ccb3772544e66805ef681b9b1522dd2 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.4/10.4.3/10.4.3-1-4-s.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: "10.4.3-1-4-s", + +path: "TestCases/chapter10/10.4/10.4.3/10.4.3-1-4-s.js", + +description: "this is not coerced to an object in strict mode (boolean)", + +test: function testcase() { + + function foo() + { + 'use strict'; + return typeof(this); + } + + function bar() + { + return typeof(this); + } + + + return foo.call(true) === 'boolean' && bar.call(true) === 'object'; + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter10/10.4/10.4.3/10.4.3-1-5-s.js b/test/suite/ietestcenter/chapter10/10.4/10.4.3/10.4.3-1-5-s.js new file mode 100644 index 0000000000000000000000000000000000000000..8e7b18dc76df74735bd78650f75d9ea984f8c261 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.4/10.4.3/10.4.3-1-5-s.js @@ -0,0 +1,55 @@ +/// 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: "10.4.3-1-5-s", + +path: "TestCases/chapter10/10.4/10.4.3/10.4.3-1-5-s.js", + +description: "this is not coerced to an object in strict mode (function)", + +test: function testcase() { + + function foo() + { + 'use strict'; + return typeof(this); + } + + function bar() + { + return typeof(this); + } + + function foobar() + { + } + + return foo.call(foobar) === 'function' && bar.call(foobar) === 'function'; + }, + +strict:1, + +precondition: function prereq() { + return true; + } + +}); diff --git a/test/suite/ietestcenter/chapter10/10.5/10.5-1-s.js b/test/suite/ietestcenter/chapter10/10.5/10.5-1-s.js new file mode 100644 index 0000000000000000000000000000000000000000..60f118009f4493f469388317c888c233a2681f39 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.5/10.5-1-s.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: "10.5-1-s", + + path: "TestCases/chapter10/10.5/10.5-1-s.js", + + description: "Strict Mode - arguments object is immutable", + strict:1, + + + test: function testcase() { + "use strict"; + try { + (function fun() { + eval("arguments = 10"); + })(30); + return false; + } catch (e) { + return (e instanceof SyntaxError); + } + }, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.5/10.5-7-b-1-s.js b/test/suite/ietestcenter/chapter10/10.5/10.5-7-b-1-s.js new file mode 100644 index 0000000000000000000000000000000000000000..9f9b7dcbc28d62dcf4f540c7ca56f39b20f3cdad --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.5/10.5-7-b-1-s.js @@ -0,0 +1,44 @@ +/// 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: "10.5-7-b-1-s", + + path: "TestCases/chapter10/10.5/10.5-7-b-1-s.js", + + description: "Strict Mode - arguments object is immutable in eval'ed functions", + + test: function testcase() { + "use strict"; + + try { + eval("(function _10_5_7_b_1_fun() { arguments = 10;} ());"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.5/10.5-7-b-2-s.js b/test/suite/ietestcenter/chapter10/10.5/10.5-7-b-2-s.js new file mode 100644 index 0000000000000000000000000000000000000000..f8aa78b1890a4fdcb89b82f6b92e9a2b6c098982 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.5/10.5-7-b-2-s.js @@ -0,0 +1,44 @@ +/// 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: "10.5-7-b-2-s", + + path: "TestCases/chapter10/10.5/10.5-7-b-2-s.js", + + description: "Strict Mode - arguments object index assignment is disallowed", + + test: function testcase() { + "use strict"; + + function _10_5_7_b_2_fun() { + arguments[7] = 12; + return arguments[7] === 12; + }; + + return _10_5_7_b_2_fun(30); + }, + + strict: 1, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.5/10.5-7-b-3-s.js b/test/suite/ietestcenter/chapter10/10.5/10.5-7-b-3-s.js new file mode 100644 index 0000000000000000000000000000000000000000..f874f2a33c754e05d5880eba9af101f6d9a57e38 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.5/10.5-7-b-3-s.js @@ -0,0 +1,44 @@ +/// 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: "10.5-7-b-3-s", + + path: "TestCases/chapter10/10.5/10.5-7-b-3-s.js", + + description: "Strict Mode - Adding property to the arguments object successful under strict mode ", + + test: function testcase() { + "use strict"; + + function _10_5_7_b_3_fun() { + arguments[1] = 12; + return arguments[0] = 30 && arguments[1] === 12; + }; + + return _10_5_7_b_3_fun(30); + }, + + strict: 1, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.5/10.5-7-b-4-s.js b/test/suite/ietestcenter/chapter10/10.5/10.5-7-b-4-s.js new file mode 100644 index 0000000000000000000000000000000000000000..d09685f69a854e12c2ddecae21fbf1a1cc547f8a --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.5/10.5-7-b-4-s.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: "10.5-7-b-4-s", + + path: "TestCases/chapter10/10.5/10.5-7-b-4-s.js", + + description: "Strict Mode - Deleting property of the arguments object successful under strict mode", + + test: function testcase() { + "use strict"; + + function _10_5_7_b_4_fun() { + var _10_5_7_b_4_1 = arguments[0] === 30 && arguments[1] === 12; + delete arguments[1]; + var _10_5_7_b_4_2 = arguments[0] === 30 && typeof arguments[1] === "undefined"; + return _10_5_7_b_4_1 && _10_5_7_b_4_2; + }; + return _10_5_7_b_4_fun(30, 12); + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.6/10.6-10-c-ii-1-s.js b/test/suite/ietestcenter/chapter10/10.6/10.6-10-c-ii-1-s.js new file mode 100644 index 0000000000000000000000000000000000000000..a306ec7cec48224a294a5e6e5d658fe244f9e56e --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.6/10.6-10-c-ii-1-s.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: "10.6-10-c-ii-1-s", + +path: "TestCases/chapter10/10.6/10.6-10-c-ii-1-s.js", + +description: "arguments[i] remains same after changing actual parameters in strict mode", + +test: function testcase() { + function foo(a,b,c) + { + 'use strict'; + a = 1; b = 'str'; c = 2.1; + return (arguments[0] === 10 && arguments[1] === 'sss' && arguments[2] === 1); + } + return foo(10, 'sss', 1); + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + + + +}); diff --git a/test/suite/ietestcenter/chapter10/10.6/10.6-10-c-ii-2-s.js b/test/suite/ietestcenter/chapter10/10.6/10.6-10-c-ii-2-s.js new file mode 100644 index 0000000000000000000000000000000000000000..ce4090815cc1fe0c5d4e9800f32235889b0f5922 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.6/10.6-10-c-ii-2-s.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: "10.6-10-c-ii-2-s", + +path: "TestCases/chapter10/10.6/10.6-10-c-ii-2-s.js", + +description: "arguments[i] doesn't map to actual parameters in strict mode", + +test: function testcase() { + + function foo(a,b,c) + { + 'use strict'; + arguments[0] = 1; arguments[1] = 'str'; arguments[2] = 2.1; + return 10 === a && 'sss' === b && 1 === c; + } + return foo(10,'sss',1); + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + + + +}); diff --git a/test/suite/ietestcenter/chapter10/10.6/10.6-13-b-1-s.js b/test/suite/ietestcenter/chapter10/10.6/10.6-13-b-1-s.js new file mode 100644 index 0000000000000000000000000000000000000000..15f8d6ce5f325ce4cb7802478b2b3c17dcbc9f9e --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.6/10.6-13-b-1-s.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: "10.6-13-b-1-s", + +path: "TestCases/chapter10/10.6/10.6-13-b-1-s.js", + +description: "Accessing caller property of Arguments object throws TypeError in strict mode", + +test: function testcase() { + 'use strict'; + try + { + arguments.caller; + } + catch (e) { + if(e instanceof TypeError) + return true; + } + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter10/10.6/10.6-13-b-2-s.js b/test/suite/ietestcenter/chapter10/10.6/10.6-13-b-2-s.js new file mode 100644 index 0000000000000000000000000000000000000000..6be2a936b14a2f32b5cd991d35d209f8153c9f4d --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.6/10.6-13-b-2-s.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: "10.6-13-b-2-s", + +path: "TestCases/chapter10/10.6/10.6-13-b-2-s.js", + +description: "arguments.caller exists in strict mode", + +test: function testcase() { + + 'use strict'; + var desc = Object.getOwnPropertyDescriptor(arguments,"caller"); + return desc!== undefined; + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter10/10.6/10.6-13-b-3-s.js b/test/suite/ietestcenter/chapter10/10.6/10.6-13-b-3-s.js new file mode 100644 index 0000000000000000000000000000000000000000..e11948de614d332e502ffd5c686654f8cdaeea62 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.6/10.6-13-b-3-s.js @@ -0,0 +1,49 @@ +/// 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: "10.6-13-b-3-s", + +path: "TestCases/chapter10/10.6/10.6-13-b-3-s.js", + +description: "arguments.caller is non-configurable in strict mode", + +test: function testcase() { + + 'use strict'; + var desc = Object.getOwnPropertyDescriptor(arguments,"caller"); + + return (desc.configurable === false && + desc.enumerable === false && + desc.hasOwnProperty('value') == false && + desc.hasOwnProperty('writable') == false && + desc.hasOwnProperty('get') == true && + desc.hasOwnProperty('set') == true); + + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter10/10.6/10.6-13-c-1-s.js b/test/suite/ietestcenter/chapter10/10.6/10.6-13-c-1-s.js new file mode 100644 index 0000000000000000000000000000000000000000..aad6c7dbbe5433d969bddac778628264679201e2 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.6/10.6-13-c-1-s.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: "10.6-13-c-1-s", + +path: "TestCases/chapter10/10.6/10.6-13-c-1-s.js", + +description: "Accessing callee property of Arguments object throws TypeError in strict mode", + +test: function testcase() { + 'use strict'; + try + { + arguments.callee; + return false; + } + catch (e) { + return (e instanceof TypeError); + } + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter10/10.6/10.6-13-c-2-s.js b/test/suite/ietestcenter/chapter10/10.6/10.6-13-c-2-s.js new file mode 100644 index 0000000000000000000000000000000000000000..5680283c44e64e18b142610fa88ff9d96d4146f6 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.6/10.6-13-c-2-s.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: "10.6-13-c-2-s", + +path: "TestCases/chapter10/10.6/10.6-13-c-2-s.js", + +description: "arguments.callee is exists in strict mode", + +test: function testcase() { + + 'use strict'; + var desc = Object.getOwnPropertyDescriptor(arguments,"callee"); + return desc !== undefined; + }, + +strict:1, + +precondition: function prereq() { + return true; + } + +}); diff --git a/test/suite/ietestcenter/chapter10/10.6/10.6-13-c-3-s.js b/test/suite/ietestcenter/chapter10/10.6/10.6-13-c-3-s.js new file mode 100644 index 0000000000000000000000000000000000000000..541e514ec2ad2061b0bf78cf3bdc21648d948789 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.6/10.6-13-c-3-s.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: "10.6-13-c-3-s", + +path: "TestCases/chapter10/10.6/10.6-13-c-3-s.js", + +description: "arguments.callee is non-configurable in strict mode", + +test: function testcase() { + + 'use strict'; + var desc = Object.getOwnPropertyDescriptor(arguments,"callee"); + return (desc.configurable === false && + desc.enumerable === false && + desc.hasOwnProperty('value') == false && + desc.hasOwnProperty('writable') == false && + desc.hasOwnProperty('get') == true && + desc.hasOwnProperty('set') == true); + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter10/10.6/10.6-14-1-s.js b/test/suite/ietestcenter/chapter10/10.6/10.6-14-1-s.js new file mode 100644 index 0000000000000000000000000000000000000000..74ad073bb199c29bd4093900c47bfad80f5e28d8 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.6/10.6-14-1-s.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: "10.6-14-1-s", + + path: "TestCases/chapter10/10.6/10.6-14-1-s.js", + + description: "Strict Mode - 'callee' exists and 'caller' exists under strict mode", + + test: function testcase() { + "use strict"; + var argObj = function () { + return arguments; + } (); + return argObj.hasOwnProperty("callee") && argObj.hasOwnProperty("caller"); + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter10/10.6/10.6-14-b-1-s.js b/test/suite/ietestcenter/chapter10/10.6/10.6-14-b-1-s.js new file mode 100644 index 0000000000000000000000000000000000000000..4dc40ff4120765386cd833f34069a118d3d62c24 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.6/10.6-14-b-1-s.js @@ -0,0 +1,49 @@ +/// 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: "10.6-14-b-1-s", + + path: "TestCases/chapter10/10.6/10.6-14-b-1-s.js", + + description: "Strict Mode - [[Enumerable]] attribute value in 'caller' is false under strict mode", + + test: function testcase() { + "use strict"; + + var argObj = function () { + return arguments; + } (); + + var verifyEnumerable = false; + for (var _10_6_14_b_1 in argObj) { + if (argObj.hasOwnProperty(_10_6_14_b_1) && _10_6_14_b_1 === "caller") { + verifyEnumerable = true; + } + } + return !verifyEnumerable && argObj.hasOwnProperty("caller"); + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter10/10.6/10.6-14-b-4-s.js b/test/suite/ietestcenter/chapter10/10.6/10.6-14-b-4-s.js new file mode 100644 index 0000000000000000000000000000000000000000..6754d57a32b31e89c7012a247cd38b501bcabee7 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.6/10.6-14-b-4-s.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: "10.6-14-b-4-s", + + path: "TestCases/chapter10/10.6/10.6-14-b-4-s.js", + + description: "Strict Mode - TypeError is thrown when accessing the [[Set]] attribute in 'caller' under strict mode", + + test: function testcase() { + "use strict"; + + var argObj = function () { + return arguments; + } (); + + try { + argObj.caller = {}; + return false; + } catch (e) { + return e instanceof TypeError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter10/10.6/10.6-14-c-1-s.js b/test/suite/ietestcenter/chapter10/10.6/10.6-14-c-1-s.js new file mode 100644 index 0000000000000000000000000000000000000000..5f1a6609d491d6a684384d2bfecb664267dd5101 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.6/10.6-14-c-1-s.js @@ -0,0 +1,49 @@ +/// 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: "10.6-14-c-1-s", + + path: "TestCases/chapter10/10.6/10.6-14-c-1-s.js", + + description: "Strict Mode - [[Enumerable]] attribute value in 'callee' is false under strict mode", + + test: function testcase() { + "use strict"; + + var argObj = function () { + return arguments; + } (); + + var verifyEnumerable = false; + for (var _10_6_14_c_1 in argObj) { + if (argObj.hasOwnProperty(_10_6_14_c_1) && _10_6_14_c_1 === "callee") { + verifyEnumerable = true; + } + } + return !verifyEnumerable && argObj.hasOwnProperty("callee"); + }, + + strict: 1, + + precondition: function prereq() { + return true; + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter10/10.6/10.6-14-c-4-s.js b/test/suite/ietestcenter/chapter10/10.6/10.6-14-c-4-s.js new file mode 100644 index 0000000000000000000000000000000000000000..6a3cc7842442e986fae5fd1f5d0e9f2d1c94fd86 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.6/10.6-14-c-4-s.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: "10.6-14-c-4-s", + + path: "TestCases/chapter10/10.6/10.6-14-c-4-s.js", + + description: "Strict Mode - TypeError is thrown when accessing the [[Set]] attribute in 'callee' under strict mode", + + test: function testcase() { + "use strict"; + + var argObj = function () { + return arguments; + } (); + + try { + argObj.callee = {}; + return false; + } catch (e) { + return e instanceof TypeError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter11/11.1/11.1.5/11.1.5-1-s.js b/test/suite/ietestcenter/chapter11/11.1/11.1.5/11.1.5-1-s.js new file mode 100644 index 0000000000000000000000000000000000000000..248a309aa0179195a440a92fa8fde426205b3adb --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.1/11.1.5/11.1.5-1-s.js @@ -0,0 +1,44 @@ +/// 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: "11.1.5-1-s", + + path: "TestCases/chapter11/11.1/11.1.5/11.1.5-1-s.js", + + description: "Strict Mode - SyntaxError is thrown when 'eval' occurs as the Identifier in a PropertySetParameterList of a PropertyAssignment that is contained in strict code", + + test: function testcase() { + "use strict"; + + try { + eval("var obj = {set _11_1_5_1_fun(eval) {}};"); + return false; + } catch (e) { + return (e instanceof SyntaxError); + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.1/11.1.5/11.1.5-2-s.js b/test/suite/ietestcenter/chapter11/11.1/11.1.5/11.1.5-2-s.js new file mode 100644 index 0000000000000000000000000000000000000000..1b0561988d4381354ec452f0e5828cfc17a1ff26 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.1/11.1.5/11.1.5-2-s.js @@ -0,0 +1,44 @@ +/// 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: "11.1.5-2-s", + + path: "TestCases/chapter11/11.1/11.1.5/11.1.5-2-s.js", + + description: "Strict Mode - SyntaxError is thrown when 'arguments' occurs as the Identifier in a PropertySetParameterList of a PropertyAssignment that is contained in strict code", + + test: function testcase() { + "use strict"; + + try { + eval("var obj = {set _11_1_5_2_fun(arguments) {} };"); + return false; + } catch (e) { + return (e instanceof SyntaxError); + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter11/11.1/11.1.5/11.1.5-3-s.js b/test/suite/ietestcenter/chapter11/11.1/11.1.5/11.1.5-3-s.js new file mode 100644 index 0000000000000000000000000000000000000000..4335fd056072e490ec94470f38c48d09ab3ad646 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.1/11.1.5/11.1.5-3-s.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: "11.1.5-3-s", + + path: "TestCases/chapter11/11.1/11.1.5/11.1.5-3-s.js", + + description: "Strict Mode - SyntaxError is thrown when 'evals' occurs as the Identifier in a PropertySetParameterList of a PropertyAssignment if its FunctionBody is strict code", + + test: function testcase() { + + try { + eval("var obj = {set _11_1_5_3_fun(eval) { \"use strict\"; }};"); + return false; + } catch (e) { + return (e instanceof SyntaxError); + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter11/11.1/11.1.5/11.1.5-4-4-a-1-s.js b/test/suite/ietestcenter/chapter11/11.1/11.1.5/11.1.5-4-4-a-1-s.js new file mode 100644 index 0000000000000000000000000000000000000000..530f3cdac88b9d74598e9b01dde02c4fce3445d3 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.1/11.1.5/11.1.5-4-4-a-1-s.js @@ -0,0 +1,58 @@ +/// 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. + + +/* + Refer 11.1.5; + The production + PropertyNameAndValueList : PropertyNameAndValueList , PropertyAssignment + 4. If previous is not undefined then throw a SyntaxError exception if any of the following conditions are true + a. This production is contained in strict code and IsDataDescriptor(previous) is true and IsDataDescriptor(propId.descriptor) is true +*/ + +ES5Harness.registerTest( { +id: "11.1.5-4-4-a-1-s", + +path: "TestCases/chapter11/11.1/11.1.5/11.1.5-4-4-a-1-s.js", + +description: "Object literal - SyntaxError for duplicate date property name in strict mode", + +test: function testcase() { + + try + { + eval("'use strict'; ({foo:0,foo:1});"); + return false; + } + catch(e) + { + return (e instanceof SyntaxError); + } + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + + + +}); diff --git a/test/suite/ietestcenter/chapter11/11.1/11.1.5/11.1.5-4-s.js b/test/suite/ietestcenter/chapter11/11.1/11.1.5/11.1.5-4-s.js new file mode 100644 index 0000000000000000000000000000000000000000..29d76d9791d37d9da0481de42deabfd5c4d1f226 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.1/11.1.5/11.1.5-4-s.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: "11.1.5-4-s", + + path: "TestCases/chapter11/11.1/11.1.5/11.1.5-4-s.js", + + description: "Strict Mode - SyntaxError is thrown when 'arguments' occurs as the Identifier in a PropertySetParameterList of a PropertyAssignment if its FunctionBody is strict code", + + test: function testcase() { + + try { + eval("var obj = {set _11_1_5_4_fun(arguments) {\"use strict\";}};"); + return false; + } catch (e) { + return (e instanceof SyntaxError); + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter11/11.1/11.1.5/11.1.5_6-2-1-s.js b/test/suite/ietestcenter/chapter11/11.1/11.1.5/11.1.5_6-2-1-s.js new file mode 100644 index 0000000000000000000000000000000000000000..56eb7c88f18e0d70af43ade4beba9e2bc9575a60 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.1/11.1.5/11.1.5_6-2-1-s.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: "11.1.5_6-2-1-s", + + path: "TestCases/chapter11/11.1/11.1.5/11.1.5_6-2-1-s.js", + + description: "Strict Mode - SyntaxError is thrown when an assignment to a reserved word or a future reserved word is contained in strict code", + + test: function testcase() { + "use strict"; + + try { + eval("var obj = {\ + get _11_1_5_6_2_1() {\ + public = 42;\ + return public;\ + }\ + };"); + + var _11_1_5_6_2_1 = obj._11_1_5_6_2_1; + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter11/11.1/11.1.5/11.1.5_6-2-2-s.js b/test/suite/ietestcenter/chapter11/11.1/11.1.5/11.1.5_6-2-2-s.js new file mode 100644 index 0000000000000000000000000000000000000000..5f381c886a4b61ae704a31acf11fae024507a86c --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.1/11.1.5/11.1.5_6-2-2-s.js @@ -0,0 +1,51 @@ +/// 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: "11.1.5_6-2-2-s", + + path: "TestCases/chapter11/11.1/11.1.5/11.1.5_6-2-2-s.js", + + description: "Strict Mode - SyntaxError is thrown when an assignment to a reserved word or a future reserved word is made inside a strict mode FunctionBody of a PropertyAssignment", + + test: function testcase() { + + try { + eval("var obj = {\ + get _11_1_5_6_2_2() {\ + \"use strict\";\ + public = 42;\ + return public;\ + }\ + };\ + var _11_1_5_6_2_2 = obj._11_1_5_6_2_2;"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter11/11.1/11.1.5/11.1.5_7-2-1-s.js b/test/suite/ietestcenter/chapter11/11.1/11.1.5/11.1.5_7-2-1-s.js new file mode 100644 index 0000000000000000000000000000000000000000..6549de96a3ee8b4d5aad06ad3f9de2c975d6eab1 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.1/11.1.5/11.1.5_7-2-1-s.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: "11.1.5_7-2-1-s", + + path: "TestCases/chapter11/11.1/11.1.5/11.1.5_7-2-1-s.js", + + description: "Strict Mode - SyntaxError is thrown when an assignment to a reserved word is contained in strict code", + + test: function testcase() { + "use strict"; + + try { + eval("var data = \"data\";\ + var obj = {\ + set _11_1_5_7_2_1(value) {\ + public = 42;\ + data = value;\ + }\ + };\ + obj._11_1_5_7_2_1 = 1;"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter11/11.1/11.1.5/11.1.5_7-2-2-s.js b/test/suite/ietestcenter/chapter11/11.1/11.1.5/11.1.5_7-2-2-s.js new file mode 100644 index 0000000000000000000000000000000000000000..a19ab33042a5a50543a34c9bcceb735e0f32394a --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.1/11.1.5/11.1.5_7-2-2-s.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: "11.1.5_7-2-2-s", + + path: "TestCases/chapter11/11.1/11.1.5/11.1.5_7-2-2-s.js", + + description: "Strict Mode - SyntaxError is thrown when an assignment to a reserved word is made in a strict FunctionBody of a PropertyAssignment", + + test: function testcase() { + "use strict"; + + try { + eval("var data = \"data\";\ + var obj = {\ + set _11_1_5_7_2_2(value) {\ + public = 42;\ + data = value;\ + }\ + };\ + obj._11_1_5_7_2_2 = 1;"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.1/11.13.1-1-6-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.1/11.13.1-1-6-s.js new file mode 100644 index 0000000000000000000000000000000000000000..569040673e6f77eb78a5c338ba8fc9c729ccd633 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.1/11.13.1-1-6-s.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. + +/* +PutValue operates only on references (see step 3.a). +*/ + + +ES5Harness.registerTest( { +id: "11.13.1-1-6-s", + +path: "TestCases/chapter11/11.13/11.13.1/11.13.1-1-6-s.js", + +description: "simple assignment throws ReferenceError if LeftHandSide is an unresolvable reference in strict mode (base obj undefined)", + strict:1, + +test: function testcase() { + 'use strict'; + + try { + __ES3_1_test_suite_test_11_13_1_unique_id_0__.x = 42; + return false; + } + catch (e) { + return (e instanceof ReferenceError); + } + }, + +precondition: function prereq() { + return true; + } + +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.1/11.13.1-1-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.1/11.13.1-1-s.js new file mode 100644 index 0000000000000000000000000000000000000000..5afcb5fc17efabdc20741d7590a93fa5f0ffcbfc --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.1/11.13.1-1-s.js @@ -0,0 +1,51 @@ +/// 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: "11.13.1-1-s", + + path: "TestCases/chapter11/11.13/11.13.1/11.13.1-1-s.js", + + description: "Strict Mode - TypeError is thrown if The LeftHandSide is a reference to a data property with the attribute value {[[Writable]]:false} under strict mode", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.defineProperty(obj, "prop", { + value: 10, + writable: false, + enumerable: true, + configurable: true + }); + + try { + obj.prop = 20; + return false; + } catch (e) { + return e instanceof TypeError && obj.prop === 10; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.1/11.13.1-2-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.1/11.13.1-2-s.js new file mode 100644 index 0000000000000000000000000000000000000000..5cdafb838d8fc8a7940ed50b8b6e9f60cdd146a1 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.1/11.13.1-2-s.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: "11.13.1-2-s", + + path: "TestCases/chapter11/11.13/11.13.1/11.13.1-2-s.js", + + description: "Strict Mode - TypeError is thrown if The LeftHandSide is a reference to an accessor property with the attribute value {[[Set]]:undefined} under strict mode", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.defineProperty(obj, "prop", { + get: function () { + return 11; + }, + set: undefined, + enumerable: true, + configurable: true + }); + + try { + obj.prop = 20; + return false; + } catch (e) { + return e instanceof TypeError && obj.prop === 11; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.1/11.13.1-3-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.1/11.13.1-3-s.js new file mode 100644 index 0000000000000000000000000000000000000000..5a60e11ae1afe673095f6e57d58b0fae5a64c3f4 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.1/11.13.1-3-s.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: "11.13.1-3-s", + + path: "TestCases/chapter11/11.13/11.13.1/11.13.1-3-s.js", + + description: "Strict Mode - TypeError is thrown if The LeftHandSide is a reference to a non-existent property of an object whose [[Extensible]] internal property has the value false under strict mode", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.preventExtensions(obj); + + try { + obj.len = 10; + return false; + } catch (e) { + return e instanceof TypeError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.1/11.13.1-4-14-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.1/11.13.1-4-14-s.js new file mode 100644 index 0000000000000000000000000000000000000000..b734960ceedb6a17ddae26b81f8b8e359e8e839b --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.1/11.13.1-4-14-s.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: "11.13.1-4-14-s", + +path: "TestCases/chapter11/11.13/11.13.1/11.13.1-4-14-s.js", + +description: "simple assignment throws TypeError if LeftHandSide is a readonly property in strict mode (Number.MAX_VALUE)", + strict:1, + +test: function testcase() { + 'use strict'; + + try { + Number.MAX_VALUE = 42; + return false; + } + catch (e) { + return (e instanceof TypeError); + } + }, + +precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.1/11.13.1-4-27-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.1/11.13.1-4-27-s.js new file mode 100644 index 0000000000000000000000000000000000000000..665621dd0c3aa45952d40cbdf49aaae354fc9f58 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.1/11.13.1-4-27-s.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: "11.13.1-4-27-s", + +path: "TestCases/chapter11/11.13/11.13.1/11.13.1-4-27-s.js", + +description: "simple assignment throws TypeError if LeftHandSide is a readonly property in strict mode (Global.undefined)", + strict:1, + +test: function testcase() { + 'use strict'; + + try { + fnGlobalObject().undefined = 42; + return false; + } + catch (e) { + return (e instanceof TypeError); + } + }, + +precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.1/11.13.1-4-28-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.1/11.13.1-4-28-s.js new file mode 100644 index 0000000000000000000000000000000000000000..e7f39fefbd5531a1e24084307bd23e8e0e9fd75b --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.1/11.13.1-4-28-s.js @@ -0,0 +1,44 @@ +/// 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: "11.13.1-4-28-s", + + path: "TestCases/chapter11/11.13/11.13.1/11.13.1-4-28-s.js", + + description: "Strict Mode - SyntaxError is thrown if the identifier 'eval' appears as the LeftHandSideExpression of simple assignment(=) under strict mode", + + test: function testcase() { + "use strict"; + var blah = eval; + try { + eval("var eval = 20;"); + return false; + } catch (e) { + return e instanceof SyntaxError && blah === eval; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.1/11.13.1-4-29-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.1/11.13.1-4-29-s.js new file mode 100644 index 0000000000000000000000000000000000000000..a6d241be41d8191b4701d3d1964063461ae5f3d8 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.1/11.13.1-4-29-s.js @@ -0,0 +1,44 @@ +/// 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: "11.13.1-4-29-s", + + path: "TestCases/chapter11/11.13/11.13.1/11.13.1-4-29-s.js", + + description: "Strict Mode - SyntaxError is thrown if the identifier 'arguments' appears as the LeftHandSideExpression of simple assignment(=) under strict mode", + + test: function testcase() { + "use strict"; + var blah = arguments; + try { + eval("var arguments = 20;"); + return false; + } catch (e) { + return e instanceof SyntaxError && blah === arguments; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.1/11.13.1-4-3-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.1/11.13.1-4-3-s.js new file mode 100644 index 0000000000000000000000000000000000000000..1303e6b31895299e98a0384c7c64cff36bc588f5 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.1/11.13.1-4-3-s.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: "11.13.1-4-3-s", + +path: "TestCases/chapter11/11.13/11.13.1/11.13.1-4-3-s.js", + +description: "simple assignment throws TypeError if LeftHandSide is a readonly property in strict mode (Global.Infinity)", + strict:1, + +test: function testcase() { + 'use strict'; + + try { + fnGlobalObject().Infinity = 42; + return false; + } + catch (e) { + return (e instanceof TypeError); + } + }, + +precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.1/11.13.1-4-6-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.1/11.13.1-4-6-s.js new file mode 100644 index 0000000000000000000000000000000000000000..257bab00b41a371962711d48069350aa343b981d --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.1/11.13.1-4-6-s.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: "11.13.1-4-6-s", + +path: "TestCases/chapter11/11.13/11.13.1/11.13.1-4-6-s.js", + +description: "simple assignment throws TypeError if LeftHandSide is a readonly property in strict mode (Function.length)", + strict:1, + +test: function testcase() { + 'use strict'; + + try { + Function.length = 42; + return false; + } + catch (e) { + return (e instanceof TypeError); + } + }, + +precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-1-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-1-s.js new file mode 100644 index 0000000000000000000000000000000000000000..2b0137f6eaa3dcdcebf212199e113007f55bfa5f --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-1-s.js @@ -0,0 +1,44 @@ + +/// 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: "11.13.2-1-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-1-s.js", + + description: "Strict Mode - ReferenceError is thrown if the LeftHandSideExpression of a Compound Assignment operator(*=) evaluates to an unresolvable reference", + + test: function testcase() { + "use strict"; + try { + eval("_11_13_2_1 *= 1;"); + return false; + } catch (e) { + return e instanceof ReferenceError; + } + }, + + strict: 1, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-10-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-10-s.js new file mode 100644 index 0000000000000000000000000000000000000000..d8fd78e09e7bf731c465107b08fa9a6d087ee0aa --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-10-s.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: "11.13.2-10-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-10-s.js", + + description: "Strict Mode - ReferenceError is thrown if the LeftHandSideExpression of a Compound Assignment operator(^=) evaluates to an unresolvable reference", + + test: function testcase() { + "use strict"; + try { + eval("_11_13_2_10 ^= 1;"); + return false; + } catch (e) { + return e instanceof ReferenceError; + } + }, + + strict: 1, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-11-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-11-s.js new file mode 100644 index 0000000000000000000000000000000000000000..54114d1fa3b4ea9f1ca7410a1f7d1d22a958ebf3 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-11-s.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: "11.13.2-11-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-11-s.js", + + description: "Strict Mode - ReferenceError is thrown if the LeftHandSideExpression of a Compound Assignment operator(|=) evaluates to an unresolvable reference", + + test: function testcase() { + "use strict"; + try { + eval("_11_13_2_11 |= 1;"); + return false; + } catch (e) { + return e instanceof ReferenceError; + } + }, + + strict: 1, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-12-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-12-s.js new file mode 100644 index 0000000000000000000000000000000000000000..c5177e2ea9b01803a5ba3114b3e0d7507dbb3deb --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-12-s.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: "11.13.2-12-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-12-s.js", + + description: "Strict Mode - ReferenceError isn't thrown if the LeftHandSideExpression of a Compound Assignment operator(*=) evaluates to a resolvable reference", + + test: function testcase() { + "use strict"; + var _11_13_2_12 = 5 + _11_13_2_12 *= 2; + return _11_13_2_12 === 10; + }, + + strict: 1, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-13-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-13-s.js new file mode 100644 index 0000000000000000000000000000000000000000..ed55d2914c3d01a0a5aa6bba99b715c45d9259eb --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-13-s.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: "11.13.2-13-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-13-s.js", + + description: "Strict Mode - ReferenceError isn't thrown if the LeftHandSideExpression of a Compound Assignment operator(/=) evaluates to a resolvable reference", + + test: function testcase() { + "use strict"; + var _11_13_2_13 = 6 + _11_13_2_13 /= 2; + return _11_13_2_13 === 3; + }, + + strict: 1, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-14-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-14-s.js new file mode 100644 index 0000000000000000000000000000000000000000..f594f0fbe5ba2dd07b5800b7791af0b59e2d09a5 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-14-s.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: "11.13.2-14-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-14-s.js", + + description: "Strict Mode - ReferenceError isn't thrown if the LeftHandSideExpression of a Compound Assignment operator(%=) evaluates to a resolvable reference", + + test: function testcase() { + "use strict"; + var _11_13_2_14 = 5 + _11_13_2_14 %= 2; + return _11_13_2_14 === 1; + }, + + strict: 1, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-15-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-15-s.js new file mode 100644 index 0000000000000000000000000000000000000000..94d24120f91ee53ab797fa43e7cf931b95684bf2 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-15-s.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: "11.13.2-15-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-15-s.js", + + description: "Strict Mode - ReferenceError isn't thrown if the LeftHandSideExpression of a Compound Assignment operator(>>>=) evaluates to a resolvable reference", + + test: function testcase() { + "use strict"; + var _11_13_2_15 = 8 + _11_13_2_15 >>>= 2; + return _11_13_2_15 === 2; + }, + + strict: 1, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-16-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-16-s.js new file mode 100644 index 0000000000000000000000000000000000000000..b14cd2dbf3ec3f22f10ef396f20038385bba173d --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-16-s.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: "11.13.2-16-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-16-s.js", + + description: "Strict Mode - ReferenceError isn't thrown if the LeftHandSideExpression of a Compound Assignment operator(-=) evaluates to a resolvable reference", + + test: function testcase() { + "use strict"; + var _11_13_2_16 = 5 + _11_13_2_16 -= 2; + return _11_13_2_16 === 3; + }, + + strict: 1, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-17-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-17-s.js new file mode 100644 index 0000000000000000000000000000000000000000..0a11d724319d9614a2851594757f060d59e0c6c6 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-17-s.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: "11.13.2-17-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-17-s.js", + + description: "Strict Mode - ReferenceError isn't thrown if the LeftHandSideExpression of a Compound Assignment operator(<<=) evaluates to a resolvable reference", + + test: function testcase() { + "use strict"; + var _11_13_2_17 = 1; + _11_13_2_17 <<= 2; + return _11_13_2_17 === 4; + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-18-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-18-s.js new file mode 100644 index 0000000000000000000000000000000000000000..e6c36482a5bec35f9622edfa7152c6d21ae8148e --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-18-s.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: "11.13.2-18-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-18-s.js", + + description: "Strict Mode - ReferenceError isn't thrown if the LeftHandSideExpression of a Compound Assignment operator(>>=) evaluates to a resolvable reference", + + test: function testcase() { + "use strict"; + var _11_13_2_18 = 4 + _11_13_2_18 >>= 2; + return _11_13_2_18 === 1; + }, + + strict: 1, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-19-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-19-s.js new file mode 100644 index 0000000000000000000000000000000000000000..e0259a6a2a4554c2b63cf49fd5add081dbd7a9c7 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-19-s.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: "11.13.2-19-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-19-s.js", + + description: "Strict Mode - ReferenceError isn't thrown if the LeftHandSideExpression of a Compound Assignment operator(+=) evaluates to a resolvable reference", + + test: function testcase() { + "use strict"; + var _11_13_2_19 = -1 + _11_13_2_19 += 10; + return _11_13_2_19 === 9; + }, + + strict: 1, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-2-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-2-s.js new file mode 100644 index 0000000000000000000000000000000000000000..30980809a4df03a1c1bd4f56a50f7ca126ad6406 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-2-s.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: "11.13.2-2-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-2-s.js", + + description: "Strict Mode - ReferenceError is thrown if the LeftHandSideExpression of a Compound Assignment operator(/=) evaluates to an unresolvable reference", + + test: function testcase() { + "use strict"; + try { + eval("_11_13_2_2 /= 1;"); + return false; + } catch (e) { + return e instanceof ReferenceError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-20-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-20-s.js new file mode 100644 index 0000000000000000000000000000000000000000..f25dafaf574811f8196af090a218959bd2cdc387 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-20-s.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: "11.13.2-20-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-20-s.js", + + description: "Strict Mode - ReferenceError isn't thrown if the LeftHandSideExpression of a Compound Assignment operator(&=) evaluates to a resolvable reference", + + test: function testcase() { + "use strict"; + var _11_13_2_20 = 5 + _11_13_2_20 &= 3; + return _11_13_2_20 === 1; + }, + + strict: 1, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-21-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-21-s.js new file mode 100644 index 0000000000000000000000000000000000000000..54c9131f8258c8f72f03f083e1cf2c307b4a3ed4 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-21-s.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: "11.13.2-21-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-21-s.js", + + description: "Strict Mode - ReferenceError isn't thrown if the LeftHandSideExpression of a Compound Assignment operator(^=) evaluates to a resolvable reference", + + test: function testcase() { + "use strict"; + var _11_13_2_21 = 5 + _11_13_2_21 ^= 3; + return _11_13_2_21 === 6; + }, + + strict: 1, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-22-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-22-s.js new file mode 100644 index 0000000000000000000000000000000000000000..fc86b842ba4806160a30cb9857d68a78433995a0 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-22-s.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: "11.13.2-22-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-22-s.js", + + description: "Strict Mode - ReferenceError isn't thrown if the LeftHandSideExpression of a Compound Assignment operator(|=) evaluates to a resolvable reference", + + test: function testcase() { + "use strict"; + var _11_13_2_22 = 5 + _11_13_2_22 |= 2; + return _11_13_2_22 === 7; + }, + + strict: 1, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-23-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-23-s.js new file mode 100644 index 0000000000000000000000000000000000000000..e30345367b436bc0e6cfd4ec513fb0b697012dd7 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-23-s.js @@ -0,0 +1,51 @@ +/// 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: "11.13.2-23-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-23-s.js", + + description: "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(*=) is a reference to a data property with the attribute value {[[Writable]]:false}", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.defineProperty(obj, "prop", { + value: 10, + writable: false, + enumerable: true, + configurable: true + }); + + try { + obj.prop *= 20; + return false; + } catch (e) { + return e instanceof TypeError && obj.prop === 10; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.defineProperty); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-24-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-24-s.js new file mode 100644 index 0000000000000000000000000000000000000000..a8d2f98e7591795708a11b2c7da4766c4e030492 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-24-s.js @@ -0,0 +1,51 @@ +/// 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: "11.13.2-24-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-24-s.js", + + description: "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(/=) is a reference to a data property with the attribute value {[[Writable]]:false}", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.defineProperty(obj, "prop", { + value: 10, + writable: false, + enumerable: true, + configurable: true + }); + + try { + obj.prop /= 20; + return false; + } catch (e) { + return e instanceof TypeError && obj.prop === 10; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.defineProperty); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-25-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-25-s.js new file mode 100644 index 0000000000000000000000000000000000000000..8ad888fba606554165006862f2f2bdf983e1f638 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-25-s.js @@ -0,0 +1,51 @@ +/// 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: "11.13.2-25-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-25-s.js", + + description: "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(%=) is a reference to a data property with the attribute value {[[Writable]]:false}", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.defineProperty(obj, "prop", { + value: 10, + writable: false, + enumerable: true, + configurable: true + }); + + try { + obj.prop %= 20; + return false; + } catch (e) { + return e instanceof TypeError && obj.prop === 10; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.defineProperty); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-26-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-26-s.js new file mode 100644 index 0000000000000000000000000000000000000000..7a51eb820bd4c39d63efad98d19e6fa938129a26 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-26-s.js @@ -0,0 +1,51 @@ +/// 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: "11.13.2-26-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-26-s.js", + + description: "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(+=) is a reference to a data property with the attribute value {[[Writable]]:false}", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.defineProperty(obj, "prop", { + value: 10, + writable: false, + enumerable: true, + configurable: true + }); + + try { + obj.prop += 20; + return false; + } catch (e) { + return e instanceof TypeError && obj.prop === 10; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.defineProperty); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-27-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-27-s.js new file mode 100644 index 0000000000000000000000000000000000000000..6924f1670a641e2efd62a2360c6c9ed2fdaa7eed --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-27-s.js @@ -0,0 +1,51 @@ +/// 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: "11.13.2-27-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-27-s.js", + + description: "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(-=) is a reference to a data property with the attribute value {[[Writable]]:false}", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.defineProperty(obj, "prop", { + value: 10, + writable: false, + enumerable: true, + configurable: true + }); + + try { + obj.prop -= 20; + return false; + } catch (e) { + return e instanceof TypeError && obj.prop === 10; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.defineProperty); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-28-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-28-s.js new file mode 100644 index 0000000000000000000000000000000000000000..9ce84c1c6c83c69c3b7fcb92fdf6e5c2958d97b7 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-28-s.js @@ -0,0 +1,51 @@ +/// 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: "11.13.2-28-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-28-s.js", + + description: "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(<<=) is a reference to a data property with the attribute value {[[Writable]]:false}", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.defineProperty(obj, "prop", { + value: 10, + writable: false, + enumerable: true, + configurable: true + }); + + try { + obj.prop <<= 20; + return false; + } catch (e) { + return e instanceof TypeError && obj.prop === 10; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.defineProperty); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-29-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-29-s.js new file mode 100644 index 0000000000000000000000000000000000000000..8385b3ee35340e4ff8bdf2543a3ca8beb18b5a6a --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-29-s.js @@ -0,0 +1,51 @@ +/// 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: "11.13.2-29-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-29-s.js", + + description: "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(>>=) is a reference to a data property with the attribute value {[[Writable]]:false}", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.defineProperty(obj, "prop", { + value: 10, + writable: false, + enumerable: true, + configurable: true + }); + + try { + obj.prop >>= 20; + return false; + } catch (e) { + return e instanceof TypeError && obj.prop === 10; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.defineProperty); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-3-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-3-s.js new file mode 100644 index 0000000000000000000000000000000000000000..020693b9620a3d42fa9e63fe687e3aa8b8b9eb89 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-3-s.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: "11.13.2-3-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-3-s.js", + + description: "Strict Mode - ReferenceError is thrown if the LeftHandSideExpression of a Compound Assignment operator(%=) evaluates to an unresolvable reference", + + test: function testcase() { + "use strict"; + try { + eval("_11_13_2_3 %= 1;"); + return false; + } catch (e) { + return e instanceof ReferenceError; + } + }, + + strict: 1, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-30-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-30-s.js new file mode 100644 index 0000000000000000000000000000000000000000..026dfd7f8e885b9c3aad2bf0cd76c7b38f087feb --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-30-s.js @@ -0,0 +1,51 @@ +/// 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: "11.13.2-30-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-30-s.js", + + description: "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(>>>=) is a reference to a data property with the attribute value {[[Writable]]:false}", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.defineProperty(obj, "prop", { + value: 10, + writable: false, + enumerable: true, + configurable: true + }); + + try { + obj.prop >>>= 20; + return false; + } catch (e) { + return e instanceof TypeError && obj.prop === 10; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.defineProperty); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-31-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-31-s.js new file mode 100644 index 0000000000000000000000000000000000000000..3040d1a109b90ce74e7a023f10eaa9fd5f88a873 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-31-s.js @@ -0,0 +1,51 @@ +/// 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: "11.13.2-31-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-31-s.js", + + description: "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(&=) is a reference to a data property with the attribute value {[[Writable]]:false}", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.defineProperty(obj, "prop", { + value: 10, + writable: false, + enumerable: true, + configurable: true + }); + + try { + obj.prop &= 20; + return false; + } catch (e) { + return e instanceof TypeError && obj.prop === 10; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.defineProperty); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-32-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-32-s.js new file mode 100644 index 0000000000000000000000000000000000000000..28ce527642b372bcaeb5e1c1b8433d3f12b7588e --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-32-s.js @@ -0,0 +1,51 @@ +/// 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: "11.13.2-32-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-32-s.js", + + description: "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(^=) is a reference to a data property with the attribute value {[[Writable]]:false}", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.defineProperty(obj, "prop", { + value: 10, + writable: false, + enumerable: true, + configurable: true + }); + + try { + obj.prop ^= 20; + return false; + } catch (e) { + return e instanceof TypeError && obj.prop === 10; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.defineProperty); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-33-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-33-s.js new file mode 100644 index 0000000000000000000000000000000000000000..0c1813d970a5f8520f99f38bb7394de620e21964 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-33-s.js @@ -0,0 +1,51 @@ +/// 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: "11.13.2-33-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-33-s.js", + + description: "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(|=) is a reference to a data property with the attribute value {[[Writable]]:false}", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.defineProperty(obj, "prop", { + value: 10, + writable: false, + enumerable: true, + configurable: true + }); + + try { + obj.prop |= 20; + return false; + } catch (e) { + return e instanceof TypeError && obj.prop === 10; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.defineProperty); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-34-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-34-s.js new file mode 100644 index 0000000000000000000000000000000000000000..8635e9bbf6efad29eb288bc7b2701d62ee4a790f --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-34-s.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: "11.13.2-34-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-34-s.js", + + description: "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(*=) is a reference to an accessor property with the attribute value {[[Set]]:undefined}", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.defineProperty(obj, "prop", { + get: function () { + return 11; + }, + set: undefined, + enumerable: true, + configurable: true + }); + + try { + obj.prop *= 20; + return false; + } catch (e) { + return e instanceof TypeError && obj.prop === 11; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.defineProperty); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-35-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-35-s.js new file mode 100644 index 0000000000000000000000000000000000000000..d7fa1b08acf1e859c65b3307ac8fa26c62f2270a --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-35-s.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: "11.13.2-35-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-35-s.js", + + description: "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(/=) is a reference to an accessor property with the attribute value {[[Set]]:undefined}", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.defineProperty(obj, "prop", { + get: function () { + return 11; + }, + set: undefined, + enumerable: true, + configurable: true + }); + + try { + obj.prop /= 20; + return false; + } catch (e) { + return e instanceof TypeError && obj.prop === 11; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.defineProperty); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-36-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-36-s.js new file mode 100644 index 0000000000000000000000000000000000000000..4618953b6ca753b8fc7c115257265c68269622c3 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-36-s.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: "11.13.2-36-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-36-s.js", + + description: "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(%=) is a reference to an accessor property with the attribute value {[[Set]]:undefined}", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.defineProperty(obj, "prop", { + get: function () { + return 11; + }, + set: undefined, + enumerable: true, + configurable: true + }); + + try { + obj.prop %= 20; + return false; + } catch (e) { + return e instanceof TypeError && obj.prop === 11; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.defineProperty); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-37-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-37-s.js new file mode 100644 index 0000000000000000000000000000000000000000..685e6aefa92e44f4362dd2437a37b470824e91ff --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-37-s.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: "11.13.2-37-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-37-s.js", + + description: "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(+=) is a reference to an accessor property with the attribute value {[[Set]]:undefined}", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.defineProperty(obj, "prop", { + get: function () { + return 11; + }, + set: undefined, + enumerable: true, + configurable: true + }); + + try { + obj.prop += 20; + return false; + } catch (e) { + return e instanceof TypeError && obj.prop === 11; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.defineProperty); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-38-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-38-s.js new file mode 100644 index 0000000000000000000000000000000000000000..6d7e6aacd1233876116b3520297b29be0d8eac29 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-38-s.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: "11.13.2-38-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-38-s.js", + + description: "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(-=) is a reference to an accessor property with the attribute value {[[Set]]:undefined}", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.defineProperty(obj, "prop", { + get: function () { + return 11; + }, + set: undefined, + enumerable: true, + configurable: true + }); + + try { + obj.prop -= 20; + return false; + } catch (e) { + return e instanceof TypeError && obj.prop === 11; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.defineProperty); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-39-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-39-s.js new file mode 100644 index 0000000000000000000000000000000000000000..02afcbb551ef68e5d31541267e52de7462ecb47f --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-39-s.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: "11.13.2-39-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-39-s.js", + + description: "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(<<=) is a reference to an accessor property with the attribute value {[[Set]]:undefined}", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.defineProperty(obj, "prop", { + get: function () { + return 11; + }, + set: undefined, + enumerable: true, + configurable: true + }); + + try { + obj.prop <<= 20; + return false; + } catch (e) { + return e instanceof TypeError && obj.prop === 11; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.defineProperty); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-4-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-4-s.js new file mode 100644 index 0000000000000000000000000000000000000000..1d282c1cd73c3a63fc2de5e7ef7b0dd1396819d8 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-4-s.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: "11.13.2-4-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-4-s.js", + + description: "Strict Mode - ReferenceError is thrown if the LeftHandSideExpression of a Compound Assignment operator(+=) evaluates to an unresolvable reference", + + test: function testcase() { + "use strict"; + try { + eval("_11_13_2_4 += 1;"); + return false; + } catch (e) { + return e instanceof ReferenceError; + } + }, + + strict: 1, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-40-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-40-s.js new file mode 100644 index 0000000000000000000000000000000000000000..a1551d679e4f1fa1f83bb0f26e7c409a3f0be146 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-40-s.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: "11.13.2-40-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-40-s.js", + + description: "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(>>=) is a reference to an accessor property with the attribute value {[[Set]]:undefined}", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.defineProperty(obj, "prop", { + get: function () { + return 11; + }, + set: undefined, + enumerable: true, + configurable: true + }); + + try { + obj.prop >>= 20; + return false; + } catch (e) { + return e instanceof TypeError && obj.prop === 11; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.defineProperty); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-41-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-41-s.js new file mode 100644 index 0000000000000000000000000000000000000000..43be65ccbff12f8ab349f0745d806cd4f73bcce5 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-41-s.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: "11.13.2-41-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-41-s.js", + + description: "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(>>>=) is a reference to an accessor property with the attribute value {[[Set]]:undefined}", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.defineProperty(obj, "prop", { + get: function () { + return 11; + }, + set: undefined, + enumerable: true, + configurable: true + }); + + try { + obj.prop >>>= 20; + return false; + } catch (e) { + return e instanceof TypeError && obj.prop === 11; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.defineProperty); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-42-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-42-s.js new file mode 100644 index 0000000000000000000000000000000000000000..7a089c27860e798eea56cead704800d05122de25 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-42-s.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: "11.13.2-42-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-42-s.js", + + description: "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(&=) is a reference to an accessor property with the attribute value {[[Set]]:undefined}", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.defineProperty(obj, "prop", { + get: function () { + return 11; + }, + set: undefined, + enumerable: true, + configurable: true + }); + + try { + obj.prop &= 20; + return false; + } catch (e) { + return e instanceof TypeError && obj.prop === 11; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.defineProperty); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-43-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-43-s.js new file mode 100644 index 0000000000000000000000000000000000000000..7df7543aee30edb50c5f85017f9824aad892451a --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-43-s.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: "11.13.2-43-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-43-s.js", + + description: "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(^=) is a reference to an accessor property with the attribute value {[[Set]]:undefined}", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.defineProperty(obj, "prop", { + get: function () { + return 11; + }, + set: undefined, + enumerable: true, + configurable: true + }); + + try { + obj.prop ^= 20; + return false; + } catch (e) { + return e instanceof TypeError && obj.prop === 11; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.defineProperty); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-44-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-44-s.js new file mode 100644 index 0000000000000000000000000000000000000000..a1332df24b571a747d33e7586313c49d18b654f1 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-44-s.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: "11.13.2-44-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-44-s.js", + + description: "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(|=) is a reference of to an accessor property with the attribute value {[[Set]]:undefined}", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.defineProperty(obj, "prop", { + get: function () { + return 11; + }, + set: undefined, + enumerable: true, + configurable: true + }); + + try { + obj.prop |= 20; + return false; + } catch (e) { + return e instanceof TypeError && obj.prop === 11; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.defineProperty); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-45-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-45-s.js new file mode 100644 index 0000000000000000000000000000000000000000..b6a2859a9788431191dc537d19e66b12886b634f --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-45-s.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: "11.13.2-45-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-45-s.js", + + description: "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(*=) is a reference to a non-existent property of an object whose [[Extensible]] internal property if false", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.preventExtensions(obj); + + try { + obj.len *= 10; + return false; + } catch (e) { + return e instanceof TypeError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.preventExtensions); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-46-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-46-s.js new file mode 100644 index 0000000000000000000000000000000000000000..007647ceec641d9f8593a2758ff955fd9a8b2e4c --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-46-s.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: "11.13.2-46-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-46-s.js", + + description: "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(/=) is a reference to a non-existent property of an object whose [[Extensible]] internal property if false", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.preventExtensions(obj); + + try { + obj.len /= 10; + return false; + } catch (e) { + return e instanceof TypeError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.preventExtensions); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-47-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-47-s.js new file mode 100644 index 0000000000000000000000000000000000000000..3effb2a31cc59a7fb67e4f03941a70420fc45fc9 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-47-s.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: "11.13.2-47-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-47-s.js", + + description: "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(%=) is a reference to a non-existent property of an object whose [[Extensible]] internal property if false", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.preventExtensions(obj); + + try { + obj.len %= 10; + return false; + } catch (e) { + return e instanceof TypeError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.preventExtensions); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-48-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-48-s.js new file mode 100644 index 0000000000000000000000000000000000000000..0c6a29a7ca2cbe82dd51227a37216564dca609f1 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-48-s.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: "11.13.2-48-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-48-s.js", + + description: "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(+=) is a reference to a non-existent property of an object whose [[Extensible]] internal property if false", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.preventExtensions(obj); + + try { + obj.len += 10; + return false; + } catch (e) { + return e instanceof TypeError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.preventExtensions); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-49-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-49-s.js new file mode 100644 index 0000000000000000000000000000000000000000..82706615fb3e46aeab84244ffd70e43a11a01f96 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-49-s.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: "11.13.2-49-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-49-s.js", + + description: "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(-=) is a reference to a non-existent property of an object whose [[Extensible]] internal property if false", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.preventExtensions(obj); + + try { + obj.len -= 10; + return false; + } catch (e) { + return e instanceof TypeError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.preventExtensions); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-5-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-5-s.js new file mode 100644 index 0000000000000000000000000000000000000000..3d6d994ca258739d094295adabdfb80774877a34 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-5-s.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: "11.13.2-5-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-5-s.js", + + description: "Strict Mode - ReferenceError is thrown if the LeftHandSideExpression of a Compound Assignment operator(-=) evaluates to an unresolvable reference", + + test: function testcase() { + "use strict"; + try { + eval("_11_13_2_5 -= 1;"); + return false; + } catch (e) { + return e instanceof ReferenceError; + } + }, + + strict: 1, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-50-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-50-s.js new file mode 100644 index 0000000000000000000000000000000000000000..54781470c95a40ff7048b9df2abca64960b0ed39 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-50-s.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: "11.13.2-50-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-50-s.js", + + description: "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(<<=) is a reference to a non-existent property of an object whose [[Extensible]] internal property if false", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.preventExtensions(obj); + + try { + obj.len <<= 10; + return false; + } catch (e) { + return e instanceof TypeError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.preventExtensions); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-51-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-51-s.js new file mode 100644 index 0000000000000000000000000000000000000000..ff1db76135277d67dee6be6d280718f5401713fe --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-51-s.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: "11.13.2-51-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-51-s.js", + + description: "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(>>=) is a reference to a non-existent property of an object whose [[Extensible]] internal property if false", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.preventExtensions(obj); + + try { + obj.len >>= 10; + return false; + } catch (e) { + return e instanceof TypeError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.preventExtensions); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-52-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-52-s.js new file mode 100644 index 0000000000000000000000000000000000000000..f497bc8421706a2668a7fd3ecbf4dcfc22f8ba93 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-52-s.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: "11.13.2-52-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-52-s.js", + + description: "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(>>>=) is a reference to a non-existent property of an object whose [[Extensible]] internal property if false", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.preventExtensions(obj); + + try { + obj.len >>>= 10; + return false; + } catch (e) { + return e instanceof TypeError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.preventExtensions); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-53-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-53-s.js new file mode 100644 index 0000000000000000000000000000000000000000..fb249a9ba93f76d0f2047c31a904ab1d081d52cd --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-53-s.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: "11.13.2-53-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-53-s.js", + + description: "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(&=) is a reference to a non-existent property of an object whose [[Extensible]] internal property if false", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.preventExtensions(obj); + + try { + obj.len &= 10; + return false; + } catch (e) { + return e instanceof TypeError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.preventExtensions); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-54-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-54-s.js new file mode 100644 index 0000000000000000000000000000000000000000..97365b282d557e50812202a47473aa66b12289a7 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-54-s.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: "11.13.2-54-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-54-s.js", + + description: "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(^=) is a reference to a non-existent property of an object whose [[Extensible]] internal property if false", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.preventExtensions(obj); + + try { + obj.len ^= 10; + return false; + } catch (e) { + return e instanceof TypeError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.preventExtensions); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-55-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-55-s.js new file mode 100644 index 0000000000000000000000000000000000000000..a2fade7046a8b7656fe5f8156582e6f469fe92e3 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-55-s.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: "11.13.2-55-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-55-s.js", + + description: "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(|=) is a reference to a non-existent property of an object whose [[Extensible]] internal property if false", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.preventExtensions(obj); + + try { + obj.len |= 10; + return false; + } catch (e) { + return e instanceof TypeError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.preventExtensions); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-1-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-1-s.js new file mode 100644 index 0000000000000000000000000000000000000000..608e1342d537ac3726fdf5b64b7b23d0388937c2 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-1-s.js @@ -0,0 +1,44 @@ +/// 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: "11.13.2-6-1-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-6-1-s.js", + + description: "Strict Mode - SyntaxError is thrown if the identifier eval appear as the LeftHandSideExpression of a Compound Assignment operator(*=)", + + test: function testcase() { + "use strict"; + var blah = eval; + try { + eval("eval *= 20;"); + return false; + } catch (e) { + return e instanceof SyntaxError && blah === eval; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-10-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-10-s.js new file mode 100644 index 0000000000000000000000000000000000000000..7766922e60885e6bdc9d4ef22179021358af5abc --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-10-s.js @@ -0,0 +1,44 @@ +/// 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: "11.13.2-6-10-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-6-10-s.js", + + description: "Strict Mode - SyntaxError is thrown if the identifier eval appear as the LeftHandSideExpression of a Compound Assignment operator(^=)", + + test: function testcase() { + "use strict"; + var blah = eval; + try { + eval("eval ^= 20;"); + return false; + } catch (e) { + return e instanceof SyntaxError && blah === eval; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-11-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-11-s.js new file mode 100644 index 0000000000000000000000000000000000000000..5287145edc7201436e8ce8002b5a31a6ca6ecd6e --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-11-s.js @@ -0,0 +1,44 @@ +/// 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: "11.13.2-6-11-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-6-11-s.js", + + description: "Strict Mode - SyntaxError is thrown if the identifier eval appear as the LeftHandSideExpression of a Compound Assignment operator(|=)", + + test: function testcase() { + "use strict"; + var blah = eval; + try { + eval("eval |= 20;"); + return false; + } catch (e) { + return e instanceof SyntaxError && blah === eval; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-12-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-12-s.js new file mode 100644 index 0000000000000000000000000000000000000000..75f12b1c82f960d539b6c99c32df2324f56d7ea7 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-12-s.js @@ -0,0 +1,44 @@ +/// 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: "11.13.2-6-12-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-6-12-s.js", + + description: "Strict Mode - SyntaxError is thrown if the identifier arguments appear as the LeftHandSideExpression of a Compound Assignment operator(*=)", + + test: function testcase() { + "use strict"; + var blah = arguments; + try { + eval("arguments *= 20;"); + return false; + } catch (e) { + return e instanceof SyntaxError && blah === arguments; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-13-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-13-s.js new file mode 100644 index 0000000000000000000000000000000000000000..892fd46aa57ef2899480cf53236933f04eaee717 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-13-s.js @@ -0,0 +1,44 @@ +/// 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: "11.13.2-6-13-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-6-13-s.js", + + description: "Strict Mode - SyntaxError is thrown if the identifier arguments appear as the LeftHandSideExpression of a Compound Assignment operator(/=)", + + test: function testcase() { + "use strict"; + var blah = arguments; + try { + eval("arguments /= 20;"); + return false; + } catch (e) { + return e instanceof SyntaxError && blah === arguments; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-14-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-14-s.js new file mode 100644 index 0000000000000000000000000000000000000000..61e4b88f4549e50ba7d377a9ea8d9ec342dd854c --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-14-s.js @@ -0,0 +1,44 @@ +/// 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: "11.13.2-6-14-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-6-14-s.js", + + description: "Strict Mode - SyntaxError is thrown if the identifier arguments appear as the LeftHandSideExpression of a Compound Assignment operator(%=)", + + test: function testcase() { + "use strict"; + var blah = arguments; + try { + eval("arguments %= 20;"); + return false; + } catch (e) { + return e instanceof SyntaxError && blah === arguments; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-15-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-15-s.js new file mode 100644 index 0000000000000000000000000000000000000000..ad7517c18197ab2ed430aae0548156ec13db84f8 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-15-s.js @@ -0,0 +1,44 @@ +/// 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: "11.13.2-6-15-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-6-15-s.js", + + description: "Strict Mode - SyntaxError is thrown if the identifier arguments appear as the LeftHandSideExpression of a Compound Assignment operator(+=)", + + test: function testcase() { + "use strict"; + var blah = arguments; + try { + eval("arguments += 20;"); + return false; + } catch (e) { + return e instanceof SyntaxError && blah === arguments; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-16-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-16-s.js new file mode 100644 index 0000000000000000000000000000000000000000..e8b7d9009724f30ffe574560b11148408ded7449 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-16-s.js @@ -0,0 +1,44 @@ +/// 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: "11.13.2-6-16-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-6-16-s.js", + + description: "Strict Mode - SyntaxError is thrown if the identifier arguments appear as the LeftHandSideExpression of a Compound Assignment operator(-=)", + + test: function testcase() { + "use strict"; + var blah = arguments; + try { + eval("arguments -= 20;"); + return false; + } catch (e) { + return e instanceof SyntaxError && blah === arguments; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-17-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-17-s.js new file mode 100644 index 0000000000000000000000000000000000000000..4eaa3cb2a80030a1b50a2fa7adce53775edb21cb --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-17-s.js @@ -0,0 +1,44 @@ +/// 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: "11.13.2-6-17-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-6-17-s.js", + + description: "Strict Mode - SyntaxError is thrown if the identifier arguments appear as the LeftHandSideExpression of a Compound Assignment operator(<<=)", + + test: function testcase() { + "use strict"; + var blah = arguments; + try { + eval("arguments <<= 20;"); + return false; + } catch (e) { + return e instanceof SyntaxError && blah === arguments; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-18-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-18-s.js new file mode 100644 index 0000000000000000000000000000000000000000..e7e72720fe53ff65919959ba60405d83c307c0a4 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-18-s.js @@ -0,0 +1,44 @@ +/// 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: "11.13.2-6-18-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-6-18-s.js", + + description: "Strict Mode - SyntaxError is thrown if the identifier arguments appear as the LeftHandSideExpression of a Compound Assignment operator(>>=)", + + test: function testcase() { + "use strict"; + var blah = arguments; + try { + eval("arguments >>= 20;"); + return false; + } catch (e) { + return e instanceof SyntaxError && blah === arguments; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-19-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-19-s.js new file mode 100644 index 0000000000000000000000000000000000000000..27c643d87680bf06022868ec1f2291d1efa94827 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-19-s.js @@ -0,0 +1,44 @@ +/// 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: "11.13.2-6-19-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-6-19-s.js", + + description: "Strict Mode - SyntaxError is thrown if the identifier arguments appear as the LeftHandSideExpression of a Compound Assignment operator(>>>=)", + + test: function testcase() { + "use strict"; + var blah = arguments; + try { + eval("arguments >>>= 20;"); + return false; + } catch (e) { + return e instanceof SyntaxError && blah === arguments; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-2-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-2-s.js new file mode 100644 index 0000000000000000000000000000000000000000..f2fbb1276ae366995b0ca471e094e2187ce2d53d --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-2-s.js @@ -0,0 +1,44 @@ +/// 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: "11.13.2-6-2-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-6-2-s.js", + + description: "Strict Mode - SyntaxError is thrown if the identifier eval appear as the LeftHandSideExpression of a Compound Assignment operator(/=)", + + test: function testcase() { + "use strict"; + var blah = eval; + try { + eval("eval /= 20;"); + return false; + } catch (e) { + return e instanceof SyntaxError && blah === eval; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-20-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-20-s.js new file mode 100644 index 0000000000000000000000000000000000000000..148f599b74c3ee4899f0f3bb3f826486127430ee --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-20-s.js @@ -0,0 +1,44 @@ +/// 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: "11.13.2-6-20-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-6-20-s.js", + + description: "Strict Mode - SyntaxError is thrown if the identifier arguments appear as the LeftHandSideExpression of a Compound Assignment operator(&=)", + + test: function testcase() { + "use strict"; + var blah = arguments; + try { + eval("arguments &= 20;"); + return false; + } catch (e) { + return e instanceof SyntaxError && blah === arguments; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-21-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-21-s.js new file mode 100644 index 0000000000000000000000000000000000000000..91c1e44a399b66e15575b0a3d82340fc8f8cebc0 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-21-s.js @@ -0,0 +1,44 @@ +/// 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: "11.13.2-6-21-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-6-21-s.js", + + description: "Strict Mode - SyntaxError is thrown if the identifier arguments appear as the LeftHandSideExpression of a Compound Assignment operator(^=)", + + test: function testcase() { + "use strict"; + var blah = arguments; + try { + eval("arguments ^= 20;"); + return false; + } catch (e) { + return e instanceof SyntaxError && blah === arguments; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-22-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-22-s.js new file mode 100644 index 0000000000000000000000000000000000000000..49f76b81e2796a245f3cf56e43c3fb3199e1a1c2 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-22-s.js @@ -0,0 +1,44 @@ +/// 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: "11.13.2-6-22-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-6-22-s.js", + + description: "Strict Mode - SyntaxError is thrown if the identifier arguments appear as the LeftHandSideExpression of a Compound Assignment operator(|=)", + + test: function testcase() { + "use strict"; + var blah = arguments; + try { + eval("arguments |= 20;"); + return false; + } catch (e) { + return e instanceof SyntaxError && blah === arguments; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-3-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-3-s.js new file mode 100644 index 0000000000000000000000000000000000000000..eda0e6d3761b63ca9640dc0d53a4f81d2ee4c08e --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-3-s.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: "11.13.2-6-3-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-6-3-s.js", + + description: "Strict Mode - SyntaxError is thrown if the identifier eval appear as the LeftHandSideExpression of a Compound Assignment operator(%=)", + + test: function testcase() { + "use strict"; + var blah = eval; + try { + eval("eval %= 20;"); + return false; + } catch (e) { + return e instanceof SyntaxError && blah === eval; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-4-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-4-s.js new file mode 100644 index 0000000000000000000000000000000000000000..a87b9390225f17ea5d2fc4c6a0d3c7388786f031 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-4-s.js @@ -0,0 +1,44 @@ +/// 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: "11.13.2-6-4-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-6-4-s.js", + + description: "Strict Mode - SyntaxError is thrown if the identifier eval appear as the LeftHandSideExpression of a Compound Assignment operator(+=)", + + test: function testcase() { + "use strict"; + var blah = eval; + try { + eval("eval += 20;"); + return false; + } catch (e) { + return e instanceof SyntaxError && blah === eval; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-5-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-5-s.js new file mode 100644 index 0000000000000000000000000000000000000000..7731c0f7436dc360442ea3d166e3b13b8b0583b4 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-5-s.js @@ -0,0 +1,44 @@ +/// 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: "11.13.2-6-5-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-6-5-s.js", + + description: "Strict Mode - SyntaxError is thrown if the identifier eval appear as the LeftHandSideExpression of a Compound Assignment operator(-=)", + + test: function testcase() { + "use strict"; + var blah = eval; + try { + eval("eval -= 20;"); + return false; + } catch (e) { + return e instanceof SyntaxError && blah === eval; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-6-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-6-s.js new file mode 100644 index 0000000000000000000000000000000000000000..21c2f2b40f47a933b5a501824bcc881c41bd0cbe --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-6-s.js @@ -0,0 +1,44 @@ +/// 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: "11.13.2-6-6-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-6-6-s.js", + + description: "Strict Mode - SyntaxError is thrown if the identifier eval appear as the LeftHandSideExpression of a Compound Assignment operator(<<=)", + + test: function testcase() { + "use strict"; + var blah = eval; + try { + eval("eval <<= 20;"); + return false; + } catch (e) { + return e instanceof SyntaxError && blah === eval; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-7-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-7-s.js new file mode 100644 index 0000000000000000000000000000000000000000..76d331f02ce877f73e359bc7a38568dffed41593 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-7-s.js @@ -0,0 +1,44 @@ +/// 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: "11.13.2-6-7-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-6-7-s.js", + + description: "Strict Mode - SyntaxError is thrown if the identifier eval appear as the LeftHandSideExpression of a Compound Assignment operator(>>=)", + + test: function testcase() { + "use strict"; + var blah = eval; + try { + eval("eval >>= 20;"); + return false; + } catch (e) { + return e instanceof SyntaxError && blah === eval; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-8-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-8-s.js new file mode 100644 index 0000000000000000000000000000000000000000..4582a33aaf015e6fcdf4814ba56e802b0bbead5f --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-8-s.js @@ -0,0 +1,44 @@ +/// 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: "11.13.2-6-8-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-6-8-s.js", + + description: "Strict Mode - SyntaxError is thrown if the identifier eval appear as the LeftHandSideExpression of a Compound Assignment operator(>>>=)", + + test: function testcase() { + "use strict"; + var blah = eval; + try { + eval("eval >>>= 20;"); + return false; + } catch (e) { + return e instanceof SyntaxError && blah === eval; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-9-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-9-s.js new file mode 100644 index 0000000000000000000000000000000000000000..c31280d19e9eea6b2599516d725aca8f9f9b84b8 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-9-s.js @@ -0,0 +1,44 @@ +/// 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: "11.13.2-6-9-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-6-9-s.js", + + description: "Strict Mode - SyntaxError is thrown if the identifier eval appear as the LeftHandSideExpression of a Compound Assignment operator(&=)", + + test: function testcase() { + "use strict"; + var blah = eval; + try { + eval("eval &= 20;"); + return false; + } catch (e) { + return e instanceof SyntaxError && blah === eval; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-s.js new file mode 100644 index 0000000000000000000000000000000000000000..e6722804d5c22e90259a34dff67a59c1b9d043b8 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-s.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: "11.13.2-6-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-6-s.js", + + description: "Strict Mode - ReferenceError is thrown if the LeftHandSideExpression of a Compound Assignment operator(<<=) evaluates to an unresolvable reference", + + test: function testcase() { + "use strict"; + try { + eval("_11_13_2_6 <<= 1;"); + return false; + } catch (e) { + return e instanceof ReferenceError; + } + }, + + strict: 1, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-7-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-7-s.js new file mode 100644 index 0000000000000000000000000000000000000000..5db0abb1626c57477f5df7d6bf68f1bf2ca9eddb --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-7-s.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: "11.13.2-7-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-7-s.js", + + description: "Strict Mode - ReferenceError is thrown if the LeftHandSideExpression of a Compound Assignment operator(>>=) evaluates to an unresolvable reference", + + test: function testcase() { + "use strict"; + try { + eval("_11_13_2_7 >>= 1;"); + return false; + } catch (e) { + return e instanceof ReferenceError; + } + }, + + strict: 1, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-8-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-8-s.js new file mode 100644 index 0000000000000000000000000000000000000000..c711cc6397b96945ed306712b7e08429bf1f71e3 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-8-s.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: "11.13.2-8-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-8-s.js", + + description: "Strict Mode - ReferenceError is thrown if the LeftHandSideExpression of a Compound Assignment operator(>>>=) evaluates to an unresolvable reference", + + test: function testcase() { + "use strict"; + try { + eval("_11_13_2_8 >>>= 1;"); + return false; + } catch (e) { + return e instanceof ReferenceError; + } + }, + + strict: 1, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-9-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-9-s.js new file mode 100644 index 0000000000000000000000000000000000000000..a9dd6444de0753a763775098910a0047d2ef8bec --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-9-s.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: "11.13.2-9-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-9-s.js", + + description: "Strict Mode - ReferenceError is thrown if the LeftHandSideExpression of a Compound Assignment operator(&=) evaluates to an unresolvable reference", + + test: function testcase() { + "use strict"; + try { + eval("_11_13_2_9 &= 1;"); + return false; + } catch (e) { + return e instanceof ReferenceError; + } + }, + + strict: 1, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.3/11.3.1/11.3.1-2-1-s.js b/test/suite/ietestcenter/chapter11/11.3/11.3.1/11.3.1-2-1-s.js new file mode 100644 index 0000000000000000000000000000000000000000..0f96d54f70700e0fd795b6c4b452d650c4ba1b1b --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.3/11.3.1/11.3.1-2-1-s.js @@ -0,0 +1,44 @@ +/// 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: "11.3.1-2-1-s", + + path: "TestCases/chapter11/11.3/11.3.1/11.3.1-2-1-s.js", + + description: "Strict Mode - SyntaxError is thrown if the identifier 'arguments' appear as a PostfixExpression(arguments++)", + + test: function testcase() { + "use strict"; + var blah = arguments; + try { + eval("arguments++;"); + return false; + } catch (e) { + return e instanceof SyntaxError && blah === arguments; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.3/11.3.1/11.3.1-2-2-s.js b/test/suite/ietestcenter/chapter11/11.3/11.3.1/11.3.1-2-2-s.js new file mode 100644 index 0000000000000000000000000000000000000000..a0eb61387745268de0028ea52c2308c850f29482 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.3/11.3.1/11.3.1-2-2-s.js @@ -0,0 +1,44 @@ +/// 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: "11.3.1-2-2-s", + + path: "TestCases/chapter11/11.3/11.3.1/11.3.1-2-2-s.js", + + description: "Strict Mode - SyntaxError is thrown if the identifier 'eval' appear as a PostfixExpression(eval++)", + + test: function testcase() { + "use strict"; + var blah = eval; + try { + eval("eval++;"); + return false; + } catch (e) { + return e instanceof SyntaxError && blah === eval; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.3/11.3.2/11.3.2-2-1-s.js b/test/suite/ietestcenter/chapter11/11.3/11.3.2/11.3.2-2-1-s.js new file mode 100644 index 0000000000000000000000000000000000000000..43dc58d01ea248fccb48b043cb019c7306befeff --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.3/11.3.2/11.3.2-2-1-s.js @@ -0,0 +1,44 @@ +/// 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: "11.3.2-2-1-s", + + path: "TestCases/chapter11/11.3/11.3.2/11.3.2-2-1-s.js", + + description: "Strict Mode - SyntaxError is thrown if the identifier 'arguments' appear as a PostfixExpression(arguments--)", + + test: function testcase() { + "use strict"; + var blah = arguments; + try { + eval("arguments--;"); + return false; + } catch (e) { + return e instanceof SyntaxError && blah === arguments; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.3/11.3.2/11.3.2-2-2-s.js b/test/suite/ietestcenter/chapter11/11.3/11.3.2/11.3.2-2-2-s.js new file mode 100644 index 0000000000000000000000000000000000000000..9f59edd0f8fb7782582cfa119dee219afc7cb5b2 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.3/11.3.2/11.3.2-2-2-s.js @@ -0,0 +1,44 @@ +/// 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: "11.3.2-2-2-s", + + path: "TestCases/chapter11/11.3/11.3.2/11.3.2-2-2-s.js", + + description: "Strict Mode - SyntaxError is thrown if the identifier 'eval' appear as a PostfixExpression(eval--)", + + test: function testcase() { + "use strict"; + var blah = eval; + try { + eval("eval--;"); + return false; + } catch (e) { + return e instanceof SyntaxError && blah === eval; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-3-a-1-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-3-a-1-s.js new file mode 100644 index 0000000000000000000000000000000000000000..4d8e9884f43a0f7af478d1983aa42341fe947c6b --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-3-a-1-s.js @@ -0,0 +1,44 @@ +/// 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: "11.4.1-3-a-1-s", + + path: "TestCases/chapter11/11.4/11.4.1/11.4.1-3-a-1-s.js", + + description: "Strict Mode - SyntaxError is thrown when deleting an un-resolvable reference", + + test: function testcase() { + "use strict"; + + try { + eval("delete obj"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-4-a-1-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-4-a-1-s.js new file mode 100644 index 0000000000000000000000000000000000000000..e96ecf314169caeb24a89f101df7206e7242b1ac --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-4-a-1-s.js @@ -0,0 +1,49 @@ +/// 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: "11.4.1-4-a-1-s", + + path: "TestCases/chapter11/11.4/11.4.1/11.4.1-4-a-1-s.js", + + description: "Strict Mode - TypeError is thrown when deleting non-configurable data property", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.defineProperty(obj, "prop", { + value: "abc", + configurable: false + }); + + try { + delete obj.prop; + return false; + } catch (e) { + return e instanceof TypeError && obj.prop === "abc"; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-4-a-2-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-4-a-2-s.js new file mode 100644 index 0000000000000000000000000000000000000000..83e54b8a30f43dfc0916950eb7f45c0bb2f87765 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-4-a-2-s.js @@ -0,0 +1,51 @@ +/// 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: "11.4.1-4-a-2-s", + + path: "TestCases/chapter11/11.4/11.4.1/11.4.1-4-a-2-s.js", + + description: "Strict Mode - TypeError is thrown when deleting non-configurable accessor property", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.defineProperty(obj, "prop", { + get: function () { + return "abc"; + }, + configurable: false + }); + + try { + delete obj.prop; + return false; + } catch (e) { + return e instanceof TypeError && obj.prop === "abc"; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-4-a-3-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-4-a-3-s.js new file mode 100644 index 0000000000000000000000000000000000000000..136ae2990d9f6371e69f648f7f2cedab4750f025 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-4-a-3-s.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: "11.4.1-4-a-3-s", + + path: "TestCases/chapter11/11.4/11.4.1/11.4.1-4-a-3-s.js", + + description: "Strict Mode - TypeError isn't thrown when deleting configurable data property", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.defineProperty(obj, "prop", { + value: "abc", + configurable: true + }); + + delete obj.prop; + return !obj.hasOwnProperty("prop"); + }, + + strict: 1, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-4-a-4-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-4-a-4-s.js new file mode 100644 index 0000000000000000000000000000000000000000..c4c7bd46c9ee44696c6a93b16a61357d27ebfaf6 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-4-a-4-s.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: "11.4.1-4-a-4-s", + + path: "TestCases/chapter11/11.4/11.4.1/11.4.1-4-a-4-s.js", + + description: "Strict Mode - TypeError isn't thrown when deleting configurable accessor property", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.defineProperty(obj, "prop", { + get: function () { + return "abc"; + }, + configurable: true + }); + + delete obj.prop; + return !obj.hasOwnProperty("prop"); + }, + + strict: 1, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-4.a-3-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-4.a-3-s.js new file mode 100644 index 0000000000000000000000000000000000000000..d7cced6cb96273a9dc96e19905f49d1dd7dd3ad1 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-4.a-3-s.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. + +/* +This test is actually testing the [[Delete]] internal method (8.12.8). Since the +language provides no way to directly exercise [[Delete]], the tests are placed here. +*/ + +ES5Harness.registerTest( { +id: "11.4.1-4.a-3-s", + +path: "TestCases/chapter11/11.4/11.4.1/11.4.1-4.a-3-s.js", + +description: "delete operator throws TypeError when deleting a non-configurable data property in strict mode", + +test: function testcase() { + 'use strict'; + + var o = {}; + var desc = { value : 1 }; // all other attributes default to false + Object.defineProperty(o, "foo", desc); + + // Now, deleting o.foo should throw TypeError because [[Configurable]] on foo is false. + try { + delete o.foo; + return false; + } + catch (e) { + return (e instanceof TypeError); + } + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.defineProperty); + } + +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-4.a-8-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-4.a-8-s.js new file mode 100644 index 0000000000000000000000000000000000000000..5f3dd9e1ee6a93e9035f06c46a8aa4ff3ff2e2af --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-4.a-8-s.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. + +/* +This test is actually testing the [[Delete]] internal method (8.12.8). Since the +language provides no way to directly exercise [[Delete]], the tests are placed here. +*/ + +ES5Harness.registerTest( { +id: "11.4.1-4.a-8-s", + +path: "TestCases/chapter11/11.4/11.4.1/11.4.1-4.a-8-s.js", + +description: "delete operator throws TypeError when deleting a non-configurable data property in strict mode", + +test: function testcase() { + 'use strict'; + + // NaN (15.1.1.1) has [[Configurable]] set to false. + try { + delete fnGlobalObject().NaN; + return false; + } + catch (e) { + return (e instanceof TypeError); + } + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + + +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-4.a-9-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-4.a-9-s.js new file mode 100644 index 0000000000000000000000000000000000000000..fa08e12db84521057c02c5260c6c87ae92c193f9 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-4.a-9-s.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. + +/* +This test is actually testing the [[Delete]] internal method (8.12.8). Since the +language provides no way to directly exercise [[Delete]], the tests are placed here. +*/ + +ES5Harness.registerTest( { +id: "11.4.1-4.a-9-s", + +path: "TestCases/chapter11/11.4/11.4.1/11.4.1-4.a-9-s.js", + +description: "delete operator throws TypeError when deleting a non-configurable data property (Math.LN2) in strict mode ", + +test: function testcase() { + 'use strict'; + + try { + delete Math.LN2; + return false; + } + catch (e) { + return (e instanceof TypeError); + } + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + + +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-1-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-1-s.js new file mode 100644 index 0000000000000000000000000000000000000000..8c1962be29159f4abff2be0a76c74891d974787d --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-1-s.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: "11.4.1-5-a-1-s", + + path: "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-1-s.js", + + description: "Strict Mode - SyntaxError is thrown when deleting a variable which is a primitive value type (number)", + + test: function testcase() { + "use strict"; + var _11_4_1_5 = 5; + + try { + eval("delete _11_4_1_5;"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-10-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-10-s.js new file mode 100644 index 0000000000000000000000000000000000000000..d48f53fa96fe9ec5f074820d569ea414a8046f6c --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-10-s.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: "11.4.1-5-a-10-s", + + path: "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-10-s.js", + + description: "Strict Mode - SyntaxError is thrown when deleting a variable of type Array", + + test: function testcase() { + "use strict"; + var arrObj = [1,2,3]; + + try { + eval("delete arrObj;"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-11-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-11-s.js new file mode 100644 index 0000000000000000000000000000000000000000..85d8bb764864d5002a13a6cb928ed2c60e3767a6 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-11-s.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: "11.4.1-5-a-11-s", + + path: "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-11-s.js", + + description: "Strict Mode - SyntaxError is thrown when deleting a variable of type String", + + test: function testcase() { + "use strict"; + var strObj = new String("abc"); + + try { + eval("delete strObj;"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-12-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-12-s.js new file mode 100644 index 0000000000000000000000000000000000000000..e39eee1b2274c99ace46e2b4f8f4a648136d6314 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-12-s.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: "11.4.1-5-a-12-s", + + path: "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-12-s.js", + + description: "Strict Mode - SyntaxError is thrown when deleting a variable of type Boolean", + + test: function testcase() { + "use strict"; + var boolObj = new Boolean(false); + + try { + eval("delete boolObj;"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-13-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-13-s.js new file mode 100644 index 0000000000000000000000000000000000000000..63676ceb808268b1d242920fc6c9290adc645e06 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-13-s.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: "11.4.1-5-a-13-s", + + path: "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-13-s.js", + + description: "Strict Mode - SyntaxError is thrown when deleting a variable of type Number", + + test: function testcase() { + "use strict"; + var numObj = new Number(0); + + try { + eval("delete numObj;"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-14-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-14-s.js new file mode 100644 index 0000000000000000000000000000000000000000..8e234124614e9c2c1e32b4719e26ca0e2f5d3147 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-14-s.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: "11.4.1-5-a-14-s", + + path: "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-14-s.js", + + description: "Strict Mode - SyntaxError is thrown when deleting a variable of type Date", + + test: function testcase() { + "use strict"; + var dateObj = new Date(); + + try { + eval("delete dateObj;"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-15-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-15-s.js new file mode 100644 index 0000000000000000000000000000000000000000..612c477c8bb0e42efef1111e5f61975aec44fed5 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-15-s.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: "11.4.1-5-a-15-s", + + path: "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-15-s.js", + + description: "Strict Mode - SyntaxError is thrown when deleting a variable of type RegExp", + + test: function testcase() { + "use strict"; + var regObj = new RegExp(); + + try { + eval("delete regObj;"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-16-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-16-s.js new file mode 100644 index 0000000000000000000000000000000000000000..cca52369437344172cd1540bd3fb1b3a2b9002c3 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-16-s.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: "11.4.1-5-a-16-s", + + path: "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-16-s.js", + + description: "Strict Mode - SyntaxError is thrown when deleting a variable of type Error", + + test: function testcase() { + "use strict"; + var errObj = new Error(); + + try { + eval("delete errObj;"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-17-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-17-s.js new file mode 100644 index 0000000000000000000000000000000000000000..60c87c09843907c1b6f8d4651f4c42598a27cac6 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-17-s.js @@ -0,0 +1,44 @@ +/// 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: "11.4.1-5-a-17-s", + + path: "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-17-s.js", + + description: "Strict Mode - SyntaxError is thrown when deleting a variable of type Arguments", + + test: function testcase() { + "use strict"; + try { + eval("var argObj = (function (a, b) { delete arguments; }(1, 2));"); + + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-18-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-18-s.js new file mode 100644 index 0000000000000000000000000000000000000000..76e31c22251329fca7dfe31e867dc49ae6a11a79 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-18-s.js @@ -0,0 +1,44 @@ +/// 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: "11.4.1-5-a-18-s", + + path: "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-18-s.js", + + description: "Strict Mode - SyntaxError is thrown when deleting a built-in (Object)", + + test: function testcase() { + "use strict"; + + try { + eval("delete Object;"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-19-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-19-s.js new file mode 100644 index 0000000000000000000000000000000000000000..abeb17b87d117c6245884c20414e8ca0a70d669d --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-19-s.js @@ -0,0 +1,44 @@ +/// 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: "11.4.1-5-a-19-s", + + path: "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-19-s.js", + + description: "Strict Mode - SyntaxError is thrown when deleting a built-in (Function)", + + test: function testcase() { + "use strict"; + + try { + eval("delete Function;"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-2-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-2-s.js new file mode 100644 index 0000000000000000000000000000000000000000..d15770081b362187775c1171a816d6277eaf93d6 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-2-s.js @@ -0,0 +1,48 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// 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: "11.4.1-5-a-2-s", + + path: "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-2-s.js", + + description: "Strict Mode - SyntaxError is thrown when deleting a function parameter", + + test: function testcase() { + "use strict"; + function funObj(x) { + eval("delete x;"); + } + + try { + funObj(1); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-20-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-20-s.js new file mode 100644 index 0000000000000000000000000000000000000000..656fcd8b4a29570c746175369ff274b3011d31e3 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-20-s.js @@ -0,0 +1,44 @@ +/// 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: "11.4.1-5-a-20-s", + + path: "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-20-s.js", + + description: "Strict Mode - SyntaxError is thrown when deleting a built-in (Array)", + + test: function testcase() { + "use strict"; + + try { + eval("delete Array;"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-21-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-21-s.js new file mode 100644 index 0000000000000000000000000000000000000000..01149eb26b37591be8394243226ca5f53cf42e9d --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-21-s.js @@ -0,0 +1,44 @@ +/// 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: "11.4.1-5-a-21-s", + + path: "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-21-s.js", + + description: "Strict Mode - SyntaxError is thrown when deleting a built-in (String)", + + test: function testcase() { + "use strict"; + + try { + eval("delete String;"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-22-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-22-s.js new file mode 100644 index 0000000000000000000000000000000000000000..481412e1650b2381dd8a75f956e7a55da158b207 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-22-s.js @@ -0,0 +1,44 @@ +/// 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: "11.4.1-5-a-22-s", + + path: "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-22-s.js", + + description: "Strict Mode - SyntaxError is thrown when deleting a built-in (Boolean)", + + test: function testcase() { + "use strict"; + + try { + eval("delete Boolean;"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-23-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-23-s.js new file mode 100644 index 0000000000000000000000000000000000000000..f4e9966c0580aac42358005492874c40f440e621 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-23-s.js @@ -0,0 +1,44 @@ +/// 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: "11.4.1-5-a-23-s", + + path: "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-23-s.js", + + description: "Strict Mode - SyntaxError is thrown when deleting a built-in (Number)", + + test: function testcase() { + "use strict"; + + try { + eval("delete Number;"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-24-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-24-s.js new file mode 100644 index 0000000000000000000000000000000000000000..18835e9d6c8e59b555b8fe16e44c7ad8cb506853 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-24-s.js @@ -0,0 +1,44 @@ +/// 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: "11.4.1-5-a-24-s", + + path: "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-24-s.js", + + description: "Strict Mode - SyntaxError is thrown when deleting a built-in (Date)", + + test: function testcase() { + "use strict"; + + try { + eval("delete Date;"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-25-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-25-s.js new file mode 100644 index 0000000000000000000000000000000000000000..bdc5f74580a0e77d74e5473cc09a293e9fbc9210 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-25-s.js @@ -0,0 +1,44 @@ +/// 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: "11.4.1-5-a-25-s", + + path: "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-25-s.js", + + description: "Strict Mode - SyntaxError is thrown when deleting a built-in (RegExp)", + + test: function testcase() { + "use strict"; + + try { + eval("delete RegExp;"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-26-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-26-s.js new file mode 100644 index 0000000000000000000000000000000000000000..cc5ec0c24a717dc51c730dceb73411e702760dc6 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-26-s.js @@ -0,0 +1,44 @@ +/// 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: "11.4.1-5-a-26-s", + + path: "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-26-s.js", + + description: "Strict Mode - SyntaxError is thrown when deleting a built-in (Error)", + + test: function testcase() { + "use strict"; + + try { + eval("delete Error;"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-3-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-3-s.js new file mode 100644 index 0000000000000000000000000000000000000000..31da03acb45e9fd87ee54245c5f019dffee1dd3c --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-3-s.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: "11.4.1-5-a-3-s", + + path: "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-3-s.js", + + description: "Strict Mode - SyntaxError is thrown when deleting a function name", + + test: function testcase() { + "use strict"; + function funObj () { } + + try { + eval("delete funObj"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-4-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-4-s.js new file mode 100644 index 0000000000000000000000000000000000000000..dcfa9c2b37bc1da01b9665ba18a73d36720215d7 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-4-s.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: "11.4.1-5-a-4-s", + + path: "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-4-s.js", + + description: "Strict Mode - SyntaxError is thrown when deleting a function parameter", + + test: function testcase() { + "use strict"; + function funObj(x, y, z) { + eval("delete y;"); + } + + try { + funObj(1); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-5-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-5-s.js new file mode 100644 index 0000000000000000000000000000000000000000..160f67d6cbf14f425fc3c7ee2a8c74eae1367ba7 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-5-s.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: "11.4.1-5-a-5-s", + + path: "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-5-s.js", + + description: "Strict Mode - SyntaxError is thrown when deleting a variable which is a primitive type (boolean)", + + test: function testcase() { + "use strict"; + var _11_4_1_5 = true; + + try { + eval("delete _11_4_1_5;"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-6-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-6-s.js new file mode 100644 index 0000000000000000000000000000000000000000..56c08ad5ca53f7f5dca4a2092df40763c5f4ac61 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-6-s.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: "11.4.1-5-a-6-s", + + path: "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-6-s.js", + + description: "Strict Mode - SyntaxError is thrown when deleting a variable which is a primitive type (string)", + + test: function testcase() { + "use strict"; + var _11_4_1_5 = "abc"; + + try { + eval("delete _11_4_1_5;"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-7-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-7-s.js new file mode 100644 index 0000000000000000000000000000000000000000..7130d243d5602d28603b9226fdc26e70150f9b36 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-7-s.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: "11.4.1-5-a-7-s", + + path: "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-7-s.js", + + description: "Strict Mode - SyntaxError is thrown when deleting a variable of type Object", + + test: function testcase() { + "use strict"; + var obj = new Object(); + + try { + eval("delete obj;"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-8-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-8-s.js new file mode 100644 index 0000000000000000000000000000000000000000..ed0e3d01635990fb7e747423462209373430e729 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-8-s.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: "11.4.1-5-a-8-s", + + path: "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-8-s.js", + + description: "Strict Mode - SyntaxError is thrown when deleting a function object", + + test: function testcase() { + "use strict"; + var funObj = function () { }; + + try { + eval("delete funObj;"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-9-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-9-s.js new file mode 100644 index 0000000000000000000000000000000000000000..0b8e185d31d14b2b2628bce863db7309ac5cec9d --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-9-s.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: "11.4.1-5-a-9-s", + + path: "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-9-s.js", + + description: "Strict Mode - SyntaxError is thrown when deleting a variable of type function (declaration)", + + test: function testcase() { + "use strict"; + function funObj () { }; + + try { + eval("delete funObj;"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.4-4.a-3-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.4-4.a-3-s.js new file mode 100644 index 0000000000000000000000000000000000000000..f415225d7b99715951648e15565ebbdf53e8c983 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.4-4.a-3-s.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. + +/* +This test is actually testing the [[Delete]] internal method (8.12.8). Since the +language provides no way to directly exercise [[Delete]], the tests are placed here. +*/ + +ES5Harness.registerTest( { +id: "11.4.4-4.a-3-s", + +path: "TestCases/chapter11/11.4/11.4.1/11.4.4-4.a-3-s.js", + +description: "delete operator throws TypeError when deleting a non-configurable data property in strict mode", + +test: function testcase() { + 'use strict'; + + var o = {}; + var desc = { value : 1 }; // all other attributes default to false + Object.defineProperty(o, "foo", desc); + + // Now, deleting o.foo should throw TypeError because [[Configurable]] on foo is false. + try { + delete o.foo; + return false; + } + catch (e) { + return (e instanceof TypeError); + } + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.defineProperty); + } + +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.4/11.4.4-2-1-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.4/11.4.4-2-1-s.js new file mode 100644 index 0000000000000000000000000000000000000000..f7ad6e110048d2cad79382905870f9c80365e750 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.4/11.4.4-2-1-s.js @@ -0,0 +1,44 @@ +/// 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: "11.4.4-2-1-s", + + path: "TestCases/chapter11/11.4/11.4.4/11.4.4-2-1-s.js", + + description: "Strict Mode - SyntaxError is thrown for ++eval", + + test: function testcase() { + "use strict"; + var blah = eval; + try { + eval("++eval;"); + return false; + } catch (e) { + return e instanceof SyntaxError && blah === eval; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.4/11.4.4-2-2-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.4/11.4.4-2-2-s.js new file mode 100644 index 0000000000000000000000000000000000000000..d2a27a281ec5b18301907f71da163f95bcfd4e0e --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.4/11.4.4-2-2-s.js @@ -0,0 +1,44 @@ +/// 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: "11.4.4-2-2-s", + + path: "TestCases/chapter11/11.4/11.4.4/11.4.4-2-2-s.js", + + description: "Strict Mode - SyntaxError is thrown for ++arguments", + + test: function testcase() { + "use strict"; + var blah = arguments; + try { + eval("++arguments;"); + return false; + } catch (e) { + return e instanceof SyntaxError && blah === arguments; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.5/11.4.5-2-1-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.5/11.4.5-2-1-s.js new file mode 100644 index 0000000000000000000000000000000000000000..be6314bf88b1964a163b9febe739e155bac726dc --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.5/11.4.5-2-1-s.js @@ -0,0 +1,44 @@ +/// 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: "11.4.5-2-1-s", + + path: "TestCases/chapter11/11.4/11.4.5/11.4.5-2-1-s.js", + + description: "Strict Mode - SyntaxError is thrown for --eval", + + test: function testcase() { + "use strict"; + var blah = eval; + try { + eval("--eval;"); + return false; + } catch (e) { + return e instanceof SyntaxError && blah === eval; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.5/11.4.5-2-2-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.5/11.4.5-2-2-s.js new file mode 100644 index 0000000000000000000000000000000000000000..a3dde1fd06bb29cdc593be1cf2eedbe93e51aeae --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.5/11.4.5-2-2-s.js @@ -0,0 +1,44 @@ +/// 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: "11.4.5-2-2-s", + + path: "TestCases/chapter11/11.4/11.4.5/11.4.5-2-2-s.js", + + description: "Strict Mode - SyntaxError is thrown for --arguments", + + test: function testcase() { + "use strict"; + var blah = arguments; + try { + eval("--arguments;"); + return false; + } catch (e) { + return e instanceof SyntaxError && blah === arguments; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter12/12.1/12.1-1.js b/test/suite/ietestcenter/chapter12/12.1/12.1-1.js new file mode 100644 index 0000000000000000000000000000000000000000..327ecfa352cb59c0a6d674a1a526ba316d1ab1fa --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.1/12.1-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: "12.1-1", + + path: "TestCases/chapter12/12.1/12.1-1.js", + + description: "12.1 - block '{ StatementListopt };' is not allowed: try-catch", + + test: function testcase() { + try { + eval("try{};catch(){}"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + precondition: function prereq() { + return true; + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter12/12.1/12.1-2.js b/test/suite/ietestcenter/chapter12/12.1/12.1-2.js new file mode 100644 index 0000000000000000000000000000000000000000..639535c2295294adaf1519ea07b0fd331c6c9707 --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.1/12.1-2.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: "12.1-2", + + path: "TestCases/chapter12/12.1/12.1-2.js", + + description: "12.1 - block '{ StatementListopt };' is not allowed: try-catch-finally", + + test: function testcase() { + try { + eval("try{};catch{};finally{}"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + precondition: function prereq() { + return true; + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter12/12.1/12.1-3.js b/test/suite/ietestcenter/chapter12/12.1/12.1-3.js new file mode 100644 index 0000000000000000000000000000000000000000..ecddb4e26f2f33e050500c62379e7ac8c277f9dc --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.1/12.1-3.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: "12.1-3", + + path: "TestCases/chapter12/12.1/12.1-3.js", + + description: "12.1 - block '{ StatementListopt };' is not allowed: try-finally", + + test: function testcase() { + try { + eval("try{};finally{}"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + precondition: function prereq() { + return true; + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter12/12.1/12.1-4.js b/test/suite/ietestcenter/chapter12/12.1/12.1-4.js new file mode 100644 index 0000000000000000000000000000000000000000..eba8682f0141bdb6608b5ba9e765b2a101b649ed --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.1/12.1-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: "12.1-4", + + path: "TestCases/chapter12/12.1/12.1-4.js", + + description: "12.1 - block '{ StatementListopt };' is not allowed: if-else", + + test: function testcase() { + try { + eval("if{};else{}"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + precondition: function prereq() { + return true; + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter12/12.1/12.1-5.js b/test/suite/ietestcenter/chapter12/12.1/12.1-5.js new file mode 100644 index 0000000000000000000000000000000000000000..720eaaa28f4f14d27dc27bc0a9370d72476e1f10 --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.1/12.1-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: "12.1-5", + + path: "TestCases/chapter12/12.1/12.1-5.js", + + description: "12.1 - block '{ StatementListopt };' is not allowed: if-else-if", + + test: function testcase() { + try { + eval("if{};else if{}"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + precondition: function prereq() { + return true; + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter12/12.1/12.1-6.js b/test/suite/ietestcenter/chapter12/12.1/12.1-6.js new file mode 100644 index 0000000000000000000000000000000000000000..d5dd8d9b81bd68fe6433f701f1f9aac9f2efe810 --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.1/12.1-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: "12.1-6", + + path: "TestCases/chapter12/12.1/12.1-6.js", + + description: "12.1 - block '{ StatementListopt };' is not allowed: if-else-if-else", + + test: function testcase() { + try { + eval("if{};else if{};else{}"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + precondition: function prereq() { + return true; + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter12/12.1/12.1-7.js b/test/suite/ietestcenter/chapter12/12.1/12.1-7.js new file mode 100644 index 0000000000000000000000000000000000000000..8915c1ff20deb59d80718f48a6f5032a3bdc9fe4 --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.1/12.1-7.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: "12.1-7", + + path: "TestCases/chapter12/12.1/12.1-7.js", + + description: "12.1 - block '{ StatementListopt };' is not allowed: do-while", + + test: function testcase() { + try { + eval("do{};while()"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + precondition: function prereq() { + return true; + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-1-s.js b/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-1-s.js new file mode 100644 index 0000000000000000000000000000000000000000..7dc6afdd3b03435093f42c0b9373db425dcccb59 --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-1-s.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: "12.10.1-1-s", + +path: "TestCases/chapter12/12.10/12.10.1/12.10.1-1-s.js", + +description: "with statement in strict mode throws SyntaxError (strict function)", + +test: function testcase() { + + try { + // wrapping it in eval since this needs to be a syntax error. The + // exception thrown must be a SyntaxError exception. + eval("\ + function f() {\ + \'use strict\';\ + var o = {}; \ + with (o) {};\ + }\ + "); + return false; + } + catch (e) { + return(e instanceof SyntaxError); + } + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-10-s.js b/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-10-s.js new file mode 100644 index 0000000000000000000000000000000000000000..03506fd3d5e4f71cc04e5a8e7435a09d84ec05cc --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-10-s.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: "12.10.1-10-s", + +path: "TestCases/chapter12/12.10/12.10.1/12.10.1-10-s.js", + +description: "with statement in strict mode throws SyntaxError (eval, where the container function is strict)", + +test: function testcase() { + 'use strict'; + + // wrapping it in eval since this needs to be a syntax error. The + // exception thrown must be a SyntaxError exception. Note that eval + // inherits the strictness of its calling context. + try { + eval("\ + var o = {};\ + with (o) {}\ + "); + return false; + } + catch (e) { + return (e instanceof SyntaxError); + } + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-11-s.js b/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-11-s.js new file mode 100644 index 0000000000000000000000000000000000000000..75c0097eadc9e56afefed3aa4517f3e198c6ccd3 --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-11-s.js @@ -0,0 +1,44 @@ +/// 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: "12.10.1-11-s", + + path: "TestCases/chapter12/12.10/12.10.1/12.10.1-11-s.js", + + description: "Strict Mode - SyntaxError is thrown when using WithStatement in strict mode code", + + test: function testcase() { + "use strict"; + try { + eval("with ({}) { throw new Error();}"); + + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-12-s.js b/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-12-s.js new file mode 100644 index 0000000000000000000000000000000000000000..1101f1e24face613d3a18c9566d17edf34c940a4 --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-12-s.js @@ -0,0 +1,49 @@ +/// 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: "12.10.1-12-s", + +path: "TestCases/chapter12/12.10/12.10.1/12.10.1-12-s.js", + +description: "with statement in strict mode throws SyntaxError (strict eval)", + +test: function testcase() { + try { + eval("\ + 'use strict'; \ + var o = {}; \ + with (o) {}\ + "); + return false; + } + catch (e) { + return (e instanceof SyntaxError) ; + } + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-13-s.js b/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-13-s.js new file mode 100644 index 0000000000000000000000000000000000000000..91cdf703ff52d10517a6f0313a4fb9c5f1515aaf --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-13-s.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: "12.10.1-13-s", + + path: "TestCases/chapter12/12.10/12.10.1/12.10.1-13-s.js", + + description: "Strict Mode - SyntaxError isn't thrown when WithStatement body is in strict mode code", + + test: function testcase() { + with ({}) { + "use strict"; + } + return true; + }, + + strict: 1, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-14-s.js b/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-14-s.js new file mode 100644 index 0000000000000000000000000000000000000000..4277ff4963dfb0db3a94c184c654f6fdb5ebb6b0 --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-14-s.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: "12.10.1-14-s", + + path: "TestCases/chapter12/12.10/12.10.1/12.10.1-14-s.js", + + description: "Strict Mode - SyntaxError is thrown when the getter of a literal object utilizes WithStatement", + + test: function testcase() { + "use strict"; + + try { + eval("var obj = { get: function (a) { with(a){} } }; "); + + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-15-s.js b/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-15-s.js new file mode 100644 index 0000000000000000000000000000000000000000..961a58f2e0e0090dbfe9b1c1990c7e4aa7a3e693 --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-15-s.js @@ -0,0 +1,44 @@ +/// 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: "12.10.1-15-s", + + path: "TestCases/chapter12/12.10/12.10.1/12.10.1-15-s.js", + + description: "Strict Mode - SyntaxError is thrown when the RHS of a dot property assignment utilizes WithStatement", + + test: function testcase() { + "use strict"; + + try { + eval("var obj = {}; obj.get = function (a) { with(a){} }; "); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-16-s.js b/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-16-s.js new file mode 100644 index 0000000000000000000000000000000000000000..bfc0a402eaf4f126a6f6e5eca8d2605bb81b0142 --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-16-s.js @@ -0,0 +1,44 @@ +/// 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: "12.10.1-16-s", + + path: "TestCases/chapter12/12.10/12.10.1/12.10.1-16-s.js", + + description: "Strict Mode - SyntaxError is thrown when the RHS of an object indexer assignment utilizes WithStatement", + + test: function testcase() { + "use strict"; + + try { + eval("var obj = {}; obj['get'] = function (a) { with(a){} }; "); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-2-s.js b/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-2-s.js new file mode 100644 index 0000000000000000000000000000000000000000..c4369f5e0a4bb00c25e5684801b4d77c3f4c5c00 --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-2-s.js @@ -0,0 +1,55 @@ +/// 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: "12.10.1-2-s", + +path: "TestCases/chapter12/12.10/12.10.1/12.10.1-2-s.js", + +description: "with statement in strict mode throws SyntaxError (nested function where container is strict)", + +test: function testcase() { + try { + // wrapping it in eval since this needs to be a syntax error. The + // exception thrown must be a SyntaxError exception. + eval("\ + function foo() {\ + \'use strict\'; \ + function f() {\ + var o = {}; \ + with (o) {};\ + }\ + }\ + "); + return false; + } + catch (e) { + return (e instanceof SyntaxError); + } + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-3-s.js b/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-3-s.js new file mode 100644 index 0000000000000000000000000000000000000000..969dae88ee4fb877a7423f45c924a92012a480b4 --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-3-s.js @@ -0,0 +1,55 @@ +/// 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: "12.10.1-3-s", + +path: "TestCases/chapter12/12.10/12.10.1/12.10.1-3-s.js", + +description: "with statement in strict mode throws SyntaxError (nested strict function)", + +test: function testcase() { + try { + // wrapping it in eval since this needs to be a syntax error. The + // exception thrown must be a SyntaxError exception. + eval("\ + function foo() {\ + function f() {\ + \'use strict\'; \ + var o = {}; \ + with (o) {};\ + }\ + }\ + "); + return false; + } + catch (e) { + return (e instanceof SyntaxError); + } + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-4-s.js b/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-4-s.js new file mode 100644 index 0000000000000000000000000000000000000000..990b2bbf5fe2a6db7cbdb4c201f7223d79a22b7a --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-4-s.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: "12.10.1-4-s", + +path: "TestCases/chapter12/12.10/12.10.1/12.10.1-4-s.js", + +description: "with statement in strict mode throws SyntaxError (strict Function)", + +test: function testcase() { + try { + var f = Function("\ + \'use strict\'; \ + var o = {}; \ + with (o) {};\ + "); + return false; + } + catch (e) { + return (e instanceof SyntaxError); + + } + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-5-s.js b/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-5-s.js new file mode 100644 index 0000000000000000000000000000000000000000..c1e9f1ef198bf64f5bd439806d8b122270179bd7 --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-5-s.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: "12.10.1-5-s", + +path: "TestCases/chapter12/12.10/12.10.1/12.10.1-5-s.js", + +description: "with statement allowed in nested Function even if its container Function is strict)", + +test: function testcase() { + + Function("\'use strict\'; var f1 = Function( \"var o = {}; with (o) {};\")"); + return true; + + }, + +strict:1, + +precondition: function prereq() { + return true; + } + +}); diff --git a/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-7-s.js b/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-7-s.js new file mode 100644 index 0000000000000000000000000000000000000000..36814d00c1d9d9f5e578f0f59ec9e19f2d1e7336 --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-7-s.js @@ -0,0 +1,51 @@ +/// 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: "12.10.1-7-s", + +path: "TestCases/chapter12/12.10/12.10.1/12.10.1-7-s.js", + +description: "with statement in strict mode throws SyntaxError (function expression, where the container function is directly evaled from strict code)", + +test: function testcase() { + 'use strict'; + + try { + eval("var f = function () {\ + var o = {}; \ + with (o) {}; \ + }\ + "); + return false; + } + catch (e) { + return (e instanceof SyntaxError); + } + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-8-s.js b/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-8-s.js new file mode 100644 index 0000000000000000000000000000000000000000..cc0b62b7a7e4ecf838170cae666a9e85127b9355 --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-8-s.js @@ -0,0 +1,51 @@ +/// 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: "12.10.1-8-s", + +path: "TestCases/chapter12/12.10/12.10.1/12.10.1-8-s.js", + +description: "with statement in strict mode throws SyntaxError (function expression, where the container Function is strict)", + +test: function testcase() { + try { + Function("\ + \'use strict\'; \ + var f1 = function () {\ + var o = {}; \ + with (o) {}; \ + }\ + "); + return false; + } + catch (e) { + return (e instanceof SyntaxError); + } + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-9-s.js b/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-9-s.js new file mode 100644 index 0000000000000000000000000000000000000000..8ed8c9b022343802f66b530b70e5f5ecb6cf92e0 --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-9-s.js @@ -0,0 +1,51 @@ +/// 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: "12.10.1-9-s", + +path: "TestCases/chapter12/12.10/12.10.1/12.10.1-9-s.js", + +description: "with statement in strict mode throws SyntaxError (strict function expression)", + +test: function testcase() { + try { + eval("\ + var f = function () {\ + \'use strict\';\ + var o = {}; \ + with (o) {}; \ + }\ + "); + return false; + } + catch (e) { + return (e instanceof SyntaxError) ; + } + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter12/12.14/12.14.1/12.14.1-1-s.js b/test/suite/ietestcenter/chapter12/12.14/12.14.1/12.14.1-1-s.js new file mode 100644 index 0000000000000000000000000000000000000000..64cac0ce159b865284f822c80d4c842be5c5d4ed --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.14/12.14.1/12.14.1-1-s.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: "12.14.1-1-s", + + path: "TestCases/chapter12/12.14/12.14.1/12.14.1-1-s.js", + + description: "Strict Mode - SyntaxError is thrown if a TryStatement with a Catch occurs within strict code and the Identifier of the Catch production is eval", + + test: function testcase() { + "use strict"; + + try { + eval("\ + try {} catch (eval) { }\ + "); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter12/12.14/12.14.1/12.14.1-2-s.js b/test/suite/ietestcenter/chapter12/12.14/12.14.1/12.14.1-2-s.js new file mode 100644 index 0000000000000000000000000000000000000000..89226a80788e619a9f2e769ce837d086d3ed9479 --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.14/12.14.1/12.14.1-2-s.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: "12.14.1-2-s", + + path: "TestCases/chapter12/12.14/12.14.1/12.14.1-2-s.js", + + description: "Strict Mode - SyntaxError is thrown if a TryStatement with a Catch occurs within strict code and the Identifier of the Catch production is arguments", + + test: function testcase() { + "use strict"; + + try { + eval("\ + try {} catch (arguments) { }\ + "); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter12/12.14/12.14.1/12.14.1-3-s.js b/test/suite/ietestcenter/chapter12/12.14/12.14.1/12.14.1-3-s.js new file mode 100644 index 0000000000000000000000000000000000000000..39dbb88ca90551148dc268d8214b2a3e36acdf99 --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.14/12.14.1/12.14.1-3-s.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: "12.14.1-3-s", + + path: "TestCases/chapter12/12.14/12.14.1/12.14.1-3-s.js", + + description: "Strict Mode - SyntaxError isn't thrown if a TryStatement with a Catch occurs within strict code and the Identifier of the Catch production is EVAL but throws SyntaxError if it is eval", + + test: function testcase() { + "use strict"; + + try{ eval(" try { \ + throw new Error(\"...\");\ + return false;\ + } catch (EVAL) {\ + try\ + {\ + throw new Error(\"...\");\ + }catch(eval)\ + {\ + return EVAL instanceof Error;\ + }\ + }"); + return false; + } catch(e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter12/12.14/12.14.1/12.14.1-4-s.js b/test/suite/ietestcenter/chapter12/12.14/12.14.1/12.14.1-4-s.js new file mode 100644 index 0000000000000000000000000000000000000000..eb3ca3b539af6cbe4968173d86cbe11ba09a3262 --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.14/12.14.1/12.14.1-4-s.js @@ -0,0 +1,44 @@ +/// 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: "12.14.1-4-s", + + path: "TestCases/chapter12/12.14/12.14.1/12.14.1-4-s.js", + + description: "Strict Mode - SyntaxError isn't thrown if a TryStatement with a Catch occurs within strict code and the Identifier of the Catch production is EVAL", + + test: function testcase() { + "use strict"; + + try { + throw new Error("..."); + return false; + } catch (EVAL) { + return EVAL instanceof Error; + } + }, + + strict: 1, + + precondition: function prereq() { + return true; + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter12/12.14/12.14.1/12.14.1-5-s.js b/test/suite/ietestcenter/chapter12/12.14/12.14.1/12.14.1-5-s.js new file mode 100644 index 0000000000000000000000000000000000000000..e7820de9f275751381b6167c02f030e79163068c --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.14/12.14.1/12.14.1-5-s.js @@ -0,0 +1,44 @@ +/// 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: "12.14.1-5-s", + + path: "TestCases/chapter12/12.14/12.14.1/12.14.1-5-s.js", + + description: "Strict Mode - SyntaxError isn't thrown if a TryStatement with a Catch occurs within strict code and the Identifier of the Catch production is Arguments", + + test: function testcase() { + "use strict"; + + try { + throw new Error("..."); + return false; + } catch (Arguments) { + return Arguments instanceof Error; + } + }, + + strict: 1, + + precondition: function prereq() { + return true; + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter12/12.14/12.14.1/12.14.1-6-s.js b/test/suite/ietestcenter/chapter12/12.14/12.14.1/12.14.1-6-s.js new file mode 100644 index 0000000000000000000000000000000000000000..bf3e5039f8ac920a1ef7ab7c37608e4994cc47b9 --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.14/12.14.1/12.14.1-6-s.js @@ -0,0 +1,44 @@ +/// 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: "12.14.1-6-s", + + path: "TestCases/chapter12/12.14/12.14.1/12.14.1-6-s.js", + + description: "Strict Mode - SyntaxError isn't thrown if a TryStatement with a Catch occurs within strict code and the Identifier of the Catch production is ARGUMENTS", + + test: function testcase() { + "use strict"; + + try { + throw new Error("..."); + return false; + } catch (ARGUMENTS) { + return ARGUMENTS instanceof Error; + } + }, + + strict: 1, + + precondition: function prereq() { + return true; + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-1-s.js b/test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-1-s.js new file mode 100644 index 0000000000000000000000000000000000000000..6431b852bd491398ffcfb3fe5700aaaf0db4aeab --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-1-s.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: "12.2.1-1-s", + +path: "TestCases/chapter12/12.2/12.2.1/12.2.1-1-s.js", + +description: "eval - a function declaring a var named 'eval' throws SyntaxError in strict mode", + +test: function testcase() { + 'use strict'; + + try { + eval('function foo() { var eval; }'); + return false; + } + catch (e) { + return (e instanceof SyntaxError); + } + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + + +}); diff --git a/test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-10-s.js b/test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-10-s.js new file mode 100644 index 0000000000000000000000000000000000000000..1b06b6b29b47cb74a335746a387c429800720fae --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-10-s.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: "12.2.1-10-s", + +path: "TestCases/chapter12/12.2/12.2.1/12.2.1-10-s.js", + +description: "Strict Mode: an indirect eval assigning into 'eval' does not throw", + +test: function testcase() { + 'use strict'; + var s = eval; + s('eval = 42;'); + return true; + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-12-s.js b/test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-12-s.js new file mode 100644 index 0000000000000000000000000000000000000000..8eefc136dd57ba68b3d70246b297383f2b3cd40b --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-12-s.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: "12.2.1-12-s", + +path: "TestCases/chapter12/12.2/12.2.1/12.2.1-12-s.js", + +description: "arguments as local var identifier throws SyntaxError in strict mode", + +test: function testcase() { + + try { + eval("(function (){'use strict'; var arguments;});"); + return false; + } + catch (e) { + return (e instanceof SyntaxError); + } + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-13-s.js b/test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-13-s.js new file mode 100644 index 0000000000000000000000000000000000000000..e2b77b649d2cfb00ad4b7d0d94b40dd957471e9b --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-13-s.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: "12.2.1-13-s", + +path: "TestCases/chapter12/12.2/12.2.1/12.2.1-13-s.js", + +description: "arguments as global var identifier throws SyntaxError in strict mode", + +test: function testcase() { + + var indirectEval = eval; + + try { + indirectEval("'use strict'; var arguments;"); + return false; + } + catch (e) { + return (e instanceof SyntaxError); + } + }, + +strict:1, + +precondition: function () { + //indirect eval must be globally scoped + var localVar = "12.2.1-13-s"; + var indirectEval = eval; + try { + if (indirectEval("localVar;")==="12.2.1-13-s" ) + return false; + } catch (e) { + } + return fnSupportsStrict(); +} + +}); diff --git a/test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-2-s.js b/test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-2-s.js new file mode 100644 index 0000000000000000000000000000000000000000..e1fcc0ff80008f7cce835b57d60d1ceffbe4d65a --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-2-s.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: "12.2.1-2-s", + +path: "TestCases/chapter12/12.2/12.2.1/12.2.1-2-s.js", + +description: "eval - a function assigning into 'eval' throws SyntaxError in strict mode", + +test: function testcase() { + 'use strict'; + + try { + eval('function foo() { eval = 42; }; foo()'); + return false; + } + catch (e) { + return (e instanceof SyntaxError); + } + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + + +}); diff --git a/test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-3-s.js b/test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-3-s.js new file mode 100644 index 0000000000000000000000000000000000000000..8f7e265984dab2c8146e1ae78c3b461698dc7d28 --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-3-s.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: "12.2.1-3-s", + +path: "TestCases/chapter12/12.2/12.2.1/12.2.1-3-s.js", + +description: "eval - a function expr declaring a var named 'eval' throws SyntaxError in strict mode", + +test: function testcase() { + 'use strict'; + + try { + eval('(function () { var eval; })'); + return false; + } + catch (e) { + return (e instanceof SyntaxError); + } + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + + +}); diff --git a/test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-4-s.js b/test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-4-s.js new file mode 100644 index 0000000000000000000000000000000000000000..eafe3a676c39d81c03e159d23a697e92c3d19787 --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-4-s.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: "12.2.1-4-s", + +path: "TestCases/chapter12/12.2/12.2.1/12.2.1-4-s.js", + +description: "eval - a function expr assigning into 'eval' throws a SyntaxError in strict mode", + +test: function testcase() { + 'use strict'; + + try { + eval('(function () { eval = 42; })()'); + return false; + } + catch (e) { + return (e instanceof SyntaxError); + } + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + + +}); diff --git a/test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-5-s.js b/test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-5-s.js new file mode 100644 index 0000000000000000000000000000000000000000..674e5883a555c7a1327172f649878db847748400 --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-5-s.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: "12.2.1-5-s", + + path: "TestCases/chapter12/12.2/12.2.1/12.2.1-5-s.js", + + description: "Strict Mode - a Function declaring var named 'eval' does not throw SyntaxError", + + test: function testcase() { + 'use strict'; + Function('var eval;'); + return true; + }, + + strict:1, + +precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-6-s.js b/test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-6-s.js new file mode 100644 index 0000000000000000000000000000000000000000..04d635406ac2f8555e6205ca4b53307f6f0b5aae --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-6-s.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: "12.2.1-6-s", + +path: "TestCases/chapter12/12.2/12.2.1/12.2.1-6-s.js", + +description: "eval - a Function assigning into 'eval' will not throw any error if contained within strict mode and its body does not start with strict mode", + +test: function testcase() { + 'use strict'; + + var f = Function('eval = 42;'); + f(); + return true; + }, + +strict:1, + +precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-7-s.js b/test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-7-s.js new file mode 100644 index 0000000000000000000000000000000000000000..35af90bfec9779960cdaacfe68cb46ad6380bae6 --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-7-s.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: "12.2.1-7-s", + +path: "TestCases/chapter12/12.2/12.2.1/12.2.1-7-s.js", + +description: "eval - a direct eval declaring a var named 'eval' throws SyntaxError in strict mode", + +test: function testcase() { + 'use strict'; + + try { + eval('var eval;'); + return false; + } + catch (e) { + return (e instanceof SyntaxError); + } + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + + +}); diff --git a/test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-8-s.js b/test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-8-s.js new file mode 100644 index 0000000000000000000000000000000000000000..960ad8a9024512f028a630925a45cd772140dba3 --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-8-s.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: "12.2.1-8-s", + +path: "TestCases/chapter12/12.2/12.2.1/12.2.1-8-s.js", + +description: "eval - a direct eval assigning into 'eval' throws SyntaxError in strict mode", + +test: function testcase() { + 'use strict'; + + try { + eval('eval = 42;'); + return false; + } + catch (e) { + return (e instanceof SyntaxError) ; + } + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + + +}); diff --git a/test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-9-s.js b/test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-9-s.js new file mode 100644 index 0000000000000000000000000000000000000000..bf259e9c60cf4d8eebacb15fb60cc82a2de901b2 --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-9-s.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: "12.2.1-9-s", + +path: "TestCases/chapter12/12.2/12.2.1/12.2.1-9-s.js", + +description: "Strict Mode: an indirect eval declaring a var named 'eval' does not throw", + +test: function testcase() { + 'use strict'; + var s = eval; + s('var eval;'); + return true; + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter13/13.0/13.0-1.js b/test/suite/ietestcenter/chapter13/13.0/13.0-1.js new file mode 100644 index 0000000000000000000000000000000000000000..c67b310eee91a66f92393cc800d304f94c82dd29 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.0/13.0-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: "13.0-1", + + path: "TestCases/chapter13/13.0/13.0-1.js", + + description: "13.0 - multiple names in one function declaration is not allowed, two function names", + + test: function testcase() { + try { + eval("function x, y() {}"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + precondition: function prereq() { + return true; + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.0/13.0-10-s.js b/test/suite/ietestcenter/chapter13/13.0/13.0-10-s.js new file mode 100644 index 0000000000000000000000000000000000000000..73b951c4b4c3dfe126c47e378850cde46c73ca4c --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.0/13.0-10-s.js @@ -0,0 +1,55 @@ +/// 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. + +/* +Refer 13; +The production FunctionBody : SourceElementsopt is evaluated as follows: +*/ + +ES5Harness.registerTest({ + id: "13.0-10-s", + + path: "TestCases/chapter13/13.0/13.0-10-s.js", + + description: "Strict Mode - SourceElements is evaluated as strict mode code when the code of this FunctionBody with an inner function contains a Use Strict Directive", + + test: function testcase() { + + function _13_0_10_fun() { + function _13_0_10_inner() { + "use strict"; + eval("eval = 42;"); + } + _13_0_10_inner(); + }; + try { + _13_0_10_fun(); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.0/13.0-11-s.js b/test/suite/ietestcenter/chapter13/13.0/13.0-11-s.js new file mode 100644 index 0000000000000000000000000000000000000000..c674487e40528442cc6bc65d42c3e4c75cbf6409 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.0/13.0-11-s.js @@ -0,0 +1,55 @@ +/// 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. + +/* +Refer 13; +The production FunctionBody : SourceElementsopt is evaluated as follows: +*/ + +ES5Harness.registerTest({ + id: "13.0-11-s", + + path: "TestCases/chapter13/13.0/13.0-11-s.js", + + description: "Strict Mode - SourceElements is evaluated as strict mode code when the code of this FunctionBody with an inner function which is in strict mode", + + test: function testcase() { + + function _13_0_11_fun() { + "use strict"; + function _13_0_11_inner() { + eval("eval = 42;"); + } + _13_0_11_inner(); + }; + try { + _13_0_11_fun(); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.0/13.0-12-s.js b/test/suite/ietestcenter/chapter13/13.0/13.0-12-s.js new file mode 100644 index 0000000000000000000000000000000000000000..605cb09762245fa43a9cae1902848103a02e7046 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.0/13.0-12-s.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. + +/* +Refer 13; +The production FunctionBody : SourceElementsopt is evaluated as follows: +*/ + +ES5Harness.registerTest({ + id: "13.0-12-s", + + path: "TestCases/chapter13/13.0/13.0-12-s.js", + + description: "Strict Mode - SourceElements is not evaluated as strict mode code when a Function constructor is contained in strict mode code and the function constructor body is not strict", + + test: function testcase() { + "use strict"; + + var _13_0_12_fun = new Function(" ","eval = 42;"); + _13_0_12_fun(); + return true; + + }, + + strict: 1, + + precondition: function prereq() { + return true; + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.0/13.0-13-s.js b/test/suite/ietestcenter/chapter13/13.0/13.0-13-s.js new file mode 100644 index 0000000000000000000000000000000000000000..d1b605c752ffe87f7b3c58172d03975ae1430874 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.0/13.0-13-s.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. + +/* +Refer 13; +The production FunctionBody : SourceElementsopt is evaluated as follows: +*/ + +ES5Harness.registerTest({ + id: "13.0-13-s", + + path: "TestCases/chapter13/13.0/13.0-13-s.js", + + description: "Strict Mode - SourceElements is evaluated as strict mode code when the function body of a Function constructor begins with a Strict Directive", + + test: function testcase() { + + try { + eval("var _13_0_13_fun = new Function(\" \", \"'use strict'; eval = 42;\"); _13_0_13_fun();"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.0/13.0-14-s.js b/test/suite/ietestcenter/chapter13/13.0/13.0-14-s.js new file mode 100644 index 0000000000000000000000000000000000000000..2ef9de83d4cccf27363272125177bd3cf5e90c0a --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.0/13.0-14-s.js @@ -0,0 +1,49 @@ +/// 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. + +/* +Refer 13; +The production FunctionBody : SourceElementsopt is evaluated as follows: +*/ + +ES5Harness.registerTest({ + id: "13.0-14-s", + + path: "TestCases/chapter13/13.0/13.0-14-s.js", + + description: "Strict Mode - SourceElements is evaluated as strict mode code when the function body of a Function constructor contains a Strict Directive", + + test: function testcase() { + + try { + var _13_0_14_fun = new Function(" ", "'use strict'; eval = 42; "); + _13_0_14_fun(); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.0/13.0-15-s.js b/test/suite/ietestcenter/chapter13/13.0/13.0-15-s.js new file mode 100644 index 0000000000000000000000000000000000000000..48216777f0345d120b13b5269492f54f1ecbfcbd --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.0/13.0-15-s.js @@ -0,0 +1,49 @@ +/// 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. + +/* +Refer 13; +The production FunctionBody : SourceElementsopt is evaluated as follows: +*/ + +ES5Harness.registerTest({ + id: "13.0-15-s", + + path: "TestCases/chapter13/13.0/13.0-15-s.js", + + description: "Strict Mode - SourceElements is evaluated as strict mode code when a FunctionDeclaration is contained in strict mode code within eval code", + + test: function testcase() { + + try { + eval("'use strict'; function _13_0_15_fun() {eval = 42;};"); + _13_0_15_fun(); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.0/13.0-16-s.js b/test/suite/ietestcenter/chapter13/13.0/13.0-16-s.js new file mode 100644 index 0000000000000000000000000000000000000000..f60d362119d858e5429dbc5f199e0f9248d87ecd --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.0/13.0-16-s.js @@ -0,0 +1,49 @@ +/// 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. + +/* +Refer 13; +The production FunctionBody : SourceElementsopt is evaluated as follows: +*/ + +ES5Harness.registerTest({ + id: "13.0-16-s", + + path: "TestCases/chapter13/13.0/13.0-16-s.js", + + description: "Strict Mode - SourceElements is evaluated as strict mode code when a FunctionExpression is contained in strict mode code within eval code", + + test: function testcase() { + + try { + eval("'use strict'; var _13_0_16_fun = function () {eval = 42;};"); + _13_0_16_fun(); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.0/13.0-17-s.js b/test/suite/ietestcenter/chapter13/13.0/13.0-17-s.js new file mode 100644 index 0000000000000000000000000000000000000000..e098644be135b001899052f5caa932e448ea5d13 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.0/13.0-17-s.js @@ -0,0 +1,44 @@ +/// 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. + +/* +Refer 13; +The production FunctionBody : SourceElementsopt is evaluated as follows: +*/ + +ES5Harness.registerTest({ + id: "13.0-17-s", + + path: "TestCases/chapter13/13.0/13.0-17-s.js", + + description: "Strict Mode - SourceElements is not evaluated as strict mode code when a Function constructor is contained in strict mode code within eval code", + + test: function testcase() { + + eval("'use strict'; var _13_0_17_fun = new Function('eval = 42;'); _13_0_17_fun();"); + return true; + }, + + strict: 1, + + precondition: function prereq() { + return true; + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.0/13.0-2.js b/test/suite/ietestcenter/chapter13/13.0/13.0-2.js new file mode 100644 index 0000000000000000000000000000000000000000..a91ae2014f68737dc77ff68ed2818ea8164ae256 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.0/13.0-2.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: "13.0-2", + + path: "TestCases/chapter13/13.0/13.0-2.js", + + description: "13.0 - multiple names in one function declaration is not allowed, three function names", + + test: function testcase() { + try { + eval("function x,y,z(){}"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + precondition: function prereq() { + return true; + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.0/13.0-3.js b/test/suite/ietestcenter/chapter13/13.0/13.0-3.js new file mode 100644 index 0000000000000000000000000000000000000000..c327e664f2b36520d1b207c52d472c442eccb4e9 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.0/13.0-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: "13.0-3", + + path: "TestCases/chapter13/13.0/13.0-3.js", + + description: "13.0 - property names in function definition is not allowed, add a new property into object", + + test: function testcase() { + var obj = {}; + try { + eval("function obj.tt() {};"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + precondition: function prereq() { + return true; + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.0/13.0-4.js b/test/suite/ietestcenter/chapter13/13.0/13.0-4.js new file mode 100644 index 0000000000000000000000000000000000000000..54aac5938701e467bfc5d6ff71e7548a263ed290 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.0/13.0-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: "13.0-4", + + path: "TestCases/chapter13/13.0/13.0-4.js", + + description: "13.0 - multiple names in one function declaration is not allowed, add a new property into a property which is a object", + + test: function testcase() { + var obj = {}; + obj.tt = { len: 10 }; + try { + eval("function obj.tt.ss() {};"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + precondition: function prereq() { + return true; + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.0/13.0-7-s.js b/test/suite/ietestcenter/chapter13/13.0/13.0-7-s.js new file mode 100644 index 0000000000000000000000000000000000000000..14f23167893a67258559e8b233876ba3be958402 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.0/13.0-7-s.js @@ -0,0 +1,49 @@ +/// 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. + +/* +Refer 13; +The production FunctionBody : SourceElementsopt is evaluated as follows: +*/ + +ES5Harness.registerTest({ + id: "13.0-7-s", + + path: "TestCases/chapter13/13.0/13.0-7-s.js", + + description: "Strict Mode - SourceElements is evaluated as strict mode code when the code of this FunctionDeclaration is contained in non-strict mode but the call to eval is a direct call in strict mode code", + + test: function testcase() { + + try { + eval("'use strict'; function _13_0_7_fun() {eval = 42;};"); + _13_0_7_fun(); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.0/13.0-8-s.js b/test/suite/ietestcenter/chapter13/13.0/13.0-8-s.js new file mode 100644 index 0000000000000000000000000000000000000000..32f48b85f3aa34ce6cae66fc2641c5c6a8402d8c --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.0/13.0-8-s.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. + +/* +Refer 13; +The production FunctionBody : SourceElementsopt is evaluated as follows: +*/ + +ES5Harness.registerTest({ + id: "13.0-8-s", + + path: "TestCases/chapter13/13.0/13.0-8-s.js", + + description: "Strict Mode - SourceElements is evaluated as strict mode code when the code of this FunctionExpression is contained in non-strict mode but the call to eval is a direct call in strict mode code", + + test: function testcase() { + "use strict"; + + try { + eval("var _13_0_8_fun = function () {eval = 42;};"); + _13_0_8_fun(); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.0/13.0-9-s.js b/test/suite/ietestcenter/chapter13/13.0/13.0-9-s.js new file mode 100644 index 0000000000000000000000000000000000000000..8ad46c8ac6587e521903f15e181e00529a98ef0a --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.0/13.0-9-s.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. + +/* +Refer 13; +The production FunctionBody : SourceElementsopt is evaluated as follows: +*/ + +ES5Harness.registerTest({ + id: "13.0-9-s", + + path: "TestCases/chapter13/13.0/13.0-9-s.js", + + description: "Strict Mode - SourceElements is evaluated as strict mode code when a FunctionDeclaration that is contained in strict mode code has an inner function", + + test: function testcase() { + "use strict"; + + var _13_0_9_fun = function () { + function _13_0_9_inner() { eval("eval = 42;"); } + _13_0_9_inner(); + }; + try { + _13_0_9_fun(); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-1-1.js b/test/suite/ietestcenter/chapter13/13.1/13.1-1-1.js new file mode 100644 index 0000000000000000000000000000000000000000..4e30988288a5660e1bced74dab15f8bb3b897dbd --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-1-1.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: "13.1-1-1", + +path: "TestCases/chapter13/13.1/13.1-1-1.js", + +description: "Duplicate identifier allowed in non-strict function declaration parameter list", + +test: function testcase() +{ + try + { + eval('function foo(a,a){}'); + return true; + } + catch (e) { return false } + } +}); diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-1-2.js b/test/suite/ietestcenter/chapter13/13.1/13.1-1-2.js new file mode 100644 index 0000000000000000000000000000000000000000..f83c65b46d3adb153fe34a6d79a15b389f26ab44 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-1-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: "13.1-1-2", + +path: "TestCases/chapter13/13.1/13.1-1-2.js", + +description: "Duplicate identifier allowed in non-strict function expression parameter list", + +test: function testcase() +{ + try + { + eval('(function foo(a,a){})'); + return true; + } + catch (e) { return false } + } +}); diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-1-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-1-s.js new file mode 100644 index 0000000000000000000000000000000000000000..e924402a647101a90663225a5ce5be33d5a2a556 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-1-s.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. + +/* +Refer 13.1; +It is a SyntaxError if the Identifier "eval" or the Identifier "arguments" occurs within a FormalParameterList +of a strict mode FunctionDeclaration or FunctionExpression. +*/ + +ES5Harness.registerTest({ + id: "13.1-1-s", + + path: "TestCases/chapter13/13.1/13.1-1-s.js", + + description: "Strict Mode - SyntaxError is thrown if the identifier 'eval' appears within a FormalParameterList of a strict mode FunctionDeclaration", + + test: function testcase() { + "use strict"; + + try { + eval("function _13_1_1_fun(eval) { }"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-10-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-10-s.js new file mode 100644 index 0000000000000000000000000000000000000000..45ab396bebf00c39e566d91fec9543e39124438f --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-10-s.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. + +/* +Refer 13.1; +It is a SyntaxError if any Identifier value occurs more than once within a FormalParameterList of a strict mode +FunctionDeclaration or FunctionExpression. +*/ + +ES5Harness.registerTest({ + id: "13.1-10-s", + + path: "TestCases/chapter13/13.1/13.1-10-s.js", + + description: "Strict Mode - SyntaxError is thrown if a function is created in 'strict mode' using a FunctionExpression and the function has three identical parameters", + + test: function testcase() { + "use strict"; + + try { + eval("var _13_1_10_fun = function (param, param, param) { };") + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-11-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-11-s.js new file mode 100644 index 0000000000000000000000000000000000000000..12827e70819132e68c79515002ad0b58ff0f1950 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-11-s.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: "13.1-11-s", + + path: "TestCases/chapter13/13.1/13.1-11-s.js", + + description: "StrictMode - SyntaxError is thrown if 'eval' occurs as the function name of a FunctionDeclaration in strict mode", + + test: function testcase() { + "use strict"; + try { + eval("function eval() { };") + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-12-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-12-s.js new file mode 100644 index 0000000000000000000000000000000000000000..f992c4319b857af1342c07d370f67031b72bcbdc --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-12-s.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: "13.1-12-s", + + path: "TestCases/chapter13/13.1/13.1-12-s.js", + + description: "StrictMode - SyntaxError is thrown if 'eval' occurs as the Identifier of a FunctionExpression in strict mode", + + test: function testcase() { + "use strict"; + var _13_1_12_s = {}; + + try { + eval("_13_1_12_s.x = function eval() {};"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-13-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-13-s.js new file mode 100644 index 0000000000000000000000000000000000000000..8c116f00ffc05891ef4e5a4f14f4c22a658399e0 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-13-s.js @@ -0,0 +1,44 @@ +/// 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: "13.1-13-s", + + path: "TestCases/chapter13/13.1/13.1-13-s.js", + + description: "StrictMode - SyntaxError is thrown if 'arguments' occurs as the function name of a FunctionDeclaration in strict mode", + + test: function testcase() { + "use strict"; + + try { + eval("function arguments() { };") + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-14-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-14-s.js new file mode 100644 index 0000000000000000000000000000000000000000..4a884377880eba6eaac0428827a6cd7c817e32f7 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-14-s.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: "13.1-14-s", + + path: "TestCases/chapter13/13.1/13.1-14-s.js", + + description: "StrictMode - SyntaxError is thrown if 'arguments' occurs as the Identifier of a FunctionExpression in strict mode", + + test: function testcase() { + "use strict"; + var _13_1_14_s = {}; + + try { + eval("_13_1_14_s.x = function arguments() {};"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-15-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-15-s.js new file mode 100644 index 0000000000000000000000000000000000000000..93458785622afc3327225dad36da18ebb26cc018 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-15-s.js @@ -0,0 +1,49 @@ +/// 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. + +/* +Refer 13.1; +It is a SyntaxError if the Identifier "eval" or the Identifier "arguments" occurs within a FormalParameterList +of a strict mode FunctionDeclaration or FunctionExpression. +*/ + +ES5Harness.registerTest({ + id: "13.1-15-s", + + path: "TestCases/chapter13/13.1/13.1-15-s.js", + + description: "Strict Mode - SyntaxError is thrown if the identifier 'eval' appears within a FormalParameterList of a strict mode FunctionDeclaration in strict eval code", + + test: function testcase() { + + try { + eval("'use strict';function _13_1_15_fun(eval) { }"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-16-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-16-s.js new file mode 100644 index 0000000000000000000000000000000000000000..c4b5e59ac8e7313381908f02c8c4a2f9499a54ea --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-16-s.js @@ -0,0 +1,49 @@ +/// 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. + +/* +Refer 13.1; +It is a SyntaxError if the Identifier "eval" or the Identifier "arguments" occurs within a FormalParameterList +of a strict mode FunctionDeclaration or FunctionExpression. +*/ + +ES5Harness.registerTest({ + id: "13.1-16-s", + + path: "TestCases/chapter13/13.1/13.1-16-s.js", + + description: "StrictMode - SyntaxError is thrown if the identifier 'eval' appears within a FormalParameterList of a strict mode FunctionDeclaration when FuctionBody is strict code", + + test: function testcase() { + + try { + eval("function _13_1_16_fun(eval) { 'use strict'; }"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-17-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-17-s.js new file mode 100644 index 0000000000000000000000000000000000000000..fc9d0b69f2564aef01f3669c22b74f94194cdf15 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-17-s.js @@ -0,0 +1,49 @@ +/// 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. + +/* +Refer 13.1; +It is a SyntaxError if the Identifier "eval" or the Identifier "arguments" occurs within a FormalParameterList +of a strict mode FunctionDeclaration or FunctionExpression. +*/ + +ES5Harness.registerTest({ + id: "13.1-17-s", + + path: "TestCases/chapter13/13.1/13.1-17-s.js", + + description: "StrictMode - SyntaxError is thrown if the identifier 'eval' appears within a FormalParameterList of a strict mode FunctionExpression in strict eval code", + + test: function testcase() { + + try { + eval("'use strict'; var _13_1_17_fun = function (eval) { }"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-18-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-18-s.js new file mode 100644 index 0000000000000000000000000000000000000000..fac3888b28c3c6c653a5ce5840c06a7ff734eb7b --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-18-s.js @@ -0,0 +1,49 @@ +/// 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. + +/* +Refer 13.1; +It is a SyntaxError if the Identifier "eval" or the Identifier "arguments" occurs within a FormalParameterList +of a strict mode FunctionDeclaration or FunctionExpression. +*/ + +ES5Harness.registerTest({ + id: "13.1-18-s", + + path: "TestCases/chapter13/13.1/13.1-18-s.js", + + description: "StrictMode - SyntaxError is thrown if the identifier 'eval' appears within a FormalParameterList of a strict mode FunctionExpression when FuctionBody is strict code", + + test: function testcase() { + + try { + eval("var _13_1_18_fun = function (eval) { 'use strict'; }"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-19-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-19-s.js new file mode 100644 index 0000000000000000000000000000000000000000..d1cdf2f8f7664650dc12de945db8bd8ab727c14f --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-19-s.js @@ -0,0 +1,49 @@ +/// 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. + +/* +Refer 13.1; +It is a SyntaxError if the Identifier "eval" or the Identifier "arguments" occurs within a FormalParameterList +of a strict mode FunctionDeclaration or FunctionExpression. +*/ + +ES5Harness.registerTest({ + id: "13.1-19-s", + + path: "TestCases/chapter13/13.1/13.1-19-s.js", + + description: "Strict Mode - SyntaxError is thrown if the identifier 'arguments' appears within a FormalParameterList of a strict mode FunctionDeclaration in strict eval code", + + test: function testcase() { + + try { + eval("'use strict';function _13_1_19_fun(arguments) { }"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-2-1.js b/test/suite/ietestcenter/chapter13/13.1/13.1-2-1.js new file mode 100644 index 0000000000000000000000000000000000000000..aeedc030a25808ded24afa0d1c4eca3f7d4b389f --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-2-1.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: "13.1-2-1", + +path: "TestCases/chapter13/13.1/13.1-2-1.js", + +description: "eval allowed as formal parameter name of a non-strict function declaration", + +test: function testcase() +{ + try + { + eval("function foo(eval){};"); + return true; + } + catch (e) { } + } +}); diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-2-2.js b/test/suite/ietestcenter/chapter13/13.1/13.1-2-2.js new file mode 100644 index 0000000000000000000000000000000000000000..127526bac1e0dd96ed031bd868d1cc75ba0b4d34 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-2-2.js @@ -0,0 +1,34 @@ +/// 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: "13.1-2-2", + +path: "TestCases/chapter13/13.1/13.1-2-2.js", + +description: "eval allowed as formal parameter name of a non-strict function expression", + +test: function testcase() +{ + eval("(function foo(eval){});"); + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-2-5.js b/test/suite/ietestcenter/chapter13/13.1/13.1-2-5.js new file mode 100644 index 0000000000000000000000000000000000000000..005d8384b0b9bcc0b7deeed784118a91e892719a --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-2-5.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: "13.1-2-5", + +path: "TestCases/chapter13/13.1/13.1-2-5.js", + +description: "arguments allowed as formal parameter name of a non-strict function declaration", + +test: function testcase() +{ + try + { + eval("function foo(arguments){};"); + return true; + } + catch (e) { } + } +}); diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-2-6.js b/test/suite/ietestcenter/chapter13/13.1/13.1-2-6.js new file mode 100644 index 0000000000000000000000000000000000000000..292a78032f2470973eff945d7a95db36c5162668 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-2-6.js @@ -0,0 +1,34 @@ +/// 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: "13.1-2-6", + +path: "TestCases/chapter13/13.1/13.1-2-6.js", + +description: "arguments allowed as formal parameter name of a non-strict function expression", + +test: function testcase() +{ + eval("(function foo(arguments){});"); + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-2-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-2-s.js new file mode 100644 index 0000000000000000000000000000000000000000..851720d7db75b2125ce802936e5a0c6420d77c80 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-2-s.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. + +/* +Refer 13.1; +It is a SyntaxError if the Identifier "eval" or the Identifier "arguments" occurs within a FormalParameterList +of a strict mode FunctionDeclaration or FunctionExpression. +*/ + +ES5Harness.registerTest({ + id: "13.1-2-s", + + path: "TestCases/chapter13/13.1/13.1-2-s.js", + + description: "Strict Mode - SyntaxError is thrown if the identifier 'eval' appears within a FormalParameterList of a strict mode FunctionExpression", + + test: function testcase() { + "use strict"; + + try { + eval("var _13_1_2_fun = function (eval) { }"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-20-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-20-s.js new file mode 100644 index 0000000000000000000000000000000000000000..d1fbf24d824b781ff6d2ac970fa1570fcd234949 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-20-s.js @@ -0,0 +1,49 @@ +/// 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. + +/* +Refer 13.1; +It is a SyntaxError if the Identifier "eval" or the Identifier "arguments" occurs within a FormalParameterList +of a strict mode FunctionDeclaration or FunctionExpression. +*/ + +ES5Harness.registerTest({ + id: "13.1-20-s", + + path: "TestCases/chapter13/13.1/13.1-20-s.js", + + description: "StrictMode - SyntaxError is thrown if the identifier 'arguments' appears within a FormalParameterList of a strict mode FunctionDeclaration when FuctionBody is strict code", + + test: function testcase() { + + try { + eval("function _13_1_20_fun(arguments) { 'use strict'; }"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-21-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-21-s.js new file mode 100644 index 0000000000000000000000000000000000000000..851d5bcb366639f696eaf71c96dc97cce6ad1ebe --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-21-s.js @@ -0,0 +1,49 @@ +/// 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. + +/* +Refer 13.1; +It is a SyntaxError if the Identifier "eval" or the Identifier "arguments" occurs within a FormalParameterList +of a strict mode FunctionDeclaration or FunctionExpression. +*/ + +ES5Harness.registerTest({ + id: "13.1-21-s", + + path: "TestCases/chapter13/13.1/13.1-21-s.js", + + description: "StrictMode - SyntaxError is thrown if the identifier 'arguments' appears within a FormalParameterList of a strict mode FunctionExpression in strict eval code", + + test: function testcase() { + + try { + eval("'use strict'; var _13_1_21_fun = function (arguments) { }"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-22-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-22-s.js new file mode 100644 index 0000000000000000000000000000000000000000..b38c1a0e8218afa9b0b174a1d36dff2c97d3a665 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-22-s.js @@ -0,0 +1,49 @@ +/// 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. + +/* +Refer 13.1; +It is a SyntaxError if the Identifier "eval" or the Identifier "arguments" occurs within a FormalParameterList +of a strict mode FunctionDeclaration or FunctionExpression. +*/ + +ES5Harness.registerTest({ + id: "13.1-22-s", + + path: "TestCases/chapter13/13.1/13.1-22-s.js", + + description: "StrictMode - SyntaxError is thrown if the identifier 'arguments' appears within a FormalParameterList of a strict mode FunctionExpression when FuctionBody is strict code", + + test: function testcase() { + + try { + eval("var _13_1_22_fun = function (arguments) { 'use strict'; }"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-23-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-23-s.js new file mode 100644 index 0000000000000000000000000000000000000000..3b6f4445d97620649479412c3a43fe780daf1790 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-23-s.js @@ -0,0 +1,49 @@ +/// 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. + +/* +Refer 13.1; +It is a SyntaxError if any Identifier value occurs more than once within a FormalParameterList of a strict mode +FunctionDeclaration or FunctionExpression. +*/ + +ES5Harness.registerTest({ + id: "13.1-23-s", + + path: "TestCases/chapter13/13.1/13.1-23-s.js", + + description: "Strict Mode - SyntaxError is thrown if a function is created using a FunctionDeclaration that is contained in eval strict code and the function has two identical parameters", + + test: function testcase() { + + try { + eval("'use strict'; function _13_1_23_fun(param, param) { }"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-24-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-24-s.js new file mode 100644 index 0000000000000000000000000000000000000000..6bfb3115af4fcdaeff3671e2ef85e8a797606fcd --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-24-s.js @@ -0,0 +1,49 @@ +/// 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. + +/* +Refer 13.1; +It is a SyntaxError if any Identifier value occurs more than once within a FormalParameterList of a strict mode +FunctionDeclaration or FunctionExpression. +*/ + +ES5Harness.registerTest({ + id: "13.1-24-s", + + path: "TestCases/chapter13/13.1/13.1-24-s.js", + + description: "Strict Mode - SyntaxError is thrown if a function is created using a FunctionDeclaration whose FunctionBody is contained in strict code and the function has two identical parameters", + + test: function testcase() { + + try { + eval("function _13_1_24_fun(param, param) { 'use strict'; }"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-25-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-25-s.js new file mode 100644 index 0000000000000000000000000000000000000000..31f82c5c59d709019912f84cf18a79a3db1a2c7c --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-25-s.js @@ -0,0 +1,49 @@ +/// 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. + +/* +Refer 13.1; +It is a SyntaxError if any Identifier value occurs more than once within a FormalParameterList of a strict mode +FunctionDeclaration or FunctionExpression. +*/ + +ES5Harness.registerTest({ + id: "13.1-25-s", + + path: "TestCases/chapter13/13.1/13.1-25-s.js", + + description: "Strict Mode - SyntaxError is thrown if a function is created using a FunctionDeclaration that is contained in eval strict code and the function has two identical parameters which are separated by a unique parameter name", + + test: function testcase() { + + try { + eval("'use strict'; function _13_1_25_fun(param1, param2, param1) { }"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-26-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-26-s.js new file mode 100644 index 0000000000000000000000000000000000000000..bd092d8e0c6e28379d58032447f61f7621c2702e --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-26-s.js @@ -0,0 +1,49 @@ +/// 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. + +/* +Refer 13.1; +It is a SyntaxError if any Identifier value occurs more than once within a FormalParameterList of a strict mode +FunctionDeclaration or FunctionExpression. +*/ + +ES5Harness.registerTest({ + id: "13.1-26-s", + + path: "TestCases/chapter13/13.1/13.1-26-s.js", + + description: "Strict Mode - SyntaxError is thrown if a function is created using a FunctionDeclaration whose FunctionBody is contained in strict code and the function has two identical parameters which are separated by a unique parameter name", + + test: function testcase() { + + try { + eval("function _13_1_26_fun(param1, param2, param1) { 'use strict'; }"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-27-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-27-s.js new file mode 100644 index 0000000000000000000000000000000000000000..0fbfc25b43238ef1c90ff6c1f59a506377ebaebd --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-27-s.js @@ -0,0 +1,49 @@ +/// 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. + +/* +Refer 13.1; +It is a SyntaxError if any Identifier value occurs more than once within a FormalParameterList of a strict mode +FunctionDeclaration or FunctionExpression. +*/ + +ES5Harness.registerTest({ + id: "13.1-27-s", + + path: "TestCases/chapter13/13.1/13.1-27-s.js", + + description: "Strict Mode - SyntaxError is thrown if a function is created using a FunctionDeclaration that is contained in eval strict code and the function has three identical parameters", + + test: function testcase() { + + try { + eval("'use strict'; function _13_1_27_fun(param, param, param) { }"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-28-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-28-s.js new file mode 100644 index 0000000000000000000000000000000000000000..ffe9b1418e0d00d7f6a717e8b9958d1ebc351eeb --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-28-s.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. + +/* +Refer 13.1; +It is a SyntaxError if any Identifier value occurs more than once within a FormalParameterList of a strict mode +FunctionDeclaration or FunctionExpression. +*/ + +ES5Harness.registerTest({ + id: "13.1-28-s", + + path: "TestCases/chapter13/13.1/13.1-28-s.js", + + description: "Strict Mode - SyntaxError is thrown if a function is created using a FunctionDeclaration whose FunctionBody is contained in strict code and the function has three identical parameters", + + test: function testcase() { + + + try { + eval("function _13_1_28_fun(param, param, param) { 'use strict'; }"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-29-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-29-s.js new file mode 100644 index 0000000000000000000000000000000000000000..2eb7e33dabdba62c68e1f86caf9c25a365735818 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-29-s.js @@ -0,0 +1,49 @@ +/// 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. + +/* +Refer 13.1; +It is a SyntaxError if any Identifier value occurs more than once within a FormalParameterList of a strict mode +FunctionDeclaration or FunctionExpression. +*/ + +ES5Harness.registerTest({ + id: "13.1-29-s", + + path: "TestCases/chapter13/13.1/13.1-29-s.js", + + description: "Strict Mode - SyntaxError is thrown if a function is created using a FunctionExpression that is contained in eval strict code and the function has two identical parameters", + + test: function testcase() { + + try { + eval("'use strict'; var _13_1_29_fun = function (param, param) { };"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-3-1.js b/test/suite/ietestcenter/chapter13/13.1/13.1-3-1.js new file mode 100644 index 0000000000000000000000000000000000000000..d9aebdacf0f6ea797f54446f09f4ad938ca325e4 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-3-1.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: "13.1-3-1", + +path: "TestCases/chapter13/13.1/13.1-3-1.js", + +description: "eval allowed as function identifier in non-strict function declaration", + +test: function testcase() +{ + try + { + eval("function eval(){};"); + return true; + } + catch (e) { } + } +}); diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-3-2.js b/test/suite/ietestcenter/chapter13/13.1/13.1-3-2.js new file mode 100644 index 0000000000000000000000000000000000000000..368317610c37586c44abef94299f7fe2b5a15121 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-3-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: "13.1-3-2", + +path: "TestCases/chapter13/13.1/13.1-3-2.js", + +description: "eval allowed as function identifier in non-strict function expression", + +test: function testcase() +{ + try + { + eval("(function eval(){});"); + return true; + } + catch (e) { } + } +}); diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-3-7.js b/test/suite/ietestcenter/chapter13/13.1/13.1-3-7.js new file mode 100644 index 0000000000000000000000000000000000000000..3f0754ea00e7e444dae82c777bf61020d1487df0 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-3-7.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: "13.1-3-7", + +path: "TestCases/chapter13/13.1/13.1-3-7.js", + +description: "arguments allowed as function identifier in non-strict function declaration", + +test: function testcase() +{ + try + { + eval("function arguments (){};"); + return true; + } + catch (e) { } + } +}); diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-3-8.js b/test/suite/ietestcenter/chapter13/13.1/13.1-3-8.js new file mode 100644 index 0000000000000000000000000000000000000000..2940cdb826c212575d90160ea3bd1a92c2789a09 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-3-8.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: "13.1-3-8", + +path: "TestCases/chapter13/13.1/13.1-3-8.js", + +description: "arguments allowed as function identifier in non-strict function expression", + +test: function testcase() +{ + try + { + eval("(function arguments (){});"); + return true; + } + catch (e) { } + } +}); diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-3-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-3-s.js new file mode 100644 index 0000000000000000000000000000000000000000..e828891dc45fd9d10038786826a37881e511bca2 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-3-s.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. + +/* +Refer 13.1; +It is a SyntaxError if the Identifier "eval" or the Identifier "arguments" occurs within a FormalParameterList +of a strict mode FunctionDeclaration or FunctionExpression. +*/ + +ES5Harness.registerTest({ + id: "13.1-3-s", + + path: "TestCases/chapter13/13.1/13.1-3-s.js", + + description: "Strict Mode - SyntaxError is thrown if the identifier 'arguments' appears within a FormalParameterList of a strict mode FunctionDeclaration", + + test: function testcase() { + "use strict"; + + try { + eval("function _13_1_3_fun(arguments) { }"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-30-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-30-s.js new file mode 100644 index 0000000000000000000000000000000000000000..18a6e4c908cd10564663edbaa2d78a45f24183b0 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-30-s.js @@ -0,0 +1,49 @@ +/// 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. + +/* +Refer 13.1; +It is a SyntaxError if any Identifier value occurs more than once within a FormalParameterList of a strict mode +FunctionDeclaration or FunctionExpression. +*/ + +ES5Harness.registerTest({ + id: "13.1-30-s", + + path: "TestCases/chapter13/13.1/13.1-30-s.js", + + description: "Strict Mode - SyntaxError is thrown if a function is created using a FunctionExpression whose FunctionBody is contained in strict code and the function has two identical parameters", + + test: function testcase() { + + try { + eval("var _13_1_30_fun = function (param, param) { 'use strict'; };"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-31-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-31-s.js new file mode 100644 index 0000000000000000000000000000000000000000..784784e6a89b5c9dea38d706d07fdd30cdc507bb --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-31-s.js @@ -0,0 +1,49 @@ +/// 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. + +/* +Refer 13.1; +It is a SyntaxError if any Identifier value occurs more than once within a FormalParameterList of a strict mode +FunctionDeclaration or FunctionExpression. +*/ + +ES5Harness.registerTest({ + id: "13.1-31-s", + + path: "TestCases/chapter13/13.1/13.1-31-s.js", + + description: "Strict Mode - SyntaxError is thrown if a function is created using a FunctionExpression that is contained in eval strict code and the function has two identical parameters, which are separated by a unique parameter name", + + test: function testcase() { + + try { + eval("'use strict'; var _13_1_31_fun = function (param1, param2, param1) { };"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-32-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-32-s.js new file mode 100644 index 0000000000000000000000000000000000000000..b189bd86577bbc403134e11510668adde1b147d4 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-32-s.js @@ -0,0 +1,49 @@ +/// 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. + +/* +Refer 13.1; +It is a SyntaxError if any Identifier value occurs more than once within a FormalParameterList of a strict mode +FunctionDeclaration or FunctionExpression. +*/ + +ES5Harness.registerTest({ + id: "13.1-32-s", + + path: "TestCases/chapter13/13.1/13.1-32-s.js", + + description: "Strict Mode - SyntaxError is thrown if a function is created using a FunctionExpression whose FunctionBody is strict and the function has two identical parameters, which are separated by a unique parameter name", + + test: function testcase() { + + try { + eval("var _13_1_32_fun = function (param1, param2, param1) { 'use strict'; };"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-33-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-33-s.js new file mode 100644 index 0000000000000000000000000000000000000000..e27291b209a87563039f43131390ae708d6d273a --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-33-s.js @@ -0,0 +1,49 @@ +/// 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. + +/* +Refer 13.1; +It is a SyntaxError if any Identifier value occurs more than once within a FormalParameterList of a strict mode +FunctionDeclaration or FunctionExpression. +*/ + +ES5Harness.registerTest({ + id: "13.1-33-s", + + path: "TestCases/chapter13/13.1/13.1-33-s.js", + + description: "Strict Mode - SyntaxError is thrown if function is created using a FunctionExpression that is contained in eval strict code and the function has three identical parameters", + + test: function testcase() { + + try { + eval("'use strict'; var _13_1_33_fun = function (param, param, param) { };") + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-34-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-34-s.js new file mode 100644 index 0000000000000000000000000000000000000000..1d59ee479752f9f613bae50aaebd675a746c5525 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-34-s.js @@ -0,0 +1,49 @@ +/// 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. + +/* +Refer 13.1; +It is a SyntaxError if any Identifier value occurs more than once within a FormalParameterList of a strict mode +FunctionDeclaration or FunctionExpression. +*/ + +ES5Harness.registerTest({ + id: "13.1-34-s", + + path: "TestCases/chapter13/13.1/13.1-34-s.js", + + description: "Strict Mode - SyntaxError is thrown if a function declaration has three identical parameters with a strict mode body", + + test: function testcase() { + + try { + eval("var _13_1_34_fun = function (param, param, param) { 'use strict'; };") + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-35-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-35-s.js new file mode 100644 index 0000000000000000000000000000000000000000..119297abb5a8e1c743f72a57709f5c6b159ce09e --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-35-s.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: "13.1-35-s", + + path: "TestCases/chapter13/13.1/13.1-35-s.js", + + description: "StrictMode - SyntaxError is thrown if 'eval' occurs as the function name of a FunctionDeclaration in strict eval code", + + test: function testcase() { + + try { + eval("'use strict'; function eval() { };") + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-36-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-36-s.js new file mode 100644 index 0000000000000000000000000000000000000000..3bd19c17fb908a817f84618775ba5e6461e6d948 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-36-s.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: "13.1-36-s", + + path: "TestCases/chapter13/13.1/13.1-36-s.js", + + description: "StrictMode - SyntaxError is thrown if 'eval' occurs as the function name of a FunctionDeclaration whose FunctionBody is in strict mode", + + test: function testcase() { + + try { + eval("function eval() { 'use strict'; };") + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-37-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-37-s.js new file mode 100644 index 0000000000000000000000000000000000000000..5d74adc0b04e425ad0e8509bf1188cb415a5221f --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-37-s.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: "13.1-37-s", + + path: "TestCases/chapter13/13.1/13.1-37-s.js", + + description: "StrictMode - SyntaxError is thrown if 'eval' occurs as the Identifier of a FunctionExpression in strict eval code", + + test: function testcase() { + var _13_1_37_s = {}; + try { + eval("'use strict'; _13_1_37_s.x = function eval() {};"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-38-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-38-s.js new file mode 100644 index 0000000000000000000000000000000000000000..a60de745e9c34d830928d67085bdb5fbb66e81e9 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-38-s.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: "13.1-38-s", + + path: "TestCases/chapter13/13.1/13.1-38-s.js", + + description: "StrictMode - SyntaxError is thrown if 'eval' occurs as the Identifier of a FunctionExpression whose FunctionBody is contained in strict code", + + test: function testcase() { + var _13_1_38_s = {}; + try { + eval("_13_1_38_s.x = function eval() {'use strict'; };"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-39-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-39-s.js new file mode 100644 index 0000000000000000000000000000000000000000..bb4e2cf0401e1f6b32576b7a2ac97ac1b53ad7f4 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-39-s.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: "13.1-39-s", + + path: "TestCases/chapter13/13.1/13.1-39-s.js", + + description: "StrictMode - SyntaxError is thrown if 'arguments' occurs as the function name of a FunctionDeclaration in strict eval code", + + test: function testcase() { + + try { + eval("'use strict'; function arguments() { };") + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-4-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-4-s.js new file mode 100644 index 0000000000000000000000000000000000000000..ac6b92bf3e6692115ef67de8dc4edb6163bfb2f8 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-4-s.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. + +/* +Refer 13.1; +It is a SyntaxError if the Identifier "eval" or the Identifier "arguments" occurs within a FormalParameterList +of a strict mode FunctionDeclaration or FunctionExpression. +*/ + +ES5Harness.registerTest({ + id: "13.1-4-s", + + path: "TestCases/chapter13/13.1/13.1-4-s.js", + + description: "Strict Mode - SyntaxError is thrown if the identifier 'arguments' appears within a FormalParameterList of a strict mode FunctionExpression", + + test: function testcase() { + "use strict"; + + try { + eval("var _13_1_4_fun = function (arguments) { };"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-40-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-40-s.js new file mode 100644 index 0000000000000000000000000000000000000000..b0424361748792d078a5d0f9337dabf94db8d961 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-40-s.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: "13.1-40-s", + + path: "TestCases/chapter13/13.1/13.1-40-s.js", + + description: "StrictMode - SyntaxError is thrown if 'arguments' occurs as the Identifier of a FunctionDeclaration whose FunctionBody is contained in strict code", + + test: function testcase() { + + try { + eval("function arguments() { 'use strict'; };") + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-41-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-41-s.js new file mode 100644 index 0000000000000000000000000000000000000000..ba7ebdd80f34202e1e4d791a153bbf7a199cd683 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-41-s.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: "13.1-41-s", + + path: "TestCases/chapter13/13.1/13.1-41-s.js", + + description: "StrictMode - SyntaxError is thrown if 'arguments' occurs as the Identifier of a FunctionExpression in strict eval code", + + test: function testcase() { + var _13_1_41_s = {}; + try { + eval("'use strict'; _13_1_41_s.x = function arguments() {};"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-42-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-42-s.js new file mode 100644 index 0000000000000000000000000000000000000000..edc0375305921023ec5ddae160bda17132dfeeb2 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-42-s.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: "13.1-42-s", + + path: "TestCases/chapter13/13.1/13.1-42-s.js", + + description: "StrictMode - SyntaxError is thrown if 'arguments' occurs as the Identifier of a FunctionExpression whose FunctionBody is contained in strict code", + + test: function testcase() { + var _13_1_42_s = {}; + try { + eval("_13_1_42_s.x = function arguments() {'use strict';};"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-5-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-5-s.js new file mode 100644 index 0000000000000000000000000000000000000000..3ba4999f6e0ba8d5b77ec22990a9efc0f0b2b106 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-5-s.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. + +/* +Refer 13.1; +It is a SyntaxError if any Identifier value occurs more than once within a FormalParameterList of a strict mode +FunctionDeclaration or FunctionExpression. +*/ + +ES5Harness.registerTest({ + id: "13.1-5-s", + + path: "TestCases/chapter13/13.1/13.1-5-s.js", + + description: "Strict Mode - SyntaxError is thrown if a function is declared in 'strict mode' using a FunctionDeclaration and the function has two identical parameters", + + test: function testcase() { + "use strict"; + + try { + eval("function _13_1_5_fun(param, param) { }"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-6-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-6-s.js new file mode 100644 index 0000000000000000000000000000000000000000..92011f6e243856e00b9d1c3c0a6d860ca334c2b8 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-6-s.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. + +/* +Refer 13.1; +It is a SyntaxError if any Identifier value occurs more than once within a FormalParameterList of a strict mode +FunctionDeclaration or FunctionExpression. +*/ + +ES5Harness.registerTest({ + id: "13.1-6-s", + + path: "TestCases/chapter13/13.1/13.1-6-s.js", + + description: "Strict Mode - SyntaxError is thrown if a function is created in 'strict mode' using a FunctionDeclaration and the function has two identical parameters, which are separated by a unique parameter name", + + test: function testcase() { + "use strict"; + + try { + eval("function _13_1_6_fun(param1, param2, param1) { }"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-7-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-7-s.js new file mode 100644 index 0000000000000000000000000000000000000000..b981d8748988a6ae00789d3442aaece77ec2dbb2 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-7-s.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. + +/* +Refer 13.1; +It is a SyntaxError if any Identifier value occurs more than once within a FormalParameterList of a strict mode +FunctionDeclaration or FunctionExpression. +*/ + +ES5Harness.registerTest({ + id: "13.1-7-s", + + path: "TestCases/chapter13/13.1/13.1-7-s.js", + + description: "Strict Mode - SyntaxError is thrown if a function is created in 'strict mode' using a FunctionDeclaration and the function has three identical parameters", + + test: function testcase() { + "use strict"; + + try { + eval("function _13_1_7_fun(param, param, param) { }"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-8-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-8-s.js new file mode 100644 index 0000000000000000000000000000000000000000..e250ff39d83cfec99ce1f61125f2162fc42effbf --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-8-s.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. + +/* +Refer 13.1; +It is a SyntaxError if any Identifier value occurs more than once within a FormalParameterList of a strict mode +FunctionDeclaration or FunctionExpression. +*/ + +ES5Harness.registerTest({ + id: "13.1-8-s", + + path: "TestCases/chapter13/13.1/13.1-8-s.js", + + description: "Strict Mode - SyntaxError is thrown if a function is created in 'strict mode' using a FunctionExpression and the function has two identical parameters", + + test: function testcase() { + "use strict"; + + try { + eval("var _13_1_8_fun = function (param, param) { };"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-9-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-9-s.js new file mode 100644 index 0000000000000000000000000000000000000000..a36126cfa20d55a877646be9b975bb53b52ba4cc --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-9-s.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. + +/* +Refer 13.1; +It is a SyntaxError if any Identifier value occurs more than once within a FormalParameterList of a strict mode +FunctionDeclaration or FunctionExpression. +*/ + +ES5Harness.registerTest({ + id: "13.1-9-s", + + path: "TestCases/chapter13/13.1/13.1-9-s.js", + + description: "Strict Mode - SyntaxError is thrown if a function is created in 'strict mode' using a FunctionExpression and the function has two identical parameters, which are separated by a unique parameter name", + + test: function testcase() { + "use strict"; + + try { + eval("var _13_1_9_fun = function (param1, param2, param1) { };"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.2/13.2-1-s.js b/test/suite/ietestcenter/chapter13/13.2/13.2-1-s.js new file mode 100644 index 0000000000000000000000000000000000000000..86e3f0daa20f5d99dbb640ce81d812d313b66761 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.2/13.2-1-s.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: "13.2-1-s", + + path: "TestCases/chapter13/13.2/13.2-1-s.js", + + description: "StrictMode - Writing or reading from a property named 'caller' of function objects is allowed under both strict and normal modes.", + + test: function testcase() { + "use strict"; + + var foo = function () { + this.caller = 12; + } + var obj = new foo(); + return obj.caller === 12; + }, + + strict : 1, + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter13/13.2/13.2-2-s.js b/test/suite/ietestcenter/chapter13/13.2/13.2-2-s.js new file mode 100644 index 0000000000000000000000000000000000000000..0176995d59fef613066c299c35dd2d4cd9710dc3 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.2/13.2-2-s.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: "13.2-2-s", + + path: "TestCases/chapter13/13.2/13.2-2-s.js", + + description: "StrictMode - A TypeError is thrown when a strict mode code writes to properties named 'caller' of function instances.", + + test: function testcase() { + "use strict"; + try { + var foo = function () { + } + foo.caller = 20; + return false; + } catch (ex) { + return ex instanceof TypeError; + } + }, + strict : 1, + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter13/13.2/13.2-3-s.js b/test/suite/ietestcenter/chapter13/13.2/13.2-3-s.js new file mode 100644 index 0000000000000000000000000000000000000000..6cf5cbaf82c2bb4871ab1ce15f797eefc888e3fa --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.2/13.2-3-s.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: "13.2-3-s", + + path: "TestCases/chapter13/13.2/13.2-3-s.js", + + description: "StrictMode - Writing or reading from a property named 'arguments' of function objects is allowed under both strict and normal modes.", + + test: function testcase() { + "use strict"; + + var foo = function () { + this.arguments = 12; + } + var obj = new foo(); + return obj.arguments === 12; + }, + strict : 1, + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter13/13.2/13.2-4-s.js b/test/suite/ietestcenter/chapter13/13.2/13.2-4-s.js new file mode 100644 index 0000000000000000000000000000000000000000..975a74360cd9c4adeb1b7ff16259181ad2706f22 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.2/13.2-4-s.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: "13.2-4-s", + + path: "TestCases/chapter13/13.2/13.2-4-s.js", + + description: "StrictMode - A TypeError is thrown when a code in strict mode tries to write to 'arguments' of function instances.", + + test: function testcase() { + "use strict"; + try { + var foo = function () { + } + foo.arguments = 20; + return false; + } catch (ex) { + return ex instanceof TypeError; + } + }, + strict : 1, + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter14/14.1/14.1-1-s.js b/test/suite/ietestcenter/chapter14/14.1/14.1-1-s.js new file mode 100644 index 0000000000000000000000000000000000000000..30848fc7391600e5a2d807123af12055876430a2 --- /dev/null +++ b/test/suite/ietestcenter/chapter14/14.1/14.1-1-s.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: "14.1-1-s", + +path: "TestCases/chapter14/14.1/14.1-1-s.js", + +description: "'use strict' directive - correct usage", + +test: function testcase() { + + function foo() + { + 'use strict'; + return(this === undefined); + } + + return foo.call(undefined); + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter14/14.1/14.1-10-s.js b/test/suite/ietestcenter/chapter14/14.1/14.1-10-s.js new file mode 100644 index 0000000000000000000000000000000000000000..ceb82dfb2fa87107a289c26e0576b88a185771e2 --- /dev/null +++ b/test/suite/ietestcenter/chapter14/14.1/14.1-10-s.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: "14.1-10-s", + +path: "TestCases/chapter14/14.1/14.1-10-s.js", + +description: "other directives - may follow 'use strict' directive ", + +test: function testcase() { + + function foo() + { + "use strict"; + "bogus directive"; + return (this === undefined); + } + + return foo.call(undefined); + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter14/14.1/14.1-11-s.js b/test/suite/ietestcenter/chapter14/14.1/14.1-11-s.js new file mode 100644 index 0000000000000000000000000000000000000000..0d3aa7083a623ecf91a5e5f70cd1435a659eb7f4 --- /dev/null +++ b/test/suite/ietestcenter/chapter14/14.1/14.1-11-s.js @@ -0,0 +1,49 @@ +/// 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: "14.1-11-s", + +path: "TestCases/chapter14/14.1/14.1-11-s.js", + +description: "comments may preceed 'use strict' directive ", + +test: function testcase() { + + function foo() + { + // comment + /* comment */ "use strict"; + + return(this === undefined); + + } + + return foo.call(undefined); + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter14/14.1/14.1-12-s.js b/test/suite/ietestcenter/chapter14/14.1/14.1-12-s.js new file mode 100644 index 0000000000000000000000000000000000000000..62e5809ed60540d001b4d4ddb939d7dd327a17bd --- /dev/null +++ b/test/suite/ietestcenter/chapter14/14.1/14.1-12-s.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: "14.1-12-s", + +path: "TestCases/chapter14/14.1/14.1-12-s.js", + +description: "comments may follow 'use strict' directive ", + +test: function testcase() { + + function foo() + { + "use strict"; /* comment */ // comment + + return (this === undefined); + } + + return foo.call(undefined); + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter14/14.1/14.1-13-s.js b/test/suite/ietestcenter/chapter14/14.1/14.1-13-s.js new file mode 100644 index 0000000000000000000000000000000000000000..4b160e7e5a868dd9076a4f3931234e19b49f6cda --- /dev/null +++ b/test/suite/ietestcenter/chapter14/14.1/14.1-13-s.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: "14.1-13-s", + +path: "TestCases/chapter14/14.1/14.1-13-s.js", + +description: "semicolon insertion works for'use strict' directive ", + +test: function testcase() { + + function foo() + { + "use strict" + return (this === undefined); + } + + return foo.call(undefined); + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter14/14.1/14.1-14-s.js b/test/suite/ietestcenter/chapter14/14.1/14.1-14-s.js new file mode 100644 index 0000000000000000000000000000000000000000..9b14573003c10b6fe1274da7c5f8292b453e4313 --- /dev/null +++ b/test/suite/ietestcenter/chapter14/14.1/14.1-14-s.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: "14.1-14-s", + +path: "TestCases/chapter14/14.1/14.1-14-s.js", + +description: "semicolon insertion may come before 'use strict' directive ", + +test: function testcase() { + + function foo() + { + "another directive" + "use strict" ; + return (this === undefined); + } + + return foo.call(undefined); + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter14/14.1/14.1-15-s.js b/test/suite/ietestcenter/chapter14/14.1/14.1-15-s.js new file mode 100644 index 0000000000000000000000000000000000000000..c4e47ca56294e4b44550af99769de20d445fe47a --- /dev/null +++ b/test/suite/ietestcenter/chapter14/14.1/14.1-15-s.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: "14.1-15-s", + +path: "TestCases/chapter14/14.1/14.1-15-s.js", + +description: "blank lines may come before 'use strict' directive ", + +test: function testcase() { + + function foo() + { + + + + + + + "use strict" ; + return (this === undefined); + } + + return foo.call(undefined); + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter14/14.1/14.1-16-s.js b/test/suite/ietestcenter/chapter14/14.1/14.1-16-s.js new file mode 100644 index 0000000000000000000000000000000000000000..05d50056a730e60ffd58a2208a9bba8767d6fc47 --- /dev/null +++ b/test/suite/ietestcenter/chapter14/14.1/14.1-16-s.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: "14.1-16-s", + +path: "TestCases/chapter14/14.1/14.1-16-s.js", + +description: "'use strict' directive - not recognized if it follow an empty statement", + +test: function testcase() { + + function foo() + { + ; 'use strict'; + return (this !== undefined); + } + + return foo.call(undefined); + }, + +strict:1, + +precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter14/14.1/14.1-17-s.js b/test/suite/ietestcenter/chapter14/14.1/14.1-17-s.js new file mode 100644 index 0000000000000000000000000000000000000000..e924e42a3e06d9cd54c69aaf231230f4d6d318e0 --- /dev/null +++ b/test/suite/ietestcenter/chapter14/14.1/14.1-17-s.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: "14.1-17-s", + +path: "TestCases/chapter14/14.1/14.1-17-s.js", + +description: "'use strict' directive - not recognized if it follow some other statment empty statement", + +test: function testcase() { + + function foo() + { + var x; + 'use strict'; + return (this !== undefined); + } + + return foo.call(undefined); + }, + +strict:1, + +precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter14/14.1/14.1-2-s.js b/test/suite/ietestcenter/chapter14/14.1/14.1-2-s.js new file mode 100644 index 0000000000000000000000000000000000000000..4b223c898277ff44eac5440b1e758105f69ec455 --- /dev/null +++ b/test/suite/ietestcenter/chapter14/14.1/14.1-2-s.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: "14.1-2-s", + +path: "TestCases/chapter14/14.1/14.1-2-s.js", + +description: '"use strict" directive - correct usage double quotes', + +test: function testcase() { + + function foo() + { + "use strict"; + return (this === undefined); + } + + return foo.call(undefined); + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter14/14.1/14.1-3-s.js b/test/suite/ietestcenter/chapter14/14.1/14.1-3-s.js new file mode 100644 index 0000000000000000000000000000000000000000..b2152b8ccf73cc4f814a209003d37b3de756f65f --- /dev/null +++ b/test/suite/ietestcenter/chapter14/14.1/14.1-3-s.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: "14.1-3-s", + +path: "TestCases/chapter14/14.1/14.1-3-s.js", + +description: "'use strict' directive - not recognized if it contains extra whitespace", + +test: function testcase() { + + function foo() + { + ' use strict '; + return (this !== undefined); + } + + return foo.call(undefined); + }, + +strict:1, + +precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter14/14.1/14.1-4-s.js b/test/suite/ietestcenter/chapter14/14.1/14.1-4-s.js new file mode 100644 index 0000000000000000000000000000000000000000..cfba044eca917d146efadc7696e4b8ebb78331a3 --- /dev/null +++ b/test/suite/ietestcenter/chapter14/14.1/14.1-4-s.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: "14.1-4-s", + +path: "TestCases/chapter14/14.1/14.1-4-s.js", + +description: "'use strict' directive - not recognized if contains Line Continuation", + +test: function testcase() { + + function foo() + { + 'use str\ +ict'; + return (this !== undefined); + } + + return foo.call(undefined); + }, + +strict:1, + +precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter14/14.1/14.1-5-s.js b/test/suite/ietestcenter/chapter14/14.1/14.1-5-s.js new file mode 100644 index 0000000000000000000000000000000000000000..e61fe4e1000772824cb64114804de91417c1f2fd --- /dev/null +++ b/test/suite/ietestcenter/chapter14/14.1/14.1-5-s.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: "14.1-5-s", + +path: "TestCases/chapter14/14.1/14.1-5-s.js", + +description: "'use strict' directive - not recognized if contains a EscapeSequence", + +test: function testcase() { + + function foo() + { + 'use\u0020strict'; + return(this !== undefined); + } + + return foo.call(undefined); + }, + +strict:1, + +precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter14/14.1/14.1-6-s.js b/test/suite/ietestcenter/chapter14/14.1/14.1-6-s.js new file mode 100644 index 0000000000000000000000000000000000000000..73671ff24307ef648e1fc00f4d32d5dcdfcb9a40 --- /dev/null +++ b/test/suite/ietestcenter/chapter14/14.1/14.1-6-s.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: "14.1-6-s", + +path: "TestCases/chapter14/14.1/14.1-6-s.js", + +description: "'use strict' directive - not recognized if contains a <TAB> instead of a space", + +test: function testcase() { + + function foo() + { + 'use strict'; + return (this !== undefined); + } + + return foo.call(undefined); + }, + +strict:1, + +precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter14/14.1/14.1-7-s.js b/test/suite/ietestcenter/chapter14/14.1/14.1-7-s.js new file mode 100644 index 0000000000000000000000000000000000000000..d227de1c9c99abfb6c4fffa7bba3a4af76c14c6e --- /dev/null +++ b/test/suite/ietestcenter/chapter14/14.1/14.1-7-s.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: "14.1-7-s", + +path: "TestCases/chapter14/14.1/14.1-7-s.js", + +description: "'use strict' directive - not recognized if upper case", + +test: function testcase() { + + function foo() + { + 'Use Strict'; + return (this !== undefined); + } + + return foo.call(undefined); + }, + +strict:1, + +precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter14/14.1/14.1-8-s.js b/test/suite/ietestcenter/chapter14/14.1/14.1-8-s.js new file mode 100644 index 0000000000000000000000000000000000000000..63ab764267dd354bd3eee763e391dea8ddc2b6c4 --- /dev/null +++ b/test/suite/ietestcenter/chapter14/14.1/14.1-8-s.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: "14.1-8-s", + +path: "TestCases/chapter14/14.1/14.1-8-s.js", + +description: "'use strict' directive - may follow other directives", + +test: function testcase() { + + function foo() + { + "bogus directive"; + "use strict"; + return (this === undefined); + } + + return foo.call(undefined); + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter14/14.1/14.1-9-s.js b/test/suite/ietestcenter/chapter14/14.1/14.1-9-s.js new file mode 100644 index 0000000000000000000000000000000000000000..0535a5728415659e975ad4d68ec81ee20b355b78 --- /dev/null +++ b/test/suite/ietestcenter/chapter14/14.1/14.1-9-s.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: "14.1-9-s", + +path: "TestCases/chapter14/14.1/14.1-9-s.js", + +description: "'use strict' directive - may occur multiple times", + +test: function testcase() { + + function foo() + { + 'use strict'; + "use strict"; + return (this === undefined); + } + + return foo.call(undefined); + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-333-1.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-333-1.js new file mode 100644 index 0000000000000000000000000000000000000000..8b8217e581aadf689105b3aa4e99c9a6dd3e97a2 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-333-1.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.6-4-333-1", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-333-1.js", + + description: "Object.defineProperty will update [[Value]] attribute of named property 'P' successfully when [[Configurable]] attribute is false, [[Writable]] attribute is true and 'O' is an Object object (8.12.9 - step 10)", + + test: function testcase() { + + var obj = {}; + + Object.defineProperty(obj, "property", { + value: 1001, + writable: true, + configurable: false + }); + + Object.defineProperty(obj, "property", { + value: 1002 + }); + + return dataPropertyAttributesAreCorrect(obj, "property", 1002, true, false, false); + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-333-11.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-333-11.js new file mode 100644 index 0000000000000000000000000000000000000000..639b4cf93bf0812853f199cd29a46c6fd84a2055 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-333-11.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.6-4-333-11", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-333-11.js", + + description: "ES5 Attributes - indexed property 'P' with attributes [[Writable]]: true, [[Enumerable]]: true, [[Configurable]]: false is writable using simple assignment, 'O' is an Arguments object", + + test: function testcase() { + var obj = (function (x) { + return arguments; + }(1001)); + + Object.defineProperty(obj, "0", { + value: 2010, + writable: true, + enumerable: true, + configurable: false + }); + var verifyValue = (obj[0] === 2010); + + return verifyValue; + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty); + } +}); diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-333-2.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-333-2.js new file mode 100644 index 0000000000000000000000000000000000000000..fa54c036819961ab27578836d03bc6d5fded1503 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-333-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.6-4-333-2", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-333-2.js", + + description: "Object.defineProperty will update [[Value]] attribute of indexed property 'P' successfully when [[Configurable]] attribute is false, [[Writable]] attribute is true and 'A' is an Array object (8.12.9 - step 10)", + + test: function testcase() { + + var obj = []; + + Object.defineProperty(obj, "0", { + value: 1001, + writable: true, + configurable: false + }); + + Object.defineProperty(obj, "0", { + value: 1002 + }); + + return dataPropertyAttributesAreCorrect(obj, "0", 1002, true, false, false); + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-333-3.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-333-3.js new file mode 100644 index 0000000000000000000000000000000000000000..5212bfa8b2aa98943782a66a86e00756162b661b --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-333-3.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.6-4-333-3", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-333-3.js", + + description: "Object.defineProperty will update [[Value]] attribute of named property 'P' successfully when [[Configurable]] attribute is false, [[Writable]] attribute is true and 'O' is an Arguments object (8.12.9 - step 10)", + + test: function testcase() { + + var obj = (function () { + return arguments; + }()); + + Object.defineProperty(obj, "property", { + value: 1001, + writable: true, + configurable: false + }); + + Object.defineProperty(obj, "property", { + value: 1002 + }); + + return dataPropertyAttributesAreCorrect(obj, "property", 1002, true, false, false); + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-333-4.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-333-4.js new file mode 100644 index 0000000000000000000000000000000000000000..72c7c286c07f8ca66f7fb0a7ce06cffa5cc8f708 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-333-4.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.6-4-333-4", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-333-4.js", + + description: "Indexed property 'P' with attributes [[Writable]]: true, [[Enumerable]]:true, [[Configurable]]:false is writable using simple assignment, 'A' is an Array Object", + + test: function testcase() { + var obj = []; + + Object.defineProperty(obj, "0", { + value: 2010, + writable: true, + enumerable: true, + configurable: false + }); + var verifyValue = (obj[0] === 2010); + obj[0] = 1001; + + return verifyValue && obj[0] === 1001; + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty); + } +}); diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-333-6.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-333-6.js new file mode 100644 index 0000000000000000000000000000000000000000..7273d1e19b2def1da9700ab3c76d9f508cf7d177 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-333-6.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.6-4-333-6", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-333-6.js", + + description: "Object.defineProperty will update [[Value]] attribute of indexed property 'P' successfully when [[Configurable]] attribute is false, [[Writable]] attribute is true and 'O' is an Object object (8.12.9 - step 10)", + + test: function testcase() { + + var obj = {}; + + Object.defineProperty(obj, "0", { + value: 1001, + writable: true, + configurable: false + }); + + Object.defineProperty(obj, "0", { + value: 1002 + }); + + return dataPropertyAttributesAreCorrect(obj, "0", 1002, true, false, false); + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-333-7.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-333-7.js new file mode 100644 index 0000000000000000000000000000000000000000..56dc4c808b5d8451fa00340719a3edbb90ca7634 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-333-7.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.6-4-333-7", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-333-7.js", + + description: "Object.defineProperty will update [[Value]] attribute of named property 'P' successfully when [[Configurable]] attribute is false, [[Writable]] attribute is true and 'A' is an Array object (8.12.9 - step 10)", + + test: function testcase() { + + var obj = []; + + Object.defineProperty(obj, "prop", { + value: 1001, + writable: true, + configurable: false + }); + + Object.defineProperty(obj, "prop", { + value: 1002 + }); + + return dataPropertyAttributesAreCorrect(obj, "prop", 1002, true, false, false); + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-339-1.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-339-1.js new file mode 100644 index 0000000000000000000000000000000000000000..eee5f803f8991c8f5aa43cacadcefe158f430b10 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-339-1.js @@ -0,0 +1,57 @@ +/// 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.6-4-339-1", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-339-1.js", + + description: "Object.defineProperty - Updating indexed data property 'P' with attributes [[Writable]]: true, [[Enumerable]]: true, [[Configurable]]: false to an accessor property does not succeed, 'A' is an Array object (8.12.9 - step 9.a)", + + test: function testcase() { + var obj = []; + + Object.defineProperty(obj, "0", { + value: 2010, + writable: true, + enumerable: true, + configurable: false + }); + var propertyDefineCorrect = obj.hasOwnProperty("0"); + var desc1 = Object.getOwnPropertyDescriptor(obj, "0"); + + function getFunc() { + return 20; + } + try { + Object.defineProperty(obj, "0", { + get: getFunc + }); + return false; + } catch (e) { + var desc2 = Object.getOwnPropertyDescriptor(obj, "0"); + return propertyDefineCorrect && desc1.value === 2010 && obj[0] === 2010 && typeof desc2.get === "undefined" && e instanceof TypeError; + } + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty) && fnExists(Object.getOwnPropertyDescriptor); + } +}); diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-339-2.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-339-2.js new file mode 100644 index 0000000000000000000000000000000000000000..984f76d0d6f418469380b9f598cf92a9553310b2 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-339-2.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.6-4-339-2", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-339-2.js", + + description: "Object.defineProperty - Updating named data property 'P' with attributes [[Writable]]: true, [[Enumerable]]: true, [[Configurable]]: false to an accessor property does not succeed, 'O' is an Arguments object (8.12.9 - step 9.a)", + + test: function testcase() { + var obj = (function () { + return arguments; + }()); + + Object.defineProperty(obj, "prop", { + value: 2010, + writable: true, + enumerable: true, + configurable: false + }); + var propertyDefineCorrect = obj.hasOwnProperty("prop"); + var desc1 = Object.getOwnPropertyDescriptor(obj, "prop"); + + function getFunc() { + return 20; + } + try { + Object.defineProperty(obj, "prop", { + get: getFunc + }); + return false; + } catch (e) { + var desc2 = Object.getOwnPropertyDescriptor(obj, "prop"); + return propertyDefineCorrect && desc1.value === 2010 && obj.prop === 2010 && typeof desc2.get === "undefined" && e instanceof TypeError; + } + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty) && fnExists(Object.getOwnPropertyDescriptor); + } +}); diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-339-3.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-339-3.js new file mode 100644 index 0000000000000000000000000000000000000000..ec4b0e4a6f3815138888c71dbf76e40a9f349056 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-339-3.js @@ -0,0 +1,58 @@ +/// 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.6-4-339-3", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-339-3.js", + + description: "Object.defineProperty - Updating named data property 'P' with attributes [[Writable]]: true, [[Enumerable]]: true, [[Configurable]]: false to an accessor property does not succeed, 'A' is an Array object (8.12.9 - step 9.a)", + + test: function testcase() { + var obj = []; + + Object.defineProperty(obj, "prop", { + value: 2010, + writable: true, + enumerable: true, + configurable: false + }); + var propertyDefineCorrect = obj.hasOwnProperty("prop"); + var desc1 = Object.getOwnPropertyDescriptor(obj, "prop"); + + function getFunc() { + return 20; + } + try { + Object.defineProperty(obj, "prop", { + get: getFunc + }); + return false; + } catch (e) { + var desc2 = Object.getOwnPropertyDescriptor(obj, "prop"); + return propertyDefineCorrect && desc1.value === 2010 && obj.prop === 2010 && + typeof desc2.get === "undefined" && e instanceof TypeError; + } + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty) && fnExists(Object.getOwnPropertyDescriptor); + } +}); diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-339-4.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-339-4.js new file mode 100644 index 0000000000000000000000000000000000000000..605d2e707f4d92b198d3c7032c1c51580bbeb89f --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-339-4.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.6-4-339-4", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-339-4.js", + + description: "Object.defineProperty - Updating indexed data property 'P' with attributes [[Writable]]: true, [[Enumerable]]: true, [[Configurable]]: false to an accessor property does not succeed, 'O' is an Arguments object (8.12.9 - step 9.a)", + + test: function testcase() { + var obj = (function () { + return arguments; + }()); + + Object.defineProperty(obj, "0", { + value: 2010, + writable: true, + enumerable: true, + configurable: false + }); + var propertyDefineCorrect = obj.hasOwnProperty("0"); + var desc1 = Object.getOwnPropertyDescriptor(obj, "0"); + + function getFunc() { + return 20; + } + try { + Object.defineProperty(obj, "0", { + get: getFunc + }); + return false; + } catch (e) { + var desc2 = Object.getOwnPropertyDescriptor(obj, "0"); + return propertyDefineCorrect && desc1.value === 2010 && obj[0] === 2010 && + typeof desc2.get === "undefined" && e instanceof TypeError; + } + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty) && fnExists(Object.getOwnPropertyDescriptor); + } +}); diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-341.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-341.js index 72c1bc876462032a70ac2a473d400bdf2af5932f..9b57c9853d38f49340b7a45667c8207a9f3658f2 100644 --- a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-341.js +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-341.js @@ -23,7 +23,7 @@ ES5Harness.registerTest({ path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-341.js", - description: "ES5 Attributes - property ([[Writable]] is true, [[Enumerable]] is false, [[Configurable]] is true) is unenumerable", + description: "ES5 Attributes - property ([[Writable]] is true, [[Enumerable]] is false, [[Configurable]] is true) is non-enumerable", test: function testcase() { var obj = {}; diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-348.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-348.js index 53289a1b67fd3abdaf597aec92da274f1ea6ff03..7b7dab4c6a9e6b75b00d59bf6bfc17cc5f53e939 100644 --- a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-348.js +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-348.js @@ -23,7 +23,7 @@ ES5Harness.registerTest({ path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-348.js", - description: "ES5 Attributes - property ([[Writable]] is true, [[Enumerable]] is false, [[Configurable]] is false) is unenumerable", + description: "ES5 Attributes - property ([[Writable]] is true, [[Enumerable]] is false, [[Configurable]] is false) is non-enumerable", test: function testcase() { var obj = {}; diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-354-13.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-354-13.js new file mode 100644 index 0000000000000000000000000000000000000000..157f04515f88e294c9615544e539fe539e6bdb77 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-354-13.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.6-4-354-13", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-354-13.js", + + description: "Object.defineProperty will update [[Value]] attribute of indexed property successfully when [[Configurable]] attribute is true and [[Writable]] attribute is false, 'O' is the global object (8.12.9 - step Note)", + + test: function testcase() { + + var obj = fnGlobalObject(); + + try { + Object.defineProperty(obj, "0", { + value: 1001, + writable: false, + configurable: true + }); + + Object.defineProperty(obj, "0", { + value: 1002 + }); + + return dataPropertyAttributesAreCorrect(obj, "0", 1002, false, false, true); + } finally { + delete obj[0]; + } + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-360-1.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-360-1.js new file mode 100644 index 0000000000000000000000000000000000000000..1d3296df7e599f6a43a8b96fe55b0bacf7883279 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-360-1.js @@ -0,0 +1,55 @@ +/// 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.6-4-360-1", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-360-1.js", + + description: "ES5 Attributes - Updating indexed data property 'P' whose attributes are [[Writable]]: false, [[Enumerable]]: true, [[Configurable]]: true to an accessor property, 'A' is an Array object (8.12.9 - step 9.b.i)", + + test: function testcase() { + var obj = []; + + Object.defineProperty(obj, "0", { + value: 2010, + writable: false, + enumerable: true, + configurable: true + }); + var desc1 = Object.getOwnPropertyDescriptor(obj, "0"); + + function getFunc() { + return 20; + } + Object.defineProperty(obj, "0", { + get: getFunc + }); + var desc2 = Object.getOwnPropertyDescriptor(obj, "0"); + + return desc1.hasOwnProperty("value") && desc2.hasOwnProperty("get") && + desc2.enumerable === true && desc2.configurable === true && + obj[0] === 20 && typeof desc2.set === "undefined" && desc2.get === getFunc; + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty) && fnExists(Object.getOwnPropertyDescriptor); + } +}); diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-360-2.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-360-2.js new file mode 100644 index 0000000000000000000000000000000000000000..140ebea9c4701825e4e0cee4bfd5d633633f07db --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-360-2.js @@ -0,0 +1,57 @@ +/// 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.6-4-360-2", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-360-2.js", + + description: "ES5 Attributes - Updating data property 'P' whose attributes are [[Writable]]: false, [[Enumerable]]: true, [[Configurable]]: true to an accessor property, 'O' is an Arguments object (8.12.9 - step 9.b.i)", + + test: function testcase() { + var obj = (function () { + return arguments; + }()); + + Object.defineProperty(obj, "prop", { + value: 2010, + writable: false, + enumerable: true, + configurable: true + }); + var desc1 = Object.getOwnPropertyDescriptor(obj, "prop"); + + function getFunc() { + return 20; + } + Object.defineProperty(obj, "prop", { + get: getFunc + }); + var desc2 = Object.getOwnPropertyDescriptor(obj, "prop"); + + return desc1.hasOwnProperty("value") && desc2.hasOwnProperty("get") && + desc2.enumerable === true && desc2.configurable === true && + obj.prop === 20 && typeof desc2.set === "undefined" && desc2.get === getFunc; + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty) && fnExists(Object.getOwnPropertyDescriptor); + } +}); diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-360-3.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-360-3.js new file mode 100644 index 0000000000000000000000000000000000000000..463a0dd65754d6e9a0c3f23c50cc25e321e7a114 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-360-3.js @@ -0,0 +1,58 @@ +/// 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.6-4-360-3", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-360-3.js", + + description: "ES5 Attributes - Updating data property 'P' whose attributes are [[Writable]]: false, [[Enumerable]]: true, [[Configurable]]: true to an accessor property, 'O' is the global object (8.12.9 - step 9.b.i)", + + test: function testcase() { + var obj = fnGlobalObject(); + try { + Object.defineProperty(obj, "prop", { + value: 2010, + writable: false, + enumerable: true, + configurable: true + }); + var desc1 = Object.getOwnPropertyDescriptor(obj, "prop"); + + function getFunc() { + return 20; + } + Object.defineProperty(obj, "prop", { + get: getFunc + }); + var desc2 = Object.getOwnPropertyDescriptor(obj, "prop"); + + return desc1.hasOwnProperty("value") && desc2.hasOwnProperty("get") && + desc2.enumerable === true && desc2.configurable === true && + obj.prop === 20 && typeof desc2.set === "undefined" && desc2.get === getFunc; + } finally { + delete obj.prop; + } + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty) && fnExists(Object.getOwnPropertyDescriptor); + } +}); diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-360-5.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-360-5.js new file mode 100644 index 0000000000000000000000000000000000000000..075057213e1bbc2b0e33bc30e932f57f3926da37 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-360-5.js @@ -0,0 +1,55 @@ +/// 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.6-4-360-5", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-360-5.js", + + description: "ES5 Attributes - Updating named data property 'P' whose attributes are [[Writable]]: false, [[Enumerable]]: true, [[Configurable]]: true to an accessor property, 'A' is an Array object (8.12.9 - step 9.b.i)", + + test: function testcase() { + var obj = []; + + Object.defineProperty(obj, "prop", { + value: 2010, + writable: false, + enumerable: true, + configurable: true + }); + var desc1 = Object.getOwnPropertyDescriptor(obj, "prop"); + + function getFunc() { + return 20; + } + Object.defineProperty(obj, "prop", { + get: getFunc + }); + var desc2 = Object.getOwnPropertyDescriptor(obj, "prop"); + + return desc1.hasOwnProperty("value") && desc2.hasOwnProperty("get") && + desc2.enumerable === true && desc2.configurable === true && + obj.prop === 20 && typeof desc2.set === "undefined" && desc2.get === getFunc; + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty) && fnExists(Object.getOwnPropertyDescriptor); + } +}); diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-360-6.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-360-6.js new file mode 100644 index 0000000000000000000000000000000000000000..3ad474c6ddd5c5391062b7f3617c6ab2300377ef --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-360-6.js @@ -0,0 +1,57 @@ +/// 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.6-4-360-6", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-360-6.js", + + description: "ES5 Attributes - Updating indexed data property 'P' whose attributes are [[Writable]]: false, [[Enumerable]]: true, [[Configurable]]: true to an accessor property, 'O' is an Arguments object (8.12.9 - step 9.b.i)", + + test: function testcase() { + var obj = (function () { + return arguments; + }()); + + Object.defineProperty(obj, "0", { + value: 2010, + writable: false, + enumerable: true, + configurable: true + }); + var desc1 = Object.getOwnPropertyDescriptor(obj, "0"); + + function getFunc() { + return 20; + } + Object.defineProperty(obj, "0", { + get: getFunc + }); + var desc2 = Object.getOwnPropertyDescriptor(obj, "0"); + + return desc1.hasOwnProperty("value") && desc2.hasOwnProperty("get") && + desc2.enumerable === true && desc2.configurable === true && + obj[0] === 20 && typeof desc2.set === "undefined" && desc2.get === getFunc; + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty) && fnExists(Object.getOwnPropertyDescriptor); + } +}); diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-360-7.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-360-7.js new file mode 100644 index 0000000000000000000000000000000000000000..da37a11708316889cd5c305405d4f2084db90709 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-360-7.js @@ -0,0 +1,58 @@ +/// 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.6-4-360-7", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-360-7.js", + + description: "ES5 Attributes - Updating indexed data property 'P' whose attributes are [[Writable]]: false, [[Enumerable]]: true, [[Configurable]]: true to an accessor property, 'O' is the global object (8.12.9 - step 9.b.i)", + + test: function testcase() { + var obj = fnGlobalObject(); + try { + Object.defineProperty(obj, "0", { + value: 2010, + writable: false, + enumerable: true, + configurable: true + }); + var desc1 = Object.getOwnPropertyDescriptor(obj, "0"); + + function getFunc() { + return 20; + } + Object.defineProperty(obj, "0", { + get: getFunc + }); + var desc2 = Object.getOwnPropertyDescriptor(obj, "0"); + + return desc1.hasOwnProperty("value") && desc2.hasOwnProperty("get") && + desc2.enumerable === true && desc2.configurable === true && + obj[0] === 20 && typeof desc2.set === "undefined" && desc2.get === getFunc; + } finally { + delete obj[0]; + } + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty) && fnExists(Object.getOwnPropertyDescriptor); + } +}); diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-369.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-369.js index df4a8b5724286bc51fa29f6bb3e037201939dff5..db0ede80122d327fcc2e588596a1dc26b36503f6 100644 --- a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-369.js +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-369.js @@ -23,7 +23,7 @@ ES5Harness.registerTest({ path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-369.js", - description: "ES5 Attributes - property ([[Writable]] is false, [[Enumerable]] is false, [[Configurable]] is true) is unenumerable", + description: "ES5 Attributes - property ([[Writable]] is false, [[Enumerable]] is false, [[Configurable]] is true) is non-enumerable", test: function testcase() { var obj = {}; diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-376.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-376.js index 190907db9f0cb5371914b1de9e5761e7a74dd8ed..ee67c2d8939ac7218bad842c36d85553848c4da6 100644 --- a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-376.js +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-376.js @@ -23,7 +23,7 @@ ES5Harness.registerTest({ path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-376.js", - description: "ES5 Attributes - property ([[Writable]] is false, [[Enumerable]] is false, [[Configurable]] is false) is unenumerable", + description: "ES5 Attributes - property ([[Writable]] is false, [[Enumerable]] is false, [[Configurable]] is false) is non-enumerable", test: function testcase() { var obj = {}; diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-403.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-403.js index 23e14d2bb4b8242ecec5e1dd564a0d7611e0a104..6794bbe67065de189392cf7d77ab54427749ad80 100644 --- a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-403.js +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-403.js @@ -33,7 +33,7 @@ ES5Harness.registerTest({ enumerable: true, configurable: true }); - var arrObj = new Array(); + var arrObj = []; arrObj.prop = 1002; return arrObj.hasOwnProperty("prop") && arrObj.prop === 1002; diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-406.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-406.js index 63e10751b82841c4da4c076c6d69debbc7b2b6a2..5104a90147cff1cf9f33ffdb40f33bb541f57243 100644 --- a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-406.js +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-406.js @@ -23,7 +23,7 @@ ES5Harness.registerTest({ path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-406.js", - description: "ES5 Attributes - Inherited property whose [[Enumerable]] attribute is set to false is unenumerable (Function instance)", + description: "ES5 Attributes - Inherited property whose [[Enumerable]] attribute is set to false is non-enumerable (Function instance)", test: function testcase() { try { diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-411.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-411.js index 5edb035c232662f1e03938ed9b4f15d01dd8b15e..cdbffb857ed6a84f38e465f45d6ecd37b6d7bd7d 100644 --- a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-411.js +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-411.js @@ -23,7 +23,7 @@ ES5Harness.registerTest({ path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-411.js", - description: "ES5 Attributes - Inherited property whose [[Enumerable]] attribute is set to false is unenumerable (Math)", + description: "ES5 Attributes - Inherited property whose [[Enumerable]] attribute is set to false is non-enumerable (Math)", test: function testcase() { try { diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-416.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-416.js index 6305722d836d2af25d156915fa3b56f4d1cb501f..0c9e2de5b13c0cd6c535379f3c9536b66551ccca 100644 --- a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-416.js +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-416.js @@ -23,7 +23,7 @@ ES5Harness.registerTest({ path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-416.js", - description: "ES5 Attributes - Inherited properties whose [[Enumerable]] attribute is set to false is unenumerable (Object.create)", + description: "ES5 Attributes - Inherited properties whose [[Enumerable]] attribute is set to false is non-enumerable (Object.create)", test: function testcase() { var appointment = {}; diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-421.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-421.js index 64afa0a7ed87e130adeb1c6ba7975d0995cb9485..e108590afb74ffbaa1a6e73664a1dce4667be76f 100644 --- a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-421.js +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-421.js @@ -23,7 +23,7 @@ ES5Harness.registerTest({ path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-421.js", - description: "ES5 Attributes - Inherited property whose [[Enumerable]] attribute is set to false is unenumerable (Function.prototype.bind)", + description: "ES5 Attributes - Inherited property whose [[Enumerable]] attribute is set to false is non-enumerable (Function.prototype.bind)", test: function testcase() { var foo = function () { }; diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-442.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-442.js index fc13071f4fc36144185146bdad37d1124041dcc5..28464b07d4948f5e3d864ac732feab1006aac457 100644 --- a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-442.js +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-442.js @@ -23,7 +23,7 @@ ES5Harness.registerTest({ path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-442.js", - description: "ES5 Attributes - property ([[Get]] is undefined, [[Set]] is undefined, [[Enumerable]] is false, [[Configurable]] is true) is unenumerable", + description: "ES5 Attributes - property ([[Get]] is undefined, [[Set]] is undefined, [[Enumerable]] is false, [[Configurable]] is true) is non-enumerable", test: function testcase() { var obj = {}; diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-451.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-451.js index b8f42f52cc725995464a2dbfe2c5d92a6b59e371..a9f7b614522b68ebd17c8f56c6143aa8683db284 100644 --- a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-451.js +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-451.js @@ -23,7 +23,7 @@ ES5Harness.registerTest({ path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-451.js", - description: "ES5 Attributes - property ([[Get]] is undefined, [[Set]] is undefined, [[Enumerable]] is false, [[Configurable]] is false) is unenumerable", + description: "ES5 Attributes - property ([[Get]] is undefined, [[Set]] is undefined, [[Enumerable]] is false, [[Configurable]] is false) is non-enumerable", test: function testcase() { var obj = {}; diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-478.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-478.js index cf41b73a0ea6d6f52ce4b82ec89b5f0d3dc7a6ad..d0d43b07c9ff6d2b5e1d3d7e25b86679087591cc 100644 --- a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-478.js +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-478.js @@ -23,7 +23,7 @@ ES5Harness.registerTest({ path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-478.js", - description: "ES5 Attributes - property ([[Get]] is undefined, [[Set]] is a Function, [[Enumerable]] is false, [[Configurable]] is true) is unenumerable", + description: "ES5 Attributes - property ([[Get]] is undefined, [[Set]] is a Function, [[Enumerable]] is false, [[Configurable]] is true) is non-enumerable", test: function testcase() { var obj = {}; diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-487.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-487.js index 0301374c366c897b14e827cf8ee8dea9807b44db..17ab81abd0bdcdc9a6c9d1a4147088453dea8cc7 100644 --- a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-487.js +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-487.js @@ -23,7 +23,7 @@ ES5Harness.registerTest({ path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-487.js", - description: "ES5 Attributes - property ([[Get]] is undefined, [[Set]] is a Function, [[Enumerable]] is false, [[Configurable]] is false) is unenumerable", + description: "ES5 Attributes - property ([[Get]] is undefined, [[Set]] is a Function, [[Enumerable]] is false, [[Configurable]] is false) is non-enumerable", test: function testcase() { var obj = {}; diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-514.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-514.js index e35fe56c76b5f4ee4236432a7e10dd3241e856e5..a4b9be08dd0dbbaaa2181a27f12119023b3990eb 100644 --- a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-514.js +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-514.js @@ -23,7 +23,7 @@ ES5Harness.registerTest({ path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-514.js", - description: "ES5 Attributes - property ([[Get]] is a Function, [[Set]] is undefined, [[Enumerable]] is false, [[Configurable]] is true) is unenumerable", + description: "ES5 Attributes - property ([[Get]] is a Function, [[Set]] is undefined, [[Enumerable]] is false, [[Configurable]] is true) is non-enumerable", test: function testcase() { var obj = {}; diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-523.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-523.js index d5e379d7e7c389534f6c06500a024f7ee31f7ead..2f8424aeab43a4154ba04067a0287e8cabb5225b 100644 --- a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-523.js +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-523.js @@ -23,7 +23,7 @@ ES5Harness.registerTest({ path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-523.js", - description: "ES5 Attributes - property ([[Get]] is a Function, [[Set]] is undefined, [[Enumerable]] is false, [[Configurable]] is false) is unenumerable", + description: "ES5 Attributes - property ([[Get]] is a Function, [[Set]] is undefined, [[Enumerable]] is false, [[Configurable]] is false) is non-enumerable", test: function testcase() { var obj = {}; diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-531-15.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-531-15.js new file mode 100644 index 0000000000000000000000000000000000000000..072620840bccb8aa667e670189d89dbd2a666d42 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-531-15.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.6-4-531-15", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-531-15.js", + + description: "ES5 Attributes - Updating a named accessor property 'P' using simple assignment is successful, 'A' is an Array object (8.12.5 step 5.b)", + + test: function testcase() { + var obj = []; + + var verifySetFunc = "data"; + var setFunc = function (value) { + verifySetFunc = value; + }; + var getFunc = function () { + return verifySetFunc; + }; + + Object.defineProperty(obj, "prop", { + get: getFunc, + set: setFunc, + enumerable: true, + configurable: true + }); + + obj.prop = "overrideData"; + var propertyDefineCorrect = obj.hasOwnProperty("prop"); + var desc = Object.getOwnPropertyDescriptor(obj, "prop"); + + return propertyDefineCorrect && desc.set === setFunc && obj.prop === "overrideData"; + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty) && fnExists(Object.getOwnPropertyDescriptor); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-531-16.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-531-16.js new file mode 100644 index 0000000000000000000000000000000000000000..efbda9c6caecafc168d92270c38896b0593e7d30 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-531-16.js @@ -0,0 +1,58 @@ +/// 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.6-4-531-16", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-531-16.js", + + description: "ES5 Attributes - Updating an indexed accessor property 'P' using simple assignment, 'O' is an Arguments object (8.12.5 step 5.b)", + + test: function testcase() { + var obj = (function () { + return arguments; + }()); + + var verifySetFunc = "data"; + var setFunc = function (value) { + verifySetFunc = value; + }; + var getFunc = function () { + return verifySetFunc; + }; + + Object.defineProperty(obj, "0", { + get: getFunc, + set: setFunc, + enumerable: true, + configurable: true + }); + + obj[0] = "overrideData"; + var propertyDefineCorrect = obj.hasOwnProperty("0"); + var desc = Object.getOwnPropertyDescriptor(obj, "0"); + + return propertyDefineCorrect && desc.set === setFunc && obj[0] === "overrideData"; + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty) && fnExists(Object.getOwnPropertyDescriptor); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-531-17.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-531-17.js new file mode 100644 index 0000000000000000000000000000000000000000..955e6469cf35f21d23862e5e6b5528582c55d870 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-531-17.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.6-4-531-17", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-531-17.js", + + description: "ES5 Attributes - Updating an indexed accessor property 'P' using simple assignment is successful, 'O' is the global object (8.12.5 step 5.b)", + + test: function testcase() { + var obj = fnGlobalObject(); + try { + obj.verifySetFunc = "data"; + var setFunc = function (value) { + obj.verifySetFunc = value; + }; + var getFunc = function () { + return obj.verifySetFunc; + }; + + Object.defineProperty(obj, "0", { + get: getFunc, + set: setFunc, + enumerable: true, + configurable: true + }); + + obj[0] = "overrideData"; + var propertyDefineCorrect = obj.hasOwnProperty("0"); + var desc = Object.getOwnPropertyDescriptor(obj, "0"); + + return propertyDefineCorrect && desc.set === setFunc && obj[0] === "overrideData"; + } finally { + delete obj[0]; + delete obj.verifySetFunc; + } + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty) && fnExists(Object.getOwnPropertyDescriptor); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-531-6.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-531-6.js new file mode 100644 index 0000000000000000000000000000000000000000..772994438d2c9ad59d28837e0bb537b13a67caf5 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-531-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.6-4-531-6", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-531-6.js", + + description: "ES5 Attributes - Updating an indexed accessor property 'P' without [[Set]] using simple assignment is failed, 'A' is an Array object (8.12.5 step 5.b)", + + test: function testcase() { + var obj = []; + + var verifySetFunc = "data"; + var getFunc = function () { + return verifySetFunc; + }; + + Object.defineProperty(obj, "0", { + get: getFunc, + enumerable: true, + configurable: true + }); + + obj[0] = "overrideData"; + var propertyDefineCorrect = obj.hasOwnProperty("0"); + var desc = Object.getOwnPropertyDescriptor(obj, "0"); + + return propertyDefineCorrect && typeof desc.set === "undefined" && obj[0] === "data"; + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty) && fnExists(Object.getOwnPropertyDescriptor); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-531-7.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-531-7.js new file mode 100644 index 0000000000000000000000000000000000000000..ebe7a6fa8080c564f49a582245fca522944b0450 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-531-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.6-4-531-7", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-531-7.js", + + description: "ES5 Attributes - Updating a named accessor property 'P' without [[Set]] using simple assignment is failed, 'O' is an Arguments object (8.12.5 step 5.b)", + + test: function testcase() { + var obj = (function () { + return arguments; + }()); + + var verifySetFunc = "data"; + var getFunc = function () { + return verifySetFunc; + }; + + Object.defineProperty(obj, "prop", { + get: getFunc, + enumerable: true, + configurable: true + }); + + obj.prop = "overrideData"; + var propertyDefineCorrect = obj.hasOwnProperty("prop"); + var desc = Object.getOwnPropertyDescriptor(obj, "prop"); + + return propertyDefineCorrect && typeof desc.set === "undefined" && obj.prop === "data"; + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty) && fnExists(Object.getOwnPropertyDescriptor); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-531-8.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-531-8.js new file mode 100644 index 0000000000000000000000000000000000000000..f7ff6f379a3736f0fdb2f4caaa883b0462ed9078 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-531-8.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.6-4-531-8", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-531-8.js", + + description: "ES5 Attributes - Updating a named accessor property 'P' without [[Set]] using simple assignment is failed, 'O' is the global object (8.12.5 step 5.b)", + + test: function testcase() { + var obj = fnGlobalObject(); + try { + obj.verifySetFunc = "data"; + var getFunc = function () { + return obj.verifySetFunc; + }; + + Object.defineProperty(obj, "prop", { + get: getFunc, + enumerable: true, + configurable: true + }); + + obj.prop = "overrideData"; + var propertyDefineCorrect = obj.hasOwnProperty("prop"); + var desc = Object.getOwnPropertyDescriptor(obj, "prop"); + + return propertyDefineCorrect && typeof desc.set === "undefined" && obj.prop === "data"; + } finally { + delete obj.prop; + delete obj.verifySetFunc; + } + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty) && fnExists(Object.getOwnPropertyDescriptor); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-538-1.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-538-1.js new file mode 100644 index 0000000000000000000000000000000000000000..ada12a8b316c3f15f0e3898964b67d8bc2591c50 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-538-1.js @@ -0,0 +1,61 @@ +/// 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.6-4-538-1", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-538-1.js", + + description: "ES5 Attributes - Updating an indexed 'P' whose [[Configurable]] attribute is true to a data property is successful, 'A' is an Array object (8.12.9 - step 9.c.i)", + + test: function testcase() { + var obj = []; + + obj.verifySetFunc = "data"; + var getFunc = function () { + return obj.verifySetFunc; + }; + + var setFunc = function (value) { + obj.verifySetFunc = value; + }; + + Object.defineProperty(obj, "0", { + get: getFunc, + set: setFunc, + enumerable: true, + configurable: true + }); + var desc1 = Object.getOwnPropertyDescriptor(obj, "0"); + + Object.defineProperty(obj, "0", { + value: 1001 + }); + var desc2 = Object.getOwnPropertyDescriptor(obj, "0"); + + return desc1.hasOwnProperty("get") && desc2.hasOwnProperty("value") && + typeof desc2.get === "undefined" && typeof desc2.get === "undefined" && + dataPropertyAttributesAreCorrect(obj, "0", 1001, false, true, true); + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty) && fnExists(Object.getOwnPropertyDescriptor); + } +}); diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-538-2.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-538-2.js new file mode 100644 index 0000000000000000000000000000000000000000..d572875c18dc1be09ab876ece2d6d1fef7eba8ff --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-538-2.js @@ -0,0 +1,63 @@ +/// 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.6-4-538-2", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-538-2.js", + + description: "ES5 Attributes - Updating a named accessor property 'P' whose [[Configurable]] attribute is true to a data property is successful, 'O' is an Arguments object", + + test: function testcase() { + var obj = (function () { + return arguments; + }()); + + obj.verifySetFunc = "data"; + var getFunc = function () { + return obj.verifySetFunc; + }; + + var setFunc = function (value) { + obj.verifySetFunc = value; + }; + + Object.defineProperty(obj, "prop", { + get: getFunc, + set: setFunc, + enumerable: true, + configurable: true + }); + var desc1 = Object.getOwnPropertyDescriptor(obj, "prop"); + + Object.defineProperty(obj, "prop", { + value: 1001 + }); + var desc2 = Object.getOwnPropertyDescriptor(obj, "prop"); + + return desc1.hasOwnProperty("get") && desc2.hasOwnProperty("value") && + typeof desc2.get === "undefined" && typeof desc2.get === "undefined" && + dataPropertyAttributesAreCorrect(obj, "prop", 1001, false, true, true); + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty) && fnExists(Object.getOwnPropertyDescriptor); + } +}); diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-538-3.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-538-3.js new file mode 100644 index 0000000000000000000000000000000000000000..f9ed5be391d46bce9afeddd10013d4f466fa21ea --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-538-3.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.6-4-538-3", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-538-3.js", + + description: "ES5 Attributes - Updating a named accessor property 'P' whose [[Configurable]] attribute is true to a data property is successful, 'O' is the global object", + + test: function testcase() { + var obj = fnGlobalObject(); + + obj.verifySetFunc = "data"; + var getFunc = function () { + return obj.verifySetFunc; + }; + + var setFunc = function (value) { + obj.verifySetFunc = value; + }; + try { + Object.defineProperty(obj, "prop", { + get: getFunc, + set: setFunc, + enumerable: true, + configurable: true + }); + var desc1 = Object.getOwnPropertyDescriptor(obj, "prop"); + + Object.defineProperty(obj, "prop", { + value: 1001 + }); + var desc2 = Object.getOwnPropertyDescriptor(obj, "prop"); + + return desc1.hasOwnProperty("get") && desc2.hasOwnProperty("value") && + typeof desc2.get === "undefined" && typeof desc2.get === "undefined" && + dataPropertyAttributesAreCorrect(obj, "prop", 1001, false, true, true); + } finally { + delete obj.prop; + delete obj.verifySetFunc; + } + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty) && fnExists(Object.getOwnPropertyDescriptor); + } +}); diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-538-5.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-538-5.js new file mode 100644 index 0000000000000000000000000000000000000000..a09eeca93c0a0e79d0d43215014a4f0bfcc3de67 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-538-5.js @@ -0,0 +1,61 @@ +/// 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.6-4-538-5", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-538-5.js", + + description: "ES5 Attributes - Updating a named accessor property 'P' whose [[Configurable]] attribute is true to a data property is successful, 'A' is an Array object (8.12.9 - step 9.c.i)", + + test: function testcase() { + var obj = []; + + obj.verifySetFunc = "data"; + var getFunc = function () { + return obj.verifySetFunc; + }; + + var setFunc = function (value) { + obj.verifySetFunc = value; + }; + + Object.defineProperty(obj, "prop", { + get: getFunc, + set: setFunc, + enumerable: true, + configurable: true + }); + var desc1 = Object.getOwnPropertyDescriptor(obj, "prop"); + + Object.defineProperty(obj, "prop", { + value: 1001 + }); + var desc2 = Object.getOwnPropertyDescriptor(obj, "prop"); + + return desc1.hasOwnProperty("get") && desc2.hasOwnProperty("value") && + typeof desc2.get === "undefined" && typeof desc2.get === "undefined" && + dataPropertyAttributesAreCorrect(obj, "prop", 1001, false, true, true); + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty) && fnExists(Object.getOwnPropertyDescriptor); + } +}); diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-538-6.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-538-6.js new file mode 100644 index 0000000000000000000000000000000000000000..c52e60bf7fd39e97902b4c12dae35f9c64ec2eb3 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-538-6.js @@ -0,0 +1,63 @@ +/// 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.6-4-538-6", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-538-6.js", + + description: "ES5 Attributes - Updating an indexed accessor property 'P' whose [[Configurable]] attribute is true to a data property is successful, 'O' is an Arguments object", + + test: function testcase() { + var obj = (function () { + return arguments; + }()); + + obj.verifySetFunc = "data"; + var getFunc = function () { + return obj.verifySetFunc; + }; + + var setFunc = function (value) { + obj.verifySetFunc = value; + }; + + Object.defineProperty(obj, "0", { + get: getFunc, + set: setFunc, + enumerable: true, + configurable: true + }); + var desc1 = Object.getOwnPropertyDescriptor(obj, "0"); + + Object.defineProperty(obj, "0", { + value: 1001 + }); + var desc2 = Object.getOwnPropertyDescriptor(obj, "0"); + + return desc1.hasOwnProperty("get") && desc2.hasOwnProperty("value") && + typeof desc2.get === "undefined" && typeof desc2.get === "undefined" && + dataPropertyAttributesAreCorrect(obj, "0", 1001, false, true, true); + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty) && fnExists(Object.getOwnPropertyDescriptor); + } +}); diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-538-7.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-538-7.js new file mode 100644 index 0000000000000000000000000000000000000000..d7906f0a7be9fdb516fd22cda0efff3e477c8251 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-538-7.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.6-4-538-7", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-538-7.js", + + description: "ES5 Attributes - Updating an indexed accessor property 'P' whose [[Configurable]] attribute is true to a data property is successful, 'O' is the global object", + + test: function testcase() { + var obj = fnGlobalObject(); + + obj.verifySetFunc = "data"; + var getFunc = function () { + return obj.verifySetFunc; + }; + + var setFunc = function (value) { + obj.verifySetFunc = value; + }; + try { + Object.defineProperty(obj, "0", { + get: getFunc, + set: setFunc, + enumerable: true, + configurable: true + }); + var desc1 = Object.getOwnPropertyDescriptor(obj, "0"); + + Object.defineProperty(obj, "0", { + value: 1001 + }); + var desc2 = Object.getOwnPropertyDescriptor(obj, "0"); + + return desc1.hasOwnProperty("get") && desc2.hasOwnProperty("value") && + typeof desc2.get === "undefined" && typeof desc2.get === "undefined" && + dataPropertyAttributesAreCorrect(obj, "0", 1001, false, true, true); + } finally { + delete obj[0]; + delete obj.verifySetFunc; + } + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty) && fnExists(Object.getOwnPropertyDescriptor); + } +}); diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-538.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-538.js index 66c510462b3be96ad749781eda6307ac09ac1ef5..a5932c76aaa4395301e2561d829ed217a305c199 100644 --- a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-538.js +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-538.js @@ -50,7 +50,9 @@ ES5Harness.registerTest({ }); var desc2 = Object.getOwnPropertyDescriptor(obj, "prop"); - return desc1.hasOwnProperty("get") && desc2.hasOwnProperty("value"); + return desc1.hasOwnProperty("get") && desc2.hasOwnProperty("value") && + typeof desc2.get === "undefined" && typeof desc2.get === "undefined" && + dataPropertyAttributesAreCorrect(obj, "prop", 1001, false, true, true); }, precondition: function prereq() { diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-540-10.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-540-10.js new file mode 100644 index 0000000000000000000000000000000000000000..db67ec4e6dd03c116cee45132db405a4ab9c71d0 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-540-10.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.6-4-540-10", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-540-10.js", + + description: "ES5 Attributes - Updating an indexed accessor property 'P' using simple assignment is successful, 'O' is an Arguments object (8.12.5 step 5.b)", + + test: function testcase() { + var obj = (function () { + return arguments; + }()); + + obj.verifySetFunc = "data"; + var getFunc = function () { + return obj.verifySetFunc; + }; + + var setFunc = function (value) { + obj.verifySetFunc = value; + }; + + Object.defineProperty(obj, "0", { + get: getFunc, + set: setFunc, + enumerable: true, + configurable: false + }); + + obj[0] = "overrideData"; + var propertyDefineCorrect = obj.hasOwnProperty("0"); + var desc = Object.getOwnPropertyDescriptor(obj, "0"); + + return propertyDefineCorrect && desc.set === setFunc && obj.verifySetFunc === "overrideData"; + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty) && fnExists(Object.getOwnPropertyDescriptor); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-540-2.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-540-2.js new file mode 100644 index 0000000000000000000000000000000000000000..a9095c52743edcbf27b4d3d4404e80aeaf9e1a55 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-540-2.js @@ -0,0 +1,71 @@ +/// 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.6-4-540-2", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-540-2.js", + + description: "Object.defineProperty fails to update [[Get]] and [[Set]] attributes of an indexed property 'P' whose [[Configurable]] attribute is false and throws TypeError exception, 'A' is an Array object (8.12.9 step 11.a)", + + test: function testcase() { + var obj = []; + + obj.verifySetFunction = "data"; + var getFunc = function () { + return obj.verifySetFunction; + }; + var setFunc = function (value) { + obj.verifySetFunction = value; + }; + Object.defineProperty(obj, "0", { + get: getFunc, + set: setFunc, + configurable: false + }); + + var result = false; + try { + Object.defineProperty(obj, "0", { + get: function () { + return 100; + } + }); + } catch (e) { + result = e instanceof TypeError && + accessorPropertyAttributesAreCorrect(obj, "0", getFunc, setFunc, "verifySetFunction", false, false); + } + + try { + Object.defineProperty(obj, "0", { + set: function (value) { + obj.verifySetFunction1 = value; + } + }); + } catch (e1) { + return result && e1 instanceof TypeError && + accessorPropertyAttributesAreCorrect(obj, "0", getFunc, setFunc, "verifySetFunction", false, false); + } + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty) && fnExists(Object.getOwnPropertyDescriptor); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-540-4.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-540-4.js new file mode 100644 index 0000000000000000000000000000000000000000..67982d8e978a44a4a387cca3bebd97e02d24c869 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-540-4.js @@ -0,0 +1,57 @@ +/// 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.6-4-540-4", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-540-4.js", + + description: "ES5 Attributes - Updating an indexed accessor property 'P' using simple assignment is successful, 'A' is an Array object (8.12.5 step 5.b)", + + test: function testcase() { + var obj = []; + + obj.verifySetFunc = "data"; + var getFunc = function () { + return obj.verifySetFunc; + }; + + var setFunc = function (value) { + obj.verifySetFunc = value; + }; + + Object.defineProperty(obj, "0", { + get: getFunc, + set: setFunc, + enumerable: true, + configurable: false + }); + + obj[0] = "overrideData"; + var propertyDefineCorrect = obj.hasOwnProperty("0"); + var desc = Object.getOwnPropertyDescriptor(obj, "0"); + + return propertyDefineCorrect && desc.set === setFunc && obj.verifySetFunc === "overrideData"; + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty) && fnExists(Object.getOwnPropertyDescriptor); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-540-5.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-540-5.js new file mode 100644 index 0000000000000000000000000000000000000000..23d8e2ee23f7ee11102bba31f0c29eb31f514a0a --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-540-5.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.6-4-540-5", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-540-5.js", + + description: "ES5 Attributes - Updating a named accessor property 'P' using simple assignment is successful, 'O' is an Arguments object (8.12.5 step 5.b)", + + test: function testcase() { + var obj = (function () { + return arguments; + }()); + + obj.verifySetFunc = "data"; + var getFunc = function () { + return obj.verifySetFunc; + }; + + var setFunc = function (value) { + obj.verifySetFunc = value; + }; + + Object.defineProperty(obj, "prop", { + get: getFunc, + set: setFunc, + enumerable: true, + configurable: false + }); + + obj.prop = "overrideData"; + var propertyDefineCorrect = obj.hasOwnProperty("prop"); + var desc = Object.getOwnPropertyDescriptor(obj, "prop"); + + return propertyDefineCorrect && desc.set === setFunc && obj.verifySetFunc === "overrideData"; + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty) && fnExists(Object.getOwnPropertyDescriptor); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-540-9.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-540-9.js new file mode 100644 index 0000000000000000000000000000000000000000..ad9cc37533874f1706d573d08d47b4690f11495c --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-540-9.js @@ -0,0 +1,57 @@ +/// 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.6-4-540-9", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-540-9.js", + + description: "ES5 Attributes - Updating a named accessor property 'P' using simple assignment is successful, 'A' is an Array object (8.12.5 step 5.b)", + + test: function testcase() { + var obj = []; + + obj.verifySetFunc = "data"; + var getFunc = function () { + return obj.verifySetFunc; + }; + + var setFunc = function (value) { + obj.verifySetFunc = value; + }; + + Object.defineProperty(obj, "prop", { + get: getFunc, + set: setFunc, + enumerable: true, + configurable: false + }); + + obj.prop = "overrideData"; + var propertyDefineCorrect = obj.hasOwnProperty("prop"); + var desc = Object.getOwnPropertyDescriptor(obj, "prop"); + + return propertyDefineCorrect && desc.set === setFunc && obj.verifySetFunc === "overrideData"; + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty) && fnExists(Object.getOwnPropertyDescriptor); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-547-1.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-547-1.js new file mode 100644 index 0000000000000000000000000000000000000000..139036155ceffe39377735612eb020e6ca944c6b --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-547-1.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.6-4-547-1", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-547-1.js", + + description: "ES5 Attributes - Updating an indexed accessor property 'P' whose [[Configurable]] attribute is false to a data property does not succeed, 'A' is an Array object (8.12.9 step 9.a)", + + test: function testcase() { + var obj = []; + + obj.verifySetFunc = "data"; + var getFunc = function () { + return obj.verifySetFunc; + }; + + var setFunc = function (value) { + obj.verifySetFunc = value; + }; + + Object.defineProperty(obj, "0", { + get: getFunc, + set: setFunc, + enumerable: true, + configurable: false + }); + var desc1 = Object.getOwnPropertyDescriptor(obj, "0"); + + try { + Object.defineProperty(obj, "0", { + value: 1001 + }); + + return false; + } catch (e) { + var desc2 = Object.getOwnPropertyDescriptor(obj, "0"); + + return desc1.hasOwnProperty("get") && !desc2.hasOwnProperty("value") && e instanceof TypeError && + accessorPropertyAttributesAreCorrect(obj, "0", getFunc, setFunc, "verifySetFunc", true, false); + } + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty) && fnExists(Object.getOwnPropertyDescriptor); + } +}); diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-547-2.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-547-2.js new file mode 100644 index 0000000000000000000000000000000000000000..a8b71040c007ce4fa15267e600c6df5c465c7155 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-547-2.js @@ -0,0 +1,67 @@ +/// 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.6-4-547-2", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-547-2.js", + + description: "ES5 Attributes - Updating a named accessor property 'P' whose [[Configurable]] attribute is false to a data property does not succeed, 'A' is an Arguments object (8.12.9 step 9.a)", + + test: function testcase() { + var obj = (function () { + return arguments; + }()); + + obj.verifySetFunc = "data"; + var getFunc = function () { + return obj.verifySetFunc; + }; + + var setFunc = function (value) { + obj.verifySetFunc = value; + }; + + Object.defineProperty(obj, "prop", { + get: getFunc, + set: setFunc, + enumerable: true, + configurable: false + }); + var desc1 = Object.getOwnPropertyDescriptor(obj, "prop"); + + try { + Object.defineProperty(obj, "prop", { + value: 1001 + }); + + return false; + } catch (e) { + var desc2 = Object.getOwnPropertyDescriptor(obj, "prop"); + + return desc1.hasOwnProperty("get") && !desc2.hasOwnProperty("value") && e instanceof TypeError && + accessorPropertyAttributesAreCorrect(obj, "prop", getFunc, setFunc, "verifySetFunc", true, false); + } + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty) && fnExists(Object.getOwnPropertyDescriptor); + } +}); diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-547-3.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-547-3.js new file mode 100644 index 0000000000000000000000000000000000000000..bb69df065b35c05ae2f42547ce1302f8c3abd616 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-547-3.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.6-4-547-3", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-547-3.js", + + description: "ES5 Attributes - Updating a named accessor property 'P' whose [[Configurable]] attribute is false to a data property does not succeed, 'A' is an Array object (8.12.9 step 9.a)", + + test: function testcase() { + var obj = []; + + obj.verifySetFunc = "data"; + var getFunc = function () { + return obj.verifySetFunc; + }; + + var setFunc = function (value) { + obj.verifySetFunc = value; + }; + + Object.defineProperty(obj, "prop", { + get: getFunc, + set: setFunc, + enumerable: true, + configurable: false + }); + var desc1 = Object.getOwnPropertyDescriptor(obj, "prop"); + + try { + Object.defineProperty(obj, "prop", { + value: 1001 + }); + + return false; + } catch (e) { + var desc2 = Object.getOwnPropertyDescriptor(obj, "prop"); + + return desc1.hasOwnProperty("get") && !desc2.hasOwnProperty("value") && e instanceof TypeError && + accessorPropertyAttributesAreCorrect(obj, "prop", getFunc, setFunc, "verifySetFunc", true, false); + } + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty) && fnExists(Object.getOwnPropertyDescriptor); + } +}); diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-547-4.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-547-4.js new file mode 100644 index 0000000000000000000000000000000000000000..0e49fa9bfc28e1c7303094a6f26070224619f320 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-547-4.js @@ -0,0 +1,67 @@ +/// 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.6-4-547-4", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-547-4.js", + + description: "ES5 Attributes - Updating an indexed accessor property 'P' whose [[Configurable]] attribute is false to a data property does not succeed, 'A' is an Arguments object (8.12.9 step 9.a)", + + test: function testcase() { + var obj = (function () { + return arguments; + }()); + + obj.verifySetFunc = "data"; + var getFunc = function () { + return obj.verifySetFunc; + }; + + var setFunc = function (value) { + obj.verifySetFunc = value; + }; + + Object.defineProperty(obj, "0", { + get: getFunc, + set: setFunc, + enumerable: true, + configurable: false + }); + var desc1 = Object.getOwnPropertyDescriptor(obj, "0"); + + try { + Object.defineProperty(obj, "0", { + value: 1001 + }); + + return false; + } catch (e) { + var desc2 = Object.getOwnPropertyDescriptor(obj, "0"); + + return desc1.hasOwnProperty("get") && !desc2.hasOwnProperty("value") && e instanceof TypeError && + accessorPropertyAttributesAreCorrect(obj, "0", getFunc, setFunc, "verifySetFunc", true, false); + } + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty) && fnExists(Object.getOwnPropertyDescriptor); + } +}); diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-550.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-550.js index 6e3b17a43dfce3fbbdbcc597ca9c71d50b0dbc20..cb051cf1b8ce4b78a0ff1da0a91fe153b9e0e7dd 100644 --- a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-550.js +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-550.js @@ -23,7 +23,7 @@ ES5Harness.registerTest({ path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-550.js", - description: "ES5 Attributes - property ([[Get]] is a Function, [[Set]] is a Function, [[Enumerable]] is false, [[Configurable]] is true) is unenumerable", + description: "ES5 Attributes - property ([[Get]] is a Function, [[Set]] is a Function, [[Enumerable]] is false, [[Configurable]] is true) is non-enumerable", test: function testcase() { var obj = {}; diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-559.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-559.js index 9bc3af19c8115a36d52616080f575e5448be2e9d..56588175d67a0c0abda339ea94a0cee63f4d16b1 100644 --- a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-559.js +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-559.js @@ -23,7 +23,7 @@ ES5Harness.registerTest({ path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-559.js", - description: "ES5 Attributes - property ([[Get]] is a Function, [[Set]] is a Function, [[Enumerable]] is false, [[Configurable]] is false) is unenumerable", + description: "ES5 Attributes - property ([[Get]] is a Function, [[Set]] is a Function, [[Enumerable]] is false, [[Configurable]] is false) is non-enumerable", test: function testcase() { var obj = {}; diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-570.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-570.js index 09a036c467c3d60874bb43eed4853954e64a5564..23f0badb71dc26851de8b34c464d78d7ae733d67 100644 --- a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-570.js +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-570.js @@ -37,9 +37,8 @@ ES5Harness.registerTest({ }); var desc = Object.getOwnPropertyDescriptor(obj, "prop"); - var tempVariable = obj.prop; - return obj.hasOwnProperty("prop") && desc.get === getFunc && verifyExecute && typeof obj.prop === "undefined"; + return obj.hasOwnProperty("prop") && desc.get === getFunc && typeof obj.prop === "undefined" && verifyExecute; }, precondition: function prereq() { diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-579.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-579.js index d9a5f80450b50c4d2e65d49c42310a51cb799b18..82904485bf480846636fc4ff55c60250c06471a0 100644 --- a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-579.js +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-579.js @@ -38,7 +38,7 @@ ES5Harness.registerTest({ enumerable: true, configurable: true }); - var arrObj = new Array(); + var arrObj = []; arrObj.prop = "myOwnProperty"; return !arrObj.hasOwnProperty("prop") && arrObj.prop === "myOwnProperty" && data === "myOwnProperty"; diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-587.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-587.js index 56df4d8eef84b3b455e348e3d5ac922c91fc6e3d..0a4be3492b9561298728ff9703e013472b00d2d3 100644 --- a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-587.js +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-587.js @@ -23,7 +23,7 @@ ES5Harness.registerTest({ path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-587.js", - description: "ES5 Attributes - Inherited property is unenumerable (Math)", + description: "ES5 Attributes - Inherited property is non-enumerable (Math)", test: function testcase() { var data = "data"; diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-99.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-99.js index fd1d73e51926efdbb533034f20b528ca2e0f5049..cb3c388637fca6297b9da19cb31af96b71032ad0 100644 --- a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-99.js +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-99.js @@ -23,7 +23,7 @@ ES5Harness.registerTest({ path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-99.js", - description: "Object.defineProperty will throw TypeError when name.configurable = false, name.[[Get]] is undefined, desc.[[Get]] refers to an objcet (8.12.9 step 11.a.ii)", + description: "Object.defineProperty will throw TypeError when name.configurable = false, name.[[Get]] is undefined, desc.[[Get]] refers to an object (8.12.9 step 11.a.ii)", test: function testcase() { diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.7/15.2.3.7-6-a-93-3.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.7/15.2.3.7-6-a-93-3.js new file mode 100644 index 0000000000000000000000000000000000000000..9bd6cdfef64aca67fc45579f8d7f5dc57c2b1547 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.7/15.2.3.7-6-a-93-3.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.7-6-a-93-3", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.7/15.2.3.7-6-a-93-3.js", + + description: "Object.defineProperties will fail to update [[Value]] attribute of named data property 'P' when [[Configurable]] attribute of first updating property is false (8.12.9 - step Note & 10.a.ii.1)", + + test: function testcase() { + + var obj = {}; + + Object.defineProperty(obj, "property", { + value: 1001, + writable: false, + configurable: false + }); + + Object.defineProperty(obj, "property1", { + value: 1003, + writable: false, + configurable: true + }); + + try { + Object.defineProperties(obj, { + property: { + value: 1002 + }, + property1: { + value: 1004 + } + }); + + return false; + } catch (e) { + return e instanceof TypeError && + dataPropertyAttributesAreCorrect(obj, "property", 1001, false, false, false) && + dataPropertyAttributesAreCorrect(obj, "property1", 1003, false, false, true); + } + }, + + precondition: function prereq() { + return fnExists(Object.defineProperties) && fnExists(Object.defineProperty); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.7/15.2.3.7-6-a-93-4.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.7/15.2.3.7-6-a-93-4.js new file mode 100644 index 0000000000000000000000000000000000000000..8eaad4f3b10e87a9393d24bd33ebdabe002e4d4b --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.7/15.2.3.7-6-a-93-4.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.7-6-a-93-4", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.7/15.2.3.7-6-a-93-4.js", + + description: "Object.defineProperties will fail to update [[Value]] attribute of indexed data property 'P' when [[Configurable]] attribute of first updating property are false (8.12.9 - step Note & 10.a.ii.1)", + + test: function testcase() { + + var obj = {}; + + Object.defineProperty(obj, "0", { + value: 1001, + writable: false, + configurable: false + }); + + Object.defineProperty(obj, "1", { + value: 1003, + writable: false, + configurable: true + }); + + try { + Object.defineProperties(obj, { + 0: { + value: 1002 + }, + 1: { + value: 1004 + } + }); + + return false; + } catch (e) { + return e instanceof TypeError && + dataPropertyAttributesAreCorrect(obj, "0", 1001, false, false, false) && + dataPropertyAttributesAreCorrect(obj, "1", 1003, false, false, true); + } + }, + + precondition: function prereq() { + return fnExists(Object.defineProperties) && fnExists(Object.defineProperty); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-1-s.js b/test/suite/ietestcenter/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-1-s.js new file mode 100644 index 0000000000000000000000000000000000000000..de0084a59eb10e4bb398decce2670ae060cf8f59 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-1-s.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.3.2.1-11-1-s", + +path: "TestCases/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-1-s.js", + +description: "Duplicate seperate parameter name in Function constructor throws SyntaxError in strict mode", + +test: function testcase() { + try { + Function('a','a','"use strict";'); + return false; + } + catch (e) { + return (e instanceof SyntaxError); + } + + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-2-s.js b/test/suite/ietestcenter/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-2-s.js new file mode 100644 index 0000000000000000000000000000000000000000..96acd84605b2eb8a7dd3b3b215c9e20e27eda4fe --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-2-s.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.3.2.1-11-2-s", + +path: "TestCases/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-2-s.js", + +description: "Duplicate seperate parameter name in Function constructor called from strict mode allowed if body not strict", + +test: function testcase() +{ + "use strict"; + try { + Function('a','a','return;'); + return true; + } catch (e) { + return false; + } + }, + +strict:1, + +precondition: function prereq() { + return true; + } + +}); diff --git a/test/suite/ietestcenter/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-3-s.js b/test/suite/ietestcenter/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-3-s.js new file mode 100644 index 0000000000000000000000000000000000000000..bac05b2b0e3ecef1947f590b7df7f11bc7d6e450 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-3-s.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.3.2.1-11-3-s", + +path: "TestCases/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-3-s.js", + +description: "Function constructor having a formal parameter named 'eval' throws SyntaxError if function body is strict mode", + +test: function testcase() { + + + try { + Function('eval', '"use strict";'); + return false; + } + catch (e) { + return (e instanceof SyntaxError); + } + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-4-s.js b/test/suite/ietestcenter/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-4-s.js new file mode 100644 index 0000000000000000000000000000000000000000..91945989e5bc702a279e2ef747b707b5d19092dd --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-4-s.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.3.2.1-11-4-s", + +path: "TestCases/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-4-s.js", + +description: "Function constructor call from strict code with formal parameter named 'eval' does not throws SyntaxError if function body is not strict mode", + +test: function testcase() { + "use strict"; + try { + Function('eval', 'return;'); + return true; + } catch (e) { + return false; + } + + }, + +strict:1, + +precondition: function prereq() { + return true; + } + +}); diff --git a/test/suite/ietestcenter/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-5-s.js b/test/suite/ietestcenter/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-5-s.js new file mode 100644 index 0000000000000000000000000000000000000000..a916e358f768423caed26a7f79d5f4537c3c18d5 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-5-s.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.3.2.1-11-5-s", + +path: "TestCases/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-5-s.js", + +description: "Duplicate combined parameter name in Function constructor throws SyntaxError in strict mode", + +test: function testcase() +{ + try + { + Function('a,a','"use strict";'); + return false; + } + catch (e) { + return(e instanceof SyntaxError); + } + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-6-s.js b/test/suite/ietestcenter/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-6-s.js new file mode 100644 index 0000000000000000000000000000000000000000..b6a09dbae26bd380f1d3a9ebc03cf0283b28aceb --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-6-s.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.3.2.1-11-6-s", + +path: "TestCases/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-6-s.js", + +description: "Duplicate combined parameter name allowed in Function constructor called in strict mode if body not strict", + +test: function testcase() +{ + "use strict"; + try { + Function('a,a','return a;'); + return true; + } catch (e) { + return false; + } + + }, + +strict:1, + +precondition: function prereq() { + return true; + } + +}); diff --git a/test/suite/ietestcenter/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-7-s.js b/test/suite/ietestcenter/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-7-s.js new file mode 100644 index 0000000000000000000000000000000000000000..140e5db5aaa751ed5c28535bced43a882c9c22e7 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-7-s.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.3.2.1-11-7-s", + +path: "TestCases/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-7-s.js", + +description: "Function constructor call from strict code with formal parameter named arguments does not throws SyntaxError if function body is not strict mode", + +test: function testcase() { + "use strict"; + try { + Function('arguments', 'return;'); + return true; + + } catch (e) { + return false; + } + }, + +strict:1, + +precondition: function prereq() { + return true; + } + +}); diff --git a/test/suite/ietestcenter/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-8-s.js b/test/suite/ietestcenter/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-8-s.js new file mode 100644 index 0000000000000000000000000000000000000000..56ff76c4fb8a7f1976f1627a05be7da4844b12b3 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-8-s.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.3.2.1-11-8-s", + + path: "TestCases/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-8-s.js", + + description: "Strict Mode - SyntaxError is not thrown if a function is created using a Function constructor that has two identical parameters, which are separated by a unique parameter name and there is no explicit 'use strict' in the function constructor's body", + + test: function testcase() { + "use strict"; + + var foo = new Function("baz", "qux", "baz", "return 0;"); + return true; + + }, + + strict : 1, + precondition: function prereq() { + return true; + } + +}); diff --git a/test/suite/ietestcenter/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-9-s.js b/test/suite/ietestcenter/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-9-s.js new file mode 100644 index 0000000000000000000000000000000000000000..f47ecedac0785c4ea4b2a8e34fd9600e4e0a79f3 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-9-s.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.3.2.1-11-9-s", + + path: "TestCases/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-9-s.js", + + description: "Strict Mode - SyntaxError is thrown if a function is created using the Function constructor that has three identical parameters and there is no explicit 'use strict' in the function constructor's body", + + test: function testcase() { + "use strict"; + + var foo = new Function("baz", "baz", "baz", "return 0;"); + return true; + }, + strict : 1, + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter15/15.3/15.3.4/15.3.4.3/15.3.4.3-1-s.js b/test/suite/ietestcenter/chapter15/15.3/15.3.4/15.3.4.3/15.3.4.3-1-s.js new file mode 100644 index 0000000000000000000000000000000000000000..b49459a5aa89572de5040786a3b22d7df28f568a --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.3/15.3.4/15.3.4.3/15.3.4.3-1-s.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.3.4.3-1-s", + + path: "TestCases/chapter15/15.3/15.3.4/15.3.4.3/15.3.4.3-1-s.js", + + description: "Strict Mode - 'this' value is a string which cannot be converted to wrapper objects when the function is called with an array of arguments", + + test: function testcase() { + "use strict"; + + function fun() { + return (this instanceof String); + } + return !fun.apply("", Array); + }, + + strict : 1, + precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter15/15.3/15.3.4/15.3.4.3/15.3.4.3-2-s.js b/test/suite/ietestcenter/chapter15/15.3/15.3.4/15.3.4.3/15.3.4.3-2-s.js new file mode 100644 index 0000000000000000000000000000000000000000..6be263632cd6653b8b77077b083dace15170c52c --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.3/15.3.4/15.3.4.3/15.3.4.3-2-s.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.3.4.3-2-s", + + path: "TestCases/chapter15/15.3/15.3.4/15.3.4.3/15.3.4.3-2-s.js", + + description: "Strict Mode - 'this' value is a number which cannot be converted to wrapper objects when the function is called with an array of arguments", + + test: function testcase() { + "use strict"; + function fun() { + return (this instanceof Number); + } + return !fun.apply(-12, Array); + }, + + strict : 1, + precondition: function prereq() { + return fnSupportsStrict(); + } + +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter15/15.3/15.3.4/15.3.4.3/15.3.4.3-3-s.js b/test/suite/ietestcenter/chapter15/15.3/15.3.4/15.3.4.3/15.3.4.3-3-s.js new file mode 100644 index 0000000000000000000000000000000000000000..d405aa40975464d573066adee979e8d0b7ccf5b8 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.3/15.3.4/15.3.4.3/15.3.4.3-3-s.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.3.4.3-3-s", + + path: "TestCases/chapter15/15.3/15.3.4/15.3.4.3/15.3.4.3-3-s.js", + + description: "Strict Mode - 'this' value is a boolean which cannot be converted to wrapper objects when the function is called with an array of arguments", + + test: function testcase() { + "use strict"; + + function fun() { + return (this instanceof Boolean); + } + return !fun.apply(false, Array); + }, + strict : 1, + precondition: function prereq() { + return fnSupportsStrict(); + } + +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter15/15.3/15.3.4/15.3.4.4/15.3.4.4-1-s.js b/test/suite/ietestcenter/chapter15/15.3/15.3.4/15.3.4.4/15.3.4.4-1-s.js new file mode 100644 index 0000000000000000000000000000000000000000..bb762230bba3488dbd18b0cc0954964a6ae2e692 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.3/15.3.4/15.3.4.4/15.3.4.4-1-s.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.3.4.4-1-s", + + path: "TestCases/chapter15/15.3/15.3.4/15.3.4.4/15.3.4.4-1-s.js", + + description: "Strict Mode - 'this' value is a string which cannot be converted to wrapper objects when the function is called without an array of arguments", + + test: function testcase() { + "use strict"; + function fun() { + return (this instanceof String); + } + return !fun.call(""); + }, + strict : 1, + precondition: function prereq() { + return fnSupportsStrict(); + } + +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter15/15.3/15.3.4/15.3.4.4/15.3.4.4-2-s.js b/test/suite/ietestcenter/chapter15/15.3/15.3.4/15.3.4.4/15.3.4.4-2-s.js new file mode 100644 index 0000000000000000000000000000000000000000..bc0fa8b1123080f4826ca40a5505735078bbb99e --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.3/15.3.4/15.3.4.4/15.3.4.4-2-s.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.3.4.4-2-s", + + path: "TestCases/chapter15/15.3/15.3.4/15.3.4.4/15.3.4.4-2-s.js", + + description: "Strict Mode - 'this' value is a number which cannot be converted to wrapper objects when the function is called without an array argument", + + test: function testcase() { + "use strict"; + function fun() { + return (this instanceof Number); + } + return !fun.call(-12); + }, + + strict : 1, + precondition: function prereq() { + return fnSupportsStrict(); + } + +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter15/15.3/15.3.4/15.3.4.4/15.3.4.4-3-s.js b/test/suite/ietestcenter/chapter15/15.3/15.3.4/15.3.4.4/15.3.4.4-3-s.js new file mode 100644 index 0000000000000000000000000000000000000000..41834e85ffe079da0d6d34a74b856f3b0dbd13e7 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.3/15.3.4/15.3.4.4/15.3.4.4-3-s.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.3.4.4-3-s", + + path: "TestCases/chapter15/15.3/15.3.4/15.3.4.4/15.3.4.4-3-s.js", + + description: "Strict Mode - 'this' value is a boolean which cannot be converted to wrapper objects when the function is called without an array of arguments", + + test: function testcase() { + "use strict"; + function fun() { + return (this instanceof Boolean); + } + return !fun.call(false); + }, + + strict : 1, + precondition: function prereq() { + return fnSupportsStrict(); + } + +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter15/15.4/15.4.4/15.4.4.16/15.4.4.16-5-1-s.js b/test/suite/ietestcenter/chapter15/15.4/15.4.4/15.4.4.16/15.4.4.16-5-1-s.js new file mode 100644 index 0000000000000000000000000000000000000000..d055607638af4730c974e7ad27178c99ffab7c77 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.4/15.4.4/15.4.4.16/15.4.4.16-5-1-s.js @@ -0,0 +1,47 @@ +/// Copyright (c) 2010 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.4.4.16-5-1-s", + +path: "TestCases/chapter15/15.4/15.4.4/15.4.4.16-5-1-s.js", + +description: "Array.prototype.every - thisArg not passed to strict callbackfn", + +test: function testcase() { + var innerThisCorrect = false; + + function callbackfn(val, idx, obj) { + "use strict"; + innerThisCorrect = this===undefined; + return true; + } + + [1].every(callbackfn); + return innerThisCorrect; + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict() && fnExists(Array.prototype.every); + } +}); diff --git a/test/suite/ietestcenter/chapter15/15.4/15.4.4/15.4.4.17/15.4.4.17-5-1-s.js b/test/suite/ietestcenter/chapter15/15.4/15.4.4/15.4.4.17/15.4.4.17-5-1-s.js new file mode 100644 index 0000000000000000000000000000000000000000..29b3b0dd741ed7facf2db090a5b24468c89fbfe5 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.4/15.4.4/15.4.4.17/15.4.4.17-5-1-s.js @@ -0,0 +1,47 @@ +/// Copyright (c) 2010 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.4.4.17-5-1-s", + +path: "TestCases/chapter15/15.4/15.4.4/15.4.4.17-5-1-s.js", + +description: "Array.prototype.some - thisArg not passed to strict callbackfn", + +test: function testcase() { + var innerThisCorrect = false; + + function callbackfn(val, idx, obj) { + "use strict"; + innerThisCorrect = this===undefined; + return true; + } + + [1].some(callbackfn); + return innerThisCorrect; + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict() && fnExists(Array.prototype.some); + } +}); diff --git a/test/suite/ietestcenter/chapter15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-1-s.js b/test/suite/ietestcenter/chapter15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-1-s.js new file mode 100644 index 0000000000000000000000000000000000000000..3ba069e2d16f3910c077212cba0b0d56c5f6c5f3 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-1-s.js @@ -0,0 +1,47 @@ +/// Copyright (c) 2010 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.4.4.18-5-1-s", + +path: "TestCases/chapter15/15.4/15.4.4/15.4.4.18-5-1-s.js", + +description: "Array.prototype.forEach - thisArg not passed to strict callbackfn", + +test: function testcase() { + var innerThisCorrect = false; + + function callbackfn(val, idx, obj) { + "use strict"; + innerThisCorrect = this===undefined; + return true; + } + + [1].forEach(callbackfn); + return innerThisCorrect; + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict() && fnExists(Array.prototype.forEach); + } +}); diff --git a/test/suite/ietestcenter/chapter15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-1-s.js b/test/suite/ietestcenter/chapter15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-1-s.js new file mode 100644 index 0000000000000000000000000000000000000000..535598579eff3d6012f3e2fd36cee0f805dd7f1f --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-1-s.js @@ -0,0 +1,47 @@ +/// Copyright (c) 2010 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.4.4.19-5-1-s", + +path: "TestCases/chapter15/15.4/15.4.4/15.4.4.19-5-1-s.js", + +description: "Array.prototype.map - thisArg not passed to strict callbackfn", + +test: function testcase() { + var innerThisCorrect = false; + + function callbackfn(val, idx, obj) { + "use strict"; + innerThisCorrect = this===undefined; + return true; + } + + [1].map(callbackfn); + return innerThisCorrect; + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict() && fnExists(Array.prototype.map); + } +}); diff --git a/test/suite/ietestcenter/chapter15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-1-s.js b/test/suite/ietestcenter/chapter15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-1-s.js new file mode 100644 index 0000000000000000000000000000000000000000..56eb00e25809fef617cad90f926ef2625f6d3ee8 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-1-s.js @@ -0,0 +1,47 @@ +/// Copyright (c) 2010 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.4.4.20-5-1-s", + +path: "TestCases/chapter15/15.4/15.4.4/15.4.4.20-5-1-s.js", + +description: "Array.prototype.filter - thisArg not passed to strict callbackfn", + +test: function testcase() { + var innerThisCorrect = false; + + function callbackfn(val, idx, obj) { + "use strict"; + innerThisCorrect = this===undefined; + return true; + } + + [1].filter(callbackfn); + return innerThisCorrect; + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict() && fnExists(Array.prototype.filter); + } +}); diff --git a/test/suite/ietestcenter/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-4-s.js b/test/suite/ietestcenter/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-4-s.js new file mode 100644 index 0000000000000000000000000000000000000000..72fc8ab3a5db13c3e4e29ef323ae76288eec2b8c --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-4-s.js @@ -0,0 +1,48 @@ +/// Copyright (c) 2010 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.4.4.21-9-c-ii-4-s", + +path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21-9-c-ii-4-s.js", + +description: "Array.prototype.reduce - undefined passed as thisValue to strict callbackfn", +//ES5 Errata, undefined in step 9.c.ii as thisValue is supposed to be undefined + +test: function testcase() { + var innerThisCorrect = false; + function callbackfn(prevVal, curVal, idx, obj) + { + "use strict"; + innerThisCorrect = this===undefined; + return true; + } + [0].reduce(callbackfn,true); + return innerThisCorrect; + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict() && fnExists(Array.prototype.reduce); + } +}); diff --git a/test/suite/ietestcenter/chapter15/15.4/15.4.4/15.4.4.22/15.4.4.22-9-c-ii-4-s.js b/test/suite/ietestcenter/chapter15/15.4/15.4.4/15.4.4.22/15.4.4.22-9-c-ii-4-s.js new file mode 100644 index 0000000000000000000000000000000000000000..978888414f51cc7973450b0ca0f75d96dfb40c5e --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.4/15.4.4/15.4.4.22/15.4.4.22-9-c-ii-4-s.js @@ -0,0 +1,46 @@ +/// Copyright (c) 2010 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.4.4.22-9-c-ii-4-s", + +path: "TestCases/chapter15/15.4/15.4.4/15.4.4.22-9-c-ii-4-s.js", + +description: "Array.prototype.reduceRight - undefined passed as thisValue to strict callbackfn", + +test: function testcase() { + var innerThisCorrect = false; + function callbackfn(prevVal, curVal, idx, obj) + { + "use strict"; + innerThisCorrect = this===undefined; + return true; + } + [0].reduceRight(callbackfn,true); + return innerThisCorrect; + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict() && fnExists(Array.prototype.reduceRight); + } +}); diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-3-10.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-3-10.js index 5deefd392ab16d8803e3ec584bc0fd4eba2b5205..0375e483f789358af5ad6dc386fe66cbe3482dd8 100644 --- a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-3-10.js +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-3-10.js @@ -24,7 +24,7 @@ ES5Harness.registerTest({ path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-3-10.js", - description: "String.prototype.trim - 'S' is a string with null character ('\u0000')", + description: "String.prototype.trim - 'S' is a string with null character ('\\u0000')", test: function testcase() { return "\u0000".trim() === "\u0000"; diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-3-9.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-3-9.js index 385bfd330e49b207ad5d329c35fb4325880fa9be..7026ea1a7a51d75cf9f5843d3ff1951fe5dcfaae 100644 --- a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-3-9.js +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-3-9.js @@ -24,7 +24,7 @@ ES5Harness.registerTest({ path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-3-9.js", - description: "String.prototype.trim - 'S' is a string with null character ('\0')", + description: "String.prototype.trim - 'S' is a string with null character ('\\0')", test: function testcase() { return "\0".trim() === "\0";