diff --git a/test/harness/helper.js b/test/harness/helper.js index 1d4737657e0aa03730641768f8df0f9066c5eda7..51cabcffbc2b082664fb2e95862b02d08142acd3 100644 --- a/test/harness/helper.js +++ b/test/harness/helper.js @@ -18,7 +18,6 @@ /// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF /// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - /* Handles updating the page with information from the runner. */ function Presenter() { var altStyle = '', @@ -240,7 +239,6 @@ function Presenter() { function logResult(test) { var appendStr = ""; altStyle = (altStyle !== ' ') ? ' ' : 'alternate'; - if (test.result==="fail") { appendStr += '<tbody>'; appendStr += '<tr class=\"' + altStyle + '\">'; diff --git a/test/suite/ch07/7.8/7.8.3/7.8.3-2gs.js b/test/suite/ch07/7.8/7.8.3/7.8.3-2gs.js new file mode 100644 index 0000000000000000000000000000000000000000..6321f07711414d9c40349a8d7424030069b84330 --- /dev/null +++ b/test/suite/ch07/7.8/7.8.3/7.8.3-2gs.js @@ -0,0 +1,32 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch07/7.8/7.8.3/7.8.3-2gs.js + * @description Strict Mode - octal extension is forbidden in strict mode (after a hex number is assigned to a variable) + * @onlyStrict + * @negative ^((?!NotEarlyError).)*$ + */ + +"use strict"; +throw NotEarlyError; +var a; +a = 0x1; +a = 01; diff --git a/test/suite/ch07/7.8/7.8.3/7.8.3-3gs.js b/test/suite/ch07/7.8/7.8.3/7.8.3-3gs.js new file mode 100644 index 0000000000000000000000000000000000000000..d6a9374e1026c6dedbdc1deb32dfca240af10a64 --- /dev/null +++ b/test/suite/ch07/7.8/7.8.3/7.8.3-3gs.js @@ -0,0 +1,30 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch07/7.8/7.8.3/7.8.3-3gs.js + * @description Strict Mode - octal extension is forbidden in strict mode (after a hex number is assigned to a variable from an eval) + * @onlyStrict + * @negative SyntaxError + */ + +"use strict"; +var a; +eval("a = 0x1;a = 01;"); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_1.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_1.js new file mode 100644 index 0000000000000000000000000000000000000000..03a96c7b3df723a8e85d842d257152db0cc4b4fa --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_1.js @@ -0,0 +1,32 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_1.js + * @description Properties - [[HasOwnProperty]] (property does not exist) + */ + +function testcase() { + + var o = {}; + return o.hasOwnProperty("foo")===false; + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_10.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_10.js new file mode 100644 index 0000000000000000000000000000000000000000..bf09529a3b419838b090834bafe6669cec930522 --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_10.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_10.js + * @description Properties - [[HasOwnProperty]] (writable, configurable, non-enumerable own value property) + */ + +function testcase() { + + var o = {}; + Object.defineProperty(o, "foo", {value: 42, writable:true, configurable:true}); + return o.hasOwnProperty("foo"); + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_11.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_11.js new file mode 100644 index 0000000000000000000000000000000000000000..6ce87a225793130f58d2bde3f74946bf8d418082 --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_11.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_11.js + * @description Properties - [[HasOwnProperty]] (writable, configurable, enumerable own value property) + */ + +function testcase() { + + var o = {}; + Object.defineProperty(o, "foo", {value: 42, writable:true, enumerable:true, configurable:true}); + return o.hasOwnProperty("foo"); + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_12.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_12.js new file mode 100644 index 0000000000000000000000000000000000000000..0eeea18819e9ca73abc9f2c7f4da6526b3acb951 --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_12.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_12.js + * @description Properties - [[HasOwnProperty]] (non-writable, non-configurable, non-enumerable inherited value property) + */ + +function testcase() { + + var base = {}; + Object.defineProperty(base, "foo", {value: 42}); + var o = Object.create(base); + return o.hasOwnProperty("foo")===false; + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_13.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_13.js new file mode 100644 index 0000000000000000000000000000000000000000..cd77b0eb86fa14e85a50f10e0a73b3213501c19d --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_13.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_13.js + * @description Properties - [[HasOwnProperty]] (non-writable, non-configurable, enumerable inherited value property) + */ + +function testcase() { + + var base = {}; + Object.defineProperty(base, "foo", {value: 42, enumerable:true}); + var o = Object.create(base); + return o.hasOwnProperty("foo")===false; + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_14.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_14.js new file mode 100644 index 0000000000000000000000000000000000000000..1d9e38509cb9dfcffc39c977db10944955e7eeb1 --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_14.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_14.js + * @description Properties - [[HasOwnProperty]] (non-writable, configurable, non-enumerable inherited value property) + */ + +function testcase() { + + var base = {}; + Object.defineProperty(base, "foo", {value: 42, configurable:true}); + var o = Object.create(base); + return o.hasOwnProperty("foo")===false; + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_15.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_15.js new file mode 100644 index 0000000000000000000000000000000000000000..80c731b57dccfcab74dae0135bed8c9762effc1e --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_15.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_15.js + * @description Properties - [[HasOwnProperty]] (writable, non-configurable, non-enumerable inherited value property) + */ + +function testcase() { + + var base = {}; + Object.defineProperty(base, "foo", {value: 42, writable:true}); + var o = Object.create(base); + return o.hasOwnProperty("foo")===false; + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_16.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_16.js new file mode 100644 index 0000000000000000000000000000000000000000..384279c4c3ce4952e45b8015d34ca147e3b2b947 --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_16.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_16.js + * @description Properties - [[HasOwnProperty]] (non-writable, configurable, enumerable inherited value property) + */ + +function testcase() { + + var base = {}; + Object.defineProperty(base, "foo", {value: 42, configurable:true, enumerable:true}); + var o = Object.create(base); + return o.hasOwnProperty("foo")===false; + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_17.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_17.js new file mode 100644 index 0000000000000000000000000000000000000000..6923ed3a3d7406ed068afc5f2aee45003276a0da --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_17.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_17.js + * @description Properties - [[HasOwnProperty]] (writable, non-configurable, enumerable inherited value property) + */ + +function testcase() { + + var base = {}; + Object.defineProperty(base, "foo", {value: 42, writable:true, enumerable:true}); + var o = Object.create(base); + return o.hasOwnProperty("foo")===false; + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_18.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_18.js new file mode 100644 index 0000000000000000000000000000000000000000..42d397b48ac5998f6875942f14c8c4806f4d4dc0 --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_18.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_18.js + * @description Properties - [[HasOwnProperty]] (writable, configurable, non-enumerable inherited value property) + */ + +function testcase() { + + var base = {}; + Object.defineProperty(base, "foo", {value: 42, writable:true, configurable:true}); + var o = Object.create(base); + return o.hasOwnProperty("foo")===false; + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_19.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_19.js new file mode 100644 index 0000000000000000000000000000000000000000..e2cdb8a6b56e7eb0e8ab5b5598b4b68c13ec2e86 --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_19.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_19.js + * @description Properties - [[HasOwnProperty]] (writable, configurable, enumerable inherited value property) + */ + +function testcase() { + + var base = {}; + Object.defineProperty(base, "foo", {value: 42, writable:true, enumerable:true, configurable:true}); + var o = Object.create(base); + return o.hasOwnProperty("foo")===false; + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_2.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_2.js new file mode 100644 index 0000000000000000000000000000000000000000..ec0d3a4cf5b42fdfc40d31cf0a55041e81e8625e --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_2.js @@ -0,0 +1,32 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_2.js + * @description Properties - [[HasOwnProperty]] (old style own property) + */ + +function testcase() { + + var o = {foo: 42}; + return o.hasOwnProperty("foo"); + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_20.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_20.js new file mode 100644 index 0000000000000000000000000000000000000000..41644bd4af6b27aa270e6f5c12a1b501d64a9d7f --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_20.js @@ -0,0 +1,32 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_20.js + * @description Properties - [[HasOwnProperty]] (literal own getter property) + */ + +function testcase() { + + var o = { get foo() { return 42;} }; + return o.hasOwnProperty("foo"); + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_21.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_21.js new file mode 100644 index 0000000000000000000000000000000000000000..c1bf3f4a33906e101737f918d1a2bbe311a3b3bc --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_21.js @@ -0,0 +1,32 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_21.js + * @description Properties - [[HasOwnProperty]] (literal own setter property) + */ + +function testcase() { + + var o = { set foo(x) {;} }; + return o.hasOwnProperty("foo"); + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_22.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_22.js new file mode 100644 index 0000000000000000000000000000000000000000..935b9c02e7a700eabeb2e9eda4b9c4e587a75df7 --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_22.js @@ -0,0 +1,32 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_22.js + * @description Properties - [[HasOwnProperty]] (literal own getter/setter property) + */ + +function testcase() { + + var o = { get foo() { return 42;}, set foo(x) {;} }; + return o.hasOwnProperty("foo"); + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_23.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_23.js new file mode 100644 index 0000000000000000000000000000000000000000..85e0ca90a25ac8f9c03fb532491f4e57b762be28 --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_23.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_23.js + * @description Properties - [[HasOwnProperty]] (literal inherited getter property) + */ + +function testcase() { + + var base = { get foo() { return 42;} }; + var o = Object.create(base); + return o.hasOwnProperty("foo")===false; + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_24.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_24.js new file mode 100644 index 0000000000000000000000000000000000000000..1fc9c546754bbcfe4263082f7ac1d1af8fa777a2 --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_24.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_24.js + * @description Properties - [[HasOwnProperty]] (literal inherited setter property) + */ + +function testcase() { + + var base = { set foo(x) {;} }; + var o = Object.create(base); + return o.hasOwnProperty("foo")===false; + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_25.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_25.js new file mode 100644 index 0000000000000000000000000000000000000000..13f7b8b5746f8ac24828e63f941d9377e719808a --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_25.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_25.js + * @description Properties - [[HasOwnProperty]] (literal inherited getter/setter property) + */ + +function testcase() { + + var base = { get foo() { return 42;}, set foo(x) {;} }; + var o = Object.create(base); + return o.hasOwnProperty("foo")===false; + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_26.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_26.js new file mode 100644 index 0000000000000000000000000000000000000000..c7aca32dbafb0a28b8a2efa4cc3a106c2cd24ab5 --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_26.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_26.js + * @description Properties - [[HasOwnProperty]] (non-configurable, non-enumerable own getter property) + */ + +function testcase() { + + var o = {}; + Object.defineProperty(o, "foo", {get: function() {return 42;}}); + return o.hasOwnProperty("foo"); + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_27.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_27.js new file mode 100644 index 0000000000000000000000000000000000000000..993d7815b32831174050fa32a73e3bbd04e015fa --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_27.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_27.js + * @description Properties - [[HasOwnProperty]] (non-configurable, enumerable own getter property) + */ + +function testcase() { + + var o = {}; + Object.defineProperty(o, "foo", {get: function() {return 42;}, enumerable:true}); + return o.hasOwnProperty("foo"); + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_28.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_28.js new file mode 100644 index 0000000000000000000000000000000000000000..b367977905c2bc53d78a47d673b081f75e9346dd --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_28.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_28.js + * @description Properties - [[HasOwnProperty]] (configurable, non-enumerable own getter property) + */ + +function testcase() { + + var o = {}; + Object.defineProperty(o, "foo", {get: function() {return 42;}, configurable:true}); + return o.hasOwnProperty("foo"); + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_29.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_29.js new file mode 100644 index 0000000000000000000000000000000000000000..80290bc85a82b6a2d192eaf5bd32382180d60a8f --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_29.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_29.js + * @description Properties - [[HasOwnProperty]] (configurable, enumerable own getter property) + */ + +function testcase() { + + var o = {}; + Object.defineProperty(o, "foo", {get: function() {return 42;}, enumerable:true, configurable:true}); + return o.hasOwnProperty("foo"); + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_3.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_3.js new file mode 100644 index 0000000000000000000000000000000000000000..f117b40639a31027c4e1a22c265b569331eaa537 --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_3.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_3.js + * @description Properties - [[HasOwnProperty]] (old style inherited property) + */ + +function testcase() { + + var base = {foo:42}; + var o = Object.create(base); + return o.hasOwnProperty("foo")===false; + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_30.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_30.js new file mode 100644 index 0000000000000000000000000000000000000000..e2b98dc4af6bacda2982681f285cf6b1c6096bc5 --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_30.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_30.js + * @description Properties - [[HasOwnProperty]] (non-configurable, non-enumerable own setter property) + */ + +function testcase() { + + var o = {}; + Object.defineProperty(o, "foo", {set: function() {;}}); + return o.hasOwnProperty("foo"); + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_31.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_31.js new file mode 100644 index 0000000000000000000000000000000000000000..9cbb0031ba574fbab9b7ee165c96dc6444c7b2ed --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_31.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_31.js + * @description Properties - [[HasOwnProperty]] (non-configurable, enumerable own setter property) + */ + +function testcase() { + + var o = {}; + Object.defineProperty(o, "foo", {set: function() {;}, enumerable:true}); + return o.hasOwnProperty("foo"); + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_32.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_32.js new file mode 100644 index 0000000000000000000000000000000000000000..c7458072d36a2ec233e33608ef34ea07bbc75f99 --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_32.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_32.js + * @description Properties - [[HasOwnProperty]] (configurable, non-enumerable own setter property) + */ + +function testcase() { + + var o = {}; + Object.defineProperty(o, "foo", {set: function() {;}, configurable:true}); + return o.hasOwnProperty("foo"); + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_33.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_33.js new file mode 100644 index 0000000000000000000000000000000000000000..90f5e8c4f33e1919104008f53dc1d145989dcdf7 --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_33.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_33.js + * @description Properties - [[HasOwnProperty]] (configurable, enumerable own setter property) + */ + +function testcase() { + + var o = {}; + Object.defineProperty(o, "foo", {set: function() {;}, enumerable:true, configurable:true}); + return o.hasOwnProperty("foo"); + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_34.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_34.js new file mode 100644 index 0000000000000000000000000000000000000000..17ca1f1ec9f076436fe3c384a20ce81e8337ac65 --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_34.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_34.js + * @description Properties - [[HasOwnProperty]] (non-configurable, non-enumerable own getter/setter property) + */ + +function testcase() { + + var o = {}; + Object.defineProperty(o, "foo", {get: function() {return 42;}, set: function() {;}}); + return o.hasOwnProperty("foo"); + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_35.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_35.js new file mode 100644 index 0000000000000000000000000000000000000000..f90197d76c33ec705acb3fad68b44fb68363255e --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_35.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_35.js + * @description Properties - [[HasOwnProperty]] (non-configurable, enumerable own getter/setter property) + */ + +function testcase() { + + var o = {}; + Object.defineProperty(o, "foo", {get: function() {return 42;}, set: function() {;}, enumerable:true}); + return o.hasOwnProperty("foo"); + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_36.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_36.js new file mode 100644 index 0000000000000000000000000000000000000000..5db786b2f85a89884759d718705b41ffa5a3236b --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_36.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_36.js + * @description Properties - [[HasOwnProperty]] (configurable, non-enumerable own getter/setter property) + */ + +function testcase() { + + var o = {}; + Object.defineProperty(o, "foo", {get: function() {return 42;}, set: function() {;}, configurable:true}); + return o.hasOwnProperty("foo"); + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_37.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_37.js new file mode 100644 index 0000000000000000000000000000000000000000..a224d7a83e5159536aa635cfeeea4f7fc87e3c81 --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_37.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_37.js + * @description Properties - [[HasOwnProperty]] (configurable, enumerable own getter/setter property) + */ + +function testcase() { + + var o = {}; + Object.defineProperty(o, "foo", {get: function() {return 42;}, set: function() {;}, enumerable:true, configurable:true}); + return o.hasOwnProperty("foo"); + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_38.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_38.js new file mode 100644 index 0000000000000000000000000000000000000000..34cbe041d359588ab0389ce8fee3a8001a3844fd --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_38.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_38.js + * @description Properties - [[HasOwnProperty]] (non-configurable, non-enumerable inherited getter property) + */ + +function testcase() { + + var base = {}; + Object.defineProperty(base, "foo", {get: function() {return 42;}}); + var o = Object.create(base); + return o.hasOwnProperty("foo")===false; + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_39.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_39.js new file mode 100644 index 0000000000000000000000000000000000000000..a4cf5c08083ccba0f9d4505b212e7f48eb7970bd --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_39.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_39.js + * @description Properties - [[HasOwnProperty]] (non-configurable, enumerable inherited getter property) + */ + +function testcase() { + + var base = {}; + Object.defineProperty(base, "foo", {get: function() {return 42;}, enumerable:true}); + var o = Object.create(base); + return o.hasOwnProperty("foo")===false; + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_4.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_4.js new file mode 100644 index 0000000000000000000000000000000000000000..1e29909c4ef345c16846046053f80f95d6479ce9 --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_4.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_4.js + * @description Properties - [[HasOwnProperty]] (non-writable, non-configurable, non-enumerable own value property) + */ + +function testcase() { + + var o = {}; + Object.defineProperty(o, "foo", {value: 42}); + return o.hasOwnProperty("foo"); + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_40.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_40.js new file mode 100644 index 0000000000000000000000000000000000000000..ab06b04adf338d980ec383eae584b255b436774b --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_40.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_40.js + * @description Properties - [[HasOwnProperty]] (configurable, non-enumerable inherited getter property) + */ + +function testcase() { + + var base = {}; + Object.defineProperty(base, "foo", {get: function() {return 42;}, configurable:true}); + var o = Object.create(base); + return o.hasOwnProperty("foo")===false; + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_41.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_41.js new file mode 100644 index 0000000000000000000000000000000000000000..1c960b3eac6e50a2582a6951d16c45ca7d2f729c --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_41.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_41.js + * @description Properties - [[HasOwnProperty]] (configurable, enumerable inherited getter property) + */ + +function testcase() { + + var base = {}; + Object.defineProperty(base, "foo", {get: function() {return 42;}, enumerable:true, configurable:true}); + var o = Object.create(base); + return o.hasOwnProperty("foo")===false; + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_42.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_42.js new file mode 100644 index 0000000000000000000000000000000000000000..eb38bab046295b5aa8020c16c8dc899a1b1a9623 --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_42.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_42.js + * @description Properties - [[HasOwnProperty]] (non-configurable, non-enumerable inherited setter property) + */ + +function testcase() { + + var base = {}; + Object.defineProperty(base, "foo", {set: function() {;}}); + var o = Object.create(base); + return o.hasOwnProperty("foo")===false; + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_43.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_43.js new file mode 100644 index 0000000000000000000000000000000000000000..b6b74fdda399ee966f8c00eecc660f0e0186182e --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_43.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_43.js + * @description Properties - [[HasOwnProperty]] (non-configurable, enumerable inherited setter property) + */ + +function testcase() { + + var base = {}; + Object.defineProperty(base, "foo", {set: function() {;}, enumerable:true}); + var o = Object.create(base); + return o.hasOwnProperty("foo")===false; + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_44.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_44.js new file mode 100644 index 0000000000000000000000000000000000000000..9ec5af0d8a31a8d127888d8e920f6e3feedeb324 --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_44.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_44.js + * @description Properties - [[HasOwnProperty]] (configurable, non-enumerable inherited setter property) + */ + +function testcase() { + + var base = {}; + Object.defineProperty(base, "foo", {set: function() {;}, configurable:true}); + var o = Object.create(base); + return o.hasOwnProperty("foo")===false; + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_45.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_45.js new file mode 100644 index 0000000000000000000000000000000000000000..cd827375b030847c25eef832eb906dca80454a45 --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_45.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_45.js + * @description Properties - [[HasOwnProperty]] (configurable, enumerable inherited setter property) + */ + +function testcase() { + + var base = {}; + Object.defineProperty(base, "foo", {set: function() {;}, enumerable:true, configurable:true}); + var o = Object.create(base); + return o.hasOwnProperty("foo")===false; + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_46.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_46.js new file mode 100644 index 0000000000000000000000000000000000000000..3092081009c0dffbbb8d909d69fe928dca831364 --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_46.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_46.js + * @description Properties - [[HasOwnProperty]] (non-configurable, non-enumerable inherited getter/setter property) + */ + +function testcase() { + + var base = {}; + Object.defineProperty(base, "foo", {get: function() {return 42;}, set: function() {;}}); + var o = Object.create(base); + return o.hasOwnProperty("foo")===false; + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_47.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_47.js new file mode 100644 index 0000000000000000000000000000000000000000..4f7c57f69a41ca03e36296d506947cb017d056ce --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_47.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_47.js + * @description Properties - [[HasOwnProperty]] (non-configurable, enumerable inherited getter/setter property) + */ + +function testcase() { + + var base = {}; + Object.defineProperty(base, "foo", {get: function() {return 42;}, set: function() {;}, enumerable:true}); + var o = Object.create(base); + return o.hasOwnProperty("foo")===false; + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_48.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_48.js new file mode 100644 index 0000000000000000000000000000000000000000..4c40a2239963d8b561c67a46a064ce671e188376 --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_48.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_48.js + * @description Properties - [[HasOwnProperty]] (configurable, non-enumerable inherited getter/setter property) + */ + +function testcase() { + + var base = {}; + Object.defineProperty(base, "foo", {get: function() {return 42;}, set: function() {;}, configurable:true}); + var o = Object.create(base); + return o.hasOwnProperty("foo")===false; + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_49.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_49.js new file mode 100644 index 0000000000000000000000000000000000000000..49831acd4d710c3ffa61be9ffd2103f01924189f --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_49.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_49.js + * @description Properties - [[HasOwnProperty]] (configurable, enumerable inherited getter/setter property) + */ + +function testcase() { + + var base = {}; + Object.defineProperty(base, "foo", {get: function() {return 42;}, set: function() {;}, enumerable:true, configurable:true}); + var o = Object.create(base); + return o.hasOwnProperty("foo")===false; + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_5.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_5.js new file mode 100644 index 0000000000000000000000000000000000000000..9a62e84b4b5af63b2dde658c7bac65ee22d67b05 --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_5.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_5.js + * @description Properties - [[HasOwnProperty]] (non-writable, non-configurable, enumerable own value property) + */ + +function testcase() { + + var o = {}; + Object.defineProperty(o, "foo", {value: 42, enumerable:true}); + return o.hasOwnProperty("foo"); + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_6.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_6.js new file mode 100644 index 0000000000000000000000000000000000000000..3c24dce96059b6367e5a240e4cc841f3d33d7c06 --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_6.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_6.js + * @description Properties - [[HasOwnProperty]] (non-writable, configurable, non-enumerable own value property) + */ + +function testcase() { + + var o = {}; + Object.defineProperty(o, "foo", {value: 42, configurable:true}); + return o.hasOwnProperty("foo"); + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_7.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_7.js new file mode 100644 index 0000000000000000000000000000000000000000..979722f1bd51d7fdfc3d49f88b9cb38eab9d4aa8 --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_7.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_7.js + * @description Properties - [[HasOwnProperty]] (writable, non-configurable, non-enumerable own value property) + */ + +function testcase() { + + var o = {}; + Object.defineProperty(o, "foo", {value: 42, writable:true}); + return o.hasOwnProperty("foo"); + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_8.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_8.js new file mode 100644 index 0000000000000000000000000000000000000000..e210386fb4ab06ba42383d7ddf2bd48e691374a6 --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_8.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_8.js + * @description Properties - [[HasOwnProperty]] (non-writable, configurable, enumerable own value property) + */ + +function testcase() { + + var o = {}; + Object.defineProperty(o, "foo", {value: 42, configurable:true, enumerable:true}); + return o.hasOwnProperty("foo"); + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_9.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_9.js new file mode 100644 index 0000000000000000000000000000000000000000..96a4f7066c3dec2ae230c40ac8ad250366c2dccd --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_9.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_9.js + * @description Properties - [[HasOwnProperty]] (writable, non-configurable, enumerable own value property) + */ + +function testcase() { + + var o = {}; + Object.defineProperty(o, "foo", {value: 42, writable:true, enumerable:true}); + return o.hasOwnProperty("foo"); + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.4/8.14.4-8-b_1.js b/test/suite/ch08/8.12/8.12.4/8.14.4-8-b_1.js new file mode 100644 index 0000000000000000000000000000000000000000..4ac055699bed77c184377588702e9b96d6fc5613 --- /dev/null +++ b/test/suite/ch08/8.12/8.12.4/8.14.4-8-b_1.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.4/8.14.4-8-b_1.js + * @description Non-writable property on a prototype written to. + */ + +function testcase() { + function foo() {}; + Object.defineProperty(foo.prototype, "bar", {value: "unwritable"}); + + var o = new foo(); + o.bar = "overridden"; + return o.hasOwnProperty("bar")===false && o.bar==="unwritable"; +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.4/8.14.4-8-b_2.js b/test/suite/ch08/8.12/8.12.4/8.14.4-8-b_2.js new file mode 100644 index 0000000000000000000000000000000000000000..92504de56e62e9ef9e1af93459255f30963ce8c8 --- /dev/null +++ b/test/suite/ch08/8.12/8.12.4/8.14.4-8-b_2.js @@ -0,0 +1,41 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.4/8.14.4-8-b_2.js + * @description Non-writable property on a prototype written to in strict mode. + * @onlyStrict + */ + +function testcase() { + "use strict"; + + function foo() {}; + Object.defineProperty(foo.prototype, "bar", {value: "unwritable"}); + + var o = new foo(); + try { + o.bar = "overridden"; + return false; + } catch(e) { + return (e instanceof TypeError) && (o.bar==="unwritable"); + } +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.5/8.12.5-3-b_1.js b/test/suite/ch08/8.12/8.12.5/8.12.5-3-b_1.js new file mode 100644 index 0000000000000000000000000000000000000000..dfa48ac5d6e023c17aead2eafe354055bc939044 --- /dev/null +++ b/test/suite/ch08/8.12/8.12.5/8.12.5-3-b_1.js @@ -0,0 +1,55 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.5/8.12.5-3-b_1.js + * @description Changing the value of a data property should not affect it's non-value property descriptor attributes. + */ + + +function testcase() { + var origReduce = Array.prototype.reduce; + var origDesc = Object.getOwnPropertyDescriptor(Array.prototype, "reduce"); + var newDesc; + + try { + Array.prototype.reduce = function () {;}; + newDesc = Object.getOwnPropertyDescriptor(Array.prototype, "reduce"); + var descArray = [origDesc, newDesc]; + + for (var j in descArray) { //Ensure no attributes are magically added to newDesc + for (var i in descArray[j]) { + if (i==="value") { + if (origDesc[i]===newDesc[i]) { + return false; + } + } + else if (origDesc[i]!==newDesc[i]) { + return false; + } + } + } + return true; + + } finally { + Array.prototype.reduce = origReduce; + } +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.5/8.12.5-3-b_2.js b/test/suite/ch08/8.12/8.12.5/8.12.5-3-b_2.js new file mode 100644 index 0000000000000000000000000000000000000000..3ff6d552430eb75b4170f330b38e406c316b158b --- /dev/null +++ b/test/suite/ch08/8.12/8.12.5/8.12.5-3-b_2.js @@ -0,0 +1,59 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.5/8.12.5-3-b_2.js + * @description Changing the value of a data property should not affect it's non-value property descriptor attributes. + */ + + +function testcase() { + var tempObj = {}; + + Object.defineProperty(tempObj, "reduce", { value:456, enumerable:false, writable:true}); + var origReduce = tempObj.reduce; + var origDesc = Object.getOwnPropertyDescriptor(tempObj, "reduce"); + + var newDesc; + + try { + tempObj.reduce = 123; + newDesc = Object.getOwnPropertyDescriptor(tempObj, "reduce"); + var descArray = [origDesc, newDesc]; + + for (var j in descArray) { + for (var i in descArray[j]) { + if (i==="value") { + if (origDesc[i]===newDesc[i]) { + return false; + } + } + else if (origDesc[i]!==newDesc[i]) { + return false; + } + } + } + return true; + + } finally { + tempObj.reduce = origReduce; + } +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.5/8.12.5-5-b_1.js b/test/suite/ch08/8.12/8.12.5/8.12.5-5-b_1.js new file mode 100644 index 0000000000000000000000000000000000000000..201b36982af7e379d0b62e2e58a6d4b4e38fe3b9 --- /dev/null +++ b/test/suite/ch08/8.12/8.12.5/8.12.5-5-b_1.js @@ -0,0 +1,54 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.5/8.12.5-5-b_1.js + * @description Changing the value of an accessor property should not affect it's property descriptor attributes. + */ + + +function testcase() { + var tempObj = {}; + + Object.defineProperty(tempObj, "reduce", { get: function() {return 456;}, enumerable:false, set: function() {;}}); + var origReduce = tempObj.reduce; + var origDesc = Object.getOwnPropertyDescriptor(tempObj, "reduce"); + + var newDesc; + + try { + tempObj.reduce = 123; + newDesc = Object.getOwnPropertyDescriptor(tempObj, "reduce"); + var descArray = [origDesc, newDesc]; + + for (var j in descArray) { + for (var i in descArray[j]) { + if (origDesc[i]!==newDesc[i]) { + return false; + } + } + } + return tempObj.reduce===456; + + } finally { + tempObj.reduce = origReduce; + } +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.9/8.12.9-9-b-i_1.js b/test/suite/ch08/8.12/8.12.9/8.12.9-9-b-i_1.js new file mode 100644 index 0000000000000000000000000000000000000000..6d44900de0ff84bfcf6b4d6a02564b58389e6f50 --- /dev/null +++ b/test/suite/ch08/8.12/8.12.9/8.12.9-9-b-i_1.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.9/8.12.9-9-b-i_1.js + * @description Redefine a configurable data property to be an accessor property on a newly non-extensible object + */ + + +function testcase() { + var o = {}; + Object.defineProperty(o, "foo", + { value: "hello", + configurable: true}); + Object.preventExtensions(o); + Object.defineProperty(o, "foo", { get: function() { return 5;} }); + + var fooDescrip = Object.getOwnPropertyDescriptor(o, "foo"); + return o.foo===5 && fooDescrip.get!==undefined && fooDescrip.set===undefined && fooDescrip.value===undefined && fooDescrip.configurable===true && fooDescrip.enumerable===false && fooDescrip.writable===undefined; +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.9/8.12.9-9-b-i_2.js b/test/suite/ch08/8.12/8.12.9/8.12.9-9-b-i_2.js new file mode 100644 index 0000000000000000000000000000000000000000..1b8b48e7dc76d8f775f39895c73617eff1746291 --- /dev/null +++ b/test/suite/ch08/8.12/8.12.9/8.12.9-9-b-i_2.js @@ -0,0 +1,40 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.9/8.12.9-9-b-i_2.js + * @description Redefine a configurable data property to be an accessor property on a newly non-extensible object + */ + + +function testcase() { + var o = {}; + Object.defineProperty(o, "foo", + { value: "hello", + configurable: true, + enumerable: true, + writable: true}); + Object.preventExtensions(o); + Object.defineProperty(o, "foo", { get: function() { return 5;} }); + + var fooDescrip = Object.getOwnPropertyDescriptor(o, "foo"); + return o.foo===5 && fooDescrip.get!==undefined && fooDescrip.set===undefined && fooDescrip.value===undefined && fooDescrip.configurable===true && fooDescrip.enumerable===true && fooDescrip.writable===undefined; +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.9/8.12.9-9-c-i_1.js b/test/suite/ch08/8.12/8.12.9/8.12.9-9-c-i_1.js new file mode 100644 index 0000000000000000000000000000000000000000..2af95327e0716773f237a14e20efbeedec8d7346 --- /dev/null +++ b/test/suite/ch08/8.12/8.12.9/8.12.9-9-c-i_1.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.9/8.12.9-9-c-i_1.js + * @description Redefine a configurable accessor property to be a data property on a non-extensible object + */ + + +function testcase() { + var o = {}; + Object.defineProperty(o, "foo", + { get: function() { return 5;}, + configurable: true}); + Object.preventExtensions(o); + Object.defineProperty(o, "foo", { value: "hello"}); + + var fooDescrip = Object.getOwnPropertyDescriptor(o, "foo"); + return o.foo==="hello" && fooDescrip.get===undefined && fooDescrip.set===undefined && fooDescrip.value==="hello" && fooDescrip.configurable===true && fooDescrip.enumerable===false && fooDescrip.writable===false; +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.9/8.12.9-9-c-i_2.js b/test/suite/ch08/8.12/8.12.9/8.12.9-9-c-i_2.js new file mode 100644 index 0000000000000000000000000000000000000000..c2b7d5c2f75e924f7765b8d6ff4ddfc08b119bdc --- /dev/null +++ b/test/suite/ch08/8.12/8.12.9/8.12.9-9-c-i_2.js @@ -0,0 +1,40 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.9/8.12.9-9-c-i_2.js + * @description Redefine a configurable accessor property to be a data property on a non-extensible object + */ + + +function testcase() { + var o = {}; + Object.defineProperty(o, "foo", + { get: function() { return 5;}, + configurable: true}); + Object.preventExtensions(o); + Object.defineProperty(o, "foo", + { value: "hello", + writable: true}); + + var fooDescrip = Object.getOwnPropertyDescriptor(o, "foo"); + return o.foo==="hello" && fooDescrip.get===undefined && fooDescrip.set===undefined && fooDescrip.value==="hello" && fooDescrip.configurable===true && fooDescrip.enumerable===false && fooDescrip.writable===true; +} +runTestCase(testcase); diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-10-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-10-s.js new file mode 100644 index 0000000000000000000000000000000000000000..f7a2543d20285c0a6016c22b63a6fa9e9f7bccc3 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-10-s.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-10-s.js + * @description Strict Mode - checking 'this' (FunctionExpression includes strict directive prologue) + * @onlyStrict + */ + +function testcase() { +var f = function () { + "use strict"; + return typeof this; +} +return f() === "undefined"; +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-100-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-100-s.js new file mode 100644 index 0000000000000000000000000000000000000000..03565a398a1ea794e697528959a6b231fcaeafda --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-100-s.js @@ -0,0 +1,37 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-100-s.js + * @description Strict Mode - checking 'this' (strict function passed as arg to String.prototype.replace from non-strict context) + * @onlyStrict + */ + +function testcase() { +var x = 3; + +function f() { + "use strict"; + x = this; + return "a"; +} +return ("ab".replace("b", f)==="aa") && (x===undefined); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-100gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-100gs.js new file mode 100644 index 0000000000000000000000000000000000000000..bbdc53d483ae60c3b317bc93f1b566224ed12ebc --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-100gs.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-100gs.js + * @description Strict Mode - checking 'this' (strict function passed as arg to String.prototype.replace from non-strict context) + * @onlyStrict + */ +var x = 3; + +function f() { + "use strict"; + x = this; + return "a"; +} +if (("ab".replace("b", f)!=="aa") || (x!==undefined)) { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-101-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-101-s.js new file mode 100644 index 0000000000000000000000000000000000000000..761faefaf47721e3e11624367b12611bca2b262c --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-101-s.js @@ -0,0 +1,37 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-101-s.js + * @description Strict Mode - checking 'this' (non-strict function passed as arg to String.prototype.replace from strict context) + * @onlyStrict + */ + +function testcase() { +var x = 3; + +function f() { + x = this; + return "a"; +} + +return (function() {"use strict"; return "ab".replace("b", f)==="aa";}()) && (x===fnGlobalObject()); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-101gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-101gs.js new file mode 100644 index 0000000000000000000000000000000000000000..6abb89c36135ca80b72a9d613bcd65760e1110d9 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-101gs.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-101gs.js + * @description Strict Mode - checking 'this' (non-strict function passed as arg to String.prototype.replace from strict context) + * @onlyStrict + */ +var x = 3; + +function f() { + x = this; + return "a"; +} + +if ( (!(function() {"use strict"; return "ab".replace("b", f)==="aa";}())) || (x!==fnGlobalObject())) { + throw "'this' had incorrect value!"; +} diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-102-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-102-s.js new file mode 100644 index 0000000000000000000000000000000000000000..cc8fc6870e6ae19fa8e27c31da5647ddba73a5cc --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-102-s.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-102-s.js + * @description Strict Mode - checking 'this' (strict anonymous function passed as arg to String.prototype.replace from non-strict context) + * @onlyStrict + */ + +function testcase() { +var x = 3; + +return ("ab".replace("b", (function () { + "use strict"; + return function () { + x = this; + return "a"; + } + })())==="aa") && (x===undefined); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-102gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-102gs.js new file mode 100644 index 0000000000000000000000000000000000000000..d049c76ca2be116a8315a9e34b4fc94e66eedddd --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-102gs.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-102gs.js + * @description Strict Mode - checking 'this' (strict anonymous function passed as arg to String.prototype.replace from non-strict context) + * @onlyStrict + */ +var x = 3; +if ( ("ab".replace("b", (function () { + "use strict"; + return function () { + x = this; + return "a"; + } + })())!=="aa") || (x!==undefined)) { + throw "'this' had incorrect value!"; +} diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-10gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-10gs.js new file mode 100644 index 0000000000000000000000000000000000000000..e89c04fefa400084e549bb9ef7c01ab5fb5eac4b --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-10gs.js @@ -0,0 +1,32 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-10gs.js + * @description Strict - checking 'this' from a global scope (FunctionExpression includes strict directive prologue) + * @onlyStrict + */ + +var f = function () { + "use strict"; + return typeof this; +} +if (f() !== "undefined") { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-11-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-11-s.js new file mode 100644 index 0000000000000000000000000000000000000000..f00a5c11d788df69c5cfafb9b3cfd984a5064a39 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-11-s.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-11-s.js + * @description Strict Mode - checking 'this' (Anonymous FunctionExpression defined within strict mode) + * @onlyStrict + */ + +function testcase() { +"use strict"; +return (function () { + return typeof this; +})() === "undefined"; +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-11gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-11gs.js new file mode 100644 index 0000000000000000000000000000000000000000..4dac505a590d67cb77c433398f986f05b300cdee --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-11gs.js @@ -0,0 +1,32 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-11gs.js + * @description Strict - checking 'this' from a global scope (Anonymous FunctionExpression defined within strict mode) + * @onlyStrict + */ + +"use strict"; +if ((function () { + return typeof this; +})() !== "undefined") { + throw "'this' had incorrect value!"; +} + diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-12-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-12-s.js new file mode 100644 index 0000000000000000000000000000000000000000..8299e2f6ca030ee9d9f8236769f6d338eb1742a1 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-12-s.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-12-s.js + * @description Strict Mode - checking 'this' (Anonymous FunctionExpression includes strict directive prologue) + * @onlyStrict + */ + +function testcase() { +return (function () { + "use strict"; + return typeof this; +})() === "undefined"; +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-12gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-12gs.js new file mode 100644 index 0000000000000000000000000000000000000000..8805ce54e1663210a48efdccfe464f865abbcec9 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-12gs.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-12gs.js + * @description Strict - checking 'this' from a global scope (Anonymous FunctionExpression includes strict directive prologue) + * @onlyStrict + */ + +if ((function () { + "use strict"; + return typeof this; +})() !== "undefined") { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-13-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-13-s.js new file mode 100644 index 0000000000000000000000000000000000000000..b649a10a3ea6f8c2781c523a6afe424ee97fba21 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-13-s.js @@ -0,0 +1,32 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-13-s.js + * @description Strict Mode - checking 'this' (Function constructor defined within strict mode) + * @onlyStrict + */ + +function testcase() { +"use strict"; +var f = Function("return typeof this;"); +return f() !== "undefined"; +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-13gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-13gs.js new file mode 100644 index 0000000000000000000000000000000000000000..b4508132929c30238b93a4ba32c5d8a977174a19 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-13gs.js @@ -0,0 +1,30 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-13gs.js + * @description Strict - checking 'this' from a global scope (Function constructor defined within strict mode) + * @onlyStrict + */ + +"use strict"; +var f = Function("return typeof this;"); +if (f() === "undefined") { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-14-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-14-s.js new file mode 100644 index 0000000000000000000000000000000000000000..cac94e3da025466155d28e84df12d62005cefedf --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-14-s.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-14-s.js + * @description Strict Mode - checking 'this' (Function constructor includes strict directive prologue) + * @onlyStrict + */ + +function testcase() { +var f = Function("\"use strict\";\nreturn typeof this;"); +return f() === "undefined"; +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-14gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-14gs.js new file mode 100644 index 0000000000000000000000000000000000000000..1a7d26e0c2a40595165a8d201cb597cea02d7812 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-14gs.js @@ -0,0 +1,29 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-14gs.js + * @description Strict - checking 'this' from a global scope (Function constructor includes strict directive prologue) + * @onlyStrict + */ + +var f = Function("\"use strict\";\nreturn typeof this;"); +if (f() !== "undefined") { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-15-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-15-s.js new file mode 100644 index 0000000000000000000000000000000000000000..f4e079244aacba57b91b23326fa7d9812bd764a1 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-15-s.js @@ -0,0 +1,32 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-15-s.js + * @description Strict Mode - checking 'this' (New'ed Function constructor defined within strict mode) + * @onlyStrict + */ + +function testcase() { +"use strict"; +var f = new Function("return typeof this;"); +return f() !== "undefined"; +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-15gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-15gs.js new file mode 100644 index 0000000000000000000000000000000000000000..6f2b195cbfb09fdb071d9a6b03414f83f1ab5f2e --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-15gs.js @@ -0,0 +1,30 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-15gs.js + * @description Strict - checking 'this' from a global scope (New'ed Function constructor defined within strict mode) + * @onlyStrict + */ + +"use strict"; +var f = new Function("return typeof this;"); +if (f() === "undefined") { + throw "'this' had incorrect value!"; +} diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-16-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-16-s.js new file mode 100644 index 0000000000000000000000000000000000000000..14f164d71f2d4351764bdd629f663928d50b4acb --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-16-s.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-16-s.js + * @description Strict Mode - checking 'this' (New'ed Function constructor includes strict directive prologue) + * @onlyStrict + */ + +function testcase() { +var f = new Function("\"use strict\";\nreturn typeof this;"); +return f() === "undefined"; +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-16gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-16gs.js new file mode 100644 index 0000000000000000000000000000000000000000..0cb39f63f3bf9dbde9c4836e12f376215751d78d --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-16gs.js @@ -0,0 +1,29 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-16gs.js + * @description Strict - checking 'this' from a global scope (New'ed Function constructor includes strict directive prologue) + * @onlyStrict + */ + +var f = new Function("\"use strict\";\nreturn typeof this;"); +if (f() !== "undefined") { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-17-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-17-s.js new file mode 100644 index 0000000000000000000000000000000000000000..646bab4fd7b9d64ac75d09be98736049aba50808 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-17-s.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-17-s.js + * @description Strict Mode - checking 'this' (eval used within strict mode) + * @onlyStrict + */ + +function testcase() { +"use strict"; +return (eval("typeof this") === "undefined") && (eval("this") !== fnGlobalObject()); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-17gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-17gs.js new file mode 100644 index 0000000000000000000000000000000000000000..3bdefd51f5dc3ff08cdbcdd6fc606ba326ceeae4 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-17gs.js @@ -0,0 +1,29 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-17gs.js + * @description Strict - checking 'this' from a global scope (eval used within strict mode) + * @onlyStrict + */ + +"use strict"; +if (eval("this") !== fnGlobalObject()) { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-19-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-19-s.js new file mode 100644 index 0000000000000000000000000000000000000000..600f8e6751b83b7e0a2a41b0604dd3030d7ff5f6 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-19-s.js @@ -0,0 +1,32 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-19-s.js + * @description Strict Mode - checking 'this' (indirect eval used within strict mode) + * @onlyStrict + */ + +function testcase() { +"use strict"; +var my_eval = eval; +return my_eval("this") === fnGlobalObject(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-19gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-19gs.js new file mode 100644 index 0000000000000000000000000000000000000000..e919eb8621d7ec1d36ee888196fd74e80e00bdc1 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-19gs.js @@ -0,0 +1,30 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-19gs.js + * @description Strict - checking 'this' from a global scope (indirect eval used within strict mode) + * @onlyStrict + */ + +"use strict"; +var my_eval = eval; +if (my_eval("this") !== fnGlobalObject()) { + throw "'this' had incorrect value!"; +} diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-20-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-20-s.js new file mode 100644 index 0000000000000000000000000000000000000000..84d9131d9a0c23daaf1d9bcf64b9e979208545a7 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-20-s.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-20-s.js + * @description Strict Mode - checking 'this' (indirect eval includes strict directive prologue) + * @onlyStrict + */ + +function testcase() { +var my_eval = eval; +return my_eval("\"use strict\";\nthis") === fnGlobalObject(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-20gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-20gs.js new file mode 100644 index 0000000000000000000000000000000000000000..be9d69eb99b870e98fb06e53ce2fe2bd43691a06 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-20gs.js @@ -0,0 +1,29 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-20gs.js + * @description Strict - checking 'this' from a global scope (indirect eval includes strict directive prologue) + * @onlyStrict + */ + +var my_eval = eval; +if (my_eval("\"use strict\";\nthis") !== fnGlobalObject() ) { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-21-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-21-s.js new file mode 100644 index 0000000000000000000000000000000000000000..c05c9e3319791863bb3e52caab3fbc857d60ce51 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-21-s.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-21-s.js + * @description Strict Mode - checking 'this' (New'ed object from FunctionDeclaration defined within strict mode) + * @onlyStrict + */ + +function testcase() { +"use strict"; +function f() { + return this; +} +return ( (new f())!==fnGlobalObject()) && (typeof (new f()) !== "undefined"); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-21gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-21gs.js new file mode 100644 index 0000000000000000000000000000000000000000..93f20d7dbe5c04abd1c1248f8fe794f7665c7ddf --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-21gs.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-21gs.js + * @description Strict - checking 'this' from a global scope (New'ed object from FunctionDeclaration defined within strict mode) + * @onlyStrict + */ + +"use strict"; +function f() { + return this; +} +if (((new f()) === fnGlobalObject()) || (typeof (new f()) === "undefined")) { + throw "'this' had incorrect value!"; +} + diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-22-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-22-s.js new file mode 100644 index 0000000000000000000000000000000000000000..3c6f0015150956944633b042fdc3b8fafb8d7244 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-22-s.js @@ -0,0 +1,35 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-22-s.js + * @description Strict Mode - checking 'this' (New'ed object from FunctionDeclaration includes strict directive prologue) + * @onlyStrict + */ + +function testcase() { +function f() { + "use strict"; + return this; +} +return ( (new f())!==fnGlobalObject()) && (typeof (new f()) !== "undefined"); + +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-22gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-22gs.js new file mode 100644 index 0000000000000000000000000000000000000000..a7df22eef2938fbc5b226a3767dec4deda481279 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-22gs.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-22gs.js + * @description Strict - checking 'this' from a global scope (New'ed object from FunctionDeclaration includes strict directive prologue) + * @onlyStrict + */ + +function f() { + "use strict"; + return this; +} +if (((new f()) === fnGlobalObject()) || (typeof (new f()) === "undefined")) { + throw "'this' had incorrect value!"; +} + diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-23-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-23-s.js new file mode 100644 index 0000000000000000000000000000000000000000..e7b2467dea1f0237e397c4e3ff6a6f8618d3ae06 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-23-s.js @@ -0,0 +1,35 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-23-s.js + * @description Strict Mode - checking 'this' (New'ed object from FunctionExpression defined within strict mode) + * @onlyStrict + */ + +function testcase() { +"use strict"; +var f = function () { + return this; +} +return ( (new f())!==fnGlobalObject()) && (typeof (new f()) !== "undefined"); + +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-23gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-23gs.js new file mode 100644 index 0000000000000000000000000000000000000000..52857ff3792531b76502e64077e18a2bda810a9b --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-23gs.js @@ -0,0 +1,32 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-23gs.js + * @description Strict - checking 'this' from a global scope (New'ed object from FunctionExpression defined within strict mode) + * @onlyStrict + */ + +"use strict"; +var f = function () { + return this; +} +if (((new f()) === fnGlobalObject()) || (typeof (new f()) === "undefined")) { + throw "'this' had incorrect value!"; +} diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-24-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-24-s.js new file mode 100644 index 0000000000000000000000000000000000000000..45161b7f2ae9b7361b441faafb03312038bc1a82 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-24-s.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-24-s.js + * @description Strict Mode - checking 'this' (New'ed object from FunctionExpression includes strict directive prologue) + * @onlyStrict + */ + +function testcase() { +var f = function () { + "use strict"; + return this; +} +return ( (new f())!==fnGlobalObject()) && (typeof (new f()) !== "undefined"); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-24gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-24gs.js new file mode 100644 index 0000000000000000000000000000000000000000..8a658ce9b5599c656313b610c8942284a985e9ce --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-24gs.js @@ -0,0 +1,32 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-24gs.js + * @description Strict - checking 'this' from a global scope (New'ed object from FunctionExpression includes strict directive prologue) + * @onlyStrict + */ + +var f = function () { + "use strict"; + return this; +} +if (((new f()) === fnGlobalObject()) || (typeof (new f()) === "undefined")) { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-25-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-25-s.js new file mode 100644 index 0000000000000000000000000000000000000000..c5fa5bd79e63df9fa0d347577b8e3ff782b69a10 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-25-s.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-25-s.js + * @description Strict Mode - checking 'this' (New'ed object from Anonymous FunctionExpression defined within strict mode) + * @onlyStrict + */ + +function testcase() { +"use strict"; +var obj = new (function () { + return this; +}); +return (obj !== fnGlobalObject()) && ((typeof obj) !== "undefined"); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-25gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-25gs.js new file mode 100644 index 0000000000000000000000000000000000000000..2c60ec1d4fda70b9912a06066632417fa154cde0 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-25gs.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-25gs.js + * @description Strict - checking 'this' from a global scope (New'ed object from Anonymous FunctionExpression defined within strict mode) + * @onlyStrict + */ + +"use strict"; +var obj = new (function () { + return this; +}); +if ((obj === fnGlobalObject()) || (typeof obj === "undefined")) { + throw "'this' had incorrect value!"; +} + diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-26-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-26-s.js new file mode 100644 index 0000000000000000000000000000000000000000..a1e01aa8362ef3ebe7790a7beea328d69d0e67b3 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-26-s.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-26-s.js + * @description Strict Mode - checking 'this' (New'ed object from Anonymous FunctionExpression includes strict directive prologue) + * @onlyStrict + */ + +function testcase() { +var obj = new (function () { + "use strict"; + return this; +}); +return (obj !== fnGlobalObject()) && ((typeof obj) !== "undefined"); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-26gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-26gs.js new file mode 100644 index 0000000000000000000000000000000000000000..832b1cc904ff404ad240babb758cbdd42583df1f --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-26gs.js @@ -0,0 +1,32 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-26gs.js + * @description Strict - checking 'this' from a global scope (New'ed object from Anonymous FunctionExpression includes strict directive prologue) + * @onlyStrict + */ + +var obj = new (function () { + "use strict"; + return this; +}); +if ((obj === fnGlobalObject()) || (typeof obj === "undefined")) { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-27-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-27-s.js new file mode 100644 index 0000000000000000000000000000000000000000..d91936f824b0b169ed31de77529960e3b6b98b3a --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-27-s.js @@ -0,0 +1,37 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-27-s.js + * @description Strict Mode - checking 'this' (FunctionDeclaration defined within a FunctionDeclaration inside strict mode) + * @onlyStrict + */ + +function testcase() { +"use strict"; +function f1() { + function f() { + return typeof this; + } + return (f()==="undefined") && ((typeof this)==="undefined"); +} +return f1(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-27gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-27gs.js new file mode 100644 index 0000000000000000000000000000000000000000..086079f2dece36b74f2e60a71c7d551d33980b9c --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-27gs.js @@ -0,0 +1,35 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-27gs.js + * @description Strict - checking 'this' from a global scope (FunctionDeclaration defined within a FunctionDeclaration inside strict mode) + * @onlyStrict + */ + +"use strict"; +function f1() { + function f() { + return typeof this; + } + return (f()==="undefined") && ((typeof this)==="undefined"); +} +if (! f1()) { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-28-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-28-s.js new file mode 100644 index 0000000000000000000000000000000000000000..c6600b1134a2600eefe0d0eb9129893695189587 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-28-s.js @@ -0,0 +1,37 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-28-s.js + * @description Strict Mode - checking 'this' (FunctionExpression defined within a FunctionDeclaration inside strict mode) + * @onlyStrict + */ + +function testcase() { +"use strict"; +function f1() { + var f = function () { + return typeof this; + } + return (f()==="undefined") && ((typeof this)==="undefined"); +} +return f1(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-28gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-28gs.js new file mode 100644 index 0000000000000000000000000000000000000000..a18f410c3a2462ec120180fa6c111ae38e835d82 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-28gs.js @@ -0,0 +1,35 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-28gs.js + * @description Strict - checking 'this' from a global scope (FunctionExpression defined within a FunctionDeclaration inside strict mode) + * @onlyStrict + */ + +"use strict"; +function f1() { + var f = function () { + return typeof this; + } + return (f()==="undefined") && ((typeof this)==="undefined"); +} +if (! f1()) { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-29-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-29-s.js new file mode 100644 index 0000000000000000000000000000000000000000..315cd7da279c17b7354cd87b1c6fbeddc96e13bd --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-29-s.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-29-s.js + * @description Strict Mode - checking 'this' (Anonymous FunctionExpression defined within a FunctionDeclaration inside strict mode) + * @onlyStrict + */ + +function testcase() { +"use strict"; +function f1() { + return ((function () { + return typeof this; + })()==="undefined") && ((typeof this)==="undefined"); +} +return f1(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-29gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-29gs.js new file mode 100644 index 0000000000000000000000000000000000000000..5c0d23023348af1b2ac017018b4b50ab6eb53a43 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-29gs.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-29gs.js + * @description Strict - checking 'this' from a global scope (Anonymous FunctionExpression defined within a FunctionDeclaration inside strict mode) + * @onlyStrict + */ + +"use strict"; +function f1() { + return ((function () { + return typeof this; + })()==="undefined") && ((typeof this)==="undefined"); +} +if (! f1()) { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-30-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-30-s.js new file mode 100644 index 0000000000000000000000000000000000000000..d5baf6e00a0db866053cd31503a3ab0b09b38417 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-30-s.js @@ -0,0 +1,37 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-30-s.js + * @description Strict Mode - checking 'this' (FunctionDeclaration defined within a FunctionExpression inside strict mode) + * @onlyStrict + */ + +function testcase() { +"use strict"; +var f1 = function () { + function f() { + return typeof this; + } + return (f()==="undefined") && ((typeof this)==="undefined"); +} +return f1(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-30gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-30gs.js new file mode 100644 index 0000000000000000000000000000000000000000..984fe11e32bbec3a010a20f533a1e1e3a242342f --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-30gs.js @@ -0,0 +1,35 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-30gs.js + * @description Strict - checking 'this' from a global scope (FunctionDeclaration defined within a FunctionExpression inside strict mode) + * @onlyStrict + */ + +"use strict"; +var f1 = function () { + function f() { + return typeof this; + } + return (f()==="undefined") && ((typeof this)==="undefined"); +} +if (! f1()) { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-31-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-31-s.js new file mode 100644 index 0000000000000000000000000000000000000000..05ebcb53ea3b89ba5a0bfe8896972ad4a6b21781 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-31-s.js @@ -0,0 +1,37 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-31-s.js + * @description Strict Mode - checking 'this' (FunctionExpression defined within a FunctionExpression inside strict mode) + * @onlyStrict + */ + +function testcase() { +"use strict"; +var f1 = function () { + var f = function () { + return typeof this; + } + return (f()==="undefined") && ((typeof this)==="undefined"); +} +return f1(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-31gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-31gs.js new file mode 100644 index 0000000000000000000000000000000000000000..54813afb8631edd9271fd3caa671e48aafc8aeb3 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-31gs.js @@ -0,0 +1,35 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-31gs.js + * @description Strict - checking 'this' from a global scope (FunctionExpression defined within a FunctionExpression inside strict mode) + * @onlyStrict + */ + +"use strict"; +var f1 = function () { + var f = function () { + return typeof this; + } + return (f()==="undefined") && ((typeof this)==="undefined"); +} +if (! f1()) { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-32-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-32-s.js new file mode 100644 index 0000000000000000000000000000000000000000..cc7d6ef19a7a9e58dbc655cf2a5b6c4a73f054a5 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-32-s.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-32-s.js + * @description Strict Mode - checking 'this' (Anonymous FunctionExpression defined within a FunctionExpression inside strict mode) + * @onlyStrict + */ + +function testcase() { +"use strict"; +var f1 = function () { + return ((function () { + return typeof this; + })()==="undefined") && ((typeof this)==="undefined"); +} +return f1(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-32gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-32gs.js new file mode 100644 index 0000000000000000000000000000000000000000..e3bf2212ef4b1b62d0f490f8355400ef3da75660 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-32gs.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-32gs.js + * @description Strict - checking 'this' from a global scope (Anonymous FunctionExpression defined within a FunctionExpression inside strict mode) + * @onlyStrict + */ + +"use strict"; +var f1 = function () { + return ((function () { + return typeof this; + })()==="undefined") && ((typeof this)==="undefined"); +} +if (! f1()) { + throw "'this' had incorrect value!"; +} diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-33-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-33-s.js new file mode 100644 index 0000000000000000000000000000000000000000..1a95f8c95fa07342582890a0bf8ea513bad41df2 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-33-s.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-33-s.js + * @description Strict Mode - checking 'this' (FunctionDeclaration defined within an Anonymous FunctionExpression inside strict mode) + * @onlyStrict + */ + +function testcase() { +"use strict"; +return (function () { + function f() { + return typeof this; + } + return (f()==="undefined") && ((typeof this)==="undefined"); +})(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-33gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-33gs.js new file mode 100644 index 0000000000000000000000000000000000000000..5b906db36b21535d5535a761b587263ff749d964 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-33gs.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-33gs.js + * @description Strict - checking 'this' from a global scope (FunctionDeclaration defined within an Anonymous FunctionExpression inside strict mode) + * @onlyStrict + */ + +"use strict"; +if (! ((function () { + function f() { + return typeof this; + } + return (f()==="undefined") && ((typeof this)==="undefined"); +})())) { + throw "'this' had incorrect value!"; +} diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-34-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-34-s.js new file mode 100644 index 0000000000000000000000000000000000000000..f6ff5cfd886a387b47ea691ca1486fa6cbf1acce --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-34-s.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-34-s.js + * @description Strict Mode - checking 'this' (FunctionExpression defined within an Anonymous FunctionExpression inside strict mode) + * @onlyStrict + */ + +function testcase() { +"use strict"; +return (function () { + var f = function () { + return typeof this; + } + return (f()==="undefined") && ((typeof this)==="undefined"); +})(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-34gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-34gs.js new file mode 100644 index 0000000000000000000000000000000000000000..e807a3d1d73caeb5294b9bd015962e1eb56c1bdf --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-34gs.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-34gs.js + * @description Strict - checking 'this' from a global scope (FunctionExpression defined within an Anonymous FunctionExpression inside strict mode) + * @onlyStrict + */ + +"use strict"; +if (! ((function () { + var f = function () { + return typeof this; + } + return (f()==="undefined") && ((typeof this)==="undefined"); +})())) { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-35-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-35-s.js new file mode 100644 index 0000000000000000000000000000000000000000..069836d0e710429fa64cb84a6c7f49b8f9a2700e --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-35-s.js @@ -0,0 +1,35 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-35-s.js + * @description Strict Mode - checking 'this' (Anonymous FunctionExpression defined within an Anonymous FunctionExpression inside strict mode) + * @onlyStrict + */ + +function testcase() { +"use strict"; +return (function () { + return ((function () { + return typeof this; + })()==="undefined") && ((typeof this)==="undefined"); +})(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-35gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-35gs.js new file mode 100644 index 0000000000000000000000000000000000000000..d4d7d5c8d99c1c91c61b53309614d7861add06e7 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-35gs.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-35gs.js + * @description Strict - checking 'this' from a global scope (Anonymous FunctionExpression defined within an Anonymous FunctionExpression inside strict mode) + * @onlyStrict + */ + +"use strict"; +if (! ((function () { + return ((function () { + return typeof this; + })()==="undefined") && ((typeof this)==="undefined"); +})())) { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-36-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-36-s.js new file mode 100644 index 0000000000000000000000000000000000000000..43326dbf277c87989b316bc257cb4b6f29fb14fd --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-36-s.js @@ -0,0 +1,37 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-36-s.js + * @description Strict Mode - checking 'this' (FunctionDeclaration defined within a FunctionDeclaration with a strict directive prologue) + * @onlyStrict + */ + +function testcase() { +function f1() { + "use strict"; + function f() { + return typeof this; + } + return (f()==="undefined") && ((typeof this)==="undefined"); +} +return f1(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-36gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-36gs.js new file mode 100644 index 0000000000000000000000000000000000000000..9b3705148b23b5ef3d268834721238c309c7d6a8 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-36gs.js @@ -0,0 +1,35 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-36gs.js + * @description Strict - checking 'this' from a global scope (FunctionDeclaration defined within a FunctionDeclaration with a strict directive prologue) + * @onlyStrict + */ + +function f1() { + "use strict"; + function f() { + return typeof this; + } + return (f()==="undefined") && ((typeof this)==="undefined"); +} +if (! f1()) { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-37-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-37-s.js new file mode 100644 index 0000000000000000000000000000000000000000..500d525524a109fb6eb075867bf18792cf51f703 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-37-s.js @@ -0,0 +1,37 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-37-s.js + * @description Strict Mode - checking 'this' (FunctionExpression defined within a FunctionDeclaration with a strict directive prologue) + * @onlyStrict + */ + +function testcase() { +function f1() { + "use strict"; + var f = function () { + return typeof this; + } + return (f()==="undefined") && ((typeof this)==="undefined"); +} +return f1(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-37gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-37gs.js new file mode 100644 index 0000000000000000000000000000000000000000..4f44eba212904806fc40495dac196f4a9ca94aea --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-37gs.js @@ -0,0 +1,35 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-37gs.js + * @description Strict - checking 'this' from a global scope (FunctionExpression defined within a FunctionDeclaration with a strict directive prologue) + * @onlyStrict + */ + +function f1() { + "use strict"; + var f = function () { + return typeof this; + } + return (f()==="undefined") && ((typeof this)==="undefined"); +} +if (! f1()) { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-38-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-38-s.js new file mode 100644 index 0000000000000000000000000000000000000000..8b08a3fde66e37355fd914e1415599d3235a6a0d --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-38-s.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-38-s.js + * @description Strict Mode - checking 'this' (Anonymous FunctionExpression defined within a FunctionDeclaration with a strict directive prologue) + * @onlyStrict + */ + +function testcase() { +function f1() { + "use strict"; + return ((function () { + return typeof this; + })()==="undefined") && ((typeof this)==="undefined"); +} +return f1(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-38gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-38gs.js new file mode 100644 index 0000000000000000000000000000000000000000..c98e18f2dda46c629c08e56848ed8f7f304bcd64 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-38gs.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-38gs.js + * @description Strict - checking 'this' from a global scope (Anonymous FunctionExpression defined within a FunctionDeclaration with a strict directive prologue) + * @onlyStrict + */ + +function f1() { + "use strict"; + return ((function () { + return typeof this; + })()==="undefined") && ((typeof this)==="undefined"); +} +if (! f1()) { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-39-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-39-s.js new file mode 100644 index 0000000000000000000000000000000000000000..24e00c147b6f7f6cba65a3f4f356da9ed4cb1b23 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-39-s.js @@ -0,0 +1,37 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-39-s.js + * @description Strict Mode - checking 'this' (FunctionDeclaration defined within a FunctionExpression with a strict directive prologue) + * @onlyStrict + */ + +function testcase() { +var f1 = function () { + "use strict"; + function f() { + return typeof this; + } + return (f()==="undefined") && ((typeof this)==="undefined"); +} +return f1(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-39gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-39gs.js new file mode 100644 index 0000000000000000000000000000000000000000..1904849190798d49b306f01f28c4a6c2a63f1ad5 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-39gs.js @@ -0,0 +1,35 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-39gs.js + * @description Strict - checking 'this' from a global scope (FunctionDeclaration defined within a FunctionExpression with a strict directive prologue) + * @onlyStrict + */ + +var f1 = function () { + "use strict"; + function f() { + return typeof this; + } + return (f()==="undefined") && ((typeof this)==="undefined"); +} +if (! f1()) { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-40-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-40-s.js new file mode 100644 index 0000000000000000000000000000000000000000..375751c4b73e2378433360391a002cd730f4db1a --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-40-s.js @@ -0,0 +1,37 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-40-s.js + * @description Strict Mode - checking 'this' (FunctionExpression defined within a FunctionExpression with a strict directive prologue) + * @onlyStrict + */ + +function testcase() { +var f1 = function () { + "use strict"; + var f = function () { + return typeof this; + } + return (f()==="undefined") && ((typeof this)==="undefined"); +} +return f1(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-40gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-40gs.js new file mode 100644 index 0000000000000000000000000000000000000000..33d59dfe28f01f0e37eb0003c99faa7efc714d11 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-40gs.js @@ -0,0 +1,35 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-40gs.js + * @description Strict - checking 'this' from a global scope (FunctionExpression defined within a FunctionExpression with a strict directive prologue) + * @onlyStrict + */ + +var f1 = function () { + "use strict"; + var f = function () { + return typeof this; + } + return (f()==="undefined") && ((typeof this)==="undefined"); +} +if (! f1()) { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-41-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-41-s.js new file mode 100644 index 0000000000000000000000000000000000000000..94767f920eb9bf9e04c2655858f655efbd1db572 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-41-s.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-41-s.js + * @description Strict Mode - checking 'this' (Anonymous FunctionExpression defined within a FunctionExpression with a strict directive prologue) + * @onlyStrict + */ + +function testcase() { +var f1 = function () { + "use strict"; + return ((function () { + return typeof this; + })()==="undefined") && ((typeof this)==="undefined"); +} +return f1(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-41gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-41gs.js new file mode 100644 index 0000000000000000000000000000000000000000..ddbbc2023ef03c1c0934311808f794fbff529c4f --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-41gs.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-41gs.js + * @description Strict - checking 'this' from a global scope (Anonymous FunctionExpression defined within a FunctionExpression with a strict directive prologue) + * @onlyStrict + */ + +var f1 = function () { + "use strict"; + return ((function () { + return typeof this; + })()==="undefined") && ((typeof this)==="undefined"); +} +if (! f1()) { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-42-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-42-s.js new file mode 100644 index 0000000000000000000000000000000000000000..9de6360bdb1283226a15361685e3008a2bf301f8 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-42-s.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-42-s.js + * @description Strict Mode - checking 'this' (FunctionDeclaration defined within an Anonymous FunctionExpression with a strict directive prologue) + * @onlyStrict + */ + +function testcase() { +return (function () { + "use strict"; + function f() { + return typeof this; + } + return (f()==="undefined") && ((typeof this)==="undefined"); +})(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-42gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-42gs.js new file mode 100644 index 0000000000000000000000000000000000000000..8d6518ae2b30a8d055459d8b1a9f809ac7dde4fc --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-42gs.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-42gs.js + * @description Strict - checking 'this' from a global scope (FunctionDeclaration defined within an Anonymous FunctionExpression with a strict directive prologue) + * @onlyStrict + */ + +if (! ((function () { + "use strict"; + function f() { + return typeof this; + } + return (f()==="undefined") && ((typeof this)==="undefined"); +})())) { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-43-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-43-s.js new file mode 100644 index 0000000000000000000000000000000000000000..7e1f92591bd20ab49558c4df583b689dc022dac0 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-43-s.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-43-s.js + * @description Strict Mode - checking 'this' (FunctionExpression defined within an Anonymous FunctionExpression with a strict directive prologue) + * @onlyStrict + */ + +function testcase() { +return (function () { + "use strict"; + var f = function () { + return typeof this; + } + return (f()==="undefined") && ((typeof this)==="undefined"); +})(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-43gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-43gs.js new file mode 100644 index 0000000000000000000000000000000000000000..7ac8f22df88fab2e8ea72b451902f0acec9fe6f4 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-43gs.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-43gs.js + * @description Strict - checking 'this' from a global scope (FunctionExpression defined within an Anonymous FunctionExpression with a strict directive prologue) + * @onlyStrict + */ + +if (! ((function () { + "use strict"; + var f = function () { + return typeof this; + } + return (f()==="undefined") && ((typeof this)==="undefined"); +})())) { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-44-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-44-s.js new file mode 100644 index 0000000000000000000000000000000000000000..10f1961abf2ce6c2a0bc6c4a47daa09e26114f55 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-44-s.js @@ -0,0 +1,35 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-44-s.js + * @description Strict Mode - checking 'this' (Anonymous FunctionExpression defined within an Anonymous FunctionExpression with a strict directive prologue) + * @onlyStrict + */ + +function testcase() { +return (function () { + "use strict"; + return ((function () { + return typeof this; + })()==="undefined") && ((typeof this)==="undefined"); +})(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-44gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-44gs.js new file mode 100644 index 0000000000000000000000000000000000000000..558cc3b0a10114b78a4c3d1045cd43dbfaee8430 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-44gs.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-44gs.js + * @description Strict - checking 'this' from a global scope (Anonymous FunctionExpression defined within an Anonymous FunctionExpression with a strict directive prologue) + * @onlyStrict + */ + +if (! ((function () { + "use strict"; + return ((function () { + return typeof this; + })()==="undefined") && ((typeof this)==="undefined"); +})())) { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-45-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-45-s.js new file mode 100644 index 0000000000000000000000000000000000000000..17144821887f3be6c261c783b30e89ef1b19cc2a --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-45-s.js @@ -0,0 +1,37 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-45-s.js + * @description Strict Mode - checking 'this' (FunctionDeclaration with a strict directive prologue defined within a FunctionDeclaration) + * @onlyStrict + */ + +function testcase() { +function f1() { + function f() { + "use strict"; + return typeof this; + } + return (f()==="undefined") && (this===fnGlobalObject()); +} +return f1(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-45gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-45gs.js new file mode 100644 index 0000000000000000000000000000000000000000..6d13c6a51967585ae85fb1bb3b1fc2a53579d71c --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-45gs.js @@ -0,0 +1,35 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-45gs.js + * @description Strict - checking 'this' from a global scope (FunctionDeclaration with a strict directive prologue defined within a FunctionDeclaration) + * @onlyStrict + */ + +function f1() { + function f() { + "use strict"; + return typeof this; + } + return (f()==="undefined") && (this===fnGlobalObject()); +} +if (! f1()) { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-46-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-46-s.js new file mode 100644 index 0000000000000000000000000000000000000000..4013696be0e8a04b7ab82ad7a0aecff05f423601 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-46-s.js @@ -0,0 +1,37 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-46-s.js + * @description Strict Mode - checking 'this' (FunctionExpression with a strict directive prologue defined within a FunctionDeclaration) + * @onlyStrict + */ + +function testcase() { +function f1() { + var f = function () { + "use strict"; + return typeof this; + } + return (f()==="undefined") && (this===fnGlobalObject()); +} +return f1(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-46gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-46gs.js new file mode 100644 index 0000000000000000000000000000000000000000..c6dd7807956cf07308ffdb44430bcc9e112cbbd1 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-46gs.js @@ -0,0 +1,35 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-46gs.js + * @description Strict - checking 'this' from a global scope (FunctionExpression with a strict directive prologue defined within a FunctionDeclaration) + * @onlyStrict + */ + +function f1() { + var f = function () { + "use strict"; + return typeof this; + } + return (f()==="undefined") && (this===fnGlobalObject()); +} +if (! f1()) { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-47-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-47-s.js new file mode 100644 index 0000000000000000000000000000000000000000..9d90c74bc2249167102f82520a3b83281e2b799e --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-47-s.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-47-s.js + * @description Strict Mode - checking 'this' (Anonymous FunctionExpression with a strict directive prologue defined within a FunctionDeclaration) + * @onlyStrict + */ + +function testcase() { +function f1() { + return ((function () { + "use strict"; + return typeof this; + })()==="undefined") && (this===fnGlobalObject()); +} +return f1(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-47gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-47gs.js new file mode 100644 index 0000000000000000000000000000000000000000..10e2b1b98a9554376362145538519fd86bea35ed --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-47gs.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-47gs.js + * @description Strict - checking 'this' from a global scope (Anonymous FunctionExpression with a strict directive prologue defined within a FunctionDeclaration) + * @onlyStrict + */ + +function f1() { + return ((function () { + "use strict"; + return typeof this; + })()==="undefined") && (this===fnGlobalObject()); +} +if (! f1()) { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-48-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-48-s.js new file mode 100644 index 0000000000000000000000000000000000000000..efd4647ec60726b71b02c4b806ac80b9b8bd960c --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-48-s.js @@ -0,0 +1,37 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-48-s.js + * @description Strict Mode - checking 'this' (FunctionDeclaration with a strict directive prologue defined within a FunctionExpression) + * @onlyStrict + */ + +function testcase() { +var f1 = function () { + function f() { + "use strict"; + return typeof this; + } + return (f()==="undefined") && (this===fnGlobalObject()); +} +return f1(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-48gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-48gs.js new file mode 100644 index 0000000000000000000000000000000000000000..d2c91f0875c58704a6178357e77d0fa67f9e525f --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-48gs.js @@ -0,0 +1,35 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-48gs.js + * @description Strict - checking 'this' from a global scope (FunctionDeclaration with a strict directive prologue defined within a FunctionExpression) + * @onlyStrict + */ + +var f1 = function () { + function f() { + "use strict"; + return typeof this; + } + return (f()==="undefined") && (this===fnGlobalObject()); +} +if (! f1()) { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-49-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-49-s.js new file mode 100644 index 0000000000000000000000000000000000000000..c873730052044925842472ff3d643e90e68e9387 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-49-s.js @@ -0,0 +1,37 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-49-s.js + * @description Strict Mode - checking 'this' (FunctionExpression with a strict directive prologue defined within a FunctionExpression) + * @onlyStrict + */ + +function testcase() { +var f1 = function () { + var f = function () { + "use strict"; + return typeof this; + } + return (f()==="undefined") && (this===fnGlobalObject()); +} +return f1(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-49gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-49gs.js new file mode 100644 index 0000000000000000000000000000000000000000..af7a98baf6e2a672d58b101942c138e0aa5d2677 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-49gs.js @@ -0,0 +1,35 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-49gs.js + * @description Strict - checking 'this' from a global scope (FunctionExpression with a strict directive prologue defined within a FunctionExpression) + * @onlyStrict + */ + +var f1 = function () { + var f = function () { + "use strict"; + return typeof this; + } + return (f()==="undefined") && (this===fnGlobalObject()); +} +if (! f1()) { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-50-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-50-s.js new file mode 100644 index 0000000000000000000000000000000000000000..c1fd0244817bafa8aab2320d178ba949e22e218d --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-50-s.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-50-s.js + * @description Strict Mode - checking 'this' (Anonymous FunctionExpression with a strict directive prologue defined within a FunctionExpression) + * @onlyStrict + */ + +function testcase() { +var f1 = function () { + return ((function () { + "use strict"; + return typeof this; + })()==="undefined") && (this===fnGlobalObject()); +} +return f1(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-50gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-50gs.js new file mode 100644 index 0000000000000000000000000000000000000000..cb30fbea1c4be4748246451585d6f987a891db50 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-50gs.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-50gs.js + * @description Strict - checking 'this' from a global scope (Anonymous FunctionExpression with a strict directive prologue defined within a FunctionExpression) + * @onlyStrict + */ + +var f1 = function () { + return ((function () { + "use strict"; + return typeof this; + })()==="undefined") && (this===fnGlobalObject()); +} +if (! f1()) { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-51-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-51-s.js new file mode 100644 index 0000000000000000000000000000000000000000..9908b67cbaf6a2f4ca5ba2c65e043c7c174ab6f4 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-51-s.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-51-s.js + * @description Strict Mode - checking 'this' (FunctionDeclaration with a strict directive prologue defined within an Anonymous FunctionExpression) + * @onlyStrict + */ + +function testcase() { +return (function () { + function f() { + "use strict"; + return typeof this; + } + return (f()==="undefined") && (this===fnGlobalObject()); +})(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-51gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-51gs.js new file mode 100644 index 0000000000000000000000000000000000000000..7024f385e1950b652603d072a8b2232f035fdc97 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-51gs.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-51gs.js + * @description Strict - checking 'this' from a global scope (FunctionDeclaration with a strict directive prologue defined within an Anonymous FunctionExpression) + * @onlyStrict + */ + +if (! ((function () { + function f() { + "use strict"; + return typeof this; + } + return (f()==="undefined") && (this===fnGlobalObject()); +})())) { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-52-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-52-s.js new file mode 100644 index 0000000000000000000000000000000000000000..565d5d539897b9d565de56a734c35f09b43ff39a --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-52-s.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-52-s.js + * @description Strict Mode - checking 'this' (FunctionExpression with a strict directive prologue defined within an Anonymous FunctionExpression) + * @onlyStrict + */ + +function testcase() { +return (function () { + var f = function () { + "use strict"; + return typeof this; + } + return (f()==="undefined") && (this===fnGlobalObject()); +})(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-52gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-52gs.js new file mode 100644 index 0000000000000000000000000000000000000000..46df6d64da5eaf0beaa46c1a486efe21481e4d39 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-52gs.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-52gs.js + * @description Strict - checking 'this' from a global scope (FunctionExpression with a strict directive prologue defined within an Anonymous FunctionExpression) + * @onlyStrict + */ + +if (! ((function () { + var f = function () { + "use strict"; + return typeof this; + } + return (f()==="undefined") && (this===fnGlobalObject()); +})())) { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-53-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-53-s.js new file mode 100644 index 0000000000000000000000000000000000000000..d7c32ee82005bffa8100f02de2b8d08b79ad012f --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-53-s.js @@ -0,0 +1,35 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-53-s.js + * @description Strict Mode - checking 'this' (Anonymous FunctionExpression with a strict directive prologue defined within an Anonymous FunctionExpression) + * @onlyStrict + */ + +function testcase() { +return (function () { + return ((function () { + "use strict"; + return typeof this; + })()==="undefined") && (this===fnGlobalObject()); +})(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-53gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-53gs.js new file mode 100644 index 0000000000000000000000000000000000000000..74620fb77b424aea9bff9aed9f23f8129c9b97c5 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-53gs.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-53gs.js + * @description Strict - checking 'this' from a global scope (Anonymous FunctionExpression with a strict directive prologue defined within an Anonymous FunctionExpression) + * @onlyStrict + */ + +if (! ((function () { + return ((function () { + "use strict"; + return typeof this; + })()==="undefined") && (this===fnGlobalObject()); +})())) { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-54-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-54-s.js new file mode 100644 index 0000000000000000000000000000000000000000..343066554872080adfde132aa0d7c7ecd536b448 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-54-s.js @@ -0,0 +1,32 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-54-s.js + * @description Strict Mode - checking 'this' (Literal getter defined within strict mode) + * @onlyStrict + */ + +function testcase() { +"use strict"; +var o = { get foo() { return this; } } +return o.foo===o; +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-54gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-54gs.js new file mode 100644 index 0000000000000000000000000000000000000000..94e2fcb04c594cbf5095b8d23918de8dfc8a28e2 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-54gs.js @@ -0,0 +1,30 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-54gs.js + * @description Strict - checking 'this' from a global scope (Literal getter defined within strict mode) + * @onlyStrict + */ + +"use strict"; +var o = { get foo() { return this; } } +if (o.foo!==o) { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-55-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-55-s.js new file mode 100644 index 0000000000000000000000000000000000000000..5073720689de137d81d1dc71f0fdb55770a1b898 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-55-s.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-55-s.js + * @description Strict Mode - checking 'this' (Literal getter includes strict directive prologue) + * @onlyStrict + */ + +function testcase() { +var o = { get foo() { "use strict"; return this; } } +return o.foo===o; +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-55gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-55gs.js new file mode 100644 index 0000000000000000000000000000000000000000..669b42b71d0794a7cc5844df46d318689e299bf7 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-55gs.js @@ -0,0 +1,29 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-55gs.js + * @description Strict - checking 'this' from a global scope (Literal getter includes strict directive prologue) + * @onlyStrict + */ + +var o = { get foo() { "use strict"; return this; } } +if (o.foo!==o) { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-56-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-56-s.js new file mode 100644 index 0000000000000000000000000000000000000000..f4d98309fe78e050f28a4d90d8239c69112a5980 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-56-s.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-56-s.js + * @description Strict Mode - checking 'this' (Literal setter defined within strict mode) + * @onlyStrict + */ + +function testcase() { +"use strict"; +var x = 2; +var o = { set foo(stuff) { x=this; } } +o.foo = 3; +return x===o; +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-56gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-56gs.js new file mode 100644 index 0000000000000000000000000000000000000000..5e9e762ce54420c4e1a48bcfd670d148ea3181b5 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-56gs.js @@ -0,0 +1,32 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-56gs.js + * @description Strict - checking 'this' from a global scope (Literal setter defined within strict mode) + * @onlyStrict + */ + +"use strict"; +var x = 2; +var o = { set foo(stuff) { x=this; } } +o.foo = 3; +if (x!==o) { + throw "'this' had incorrect value!"; +} diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-57-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-57-s.js new file mode 100644 index 0000000000000000000000000000000000000000..1b16bd4a01c1ac96c117c41daac23188b52b8475 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-57-s.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-57-s.js + * @description Strict Mode - checking 'this' (Literal setter includes strict directive prologue) + * @onlyStrict + */ + +function testcase() { +var x = 2; +var o = { set foo(stuff) { "use strict"; x=this; } } +o.foo = 3; +return x===o; +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-57gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-57gs.js new file mode 100644 index 0000000000000000000000000000000000000000..92318154f9653f18b530d185e40ab822d413d7d1 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-57gs.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-57gs.js + * @description Strict - checking 'this' from a global scope (Literal setter includes strict directive prologue) + * @onlyStrict + */ + +var x = 2; +var o = { set foo(stuff) { "use strict"; x=this; } } +o.foo = 3; +if (x!==o) { + throw "'this' had incorrect value!"; +} diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-58-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-58-s.js new file mode 100644 index 0000000000000000000000000000000000000000..54ba866eb105bee07e1dd35f4197c0f4ed13a6b6 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-58-s.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-58-s.js + * @description Strict Mode - checking 'this' (Injected getter defined within strict mode) + * @onlyStrict + */ + +function testcase() { +"use strict"; +var o = {}; +Object.defineProperty(o, "foo", { get: function() { return this; } }); +return o.foo===o; +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-58gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-58gs.js new file mode 100644 index 0000000000000000000000000000000000000000..75cf067dd8f86265f4fc165760146fd7e94d563c --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-58gs.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-58gs.js + * @description Strict - checking 'this' from a global scope (Injected getter defined within strict mode) + * @onlyStrict + */ + +"use strict"; +var o = {}; +Object.defineProperty(o, "foo", { get : function() { return this; } }); +if (o.foo!==o) { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-59-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-59-s.js new file mode 100644 index 0000000000000000000000000000000000000000..620a003caab495223c4e922ad86b5cbbb65721b4 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-59-s.js @@ -0,0 +1,32 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-59-s.js + * @description Strict Mode - checking 'this' (Injected getter includes strict directive prologue) + * @onlyStrict + */ + +function testcase() { +var o = {}; +Object.defineProperty(o, "foo", { get: function() { "use strict"; return this; } }); +return o.foo===o; +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-59gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-59gs.js new file mode 100644 index 0000000000000000000000000000000000000000..7d900bdbcbf183dfe8faa2f935a91c9a67bab733 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-59gs.js @@ -0,0 +1,30 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-59gs.js + * @description Strict - checking 'this' from a global scope (Injected getter includes strict directive prologue) + * @onlyStrict + */ + +var o = {}; +Object.defineProperty(o, "foo", { get: function() { "use strict"; return this; } }); +if (o.foo!==o) { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-60-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-60-s.js new file mode 100644 index 0000000000000000000000000000000000000000..66887c15a361dccf68c6e6e2d62a9f09d9ca375f --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-60-s.js @@ -0,0 +1,35 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-60-s.js + * @description Strict Mode - checking 'this' (Injected setter defined within strict mode) + * @onlyStrict + */ + +function testcase() { +"use strict"; +var o = {}; +var x = 2; +Object.defineProperty(o, "foo", { set: function(stuff) { x=this; } }); +o.foo = 3; +return x===o; +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-60gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-60gs.js new file mode 100644 index 0000000000000000000000000000000000000000..2698998a4c83624dc9e943fdfccb67a8122b2e32 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-60gs.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-60gs.js + * @description Strict - checking 'this' from a global scope (Injected setter defined within strict mode) + * @onlyStrict + */ + +"use strict"; +var o = {}; +var x = 2; +Object.defineProperty(o, "foo", { set: function(stuff) { x=this; } }); +o.foo = 3; +if (x!==o) { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-61-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-61-s.js new file mode 100644 index 0000000000000000000000000000000000000000..d1196b32a72fcf29910ff9dbdff3c3c0b00d33cd --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-61-s.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-61-s.js + * @description Strict Mode - checking 'this' (Injected setter includes strict directive prologue) + * @onlyStrict + */ + +function testcase() { +var o = {}; +var x = 2; +Object.defineProperty(o, "foo", { set: function(stuff) { "use strict"; x=this; } }); +o.foo = 3; +return x===o; +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-61gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-61gs.js new file mode 100644 index 0000000000000000000000000000000000000000..3a58b06ff1fbdc9e8aa103f8b6cc016e00b51db6 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-61gs.js @@ -0,0 +1,32 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-61gs.js + * @description Strict - checking 'this' from a global scope (Injected setter includes strict directive prologue) + * @onlyStrict + */ + +var o = {}; +var x = 2; +Object.defineProperty(o, "foo", { set: function(stuff) { "use strict"; x=this; } }); +o.foo = 3; +if (x!==o) { + throw "'this' had incorrect value!"; +} diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-62-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-62-s.js new file mode 100644 index 0000000000000000000000000000000000000000..df5f324997bd63b53dab0aaddd799f368ef4d849 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-62-s.js @@ -0,0 +1,32 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-62-s.js + * @description Strict Mode - checking 'this' (strict function declaration called by non-strict function declaration) + * @onlyStrict + */ + +function testcase() { +function f() { "use strict"; return this;}; +function foo() { return f();} +return foo()===undefined; +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-62gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-62gs.js new file mode 100644 index 0000000000000000000000000000000000000000..c94f0a08f2a8dd9347ff6407b3e4fa2f8d30acb1 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-62gs.js @@ -0,0 +1,30 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-62gs.js + * @description Strict - checking 'this' from a global scope (strict function declaration called by non-strict function declaration) + * @onlyStrict + */ + +function f() { "use strict"; return this;}; +function foo() { return f();} +if (foo()!==undefined){ + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-63-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-63-s.js new file mode 100644 index 0000000000000000000000000000000000000000..70ca76a8104b01d9f5e4ce2f6b2dda107d4c0e74 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-63-s.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-63-s.js + * @description Strict Mode - checking 'this' (strict function declaration called by non-strict eval) + * @onlyStrict + */ + +function testcase() { +function f() { "use strict"; return this===undefined;}; +return eval("f();"); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-63gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-63gs.js new file mode 100644 index 0000000000000000000000000000000000000000..4a3df98a891f26a5d7b514f4e3db0a0df02068ac --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-63gs.js @@ -0,0 +1,29 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-63gs.js + * @description Strict - checking 'this' from a global scope (strict function declaration called by non-strict eval) + * @onlyStrict + */ + +function f() { "use strict"; return this===undefined;}; +if (! eval("f();")){ + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-64-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-64-s.js new file mode 100644 index 0000000000000000000000000000000000000000..fc60bb0991416bd5880b1d63f59926129ca9b56e --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-64-s.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-64-s.js + * @description Strict Mode - checking 'this' (strict function declaration called by non-strict Function constructor) + * @onlyStrict + */ + +function testcase() { +fnGlobalObject().f = function() { "use strict"; return this===undefined;}; +return Function("return f();")(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-64gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-64gs.js new file mode 100644 index 0000000000000000000000000000000000000000..f5de739614a36da3ae898df05678851ff007db09 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-64gs.js @@ -0,0 +1,29 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-64gs.js + * @description Strict - checking 'this' from a global scope (strict function declaration called by non-strict Function constructor) + * @onlyStrict + */ + +function f() { "use strict"; return this===undefined;}; +if (! (Function("return f();")())){ + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-65-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-65-s.js new file mode 100644 index 0000000000000000000000000000000000000000..b8ed88308558e7dc782ad680f3f764d34867e29d --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-65-s.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-65-s.js + * @description Strict Mode - checking 'this' (strict function declaration called by non-strict new'ed Function constructor) + * @onlyStrict + */ + +function testcase() { +fnGlobalObject().f = function() { "use strict"; return this===undefined;}; +return (new Function("return f();"))(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-65gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-65gs.js new file mode 100644 index 0000000000000000000000000000000000000000..7babdbd7c2a132e3c17fa9f5b6ad8b682c27e346 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-65gs.js @@ -0,0 +1,29 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-65gs.js + * @description Strict - checking 'this' from a global scope (strict function declaration called by non-strict new'ed Function constructor) + * @onlyStrict + */ + +function f() { "use strict"; return this===undefined;}; +if (! ( (new Function("return f();")) () )){ + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-66-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-66-s.js new file mode 100644 index 0000000000000000000000000000000000000000..d10a6fd1699e40718877ba1b88d7af8c28e54a44 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-66-s.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-66-s.js + * @description Strict Mode - checking 'this' (strict function declaration called by Function.prototype.apply()) + * @onlyStrict + */ + +function testcase() { +function f() { "use strict"; return this===undefined;}; +return f.apply(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-66gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-66gs.js new file mode 100644 index 0000000000000000000000000000000000000000..77e7b5d0e61811cf8705d812c44c3ebd56fb46c6 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-66gs.js @@ -0,0 +1,29 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-66gs.js + * @description Strict - checking 'this' from a global scope (strict function declaration called by Function.prototype.apply()) + * @onlyStrict + */ + +function f() { "use strict"; return this===undefined;}; +if (! f.apply()){ + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-67-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-67-s.js new file mode 100644 index 0000000000000000000000000000000000000000..64a4269b7e424304cfa1519c168447a674f8b8d0 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-67-s.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-67-s.js + * @description Strict Mode - checking 'this' (strict function declaration called by Function.prototype.apply(null)) + * @onlyStrict + */ + +function testcase() { +function f() { "use strict"; return this===null;}; +return f.apply(null); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-67gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-67gs.js new file mode 100644 index 0000000000000000000000000000000000000000..c808ca5c731941bcb3a5ab67b607fc003297d12e --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-67gs.js @@ -0,0 +1,29 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-67gs.js + * @description Strict - checking 'this' from a global scope (strict function declaration called by Function.prototype.apply(null)) + * @onlyStrict + */ + +function f() { "use strict"; return this===null;}; +if (! f.apply(null)){ + throw "'this' had incorrect value!"; +} diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-68-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-68-s.js new file mode 100644 index 0000000000000000000000000000000000000000..d83b04a31b4d154e6e62e6e9b153b8bf765835a3 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-68-s.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-68-s.js + * @description Strict Mode - checking 'this' (strict function declaration called by Function.prototype.apply(undefined)) + * @onlyStrict + */ + +function testcase() { +function f() { "use strict"; return this===undefined;}; +return f.apply(undefined); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-68gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-68gs.js new file mode 100644 index 0000000000000000000000000000000000000000..0106f3f9a8922e3113bea4b280f05f641c103714 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-68gs.js @@ -0,0 +1,29 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-68gs.js + * @description Strict - checking 'this' from a global scope (strict function declaration called by Function.prototype.apply(undefined)) + * @onlyStrict + */ + +function f() { "use strict"; return this===undefined;}; +if (! f.apply(undefined)){ + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-69-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-69-s.js new file mode 100644 index 0000000000000000000000000000000000000000..2c011b50e11646b3885773431aace3f9714fb027 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-69-s.js @@ -0,0 +1,32 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-69-s.js + * @description Strict Mode - checking 'this' (strict function declaration called by Function.prototype.apply(someObject)) + * @onlyStrict + */ + +function testcase() { +var o = {}; +function f() { "use strict"; return this===o;}; +return f.apply(o); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-69gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-69gs.js new file mode 100644 index 0000000000000000000000000000000000000000..47ed693df18c5cdad283800c835f6fdb68e4bc74 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-69gs.js @@ -0,0 +1,30 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-69gs.js + * @description Strict - checking 'this' from a global scope (strict function declaration called by Function.prototype.apply(someObject)) + * @onlyStrict + */ + +var o = {}; +function f() { "use strict"; return this===o;}; +if (! f.apply(o)){ + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-70-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-70-s.js new file mode 100644 index 0000000000000000000000000000000000000000..8b6ad9bac64791a2909c28cf1fb733cad32887f3 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-70-s.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-70-s.js + * @description Strict Mode - checking 'this' (strict function declaration called by Function.prototype.apply(globalObject)) + * @onlyStrict + */ + +function testcase() { +function f() { "use strict"; return this;}; +return f.apply(fnGlobalObject()) === fnGlobalObject(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-70gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-70gs.js new file mode 100644 index 0000000000000000000000000000000000000000..17b8c5c01ff1e3b80ad823bae79893cbe389dc05 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-70gs.js @@ -0,0 +1,29 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-70gs.js + * @description Strict - checking 'this' from a global scope (strict function declaration called by Function.prototype.apply(globalObject)) + * @onlyStrict + */ + +function f() { "use strict"; return this;}; +if (f.apply(fnGlobalObject()) !== fnGlobalObject()){ + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-71-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-71-s.js new file mode 100644 index 0000000000000000000000000000000000000000..ee94f1385b902edd2d1c66a03c04b95fd2855965 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-71-s.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-71-s.js + * @description Strict Mode - checking 'this' (strict function declaration called by Function.prototype.call()) + * @onlyStrict + */ + +function testcase() { +function f() { "use strict"; return this===undefined;}; +return f.call(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-71gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-71gs.js new file mode 100644 index 0000000000000000000000000000000000000000..a2aab51920a0fe39e697aa913fa6556ce9a504ee --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-71gs.js @@ -0,0 +1,29 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-71gs.js + * @description Strict - checking 'this' from a global scope (strict function declaration called by Function.prototype.call()) + * @onlyStrict + */ + +function f() { "use strict"; return this===undefined;}; +if (! f.call()){ + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-72-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-72-s.js new file mode 100644 index 0000000000000000000000000000000000000000..86688a310f683062ab34f6a3869e41be4b8497ed --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-72-s.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-72-s.js + * @description Strict Mode - checking 'this' (strict function declaration called by Function.prototype.call(null)) + * @onlyStrict + */ + +function testcase() { +function f() { "use strict"; return this===null;}; +return f.call(null); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-72gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-72gs.js new file mode 100644 index 0000000000000000000000000000000000000000..33f1b4ba48686469580e0c1e575e27b40a1339bb --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-72gs.js @@ -0,0 +1,29 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-72gs.js + * @description Strict - checking 'this' from a global scope (strict function declaration called by Function.prototype.call(null)) + * @onlyStrict + */ + +function f() { "use strict"; return this===null;}; +if (! f.call(null)){ + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-73-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-73-s.js new file mode 100644 index 0000000000000000000000000000000000000000..341dae71db68f04db5e195996503e7fd952a94a4 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-73-s.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-73-s.js + * @description Strict Mode - checking 'this' (strict function declaration called by Function.prototype.call(undefined)) + * @onlyStrict + */ + +function testcase() { +function f() { "use strict"; return this===undefined;}; +return f.call(undefined); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-73gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-73gs.js new file mode 100644 index 0000000000000000000000000000000000000000..f37cc43264f61b15349438c456b2b81d5bdfbe72 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-73gs.js @@ -0,0 +1,29 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-73gs.js + * @description Strict - checking 'this' from a global scope (strict function declaration called by Function.prototype.call(undefined)) + * @onlyStrict + */ + +function f() { "use strict"; return this===undefined;}; +if (! f.call(undefined)){ + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-74-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-74-s.js new file mode 100644 index 0000000000000000000000000000000000000000..7c03a5f644e52ccbb892c6a905d2efe82aeb255a --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-74-s.js @@ -0,0 +1,32 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-74-s.js + * @description Strict Mode - checking 'this' (strict function declaration called by Function.prototype.call(someObject)) + * @onlyStrict + */ + +function testcase() { +var o = {}; +function f() { "use strict"; return this===o;}; +return f.call(o); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-74gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-74gs.js new file mode 100644 index 0000000000000000000000000000000000000000..b60af0d1b6d407c77e277096734b5ff451ca50a1 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-74gs.js @@ -0,0 +1,30 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-74gs.js + * @description Strict - checking 'this' from a global scope (strict function declaration called by Function.prototype.call(someObject)) + * @onlyStrict + */ + +var o = {}; +function f() { "use strict"; return this===o;}; +if (! f.call(o)){ + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-75-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-75-s.js new file mode 100644 index 0000000000000000000000000000000000000000..68553162e09ae0250e4f526765abbe7592d8061c --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-75-s.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-75-s.js + * @description Strict Mode - checking 'this' (strict function declaration called by Function.prototype.call(globalObject)) + * @onlyStrict + */ + +function testcase() { +function f() { "use strict"; return this;}; +return f.call(fnGlobalObject()) === fnGlobalObject(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-75gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-75gs.js new file mode 100644 index 0000000000000000000000000000000000000000..9218e1b53ed15c3701b59918f638b0b8621018c3 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-75gs.js @@ -0,0 +1,29 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-75gs.js + * @description Strict - checking 'this' from a global scope (strict function declaration called by Function.prototype.call(globalObject)) + * @onlyStrict + */ + +function f() { "use strict"; return this;}; +if (f.call(fnGlobalObject()) !== fnGlobalObject()){ + throw "'this' had incorrect value!"; +} diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-76-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-76-s.js new file mode 100644 index 0000000000000000000000000000000000000000..fba925f2b594eb9aa5a2f6d5a294073928b6161e --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-76-s.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-76-s.js + * @description Strict Mode - checking 'this' (strict function declaration called by Function.prototype.bind()()) + * @onlyStrict + */ + +function testcase() { +function f() { "use strict"; return this===undefined;}; +return f.bind()(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-76gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-76gs.js new file mode 100644 index 0000000000000000000000000000000000000000..d0fcea66a99a69465786e30ec70aad9bc83a91e4 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-76gs.js @@ -0,0 +1,29 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-76gs.js + * @description Strict - checking 'this' from a global scope (strict function declaration called by Function.prototype.bind()()) + * @onlyStrict + */ + +function f() { "use strict"; return this===undefined;}; +if (! (f.bind()())){ + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-77-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-77-s.js new file mode 100644 index 0000000000000000000000000000000000000000..6e9959ca092eaef829f9af1f9d97495fffe3f236 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-77-s.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-77-s.js + * @description Strict Mode - checking 'this' (strict function declaration called by Function.prototype.bind(null)()) + * @onlyStrict + */ + +function testcase() { +function f() { "use strict"; return this===null;}; +return f.bind(null)(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-77gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-77gs.js new file mode 100644 index 0000000000000000000000000000000000000000..0da430f782a12a0f43117eec3f48f3372e55e547 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-77gs.js @@ -0,0 +1,29 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-77gs.js + * @description Strict - checking 'this' from a global scope (strict function declaration called by Function.prototype.bind(null)()) + * @onlyStrict + */ + +function f() { "use strict"; return this===null;}; +if (! (f.bind(null)())){ + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-78-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-78-s.js new file mode 100644 index 0000000000000000000000000000000000000000..5bf13e1594e01fa4a7bb6e18e47064dbb91a9980 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-78-s.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-78-s.js + * @description Strict Mode - checking 'this' (strict function declaration called by Function.prototype.bind(undefined)()) + * @onlyStrict + */ + +function testcase() { +function f() { "use strict"; return this===undefined;}; +return f.bind(undefined)(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-78gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-78gs.js new file mode 100644 index 0000000000000000000000000000000000000000..dab370f6ba0a1c20d2838a9793e223cb9ca31de8 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-78gs.js @@ -0,0 +1,29 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-78gs.js + * @description Strict - checking 'this' from a global scope (strict function declaration called by Function.prototype.bind(undefined)()) + * @onlyStrict + */ + +function f() { "use strict"; return this===undefined;}; +if (! (f.bind(undefined)())){ + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-79-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-79-s.js new file mode 100644 index 0000000000000000000000000000000000000000..dc6e585139a14a63622ac087d3590a3331357100 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-79-s.js @@ -0,0 +1,32 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-79-s.js + * @description Strict Mode - checking 'this' (strict function declaration called by Function.prototype.bind(someObject)()) + * @onlyStrict + */ + +function testcase() { +var o = {}; +function f() { "use strict"; return this===o;}; +return f.bind(o)(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-79gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-79gs.js new file mode 100644 index 0000000000000000000000000000000000000000..440ef17b4c06bcc28763ec288211e1574201f7f0 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-79gs.js @@ -0,0 +1,30 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-79gs.js + * @description Strict - checking 'this' from a global scope (strict function declaration called by Function.prototype.bind(someObject)()) + * @onlyStrict + */ + +var o = {}; +function f() { "use strict"; return this===o;}; +if (! (f.bind(o)())){ + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-80-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-80-s.js new file mode 100644 index 0000000000000000000000000000000000000000..d406018ed5adfd736578a8b8a92e299a382c892f --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-80-s.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-80-s.js + * @description Strict Mode - checking 'this' (strict function declaration called by Function.prototype.bind(globalObject)()) + * @onlyStrict + */ + +function testcase() { +function f() { "use strict"; return this;}; +return f.bind(fnGlobalObject())() === fnGlobalObject(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-80gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-80gs.js new file mode 100644 index 0000000000000000000000000000000000000000..b19a1422282020e318576919162b43dc8a5f3643 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-80gs.js @@ -0,0 +1,29 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-80gs.js + * @description Strict - checking 'this' from a global scope (strict function declaration called by Function.prototype.bind(globalObject)()) + * @onlyStrict + */ + +function f() { "use strict"; return this;}; +if (f.bind(fnGlobalObject())() !== fnGlobalObject()){ + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-81-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-81-s.js new file mode 100644 index 0000000000000000000000000000000000000000..77a5e2c6a70b3f2ae7f7799047a4966915092ee5 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-81-s.js @@ -0,0 +1,32 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-81-s.js + * @description Strict Mode - checking 'this' (non-strict function declaration called by strict function declaration) + * @onlyStrict + */ + +function testcase() { +function f() { return this!==undefined;}; +function foo() { "use strict"; return f();} +return foo(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-81gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-81gs.js new file mode 100644 index 0000000000000000000000000000000000000000..c4f37c69864ed6a950eff301ed0c17250d15df41 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-81gs.js @@ -0,0 +1,30 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-81gs.js + * @description Strict - checking 'this' from a global scope (non-strict function declaration called by strict function declaration) + * @onlyStrict + */ + +function f() { return this!==undefined;}; +function foo() { "use strict"; return f();} +if (! foo()){ + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-82-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-82-s.js new file mode 100644 index 0000000000000000000000000000000000000000..f14caca28b3363118332c491c1526f3837554bc8 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-82-s.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-82-s.js + * @description Strict Mode - checking 'this' (non-strict function declaration called by strict eval) + * @onlyStrict + */ + +function testcase() { +function f() { return this!==undefined;}; +return (function () {"use strict"; return eval("f();");})(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-82gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-82gs.js new file mode 100644 index 0000000000000000000000000000000000000000..d07bf0bad27f0870a226e79da5bc32f97bbccca4 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-82gs.js @@ -0,0 +1,29 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-82gs.js + * @description Strict - checking 'this' from a global scope (non-strict function declaration called by strict eval) + * @onlyStrict + */ + +function f() { return this!==undefined;}; +if (! ((function () {"use strict"; return eval("f();");})()) ){ + throw "'this' had incorrect value!"; +} diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-83-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-83-s.js new file mode 100644 index 0000000000000000000000000000000000000000..b40b8dce683180a04de1fa165909dc57d1a5cf12 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-83-s.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-83-s.js + * @description Strict Mode - checking 'this' (non-strict function declaration called by strict Function constructor) + * @onlyStrict + */ + +function testcase() { +fnGlobalObject().f = function() {return this!==undefined;}; +return (function () {return Function("\"use strict\";return f();")();})(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-83gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-83gs.js new file mode 100644 index 0000000000000000000000000000000000000000..c617fba9952ce7e9aa11e8abe7461e7634905ea4 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-83gs.js @@ -0,0 +1,29 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-83gs.js + * @description Strict - checking 'this' from a global scope (non-strict function declaration called by strict Function constructor) + * @onlyStrict + */ + +function f() {return this!==undefined;}; +if (! ((function () {return Function("\"use strict\";return f();")();})()) ){ + throw "'this' had incorrect value!"; +} diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-84-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-84-s.js new file mode 100644 index 0000000000000000000000000000000000000000..bd4ad7cc3c2d39ab379d05ccb6797970bf1f60bf --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-84-s.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-84-s.js + * @description Strict Mode - checking 'this' (non-strict function declaration called by strict new'ed Function constructor) + * @onlyStrict + */ + +function testcase() { +fnGlobalObject().f = function() { return this!==undefined;}; +return (function () {return new Function("\"use strict\";return f();")();})(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-84gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-84gs.js new file mode 100644 index 0000000000000000000000000000000000000000..9a3d8297f5b36500fe00835bdbda75fe799847c9 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-84gs.js @@ -0,0 +1,29 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-84gs.js + * @description Strict - checking 'this' from a global scope (non-strict function declaration called by strict new'ed Function constructor) + * @onlyStrict + */ + +function f() { return this!==undefined;}; +if (! ((function () {return new Function("\"use strict\";return f();")();})()) ){ + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-85-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-85-s.js new file mode 100644 index 0000000000000000000000000000000000000000..b337c11b7f4a0355a84c1c92f75d746692640693 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-85-s.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-85-s.js + * @description Strict Mode - checking 'this' (non-strict function declaration called by strict Function.prototype.apply()) + * @onlyStrict + */ + +function testcase() { +function f() { return this!==undefined;}; +return (function () {"use strict"; return f.apply();})(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-85gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-85gs.js new file mode 100644 index 0000000000000000000000000000000000000000..c8e2810cfb43a7c194a7b40a4f3276d4350f5bb9 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-85gs.js @@ -0,0 +1,29 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-85gs.js + * @description Strict - checking 'this' from a global scope (non-strict function declaration called by strict Function.prototype.apply()) + * @onlyStrict + */ + +function f() { return this!==undefined;}; +if (! ((function () {"use strict"; return f.apply();})())){ + throw "'this' had incorrect value!"; +} diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-86-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-86-s.js new file mode 100644 index 0000000000000000000000000000000000000000..2002e99652826db96322d9a6e0db1ee9b78244e4 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-86-s.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-86-s.js + * @description Strict Mode - checking 'this' (non-strict function declaration called by strict Function.prototype.apply(null)) + * @onlyStrict + */ + +function testcase() { +function f() { return this===fnGlobalObject();}; +return (function () {"use strict"; return f.apply(null);})(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-86gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-86gs.js new file mode 100644 index 0000000000000000000000000000000000000000..b8b914e6c463d68dcc89f3164b2b27d5e741fa7b --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-86gs.js @@ -0,0 +1,29 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-86gs.js + * @description Strict - checking 'this' from a global scope (non-strict function declaration called by strict Function.prototype.apply(null)) + * @onlyStrict + */ + +function f() { return this===fnGlobalObject();}; +if (! ((function () {"use strict"; return f.apply(null);})())){ + throw "'this' had incorrect value!"; +} diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-87-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-87-s.js new file mode 100644 index 0000000000000000000000000000000000000000..08c7912cdbb2c7254ca73eabc2622cf62f3c6d89 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-87-s.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-87-s.js + * @description Strict Mode - checking 'this' (non-strict function declaration called by strict Function.prototype.apply(undefined)) + * @onlyStrict + */ + +function testcase() { +function f() { return this===fnGlobalObject()}; +return (function () {"use strict"; return f.apply(undefined);})(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-87gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-87gs.js new file mode 100644 index 0000000000000000000000000000000000000000..058e0a1984dc501ff375d9be25178be26a6fbe58 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-87gs.js @@ -0,0 +1,29 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-87gs.js + * @description Strict - checking 'this' from a global scope (non-strict function declaration called by strict Function.prototype.apply(undefined)) + * @onlyStrict + */ + +function f() { return this===fnGlobalObject();}; +if (! ((function () {"use strict"; return f.apply(undefined);})())){ + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-88-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-88-s.js new file mode 100644 index 0000000000000000000000000000000000000000..a014147428292088c0ff054b6d120b041cf46e6f --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-88-s.js @@ -0,0 +1,32 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-88-s.js + * @description Strict Mode - checking 'this' (non-strict function declaration called by strict Function.prototype.apply(someObject)) + * @onlyStrict + */ + +function testcase() { +var o = {}; +function f() { return this===o;}; +return (function () {"use strict"; return f.apply(o);})(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-88gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-88gs.js new file mode 100644 index 0000000000000000000000000000000000000000..01db70049b0f253b6b670f1f57be06f89ff63f37 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-88gs.js @@ -0,0 +1,30 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-88gs.js + * @description Strict - checking 'this' from a global scope (non-strict function declaration called by strict Function.prototype.apply(someObject)) + * @onlyStrict + */ + +var o = {}; +function f() { return this===o;}; +if (! ((function () {"use strict"; return f.apply(o);})())){ + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-89-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-89-s.js new file mode 100644 index 0000000000000000000000000000000000000000..5b48014a89a173d6ad1bc9b56fdd4e6ffe4f04c4 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-89-s.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-89-s.js + * @description Strict Mode - checking 'this' (non-strict function declaration called by strict Function.prototype.apply(globalObject)) + * @onlyStrict + */ + +function testcase() { +function f() { return this;}; +return (function () {"use strict"; return f.apply(fnGlobalObject()); })() === fnGlobalObject(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-89gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-89gs.js new file mode 100644 index 0000000000000000000000000000000000000000..e1317c9752ea9dfed16a735e52b3029a37554bb3 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-89gs.js @@ -0,0 +1,29 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-89gs.js + * @description Strict - checking 'this' from a global scope (non-strict function declaration called by strict Function.prototype.apply(globalObject)) + * @onlyStrict + */ + +function f() { return this;}; +if ((function () {"use strict"; return f.apply(fnGlobalObject());})() !== fnGlobalObject()){ + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-9-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-9-s.js new file mode 100644 index 0000000000000000000000000000000000000000..b692ad1878e29e2af56296a9b15425bc2165c218 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-9-s.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-9-s.js + * @description Strict Mode - checking 'this' (FunctionExpression defined within strict mode) + * @onlyStrict + */ + +function testcase() { +"use strict"; +var f = function () { + return typeof this; +} +return f() === "undefined"; +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-90-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-90-s.js new file mode 100644 index 0000000000000000000000000000000000000000..77d6cc8ff1c57cb139eb5a68daaf3db2212b8866 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-90-s.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-90-s.js + * @description Strict Mode - checking 'this' (non-strict function declaration called by strict Function.prototype.call()) + * @onlyStrict + */ + +function testcase() { +function f() { return this===fnGlobalObject();}; +return (function () {"use strict"; return f.call(); })(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-90gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-90gs.js new file mode 100644 index 0000000000000000000000000000000000000000..48a8fff6c4798e593282f101c406054aaed0968b --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-90gs.js @@ -0,0 +1,29 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-90gs.js + * @description Strict - checking 'this' from a global scope (non-strict function declaration called by strict Function.prototype.call()) + * @onlyStrict + */ + +function f() { return this===fnGlobalObject();}; +if (! ((function () {"use strict"; return f.call();})())){ + throw "'this' had incorrect value!"; +} diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-91-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-91-s.js new file mode 100644 index 0000000000000000000000000000000000000000..7c2d4d913993d773b6bcf9a1ead1db5a1d018079 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-91-s.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-91-s.js + * @description Strict Mode - checking 'this' (non-strict function declaration called by strict Function.prototype.call(null)) + * @onlyStrict + */ + +function testcase() { +function f() { return this===fnGlobalObject();}; +return (function () {"use strict"; return f.call(null); })(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-91gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-91gs.js new file mode 100644 index 0000000000000000000000000000000000000000..fbcb7e186ed38b0d2909c1db97756a63ab3334fc --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-91gs.js @@ -0,0 +1,29 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-91gs.js + * @description Strict - checking 'this' from a global scope (non-strict function declaration called by strict Function.prototype.call(null)) + * @onlyStrict + */ + +function f() { return this===fnGlobalObject();}; +if (! ((function () {"use strict"; return f.call(null); })())){ + throw "'this' had incorrect value!"; +} diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-92-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-92-s.js new file mode 100644 index 0000000000000000000000000000000000000000..2e65d20cf9808a52519694a3ff925823bc8cfd1f --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-92-s.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-92-s.js + * @description Strict Mode - checking 'this' (non-strict function declaration called by strict Function.prototype.call(undefined)) + * @onlyStrict + */ + +function testcase() { +function f() { return this===fnGlobalObject();}; +return (function () {"use strict"; return f.call(undefined);})(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-92gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-92gs.js new file mode 100644 index 0000000000000000000000000000000000000000..c9625b34d74aaf09e5f316930c31397d561883c8 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-92gs.js @@ -0,0 +1,29 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-92gs.js + * @description Strict - checking 'this' from a global scope (non-strict function declaration called by strict Function.prototype.call(undefined)) + * @onlyStrict + */ + +function f() { return this===fnGlobalObject();}; +if (! ((function () {"use strict"; return f.call(undefined);})())){ + throw "'this' had incorrect value!"; +} diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-93-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-93-s.js new file mode 100644 index 0000000000000000000000000000000000000000..f055e795c15cf482db920532a5ccd4918c4b050d --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-93-s.js @@ -0,0 +1,32 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-93-s.js + * @description Strict Mode - checking 'this' (non-strict function declaration called by strict Function.prototype.call(someObject)) + * @onlyStrict + */ + +function testcase() { +var o = {}; +function f() { return this===o;}; +return (function () {"use strict"; return f.call(o); })(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-93gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-93gs.js new file mode 100644 index 0000000000000000000000000000000000000000..3f05fadbeb7d84d1bb208c76347ad7d8eacf72e6 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-93gs.js @@ -0,0 +1,30 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-93gs.js + * @description Strict - checking 'this' from a global scope (non-strict function declaration called by strict Function.prototype.call(someObject)) + * @onlyStrict + */ + +var o = {}; +function f() { return this===o;}; +if (! ((function () {"use strict"; return f.call(o); })())){ + throw "'this' had incorrect value!"; +} diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-94-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-94-s.js new file mode 100644 index 0000000000000000000000000000000000000000..5f8f96b25ba10424d50f6548eeae19cba1961150 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-94-s.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-94-s.js + * @description Strict Mode - checking 'this' (non-strict function declaration called by strict Function.prototype.call(globalObject)) + * @onlyStrict + */ + +function testcase() { +function f() { return this===fnGlobalObject();}; +return (function () {"use strict"; return f.call(fnGlobalObject());})(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-94gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-94gs.js new file mode 100644 index 0000000000000000000000000000000000000000..f8ddd4113f1f8a6375eb1eba5a2d81ac18bc41a2 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-94gs.js @@ -0,0 +1,29 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-94gs.js + * @description Strict - checking 'this' from a global scope (non-strict function declaration called by strict Function.prototype.call(globalObject)) + * @onlyStrict + */ + +function f() { return this===fnGlobalObject();}; +if (! ((function () {"use strict"; return f.call(fnGlobalObject());})())){ + throw "'this' had incorrect value!"; +} diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-95-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-95-s.js new file mode 100644 index 0000000000000000000000000000000000000000..8355cce22d32123367d2515a2efadd8c29e72d41 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-95-s.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-95-s.js + * @description Strict Mode - checking 'this' (non-strict function declaration called by strict Function.prototype.bind()()) + * @onlyStrict + */ + +function testcase() { +function f() { return this===fnGlobalObject();}; +return (function () {"use strict"; return f.bind()(); })(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-95gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-95gs.js new file mode 100644 index 0000000000000000000000000000000000000000..5d5fe280adb9908c40d97380487ecd8cf6852ac6 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-95gs.js @@ -0,0 +1,29 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-95gs.js + * @description Strict - checking 'this' from a global scope (non-strict function declaration called by strict Function.prototype.bind()()) + * @onlyStrict + */ + +function f() { return this===fnGlobalObject();}; +if (! ((function () {"use strict"; return f.bind()(); })())){ + throw "'this' had incorrect value!"; +} diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-96-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-96-s.js new file mode 100644 index 0000000000000000000000000000000000000000..01cad6650456b895927b4a052efc4f4c378b43df --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-96-s.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-96-s.js + * @description Strict Mode - checking 'this' (non-strict function declaration called by strict Function.prototype.bind(null)()) + * @onlyStrict + */ + +function testcase() { +function f() { return this===fnGlobalObject();}; +return (function () {"use strict"; return f.bind(null)(); })(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-96gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-96gs.js new file mode 100644 index 0000000000000000000000000000000000000000..8a95144e94f6addf16cea9e408ef60b9f13105ab --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-96gs.js @@ -0,0 +1,29 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-96gs.js + * @description Strict - checking 'this' from a global scope (non-strict function declaration called by strict Function.prototype.bind(null)()) + * @onlyStrict + */ + +function f() { return this===fnGlobalObject();}; +if (! ((function () {"use strict"; return f.bind(null)(); })())){ + throw "'this' had incorrect value!"; +} diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-97-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-97-s.js new file mode 100644 index 0000000000000000000000000000000000000000..b7daed48952824ce9316c76150839a7c3c5bd37a --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-97-s.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-97-s.js + * @description Strict Mode - checking 'this' (non-strict function declaration called by strict Function.prototype.bind(undefined)()) + * @onlyStrict + */ + +function testcase() { +function f() { return this===fnGlobalObject();}; +return (function () {"use strict"; return f.bind(undefined)();})(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-97gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-97gs.js new file mode 100644 index 0000000000000000000000000000000000000000..2133adf18537a2233d9e63b58617fc344b3bc2b6 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-97gs.js @@ -0,0 +1,29 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-97gs.js + * @description Strict - checking 'this' from a global scope (non-strict function declaration called by strict Function.prototype.bind(undefined)()) + * @onlyStrict + */ + +function f() { return this===fnGlobalObject();}; +if (! ((function () {"use strict"; return f.bind(undefined)(); })())){ + throw "'this' had incorrect value!"; +} diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-98-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-98-s.js new file mode 100644 index 0000000000000000000000000000000000000000..e4a05ff50bf0e5d9687cbf1e037f7e94fea8d141 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-98-s.js @@ -0,0 +1,32 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-98-s.js + * @description Strict Mode - checking 'this' (non-strict function declaration called by strict Function.prototype.bind(someObject)()) + * @onlyStrict + */ + +function testcase() { +var o = {}; +function f() { return this===o;}; +return (function () {"use strict"; return f.bind(o)();})(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-98gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-98gs.js new file mode 100644 index 0000000000000000000000000000000000000000..9de8ece668e4383888e426b74b27a6ee4cc379a1 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-98gs.js @@ -0,0 +1,30 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-98gs.js + * @description Strict - checking 'this' from a global scope (non-strict function declaration called by strict Function.prototype.bind(someObject)()) + * @onlyStrict + */ + +var o = {}; +function f() { return this===o;}; +if (! ((function () {"use strict"; return f.bind(o)();})())){ + throw "'this' had incorrect value!"; +} diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-99-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-99-s.js new file mode 100644 index 0000000000000000000000000000000000000000..2e64fc80e6161a82e3ba38c1007a22fa0c5ba0bc --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-99-s.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-99-s.js + * @description Strict Mode - checking 'this' (non-strict function declaration called by strict Function.prototype.bind(globalObject)()) + * @onlyStrict + */ + +function testcase() { +function f() { return this===fnGlobalObject();}; +return (function () {"use strict"; return f.bind(fnGlobalObject())();})(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-99gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-99gs.js new file mode 100644 index 0000000000000000000000000000000000000000..feb7e6f57ff639c5e499dde4c2b00b067224c89d --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-99gs.js @@ -0,0 +1,29 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-99gs.js + * @description Strict - checking 'this' from a global scope (non-strict function declaration called by strict Function.prototype.bind(globalObject)()) + * @onlyStrict + */ + +function f() { return this===fnGlobalObject();}; +if (! ((function () {"use strict"; return f.bind(fnGlobalObject())();})())){ + throw "'this' had incorrect value!"; +} diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-9gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-9gs.js new file mode 100644 index 0000000000000000000000000000000000000000..d9422091dcb6357a16db1215cbce6561c21d79a8 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-9gs.js @@ -0,0 +1,32 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-9gs.js + * @description Strict - checking 'this' from a global scope (FunctionExpression defined within strict mode) + * @onlyStrict + */ + +"use strict"; +var f = function () { + return typeof this; +} +if (f() !== "undefined") { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.6/10.6-13-a-2.js b/test/suite/ch10/10.6/10.6-13-a-2.js new file mode 100644 index 0000000000000000000000000000000000000000..4364527cc70dfefeacb532424a1d93745d82ebd4 --- /dev/null +++ b/test/suite/ch10/10.6/10.6-13-a-2.js @@ -0,0 +1,46 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.6/10.6-13-a-2.js + * @description A direct call to arguments.callee.caller should work + */ + + +function testcase() { + var called = false; + + function test1(flag) { + if (flag!==true) { + test2(); + } else { + called = true; + } + } + + function test2() { + arguments.callee.caller(true); + } + + test1(); + return called; +} + +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.6/10.6-13-a-3.js b/test/suite/ch10/10.6/10.6-13-a-3.js new file mode 100644 index 0000000000000000000000000000000000000000..c00234b5b2f7dd4c98c0ed34a0e202792df14ec0 --- /dev/null +++ b/test/suite/ch10/10.6/10.6-13-a-3.js @@ -0,0 +1,47 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.6/10.6-13-a-3.js + * @description An indirect call to arguments.callee.caller should work + */ + + +function testcase() { + var called = false; + + function test1(flag) { + if (flag!==true) { + test2(); + } else { + called = true; + } + } + + function test2() { + var explicit = arguments.callee.caller; + explicit(true); + } + + test1(); + return called; +} + +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch11/11.2/11.2.3/11.2.3-3_1.js b/test/suite/ch11/11.2/11.2.3/11.2.3-3_1.js new file mode 100644 index 0000000000000000000000000000000000000000..42d037e0749428fabda6d37865bd7d7063fa224a --- /dev/null +++ b/test/suite/ch11/11.2/11.2.3/11.2.3-3_1.js @@ -0,0 +1,39 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch11/11.2/11.2.3/11.2.3-3_1.js + * @description Call arguments are evaluated before the check is made to see if the object is actually callable (FunctionDeclaration) + */ + + +function testcase() { + var fooCalled = false; + function foo(){ fooCalled = true; } + + var o = { }; + try { + o.bar( foo() ); + throw new Exception("o.bar does not exist!"); + } catch(e) { + return (e instanceof TypeError) && (fooCalled===true); + } +} +runTestCase(testcase); diff --git a/test/suite/ch11/11.2/11.2.3/11.2.3-3_2.js b/test/suite/ch11/11.2/11.2.3/11.2.3-3_2.js new file mode 100644 index 0000000000000000000000000000000000000000..ef5e3d317a29f16bb7912b95dc2feea74c26a8a4 --- /dev/null +++ b/test/suite/ch11/11.2/11.2.3/11.2.3-3_2.js @@ -0,0 +1,39 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch11/11.2/11.2.3/11.2.3-3_2.js + * @description Call arguments are evaluated before the check is made to see if the object is actually callable (FunctionExpression) + */ + + +function testcase() { + var fooCalled = false; + var foo = function (){ fooCalled = true; } + + var o = { }; + try { + o.bar( foo() ); + throw new Exception("o.bar does not exist!"); + } catch(e) { + return (e instanceof TypeError) && (fooCalled===true); + } +} +runTestCase(testcase); diff --git a/test/suite/ch11/11.2/11.2.3/11.2.3-3_3.js b/test/suite/ch11/11.2/11.2.3/11.2.3-3_3.js new file mode 100644 index 0000000000000000000000000000000000000000..79f71a4e19c8096c993b163a2d612db30992d954 --- /dev/null +++ b/test/suite/ch11/11.2/11.2.3/11.2.3-3_3.js @@ -0,0 +1,39 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch11/11.2/11.2.3/11.2.3-3_3.js + * @description Call arguments are not evaluated before the check is made to see if the object is actually callable (undefined member) + */ + + +function testcase() { + var fooCalled = false; + function foo(){ fooCalled = true; } + + var o = { }; + try { + o.bar.gar( foo() ); + throw new Exception("o.bar does not exist!"); + } catch(e) { + return (e instanceof TypeError) && (fooCalled===false); + } +} +runTestCase(testcase); diff --git a/test/suite/ch11/11.2/11.2.3/11.2.3-3_4.js b/test/suite/ch11/11.2/11.2.3/11.2.3-3_4.js new file mode 100644 index 0000000000000000000000000000000000000000..423200d2d8d4a043c13755300740e2b33f1a7518 --- /dev/null +++ b/test/suite/ch11/11.2/11.2.3/11.2.3-3_4.js @@ -0,0 +1,41 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch11/11.2/11.2.3/11.2.3-3_4.js + * @description Call arguments are evaluated before the check is made to see if the object is actually callable (property) + */ + + +function testcase() { + var fooCalled = false; + function foo(){ fooCalled = true; } + + var o = { }; + Object.defineProperty(o, "bar", {get: function() {this.barGetter = true; return 42;}, + set: function(x) {this.barSetter = true; }}); + try { + o.bar( foo() ); + throw new Exception("o.bar does not exist!"); + } catch(e) { + return (e instanceof TypeError) && (fooCalled===true) && (o.barGetter===true) && (o.barSetter===undefined); + } +} +runTestCase(testcase); diff --git a/test/suite/ch11/11.2/11.2.3/11.2.3-3_5.js b/test/suite/ch11/11.2/11.2.3/11.2.3-3_5.js new file mode 100644 index 0000000000000000000000000000000000000000..a850a1dbbd6492ce7e8e31941e831c4e4edbe8b0 --- /dev/null +++ b/test/suite/ch11/11.2/11.2.3/11.2.3-3_5.js @@ -0,0 +1,39 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch11/11.2/11.2.3/11.2.3-3_5.js + * @description Call arguments are evaluated before the check is made to see if the object is actually callable (eval'ed) + */ + + +function testcase() { + var fooCalled = false; + function foo(){ fooCalled = true; } + + var o = { }; + try { + eval("o.bar( foo() );"); + throw new Exception("o.bar does not exist!"); + } catch(e) { + return (e instanceof TypeError) && (fooCalled===true); + } +} +runTestCase(testcase); diff --git a/test/suite/ch11/11.2/11.2.3/11.2.3-3_6.js b/test/suite/ch11/11.2/11.2.3/11.2.3-3_6.js new file mode 100644 index 0000000000000000000000000000000000000000..5abd045c0956b01ea84f10de8f1844178f98e102 --- /dev/null +++ b/test/suite/ch11/11.2/11.2.3/11.2.3-3_6.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch11/11.2/11.2.3/11.2.3-3_6.js + * @description Call arguments are evaluated before the check is made to see if the object is actually callable (getter called) + */ + + +function testcase() { + var o = { }; + Object.defineProperty(o, "bar", {get: function() {this.barGetter = true; return 42;}, + set: function(x) {this.barSetter = true; }}); + try { + o.foo( o.bar ); + throw new Exception("o.foo does not exist!"); + } catch(e) { + return (e instanceof TypeError) && (o.barGetter===true) && (o.barSetter===undefined); + } +} +runTestCase(testcase); diff --git a/test/suite/ch11/11.2/11.2.3/11.2.3-3_7.js b/test/suite/ch11/11.2/11.2.3/11.2.3-3_7.js new file mode 100644 index 0000000000000000000000000000000000000000..a201b8d070f0c917a53a7d727e12919bb8d08e38 --- /dev/null +++ b/test/suite/ch11/11.2/11.2.3/11.2.3-3_7.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch11/11.2/11.2.3/11.2.3-3_7.js + * @description Call arguments are evaluated before the check is made to see if the object is actually callable (getter called as indexed property) + */ + + +function testcase() { + var o = { }; + Object.defineProperty(o, "bar", {get: function() {this.barGetter = true; return 42;}, + set: function(x) {this.barSetter = true; }}); + try { + o.foo( o["bar"] ); + throw new Exception("o.foo does not exist!"); + } catch(e) { + return (e instanceof TypeError) && (o.barGetter===true) && (o.barSetter===undefined); + } +} +runTestCase(testcase); diff --git a/test/suite/ch11/11.2/11.2.3/11.2.3-3_8.js b/test/suite/ch11/11.2/11.2.3/11.2.3-3_8.js new file mode 100644 index 0000000000000000000000000000000000000000..5e63653fd114e6934835559c76fbecba2edc3fb3 --- /dev/null +++ b/test/suite/ch11/11.2/11.2.3/11.2.3-3_8.js @@ -0,0 +1,42 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch11/11.2/11.2.3/11.2.3-3_8.js + * @description Call arguments are evaluated before the check is made to see if the object is actually callable (global object) + */ + + +function testcase() { + if (this!==fnGlobalObject()) { + return; + } + + var fooCalled = false; + function foo(){ fooCalled = true; } + + try { + this.bar( foo() ); + throw new Exception("this.bar does not exist!"); + } catch(e) { + return (e instanceof TypeError) && (fooCalled===true); + } +} +runTestCase(testcase); diff --git a/test/suite/ch11/11.4/11.4.1/11.4.1-5-a-27-s.js b/test/suite/ch11/11.4/11.4.1/11.4.1-5-a-27-s.js new file mode 100644 index 0000000000000000000000000000000000000000..4b6f0d176c0d850bcbee677bb69b2967f0c8d255 --- /dev/null +++ b/test/suite/ch11/11.4/11.4.1/11.4.1-5-a-27-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. + +/** + * @path ch11/11.4/11.4.1/11.4.1-5-a-27-s.js + * @description Strict Mode - TypeError is thrown after deleting a property, calling preventExtensions, and attempting to reassign the property + * @onlyStrict + */ + + +function testcase() { + "use strict"; + var a = {x:0, get y() { return 0;}}; + delete a.x; + Object.preventExtensions(a); + try { + a.x = 1; + return false; + } catch (e) { + return e instanceof TypeError; + } +} +runTestCase(testcase); diff --git a/test/suite/ch11/11.4/11.4.1/11.4.1-5-a-28-s.js b/test/suite/ch11/11.4/11.4.1/11.4.1-5-a-28-s.js new file mode 100644 index 0000000000000000000000000000000000000000..bb1999b3dc8b894b4f192529643aa2f2dc7ec10b --- /dev/null +++ b/test/suite/ch11/11.4/11.4.1/11.4.1-5-a-28-s.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch11/11.4/11.4.1/11.4.1-5-a-28-s.js + * @description Strict Mode - TypeError is thrown when deleting RegExp.length + * @onlyStrict + */ + + +function testcase() { + "use strict"; + var a = new RegExp(); + try { + var b = delete RegExp.length; + return false; + } catch (e) { + return e instanceof TypeError; + } +} +runTestCase(testcase); diff --git a/test/suite/ch13/13.0/13_4-17gs.js b/test/suite/ch13/13.0/13_4-17gs.js index 2d82271719a0b5f7483af62622c55469915774d6..af52092138f4bd69aa6d0951812b64b2906db59d 100644 --- a/test/suite/ch13/13.0/13_4-17gs.js +++ b/test/suite/ch13/13.0/13_4-17gs.js @@ -1,4 +1,4 @@ -/// Copyright (c) 2011 Microsoft Corporation +/// Copyright (c) 2012 Microsoft Corporation /// /// Redistribution and use in source and binary forms, with or without modification, are permitted provided /// that the following conditions are met: @@ -18,6 +18,7 @@ /// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF /// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + /** * @path ch13/13.0/13_4-17gs.js * @description Strict Mode - SourceElements is evaluated as strict mode code when a Function constructor is contained in strict mode code diff --git a/test/suite/ch13/13.0/13_4-5gs.js b/test/suite/ch13/13.0/13_4-5gs.js index e648c35b6b91952c4ec0210346590191585a3804..46a2c34a3485318829d6dc4c382e608ceda94235 100644 --- a/test/suite/ch13/13.0/13_4-5gs.js +++ b/test/suite/ch13/13.0/13_4-5gs.js @@ -1,4 +1,4 @@ -/// Copyright (c) 2011 Microsoft Corporation +/// Copyright (c) 2012 Microsoft Corporation /// /// Redistribution and use in source and binary forms, with or without modification, are permitted provided /// that the following conditions are met: @@ -18,6 +18,7 @@ /// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF /// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + /** * @path ch13/13.0/13_4-5gs.js * @description Strict Mode - SourceElements is evaluated as strict mode code when a FunctionDeclaration is contained in strict mode code diff --git a/test/suite/ch13/13.2/13.2-10-s.js b/test/suite/ch13/13.2/13.2-10-s.js new file mode 100644 index 0000000000000000000000000000000000000000..8b8ffae9b956776b08a4e042ba3db5f42b3ed86a --- /dev/null +++ b/test/suite/ch13/13.2/13.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. + +/** + * @path ch13/13.2/13.2-10-s.js + * @description StrictMode - writing a property named 'caller' of function objects is not allowed outside the function + * @onlyStrict + */ + + + +function testcase() { + var foo = Function("'use strict';"); + try { + foo.caller = 41; + return false; + } + catch (e) { + return e instanceof TypeError; + } +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch13/13.2/13.2-11-s.js b/test/suite/ch13/13.2/13.2-11-s.js new file mode 100644 index 0000000000000000000000000000000000000000..6c33127ee7743cfd9999e6f67bf9982a43e4a835 --- /dev/null +++ b/test/suite/ch13/13.2/13.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. + +/** + * @path ch13/13.2/13.2-11-s.js + * @description StrictMode - enumerating over a function object looking for 'caller' fails outside of the function + * @onlyStrict + */ + + + +function testcase() { + var foo = Function("'use strict';"); + + for (var tempIndex in foo) { + if (tempIndex === "caller") { + return false; + } + } + return true; +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch13/13.2/13.2-12-s.js b/test/suite/ch13/13.2/13.2-12-s.js new file mode 100644 index 0000000000000000000000000000000000000000..8ac8d40f9588ec9f9a1e7c21f7f4c10a2e51d8bf --- /dev/null +++ b/test/suite/ch13/13.2/13.2-12-s.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch13/13.2/13.2-12-s.js + * @description StrictMode - enumerating over a function object looking for 'caller' fails inside the function + * @onlyStrict + */ + + + +function testcase() { + var foo = Function("'use strict'; for (var tempIndex in this) {if (tempIndex===\"caller\") {return false;}}; return true;"); + return foo(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch13/13.2/13.2-13-s.js b/test/suite/ch13/13.2/13.2-13-s.js new file mode 100644 index 0000000000000000000000000000000000000000..b46625ca02ce045bad66ce6b208957f15b82a8a7 --- /dev/null +++ b/test/suite/ch13/13.2/13.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. + +/** + * @path ch13/13.2/13.2-13-s.js + * @description StrictMode - reading a property named 'arguments' of function objects is not allowed outside the function + * @onlyStrict + */ + + + +function testcase() { + var foo = new Function("'use strict';"); + try { + var temp = foo.arguments; + return false; + } + catch (e) { + return e instanceof TypeError; + } +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch13/13.2/13.2-14-s.js b/test/suite/ch13/13.2/13.2-14-s.js new file mode 100644 index 0000000000000000000000000000000000000000..cd834d8217ab79fbba63e3c69091a2e80e2645fd --- /dev/null +++ b/test/suite/ch13/13.2/13.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. + +/** + * @path ch13/13.2/13.2-14-s.js + * @description StrictMode - writing a property named 'arguments' of function objects is not allowed outside the function + * @onlyStrict + */ + + + +function testcase() { + var foo = new Function("'use strict';"); + try { + foo.arguments = 41; + return false; + } + catch (e) { + return e instanceof TypeError; + } +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch13/13.2/13.2-15-s.js b/test/suite/ch13/13.2/13.2-15-s.js new file mode 100644 index 0000000000000000000000000000000000000000..d4faf9dd687d0640bcee3444357e707f4e03e15e --- /dev/null +++ b/test/suite/ch13/13.2/13.2-15-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. + +/** + * @path ch13/13.2/13.2-15-s.js + * @description StrictMode - enumerating over a function object looking for 'arguments' fails outside of the function + * @onlyStrict + */ + + + +function testcase() { + var foo = new Function("'use strict';"); + + for (var tempIndex in foo) { + if (tempIndex === "arguments") { + return false; + } + } + return true; +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch13/13.2/13.2-16-s.js b/test/suite/ch13/13.2/13.2-16-s.js new file mode 100644 index 0000000000000000000000000000000000000000..31daadd0cd56bbbe40c6fc0699a198ae346c677b --- /dev/null +++ b/test/suite/ch13/13.2/13.2-16-s.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch13/13.2/13.2-16-s.js + * @description StrictMode - enumerating over a function object looking for 'arguments' fails inside the function + * @onlyStrict + */ + + + +function testcase() { + var foo = new Function("'use strict'; for (var tempIndex in this) {if (tempIndex===\"arguments\") {return false;}}; return true;"); + return foo(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch13/13.2/13.2-17-s.js b/test/suite/ch13/13.2/13.2-17-s.js new file mode 100644 index 0000000000000000000000000000000000000000..7dddaf10256e1ae407aee677717e6e8bd4ddab14 --- /dev/null +++ b/test/suite/ch13/13.2/13.2-17-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. + +/** + * @path ch13/13.2/13.2-17-s.js + * @description StrictMode - reading a property named 'arguments' of function objects is not allowed outside the function + * @onlyStrict + */ + + + +function testcase() { + var foo = Function("'use strict';"); + try { + var temp = foo.arguments; + return false; + } + catch (e) { + return e instanceof TypeError; + } +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch13/13.2/13.2-18-s.js b/test/suite/ch13/13.2/13.2-18-s.js new file mode 100644 index 0000000000000000000000000000000000000000..7c4f27baeef13a7fd7c879d2bb21719237b2239a --- /dev/null +++ b/test/suite/ch13/13.2/13.2-18-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. + +/** + * @path ch13/13.2/13.2-18-s.js + * @description StrictMode - writing a property named 'arguments' of function objects is not allowed outside the function + * @onlyStrict + */ + + + +function testcase() { + var foo = Function("'use strict';"); + try { + foo.arguments = 41; + return false; + } + catch (e) { + return e instanceof TypeError; + } +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch13/13.2/13.2-19-b-3gs.js b/test/suite/ch13/13.2/13.2-19-b-3gs.js new file mode 100644 index 0000000000000000000000000000000000000000..c02bc5bd3e9a5ee117a6773f1b6300190d7dc540 --- /dev/null +++ b/test/suite/ch13/13.2/13.2-19-b-3gs.js @@ -0,0 +1,29 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch13/13.2/13.2-19-b-3gs.js + * @description StrictMode - error is thrown when assign a value to the 'caller' property of a function object + * @onlyStrict + * @negative NotEarlyError + */ +"use strict"; +throw NotEarlyError; +function _13_2_19_b_3_gs() {} +_13_2_19_b_3_gs.caller = 1; diff --git a/test/suite/ch13/13.2/13.2-19-s.js b/test/suite/ch13/13.2/13.2-19-s.js new file mode 100644 index 0000000000000000000000000000000000000000..13c2343d7d323de0ec15dc2635d6680db7e4a4ac --- /dev/null +++ b/test/suite/ch13/13.2/13.2-19-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. + +/** + * @path ch13/13.2/13.2-19-s.js + * @description StrictMode - enumerating over a function object looking for 'arguments' fails outside of the function + * @onlyStrict + */ + + + +function testcase() { + var foo = Function("'use strict';"); + + for (var tempIndex in foo) { + if (tempIndex === "arguments") { + return false; + } + } + return true; +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch13/13.2/13.2-20-s.js b/test/suite/ch13/13.2/13.2-20-s.js new file mode 100644 index 0000000000000000000000000000000000000000..e7f425b8a6f23cb57c1817de18b3a5f43a5976c5 --- /dev/null +++ b/test/suite/ch13/13.2/13.2-20-s.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch13/13.2/13.2-20-s.js + * @description StrictMode - enumerating over a function object looking for 'arguments' fails inside the function + * @onlyStrict + */ + + + +function testcase() { + var foo = Function("'use strict'; for (var tempIndex in this) {if (tempIndex===\"arguments\") {return false;}}; return true;"); + return foo(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch13/13.2/13.2-21-s.js b/test/suite/ch13/13.2/13.2-21-s.js new file mode 100644 index 0000000000000000000000000000000000000000..06ab40e25722acdac2fdb43fbe5163f98d48d59e --- /dev/null +++ b/test/suite/ch13/13.2/13.2-21-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. + +/** + * @path ch13/13.2/13.2-21-s.js + * @description StrictMode - reading a property named 'caller' of function objects is not allowed outside the function + * @onlyStrict + */ + + + +function testcase() { + function foo () {"use strict";} + try { + var temp = foo.caller; + return false; + } + catch (e) { + return e instanceof TypeError; + } +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch13/13.2/13.2-22-s.js b/test/suite/ch13/13.2/13.2-22-s.js new file mode 100644 index 0000000000000000000000000000000000000000..dbffb87850d29c9350e359c0e15affa3142a0321 --- /dev/null +++ b/test/suite/ch13/13.2/13.2-22-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. + +/** + * @path ch13/13.2/13.2-22-s.js + * @description StrictMode - writing a property named 'caller' of function objects is not allowed outside the function + * @onlyStrict + */ + + + +function testcase() { + function foo () {"use strict";} + try { + foo.caller = 41; + return false; + } + catch (e) { + return e instanceof TypeError; + } +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch13/13.2/13.2-23-s.js b/test/suite/ch13/13.2/13.2-23-s.js new file mode 100644 index 0000000000000000000000000000000000000000..c720bc8920349e750b305de81f1ec240e9532a12 --- /dev/null +++ b/test/suite/ch13/13.2/13.2-23-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. + +/** + * @path ch13/13.2/13.2-23-s.js + * @description StrictMode - enumerating over a function object looking for 'caller' fails outside of the function + * @onlyStrict + */ + + + +function testcase() { + function foo () {"use strict";} + for (var tempIndex in foo) { + if (tempIndex === "caller") { + return false; + } + } + return true; +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch13/13.2/13.2-24-s.js b/test/suite/ch13/13.2/13.2-24-s.js new file mode 100644 index 0000000000000000000000000000000000000000..eb37d46cd520c44c988bb04453ba138e4dd09a80 --- /dev/null +++ b/test/suite/ch13/13.2/13.2-24-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. + +/** + * @path ch13/13.2/13.2-24-s.js + * @description StrictMode - enumerating over a function object looking for 'caller' fails inside the function + * @onlyStrict + */ + + + +function testcase() { + function foo () { + "use strict"; + for (var tempIndex in this) { + if (tempIndex==="caller") { + return false; + } + } + return true; + } + return foo(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch13/13.2/13.2-25-s.js b/test/suite/ch13/13.2/13.2-25-s.js new file mode 100644 index 0000000000000000000000000000000000000000..4b9ac5aca55df3923c8f4113508612ee92875013 --- /dev/null +++ b/test/suite/ch13/13.2/13.2-25-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. + +/** + * @path ch13/13.2/13.2-25-s.js + * @description StrictMode - reading a property named 'arguments' of function objects is not allowed outside the function + * @onlyStrict + */ + + + +function testcase() { + function foo () {"use strict";} + try { + var temp = foo.arguments; + return false; + } + catch (e) { + return e instanceof TypeError; + } +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch13/13.2/13.2-26-s.js b/test/suite/ch13/13.2/13.2-26-s.js new file mode 100644 index 0000000000000000000000000000000000000000..fbe806fa6dc11ec867ff7ee34e6a7b19386e1067 --- /dev/null +++ b/test/suite/ch13/13.2/13.2-26-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. + +/** + * @path ch13/13.2/13.2-26-s.js + * @description StrictMode - writing a property named 'arguments' of function objects is not allowed outside the function + * @onlyStrict + */ + + + +function testcase() { + function foo () {"use strict";} + try { + foo.arguments = 41; + return false; + } + catch (e) { + return e instanceof TypeError; + } +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch13/13.2/13.2-27-s.js b/test/suite/ch13/13.2/13.2-27-s.js new file mode 100644 index 0000000000000000000000000000000000000000..a30b1a63a94f844edca907e13cd9572a92ee789f --- /dev/null +++ b/test/suite/ch13/13.2/13.2-27-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. + +/** + * @path ch13/13.2/13.2-27-s.js + * @description StrictMode - enumerating over a function object looking for 'arguments' fails outside of the function + * @onlyStrict + */ + + + +function testcase() { + function foo () {"use strict";} + + for (var tempIndex in foo) { + if (tempIndex === "arguments") { + return false; + } + } + return true; +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch13/13.2/13.2-28-s.js b/test/suite/ch13/13.2/13.2-28-s.js new file mode 100644 index 0000000000000000000000000000000000000000..501cebf62ff8e5988cbe27d1208634641b02e928 --- /dev/null +++ b/test/suite/ch13/13.2/13.2-28-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. + +/** + * @path ch13/13.2/13.2-28-s.js + * @description StrictMode - enumerating over a function object looking for 'arguments' fails inside the function + * @onlyStrict + */ + + + +function testcase() { + function foo() { + "use strict"; + for (var tempIndex in this) { + if (tempIndex==="arguments") { + return false; + } + } + return true; + } + return foo(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch13/13.2/13.2-29-s.js b/test/suite/ch13/13.2/13.2-29-s.js new file mode 100644 index 0000000000000000000000000000000000000000..63c454b2b57c10cbda1181595a68714275112b50 --- /dev/null +++ b/test/suite/ch13/13.2/13.2-29-s.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. + +/** + * @path ch13/13.2/13.2-29-s.js + * @description StrictMode - property named 'caller' of function objects is not configurable + * @onlyStrict + */ + + + +function testcase() { + function foo() {"use strict";} + return ! Object.getOwnPropertyDescriptor(foo, + "caller").configurable; +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch13/13.2/13.2-30-s.js b/test/suite/ch13/13.2/13.2-30-s.js new file mode 100644 index 0000000000000000000000000000000000000000..6a2b68eff12a22b25be0e9bb6f6cacf183d0f1de --- /dev/null +++ b/test/suite/ch13/13.2/13.2-30-s.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch13/13.2/13.2-30-s.js + * @description StrictMode - property named 'caller' of function objects is not configurable + * @onlyStrict + */ + + + +function testcase() { + return ! Object.getOwnPropertyDescriptor(Function("'use strict';"), + "caller").configurable; +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch13/13.2/13.2-31-s.js b/test/suite/ch13/13.2/13.2-31-s.js new file mode 100644 index 0000000000000000000000000000000000000000..d6ccdd02cfa1c64d78f60cd46253b9a08640971c --- /dev/null +++ b/test/suite/ch13/13.2/13.2-31-s.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch13/13.2/13.2-31-s.js + * @description StrictMode - property named 'caller' of function objects is not configurable + * @onlyStrict + */ + + + +function testcase() { + return ! Object.getOwnPropertyDescriptor(new Function("'use strict';"), + "caller").configurable; +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch13/13.2/13.2-32-s.js b/test/suite/ch13/13.2/13.2-32-s.js new file mode 100644 index 0000000000000000000000000000000000000000..f743719e10e7b210f56058ff28c71825927c4325 --- /dev/null +++ b/test/suite/ch13/13.2/13.2-32-s.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. + +/** + * @path ch13/13.2/13.2-32-s.js + * @description StrictMode - property named 'caller' of function objects is not configurable + * @onlyStrict + */ + + + +function testcase() { + var funcExpr = function () { "use strict";}; + return ! Object.getOwnPropertyDescriptor(funcExpr, + "caller").configurable; +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch13/13.2/13.2-33-s.js b/test/suite/ch13/13.2/13.2-33-s.js new file mode 100644 index 0000000000000000000000000000000000000000..32b7f2ff9c1b8eeb052452e597e99ba78695a28a --- /dev/null +++ b/test/suite/ch13/13.2/13.2-33-s.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. + +/** + * @path ch13/13.2/13.2-33-s.js + * @description StrictMode - property named 'arguments' of function objects is not configurable + * @onlyStrict + */ + + + +function testcase() { + function foo() {"use strict";} + return ! Object.getOwnPropertyDescriptor(foo, + "arguments").configurable; +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch13/13.2/13.2-34-s.js b/test/suite/ch13/13.2/13.2-34-s.js new file mode 100644 index 0000000000000000000000000000000000000000..53c9242c6f4d0a1199e0941cfc28076e805a1b75 --- /dev/null +++ b/test/suite/ch13/13.2/13.2-34-s.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch13/13.2/13.2-34-s.js + * @description StrictMode - property named 'arguments' of function objects is not configurable + * @onlyStrict + */ + + + +function testcase() { + return ! Object.getOwnPropertyDescriptor(Function("'use strict';"), + "arguments").configurable; +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch13/13.2/13.2-35-s.js b/test/suite/ch13/13.2/13.2-35-s.js new file mode 100644 index 0000000000000000000000000000000000000000..ebb765ebfceb45d6f990f881f94f98ff68627fa7 --- /dev/null +++ b/test/suite/ch13/13.2/13.2-35-s.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch13/13.2/13.2-35-s.js + * @description StrictMode - property named 'arguments' of function objects is not configurable + * @onlyStrict + */ + + + +function testcase() { + return ! Object.getOwnPropertyDescriptor(new Function("'use strict';"), + "arguments").configurable; +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch13/13.2/13.2-36-s.js b/test/suite/ch13/13.2/13.2-36-s.js new file mode 100644 index 0000000000000000000000000000000000000000..e14fb7c15892e15c69291fe77bc09f5e3df2772c --- /dev/null +++ b/test/suite/ch13/13.2/13.2-36-s.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. + +/** + * @path ch13/13.2/13.2-36-s.js + * @description StrictMode - property named 'arguments' of function objects is not configurable + * @onlyStrict + */ + + + +function testcase() { + var funcExpr = function () { "use strict";}; + return ! Object.getOwnPropertyDescriptor(funcExpr, + "arguments").configurable; +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch13/13.2/13.2-6-s.js b/test/suite/ch13/13.2/13.2-6-s.js new file mode 100644 index 0000000000000000000000000000000000000000..18c8321ec946fdb5d254b740d72bcd39274e185e --- /dev/null +++ b/test/suite/ch13/13.2/13.2-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. + +/** + * @path ch13/13.2/13.2-6-s.js + * @description StrictMode - writing a property named 'caller' of function objects is not allowed outside the function + * @onlyStrict + */ + + + +function testcase() { + var foo = new Function("'use strict';"); + try { + foo.caller = 41; + return false; + } + catch (e) { + return e instanceof TypeError; + } +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch13/13.2/13.2-9-s.js b/test/suite/ch13/13.2/13.2-9-s.js new file mode 100644 index 0000000000000000000000000000000000000000..561ded3be54b892506974ae2df56bf41fbeb84a7 --- /dev/null +++ b/test/suite/ch13/13.2/13.2-9-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. + +/** + * @path ch13/13.2/13.2-9-s.js + * @description StrictMode - reading a property named 'caller' of function objects is not allowed outside the function + * @onlyStrict + */ + + + +function testcase() { + var foo = Function("'use strict';"); + try { + var temp = foo.caller; + return false; + } + catch (e) { + return e instanceof TypeError; + } +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch15/15.10/15.10.4/15.10.4.1-1.js b/test/suite/ch15/15.10/15.10.4/15.10.4.1/15.10.4.1-1.js similarity index 95% rename from test/suite/ch15/15.10/15.10.4/15.10.4.1-1.js rename to test/suite/ch15/15.10/15.10.4/15.10.4.1/15.10.4.1-1.js index 54874fa5bd34c0e466f6c46cb3b80bb59eef000b..df5b4f537d43ae466fdc083109e214a8f2ef4a2d 100644 --- a/test/suite/ch15/15.10/15.10.4/15.10.4.1-1.js +++ b/test/suite/ch15/15.10/15.10.4/15.10.4.1/15.10.4.1-1.js @@ -19,7 +19,7 @@ /// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /** - * @path ch15/15.10/15.10.4/15.10.4.1-1.js + * @path ch15/15.10/15.10.4/15.10.4.1/15.10.4.1-1.js * @description RegExp - the thrown error is TypeError instead of RegExpError when pattern is an object whose [[Class]] property is 'RegExp' and flags is not undefined */ diff --git a/test/suite/ch15/15.10/15.10.4/15.10.4.1-2.js b/test/suite/ch15/15.10/15.10.4/15.10.4.1/15.10.4.1-2.js similarity index 95% rename from test/suite/ch15/15.10/15.10.4/15.10.4.1-2.js rename to test/suite/ch15/15.10/15.10.4/15.10.4.1/15.10.4.1-2.js index 617da247b6b13687645852cd898226f47b6aa5f4..5db110bebe84a688314d0f8386cf0f412f652c22 100644 --- a/test/suite/ch15/15.10/15.10.4/15.10.4.1-2.js +++ b/test/suite/ch15/15.10/15.10.4/15.10.4.1/15.10.4.1-2.js @@ -19,7 +19,7 @@ /// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /** - * @path ch15/15.10/15.10.4/15.10.4.1-2.js + * @path ch15/15.10/15.10.4/15.10.4.1/15.10.4.1-2.js * @description RegExp - the thrown error is SyntaxError instead of RegExpError when the characters of 'P' do not have the syntactic form Pattern */ diff --git a/test/suite/ch15/15.10/15.10.4/15.10.4.1-3.js b/test/suite/ch15/15.10/15.10.4/15.10.4.1/15.10.4.1-3.js similarity index 95% rename from test/suite/ch15/15.10/15.10.4/15.10.4.1-3.js rename to test/suite/ch15/15.10/15.10.4/15.10.4.1/15.10.4.1-3.js index 1c3d43ea7fd5c59bd89227dcb5a4626b7e2a871c..1081b9d81918c0d66a0c3d2df0a3dcdc26d6ca3a 100644 --- a/test/suite/ch15/15.10/15.10.4/15.10.4.1-3.js +++ b/test/suite/ch15/15.10/15.10.4/15.10.4.1/15.10.4.1-3.js @@ -19,7 +19,7 @@ /// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /** - * @path ch15/15.10/15.10.4/15.10.4.1-3.js + * @path ch15/15.10/15.10.4/15.10.4.1/15.10.4.1-3.js * @description RegExp - the thrown error is SyntaxError instead of RegExpError when 'F' contains any character other than 'g', 'i', or 'm' */ diff --git a/test/suite/ch15/15.10/15.10.4/15.10.4.1-4.js b/test/suite/ch15/15.10/15.10.4/15.10.4.1/15.10.4.1-4.js similarity index 95% rename from test/suite/ch15/15.10/15.10.4/15.10.4.1-4.js rename to test/suite/ch15/15.10/15.10.4/15.10.4.1/15.10.4.1-4.js index 2321f215453e4b0494bf36e425c03ca26923c0b7..c2852bf3e62c611299a01adb298df165a3a8fda5 100644 --- a/test/suite/ch15/15.10/15.10.4/15.10.4.1-4.js +++ b/test/suite/ch15/15.10/15.10.4/15.10.4.1/15.10.4.1-4.js @@ -19,7 +19,7 @@ /// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /** - * @path ch15/15.10/15.10.4/15.10.4.1-4.js + * @path ch15/15.10/15.10.4/15.10.4.1/15.10.4.1-4.js * @description RegExp - the SyntaxError is not thrown when flags is 'gim' */ diff --git a/test/suite/ch15/15.10/15.10.4/15.10.4.1/15.10.4.1-5.js b/test/suite/ch15/15.10/15.10.4/15.10.4.1/15.10.4.1-5.js new file mode 100644 index 0000000000000000000000000000000000000000..6dc5ee508321fe152908e8404f35ab99eeed9012 --- /dev/null +++ b/test/suite/ch15/15.10/15.10.4/15.10.4.1/15.10.4.1-5.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.10/15.10.4/15.10.4.1/15.10.4.1-5.js + * @description RegExp - the 'source' property of an empty RegExp should not be the empty string + */ + + +function testcase() { + var regObj = new RegExp(); + return (regObj.source!=="") && (RegExp().source!==""); +} +runTestCase(testcase); diff --git a/test/suite/ch15/15.2/15.2.4/15.2.4.4/15.2.4.4-1.js b/test/suite/ch15/15.2/15.2.4/15.2.4.4/15.2.4.4-1.js new file mode 100644 index 0000000000000000000000000000000000000000..a7e86df04ebfbb9f6765d5e45f46281900dd1ce8 --- /dev/null +++ b/test/suite/ch15/15.2/15.2.4/15.2.4.4/15.2.4.4-1.js @@ -0,0 +1,30 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.2/15.2.4/15.2.4.4/15.2.4.4-1.js + * @description Object.prototype.valueOf - typeof Object.prototype.valueOf.call(true)==="object" + */ + + +function testcase() { + return (typeof Object.prototype.valueOf.call(true)) === "object"; +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch15/15.2/15.2.4/15.2.4.4/15.2.4.4-2.js b/test/suite/ch15/15.2/15.2.4/15.2.4.4/15.2.4.4-2.js new file mode 100644 index 0000000000000000000000000000000000000000..1d4bc57ed54d1702f7c18ab6c8b5b512523e2a96 --- /dev/null +++ b/test/suite/ch15/15.2/15.2.4/15.2.4.4/15.2.4.4-2.js @@ -0,0 +1,30 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.2/15.2.4/15.2.4.4/15.2.4.4-2.js + * @description Object.prototype.valueOf - typeof Object.prototype.valueOf.call(false)==="object" + */ + + +function testcase() { + return (typeof Object.prototype.valueOf.call(false)) === "object"; +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-10gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-10gs.js new file mode 100644 index 0000000000000000000000000000000000000000..92aad3a3db0fbb0314f75f75fc528fb7ada56a4b --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-10gs.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-10gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (New'ed Function constructor includes strict directive prologue) + * @onlyStrict + * @negative TypeError + */ + + +var f = new Function("\"use strict\";\nreturn gNonStrict();"); +f(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-11gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-11gs.js new file mode 100644 index 0000000000000000000000000000000000000000..1e2a9b5f381ba538812bbea587aa775823f7394b --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-11gs.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-11gs.js + * @description Strict mode - checking access to strict function caller from strict function (eval used within strict mode) + * @onlyStrict + * @negative TypeError + */ + + +"use strict"; +eval("gNonStrict();"); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-12gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-12gs.js new file mode 100644 index 0000000000000000000000000000000000000000..765ea8b09b911327d61c7132cd6d9666a36e803d --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-12gs.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-12gs.js + * @description Strict mode - checking access to non-strict function caller from non-strict function (eval includes strict directive prologue) + * @onlyStrict + */ + + +eval("\"use strict\";\ngNonStrict();"); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-13gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-13gs.js new file mode 100644 index 0000000000000000000000000000000000000000..f1a89c5da509881f5b5c11a67433ea9f8b5c17f1 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-13gs.js @@ -0,0 +1,37 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-13gs.js + * @description Strict mode - checking access to non-strict function caller from strict function (indirect eval used within strict mode) + * @onlyStrict + * @negative TypeError + */ + + +"use strict"; +var my_eval = eval; +my_eval("gNonStrict();"); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-14gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-14gs.js new file mode 100644 index 0000000000000000000000000000000000000000..55641ef964c0026e0f9847b8a1d202dd1aa07a44 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-14gs.js @@ -0,0 +1,35 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-14gs.js + * @description Strict mode - checking access to non-strict function caller from non-strict function (indirect eval includes strict directive prologue) + * @onlyStrict + */ + + +var my_eval = eval; +my_eval("\"use strict\";\ngNonStrict();"); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-15gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-15gs.js new file mode 100644 index 0000000000000000000000000000000000000000..4d2f9e092f1d6953cce6dc90fdfb941a37f79cad --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-15gs.js @@ -0,0 +1,39 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-15gs.js + * @description Strict mode - checking access to strict function caller from strict function (New'ed object from FunctionDeclaration defined within strict mode) + * @onlyStrict + * @negative TypeError + */ + + +"use strict"; +function f() { + return gNonStrict(); +} +new f(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-16gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-16gs.js new file mode 100644 index 0000000000000000000000000000000000000000..87bbf173e8268275ff955de412d399244917fca5 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-16gs.js @@ -0,0 +1,39 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-16gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (New'ed object from FunctionDeclaration includes strict directive prologue) + * @onlyStrict + * @negative TypeError + */ + + +function f() { + "use strict"; + return gNonStrict(); +} +new f(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-17gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-17gs.js new file mode 100644 index 0000000000000000000000000000000000000000..2cadec95d9e578736f599196b08451e889952f0c --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-17gs.js @@ -0,0 +1,39 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-17gs.js + * @description Strict mode - checking access to strict function caller from strict function (New'ed object from FunctionExpression defined within strict mode) + * @onlyStrict + * @negative TypeError + */ + + +"use strict"; +var f = function () { + return gNonStrict(); +} +new f(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-18gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-18gs.js new file mode 100644 index 0000000000000000000000000000000000000000..625f0a0d9bd4548cc819dd91704b5983f5e70000 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-18gs.js @@ -0,0 +1,39 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-18gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (New'ed object from FunctionExpression includes strict directive prologue) + * @onlyStrict + * @negative TypeError + */ + + +var f = function () { + "use strict"; + return gNonStrict(); +} +new f(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-19gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-19gs.js new file mode 100644 index 0000000000000000000000000000000000000000..5c0c352ee9d502a9518a9ae9629994307880ce41 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-19gs.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-19gs.js + * @description Strict mode - checking access to strict function caller from strict function (New'ed object from Anonymous FunctionExpression defined within strict mode) + * @onlyStrict + * @negative TypeError + */ + + +"use strict"; +var obj = new (function () { + return gNonStrict(); +}); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-1gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-1gs.js new file mode 100644 index 0000000000000000000000000000000000000000..4529d480dc558c4475b95b8b4986c2f6d61e3367 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-1gs.js @@ -0,0 +1,39 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-1gs.js + * @description Strict mode - checking access to strict function caller from strict function (FunctionDeclaration defined within strict mode) + * @onlyStrict + * @negative TypeError + */ + + +"use strict"; +function f() { + return gNonStrict(); +} +f(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-20gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-20gs.js new file mode 100644 index 0000000000000000000000000000000000000000..6646663bcc2b0cd88f6a1fb7aad7bc9ead01f027 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-20gs.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-20gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (New'ed object from Anonymous FunctionExpression includes strict directive prologue) + * @onlyStrict + * @negative TypeError + */ + + +var obj = new (function () { + "use strict"; + return gNonStrict(); +}); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-21gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-21gs.js new file mode 100644 index 0000000000000000000000000000000000000000..c5c9087ef22824eeb59f45b149b4d11a957c4bd1 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-21gs.js @@ -0,0 +1,42 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-21gs.js + * @description Strict mode - checking access to strict function caller from strict function (FunctionDeclaration defined within a FunctionDeclaration inside strict mode) + * @onlyStrict + * @negative TypeError + */ + + +"use strict"; +function f1() { + function f() { + return gNonStrict(); + } + return f(); +} +f1(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-22gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-22gs.js new file mode 100644 index 0000000000000000000000000000000000000000..7f88bf06f408a0fa23d3db35edb8d07e27dd11f1 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-22gs.js @@ -0,0 +1,42 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-22gs.js + * @description Strict mode - checking access to strict function caller from strict function (FunctionExpression defined within a FunctionDeclaration inside strict mode) + * @onlyStrict + * @negative TypeError + */ + + +"use strict"; +function f1() { + var f = function () { + return gNonStrict(); + } + return f(); +} +f1(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-23gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-23gs.js new file mode 100644 index 0000000000000000000000000000000000000000..05913a8b828ce8d9379942ec73875eddc4b30f0a --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-23gs.js @@ -0,0 +1,41 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-23gs.js + * @description Strict mode - checking access to strict function caller from strict function (Anonymous FunctionExpression defined within a FunctionDeclaration inside strict mode) + * @onlyStrict + * @negative TypeError + */ + + +"use strict"; +function f1() { + return (function () { + return gNonStrict(); + })(); +} +f1(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-24gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-24gs.js new file mode 100644 index 0000000000000000000000000000000000000000..97f8cdb6ff0bab187f3f276b5db2f7ed8e8c8c51 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-24gs.js @@ -0,0 +1,42 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-24gs.js + * @description Strict mode - checking access to strict function caller from strict function (FunctionDeclaration defined within a FunctionExpression inside strict mode) + * @onlyStrict + * @negative TypeError + */ + + +"use strict"; +var f1 = function () { + function f() { + return gNonStrict(); + } + return f(); +} +f1(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-25gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-25gs.js new file mode 100644 index 0000000000000000000000000000000000000000..4be80ade9c52ae2cc61b8f1845cc6a7319b329fe --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-25gs.js @@ -0,0 +1,42 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-25gs.js + * @description Strict mode - checking access to strict function caller from strict function (FunctionExpression defined within a FunctionExpression inside strict mode) + * @onlyStrict + * @negative TypeError + */ + + +"use strict"; +var f1 = function () { + var f = function () { + return gNonStrict(); + } + return f(); +} +f1(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-26gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-26gs.js new file mode 100644 index 0000000000000000000000000000000000000000..bd11514aa0955307c4ddaaf0f0355f15a0f5ef52 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-26gs.js @@ -0,0 +1,41 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-26gs.js + * @description Strict mode - checking access to strict function caller from strict function (Anonymous FunctionExpression defined within a FunctionExpression inside strict mode) + * @onlyStrict + * @negative TypeError + */ + + +"use strict"; +var f1 = function () { + return (function () { + return gNonStrict(); + })(); +} +f1(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-27gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-27gs.js new file mode 100644 index 0000000000000000000000000000000000000000..5d6d61f0d28251bdd9cf19ab9e07acad28ebf74b --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-27gs.js @@ -0,0 +1,41 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-27gs.js + * @description Strict mode - checking access to strict function caller from strict function (FunctionDeclaration defined within an Anonymous FunctionExpression inside strict mode) + * @onlyStrict + * @negative TypeError + */ + + +"use strict"; +(function () { + function f() { + return gNonStrict(); + } + return f(); +})(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-28gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-28gs.js new file mode 100644 index 0000000000000000000000000000000000000000..202fedfec9f6342f282b203303742c33ceb288a8 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-28gs.js @@ -0,0 +1,41 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-28gs.js + * @description Strict mode - checking access to strict function caller from strict function (FunctionExpression defined within an Anonymous FunctionExpression inside strict mode) + * @onlyStrict + * @negative TypeError + */ + + +"use strict"; +(function () { + var f = function () { + return gNonStrict(); + } + return f(); +})(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-29gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-29gs.js new file mode 100644 index 0000000000000000000000000000000000000000..b3f4192ca2828fdc35dd1c0552ca3574a2ffb8c2 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-29gs.js @@ -0,0 +1,40 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-29gs.js + * @description Strict mode - checking access to strict function caller from strict function (Anonymous FunctionExpression defined within an Anonymous FunctionExpression inside strict mode) + * @onlyStrict + * @negative TypeError + */ + + +"use strict"; +(function () { + return (function () { + return gNonStrict(); + })(); +})(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-2gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-2gs.js new file mode 100644 index 0000000000000000000000000000000000000000..c79deeb8f064c027660d0d20bc2da379665fdc4c --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-2gs.js @@ -0,0 +1,39 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-2gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (FunctionDeclaration includes strict directive prologue) + * @onlyStrict + * @negative TypeError + */ + + +function f() { + "use strict"; + return gNonStrict(); +} +f(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-30gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-30gs.js new file mode 100644 index 0000000000000000000000000000000000000000..4f4b317dc3d9b00b4ed375c41b94899315541f7d --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-30gs.js @@ -0,0 +1,42 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-30gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (FunctionDeclaration defined within a FunctionDeclaration with a strict directive prologue) + * @onlyStrict + * @negative TypeError + */ + + +function f1() { + "use strict"; + function f() { + return gNonStrict(); + } + return f(); +} +f1(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-31gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-31gs.js new file mode 100644 index 0000000000000000000000000000000000000000..9e3411c183f27e60c5482001e4c178d80b058341 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-31gs.js @@ -0,0 +1,42 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-31gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (FunctionExpression defined within a FunctionDeclaration with a strict directive prologue) + * @onlyStrict + * @negative TypeError + */ + + +function f1() { + "use strict"; + var f = function () { + return gNonStrict(); + } + return f(); +} +f1(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-32gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-32gs.js new file mode 100644 index 0000000000000000000000000000000000000000..f5faa72a174bfa2233d55a600423ec31f66c49dc --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-32gs.js @@ -0,0 +1,41 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-32gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (Anonymous FunctionExpression defined within a FunctionDeclaration with a strict directive prologue) + * @onlyStrict + * @negative TypeError + */ + + +function f1() { + "use strict"; + return (function () { + return gNonStrict(); + })(); +} +f1(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-33gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-33gs.js new file mode 100644 index 0000000000000000000000000000000000000000..c873f43c9f5edc0d2e60195944dc5f096ef6c559 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-33gs.js @@ -0,0 +1,42 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-33gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (FunctionDeclaration defined within a FunctionExpression with a strict directive prologue) + * @onlyStrict + * @negative TypeError + */ + + +var f1 = function () { + "use strict"; + function f() { + return gNonStrict(); + } + return f(); +} +f1(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-34gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-34gs.js new file mode 100644 index 0000000000000000000000000000000000000000..f99bb167cd558e724d3cb9fd856bf250a3c8c20a --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-34gs.js @@ -0,0 +1,42 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-34gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (FunctionExpression defined within a FunctionExpression with a strict directive prologue) + * @onlyStrict + * @negative TypeError + */ + + +var f1 = function () { + "use strict"; + var f = function () { + return gNonStrict(); + } + return f(); +} +f1(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-35gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-35gs.js new file mode 100644 index 0000000000000000000000000000000000000000..93cae80d32e89cd19a1841f79885cb74855db177 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-35gs.js @@ -0,0 +1,41 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-35gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (Anonymous FunctionExpression defined within a FunctionExpression with a strict directive prologue) + * @onlyStrict + * @negative TypeError + */ + + +var f1 = function () { + "use strict"; + return (function () { + return gNonStrict(); + })(); +} +f1(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-36gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-36gs.js new file mode 100644 index 0000000000000000000000000000000000000000..df4a8668c63efbf2c5d7991e633f90e3eed8aacd --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-36gs.js @@ -0,0 +1,41 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-36gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (FunctionDeclaration defined within an Anonymous FunctionExpression with a strict directive prologue) + * @onlyStrict + * @negative TypeError + */ + + +(function () { + "use strict"; + function f() { + return gNonStrict(); + } + return f(); +})(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-37gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-37gs.js new file mode 100644 index 0000000000000000000000000000000000000000..3918ac8007b33e428de51e2d09e7cba4d0cd4419 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-37gs.js @@ -0,0 +1,41 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-37gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (FunctionExpression defined within an Anonymous FunctionExpression with a strict directive prologue) + * @onlyStrict + * @negative TypeError + */ + + +(function () { + "use strict"; + var f = function () { + return gNonStrict(); + } + return f(); +})(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-38gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-38gs.js new file mode 100644 index 0000000000000000000000000000000000000000..9b0600fce532d5e254315b1b992bcef73f231825 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-38gs.js @@ -0,0 +1,40 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-38gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (Anonymous FunctionExpression defined within an Anonymous FunctionExpression with a strict directive prologue) + * @onlyStrict + * @negative TypeError + */ + + +(function () { + "use strict"; + return (function () { + return gNonStrict(); + })(); +})(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-39gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-39gs.js new file mode 100644 index 0000000000000000000000000000000000000000..157f1799affa3a55ac446f58310af232927bce1d --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-39gs.js @@ -0,0 +1,42 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-39gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (FunctionDeclaration with a strict directive prologue defined within a FunctionDeclaration) + * @onlyStrict + * @negative TypeError + */ + + +function f1() { + function f() { + "use strict"; + return gNonStrict(); + } + return f(); +} +f1(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-3gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-3gs.js new file mode 100644 index 0000000000000000000000000000000000000000..beb694ae6d51a79928e4d0559d215a67c87d7b07 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-3gs.js @@ -0,0 +1,39 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-3gs.js + * @description Strict mode - checking access to strict function caller from strict function (FunctionExpression defined within strict mode) + * @onlyStrict + * @negative TypeError + */ + + +"use strict"; +var f = function () { + return gNonStrict(); +} +f(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-40gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-40gs.js new file mode 100644 index 0000000000000000000000000000000000000000..fcefb9e2d47252529e507454948672bd212f54cd --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-40gs.js @@ -0,0 +1,42 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-40gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (FunctionExpression with a strict directive prologue defined within a FunctionDeclaration) + * @onlyStrict + * @negative TypeError + */ + + +function f1() { + var f = function () { + "use strict"; + return gNonStrict(); + } + return f(); +} +f1(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-41gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-41gs.js new file mode 100644 index 0000000000000000000000000000000000000000..040610cf016836fcab4c0b1ceddefb887d649de9 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-41gs.js @@ -0,0 +1,41 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-41gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (Anonymous FunctionExpression with a strict directive prologue defined within a FunctionDeclaration) + * @onlyStrict + * @negative TypeError + */ + + +function f1() { + return (function () { + "use strict"; + return gNonStrict(); + })(); +} +f1(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-42gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-42gs.js new file mode 100644 index 0000000000000000000000000000000000000000..8ee2a733e5e963a54af4933ce06cc478769a2e75 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-42gs.js @@ -0,0 +1,42 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-42gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (FunctionDeclaration with a strict directive prologue defined within a FunctionExpression) + * @onlyStrict + * @negative TypeError + */ + + +var f1 = function () { + function f() { + "use strict"; + return gNonStrict(); + } + return f(); +} +f1(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-43gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-43gs.js new file mode 100644 index 0000000000000000000000000000000000000000..cdaff2ec77035aa5124a93ae34d08591fb4a3f02 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-43gs.js @@ -0,0 +1,42 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-43gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (FunctionExpression with a strict directive prologue defined within a FunctionExpression) + * @onlyStrict + * @negative TypeError + */ + + +var f1 = function () { + var f = function () { + "use strict"; + return gNonStrict(); + } + return f(); +} +f1(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-44gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-44gs.js new file mode 100644 index 0000000000000000000000000000000000000000..84933722bf92a2c50f8a7ee1efb8a50def825684 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-44gs.js @@ -0,0 +1,41 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-44gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (Anonymous FunctionExpression with a strict directive prologue defined within a FunctionExpression) + * @onlyStrict + * @negative TypeError + */ + + +var f1 = function () { + return (function () { + "use strict"; + return gNonStrict(); + })(); +} +f1(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-45gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-45gs.js new file mode 100644 index 0000000000000000000000000000000000000000..a0cb3fc623704118bc12d4d05cd56307cbb833d8 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-45gs.js @@ -0,0 +1,41 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-45gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (FunctionDeclaration with a strict directive prologue defined within an Anonymous FunctionExpression) + * @onlyStrict + * @negative TypeError + */ + + +(function () { + function f() { + "use strict"; + return gNonStrict(); + } + return f(); +})(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-46gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-46gs.js new file mode 100644 index 0000000000000000000000000000000000000000..7d1f92192ca31d22f79e174d64e62fca0fca9e41 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-46gs.js @@ -0,0 +1,41 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-46gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (FunctionExpression with a strict directive prologue defined within an Anonymous FunctionExpression) + * @onlyStrict + * @negative TypeError + */ + + +(function () { + var f = function () { + "use strict"; + return gNonStrict(); + } + return f(); +})(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-47gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-47gs.js new file mode 100644 index 0000000000000000000000000000000000000000..8f5a79d0d91c20e05c703402415157acb26bb55c --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-47gs.js @@ -0,0 +1,40 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-47gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (Anonymous FunctionExpression with a strict directive prologue defined within an Anonymous FunctionExpression) + * @onlyStrict + * @negative TypeError + */ + + +(function () { + return (function () { + "use strict"; + return gNonStrict(); + })(); +})(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-48gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-48gs.js new file mode 100644 index 0000000000000000000000000000000000000000..81c70afb26830566e95c7e1d4346c9410e114356 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-48gs.js @@ -0,0 +1,37 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-48gs.js + * @description Strict mode - checking access to strict function caller from strict function (Literal getter defined within strict mode) + * @onlyStrict + * @negative TypeError + */ + + +"use strict"; +var o = { get foo() { return gNonStrict(); } } +o.foo; + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-49gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-49gs.js new file mode 100644 index 0000000000000000000000000000000000000000..c1a8761250f28f4a134c491e9dfe5f8af004d64a --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-49gs.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-49gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (Literal getter includes strict directive prologue) + * @onlyStrict + * @negative TypeError + */ + + +var o = { get foo() { "use strict"; return gNonStrict(); } } +o.foo; + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-4gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-4gs.js new file mode 100644 index 0000000000000000000000000000000000000000..24f23b21c87ca8e92c079c526259c41fe4cc255d --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-4gs.js @@ -0,0 +1,39 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-4gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (FunctionExpression includes strict directive prologue) + * @onlyStrict + * @negative TypeError + */ + + +var f = function () { + "use strict"; + return gNonStrict(); +} +f(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-50gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-50gs.js new file mode 100644 index 0000000000000000000000000000000000000000..fff605a9154b0ce1599265c0e8fa7538fd60a41b --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-50gs.js @@ -0,0 +1,37 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-50gs.js + * @description Strict mode - checking access to strict function caller from strict function (Literal setter defined within strict mode) + * @onlyStrict + * @negative TypeError + */ + + +"use strict"; +var o = { set foo(stuff) { return gNonStrict(); } } +o.foo = 7; + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-51gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-51gs.js new file mode 100644 index 0000000000000000000000000000000000000000..0367a94d3d61ffd484614c31b6d1efcfd606e3c2 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-51gs.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-51gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (Literal setter includes strict directive prologue) + * @onlyStrict + * @negative TypeError + */ + + +var o = { set foo(stuff) { "use strict"; return gNonStrict(); } } +o.foo = 8; + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-52gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-52gs.js new file mode 100644 index 0000000000000000000000000000000000000000..8402204876c03e6a42870331f980f59bc5967711 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-52gs.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-52gs.js + * @description Strict mode - checking access to strict function caller from strict function (Injected getter defined within strict mode) + * @onlyStrict + * @negative TypeError + */ + + +"use strict"; +var o = {}; +Object.defineProperty(o, "foo", { get: function() { return gNonStrict(); } }); +o.foo; + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-53gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-53gs.js new file mode 100644 index 0000000000000000000000000000000000000000..3996d6b0f283d59cd0f2df0ad893fee8dc7b3d29 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-53gs.js @@ -0,0 +1,37 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-53gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (Injected getter includes strict directive prologue) + * @onlyStrict + * @negative TypeError + */ + + +var o = {}; +Object.defineProperty(o, "foo", { get: function() { "use strict"; return gNonStrict(); } }); +o.foo; + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-54gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-54gs.js new file mode 100644 index 0000000000000000000000000000000000000000..5960057fc02e8ecd9e1d33e44f70c497a74cfe03 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-54gs.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-54gs.js + * @description Strict mode - checking access to strict function caller from strict function (Injected setter defined within strict mode) + * @onlyStrict + * @negative TypeError + */ + + +"use strict"; +var o = {}; +Object.defineProperty(o, "foo", { set: function(stuff) { return gNonStrict(); } }); +o.foo = 9; + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-55gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-55gs.js new file mode 100644 index 0000000000000000000000000000000000000000..dcdd399dc713faff45a98954c4b5177361ef16f5 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-55gs.js @@ -0,0 +1,37 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-55gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (Injected setter includes strict directive prologue) + * @onlyStrict + * @negative TypeError + */ + + +var o = {}; +Object.defineProperty(o, "foo", { set: function(stuff) { "use strict"; return gNonStrict(); } }); +o.foo = 10; + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-56gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-56gs.js new file mode 100644 index 0000000000000000000000000000000000000000..96ae2c2687b63adc92dec6f301ec2d593ba19c2c --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-56gs.js @@ -0,0 +1,37 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-56gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (strict function declaration called by non-strict function declaration) + * @onlyStrict + * @negative TypeError + */ + + +function f() { "use strict"; return gNonStrict();}; +function foo() { return f();} +foo(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-57gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-57gs.js new file mode 100644 index 0000000000000000000000000000000000000000..9f5ea23cf601bfc5461123f4635accabf6e89d4a --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-57gs.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-57gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (strict function declaration called by non-strict eval) + * @onlyStrict + * @negative TypeError + */ + + +function f() { "use strict"; return gNonStrict();}; +eval("f();"); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-58gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-58gs.js new file mode 100644 index 0000000000000000000000000000000000000000..ba4896abace66b01033a2a17c272e273bde2b4ad --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-58gs.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-58gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (strict function declaration called by non-strict Function constructor) + * @onlyStrict + * @negative TypeError + */ + + +function f() { "use strict"; return gNonStrict();}; +Function("return f();")(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-59gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-59gs.js new file mode 100644 index 0000000000000000000000000000000000000000..0de2f9046deaa2aa1fb988fb172ad5e6912b8b7b --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-59gs.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-59gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (strict function declaration called by non-strict new'ed Function constructor) + * @onlyStrict + * @negative TypeError + */ + + +function f() { "use strict"; return gNonStrict();}; +new Function("return f();")(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-5gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-5gs.js new file mode 100644 index 0000000000000000000000000000000000000000..a558cc3b4f424aa4f71e61abe564675b725dec62 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-5gs.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-5gs.js + * @description Strict mode - checking access to strict function caller from strict function (Anonymous FunctionExpression defined within strict mode) + * @onlyStrict + * @negative TypeError + */ + + +"use strict"; +(function () { + return gNonStrict(); +})(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-60gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-60gs.js new file mode 100644 index 0000000000000000000000000000000000000000..25c45d7b652dd963e7f5c8c1241a36fd29278526 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-60gs.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-60gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (strict function declaration called by Function.prototype.apply()) + * @onlyStrict + * @negative TypeError + */ + + +function f() { "use strict"; return gNonStrict();}; +f.apply(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-61gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-61gs.js new file mode 100644 index 0000000000000000000000000000000000000000..06461a4c084f0cc6e7620c75276d737e4ab93d9b --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-61gs.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-61gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (strict function declaration called by Function.prototype.apply(null)) + * @onlyStrict + * @negative TypeError + */ + + +function f() { "use strict"; return gNonStrict();}; +f.apply(null); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-62gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-62gs.js new file mode 100644 index 0000000000000000000000000000000000000000..df931b4825238743ad9eb7783a6a5a71a80b4c9d --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-62gs.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-62gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (strict function declaration called by Function.prototype.apply(undefined)) + * @onlyStrict + * @negative TypeError + */ + + +function f() { "use strict"; return gNonStrict();}; +f.apply(undefined); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-63gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-63gs.js new file mode 100644 index 0000000000000000000000000000000000000000..2b190192d18372247060a46f2d0d23c8b71ed211 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-63gs.js @@ -0,0 +1,37 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-63gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (strict function declaration called by Function.prototype.apply(someObject)) + * @onlyStrict + * @negative TypeError + */ + + +function f() { "use strict"; return gNonStrict();}; +var o = {}; +f.apply(o); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-64gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-64gs.js new file mode 100644 index 0000000000000000000000000000000000000000..1732d51146ab73fe946fbc875ee91a16ceb3df25 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-64gs.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-64gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (strict function declaration called by Function.prototype.apply(globalObject)) + * @onlyStrict + * @negative TypeError + */ + + +function f() { "use strict"; return gNonStrict();}; +f.apply(fnGlobalObject()); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-65gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-65gs.js new file mode 100644 index 0000000000000000000000000000000000000000..ed6c9a656e0ca1b7fecb88cec103177579d5c8e9 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-65gs.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-65gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (strict function declaration called by Function.prototype.call()) + * @onlyStrict + * @negative TypeError + */ + + +function f() { "use strict"; return gNonStrict();}; +f.call(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-66gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-66gs.js new file mode 100644 index 0000000000000000000000000000000000000000..b02c2e2183458032972401c40397b4def3d6cdca --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-66gs.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-66gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (strict function declaration called by Function.prototype.call(null)) + * @onlyStrict + * @negative TypeError + */ + + +function f() { "use strict"; return gNonStrict();}; +f.call(null); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-67gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-67gs.js new file mode 100644 index 0000000000000000000000000000000000000000..f2ab4b11f61e5781c0e9916f48759f6cea1bec31 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-67gs.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-67gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (strict function declaration called by Function.prototype.call(undefined)) + * @onlyStrict + * @negative TypeError + */ + + +function f() { "use strict"; return gNonStrict();}; +f.call(undefined); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-68gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-68gs.js new file mode 100644 index 0000000000000000000000000000000000000000..3123e935b5fcbf8d1e8552cedb7df8cddca1ba44 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-68gs.js @@ -0,0 +1,37 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-68gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (strict function declaration called by Function.prototype.call(someObject)) + * @onlyStrict + * @negative TypeError + */ + + +function f() { "use strict"; return gNonStrict();}; +var o = {}; +f.call(o); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-69gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-69gs.js new file mode 100644 index 0000000000000000000000000000000000000000..41e73ff48a3b9c0a58a4a5f885f472f110e88fc3 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-69gs.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-69gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (strict function declaration called by Function.prototype.call(globalObject)) + * @onlyStrict + * @negative TypeError + */ + + +function f() { "use strict"; return gNonStrict();}; +f.call(fnGlobalObject()); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-6gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-6gs.js new file mode 100644 index 0000000000000000000000000000000000000000..0984163ec87a15960812c722d842bf84ace92e73 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-6gs.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-6gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (Anonymous FunctionExpression includes strict directive prologue) + * @onlyStrict + * @negative TypeError + */ + + +(function () { + "use strict"; + return gNonStrict(); +})(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-70gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-70gs.js new file mode 100644 index 0000000000000000000000000000000000000000..3ba84df3c49d7d12110bf6e35e578db08a3c6418 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-70gs.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-70gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (strict function declaration called by Function.prototype.bind()()) + * @onlyStrict + * @negative TypeError + */ + + +function f() { "use strict"; return gNonStrict();}; +f.bind()(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-71gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-71gs.js new file mode 100644 index 0000000000000000000000000000000000000000..50c4f8e11cc952f77ac146b32260d3296f3ae946 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-71gs.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-71gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (strict function declaration called by Function.prototype.bind(null)()) + * @onlyStrict + * @negative TypeError + */ + + +function f() { "use strict"; return gNonStrict();}; +f.bind(null)(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-72gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-72gs.js new file mode 100644 index 0000000000000000000000000000000000000000..e29ccca958e2b3bd9c470baaff10f8ff4cefb6a4 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-72gs.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-72gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (strict function declaration called by Function.prototype.bind(undefined)()) + * @onlyStrict + * @negative TypeError + */ + + +function f() { "use strict"; return gNonStrict();}; +f.bind(undefined)(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-73gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-73gs.js new file mode 100644 index 0000000000000000000000000000000000000000..d02589281778e8cd0320ad29df65e5af5aed3803 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-73gs.js @@ -0,0 +1,37 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-73gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (strict function declaration called by Function.prototype.bind(someObject)()) + * @onlyStrict + * @negative TypeError + */ + + +function f() { "use strict"; return gNonStrict();}; +var o = {}; +f.bind(o)(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-74gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-74gs.js new file mode 100644 index 0000000000000000000000000000000000000000..e59aae69f0c99c254688a615e3e487e131fc6ce9 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-74gs.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-74gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (strict function declaration called by Function.prototype.bind(globalObject)()) + * @onlyStrict + * @negative TypeError + */ + + +function f() { "use strict"; return gNonStrict();}; +f.bind(fnGlobalObject())(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-75gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-75gs.js new file mode 100644 index 0000000000000000000000000000000000000000..a46e66faf7d18a8260f4ba2e335cfff0d1664ce0 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-75gs.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-75gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (non-strict function declaration called by strict function declaration) + * @onlyStrict + */ + + +function f() { return gNonStrict();}; +function foo() { "use strict"; return f();} +foo(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-76gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-76gs.js new file mode 100644 index 0000000000000000000000000000000000000000..798370c314a41ad7f23b5ebac9134c8bb9abe959 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-76gs.js @@ -0,0 +1,35 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-76gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (non-strict function declaration called by strict eval) + * @onlyStrict + */ + + +function f() { return gNonStrict();}; +(function () {"use strict"; return eval("f();"); })(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-77gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-77gs.js new file mode 100644 index 0000000000000000000000000000000000000000..b18c35aed92e19e18586abc474f19c29f3a497d6 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-77gs.js @@ -0,0 +1,35 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-77gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (non-strict function declaration called by strict Function constructor) + * @onlyStrict + */ + + +function f() {return gNonStrict();}; +(function () {"use strict"; return Function("return f();")(); })(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-78gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-78gs.js new file mode 100644 index 0000000000000000000000000000000000000000..9ff7be956db35c4dd7cd4f299de8feffb55a2830 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-78gs.js @@ -0,0 +1,35 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-78gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (non-strict function declaration called by strict new'ed Function constructor) + * @onlyStrict + */ + + +function f() { return gNonStrict();}; +(function () {"use strict"; return new Function("return f();")(); })(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-79gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-79gs.js new file mode 100644 index 0000000000000000000000000000000000000000..47c5964b0be6b350e9bff5ee7e8e6d6169e96a32 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-79gs.js @@ -0,0 +1,35 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-79gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (non-strict function declaration called by strict Function.prototype.apply()) + * @onlyStrict + */ + + +function f() { return gNonStrict();}; +(function () {"use strict"; return f.apply();})(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-7gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-7gs.js new file mode 100644 index 0000000000000000000000000000000000000000..d5689d4614e5f753fd1dc047dc06b3c1acae3e1d --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-7gs.js @@ -0,0 +1,37 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-7gs.js + * @description Strict mode - checking access to non-strict function caller from strict function (Function constructor defined within strict mode) + * @onlyStrict + * @negative TypeError + */ + + +"use strict"; +var f = Function("return gNonStrict();"); +f(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-80gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-80gs.js new file mode 100644 index 0000000000000000000000000000000000000000..8f175407f81dedec66c435a51106ad55700260cf --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-80gs.js @@ -0,0 +1,35 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-80gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (non-strict function declaration called by strict Function.prototype.apply(null)) + * @onlyStrict + */ + + +function f() { return gNonStrict();}; +(function () {"use strict"; return f.apply(null); })(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-81gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-81gs.js new file mode 100644 index 0000000000000000000000000000000000000000..330591c98511ee2edd7adf6ccd60e0ef9de7e918 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-81gs.js @@ -0,0 +1,35 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-81gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (non-strict function declaration called by strict Function.prototype.apply(undefined)) + * @onlyStrict + */ + + +function f() { return gNonStrict();}; +(function () {"use strict"; return f.apply(undefined); })(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-82gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-82gs.js new file mode 100644 index 0000000000000000000000000000000000000000..a111de9979c52ee1d71263fd030abe8e90f0fbb7 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-82gs.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-82gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (non-strict function declaration called by strict Function.prototype.apply(someObject)) + * @onlyStrict + */ + + +function f() { return gNonStrict();}; +var o = {}; +(function () {"use strict"; return f.apply(o); })(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-83gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-83gs.js new file mode 100644 index 0000000000000000000000000000000000000000..488124e93d8d8f1599c054c4a36e89f58a199ef9 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-83gs.js @@ -0,0 +1,35 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-83gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (non-strict function declaration called by strict Function.prototype.apply(globalObject)) + * @onlyStrict + */ + + +function f() { return gNonStrict();}; +(function () {"use strict"; return f.apply(fnGlobalObject()); })(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-84gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-84gs.js new file mode 100644 index 0000000000000000000000000000000000000000..e69f4b8a02066a3d91d757c03104b7e16dc6fcc2 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-84gs.js @@ -0,0 +1,35 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-84gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (non-strict function declaration called by strict Function.prototype.call()) + * @onlyStrict + */ + + +function f() { return gNonStrict();}; +(function () {"use strict"; return f.call();})(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-85gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-85gs.js new file mode 100644 index 0000000000000000000000000000000000000000..b6dae55425fa55f31293800c29d5cb8399423f46 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-85gs.js @@ -0,0 +1,35 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-85gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (non-strict function declaration called by strict Function.prototype.call(null)) + * @onlyStrict + */ + + +function f() { return gNonStrict();}; +(function () {"use strict"; return f.call(null);})(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-86gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-86gs.js new file mode 100644 index 0000000000000000000000000000000000000000..967eefbba3e35f04f018538581008de36bdb5b97 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-86gs.js @@ -0,0 +1,35 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-86gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (non-strict function declaration called by strict Function.prototype.call(undefined)) + * @onlyStrict + */ + + +function f() { return gNonStrict();}; +(function () {"use strict"; return f.call(undefined); })(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-87gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-87gs.js new file mode 100644 index 0000000000000000000000000000000000000000..abfdc433ac43f1de616d03ce5425b1aa1137ae3c --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-87gs.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-87gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (non-strict function declaration called by strict Function.prototype.call(someObject)) + * @onlyStrict + */ + + +function f() { return gNonStrict();}; +var o = {}; +(function () {"use strict"; return f.call(o); })(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-88gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-88gs.js new file mode 100644 index 0000000000000000000000000000000000000000..ab8cce73822f74c33a0cf8bc7b637ab040517fe4 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-88gs.js @@ -0,0 +1,35 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-88gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (non-strict function declaration called by strict Function.prototype.call(globalObject)) + * @onlyStrict + */ + + +function f() { return gNonStrict();}; +(function () {"use strict"; return f.call(fnGlobalObject()); })(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-89gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-89gs.js new file mode 100644 index 0000000000000000000000000000000000000000..a12519da782f4878a847126a7cceb35016b26920 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-89gs.js @@ -0,0 +1,35 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-89gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (non-strict function declaration called by strict Function.prototype.bind()()) + * @onlyStrict + */ + + +function f() { return gNonStrict();}; +(function () {"use strict"; return f.bind();})(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-8gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-8gs.js new file mode 100644 index 0000000000000000000000000000000000000000..837dd39c16420167ac53e7a2e3c3856d0b5f6ed0 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-8gs.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-8gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (Function constructor includes strict directive prologue) + * @onlyStrict + * @negative TypeError + */ + + +var f = Function("\"use strict\";\nreturn gNonStrict();"); +f(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-90gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-90gs.js new file mode 100644 index 0000000000000000000000000000000000000000..a3919e30d142a813ac9ab97c098fc70c2421e589 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-90gs.js @@ -0,0 +1,35 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-90gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (non-strict function declaration called by strict Function.prototype.bind(null)()) + * @onlyStrict + */ + + +function f() { return gNonStrict();}; +(function () {"use strict"; return f.bind(null)(); })(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-91gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-91gs.js new file mode 100644 index 0000000000000000000000000000000000000000..025eb038c0d55535630c1fb6829cd71f0528b4d1 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-91gs.js @@ -0,0 +1,35 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-91gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (non-strict function declaration called by strict Function.prototype.bind(undefined)()) + * @onlyStrict + */ + + +function f() { return gNonStrict();}; +(function () {"use strict"; return f.bind(undefined)(); })(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-92gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-92gs.js new file mode 100644 index 0000000000000000000000000000000000000000..f3f838a61298649699f27a9d2a9fe31fe2681842 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-92gs.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-92gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (non-strict function declaration called by strict Function.prototype.bind(someObject)()) + * @onlyStrict + */ + + +function f() { return gNonStrict();}; +var o = {}; +(function () {"use strict"; return f.bind(o)(); })(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-93gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-93gs.js new file mode 100644 index 0000000000000000000000000000000000000000..502489733a45d11afb2a26db3bcd3bb0643e2144 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-93gs.js @@ -0,0 +1,35 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-93gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (non-strict function declaration called by strict Function.prototype.bind(globalObject)()) + * @onlyStrict + */ + + +function f() { return gNonStrict();}; +(function () {"use strict"; return f.bind(fnGlobalObject())(); })(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-94gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-94gs.js new file mode 100644 index 0000000000000000000000000000000000000000..df880935afb6b61bf0c9ee3b367f883aacd5998f --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-94gs.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-94gs.js + * @description Strict mode - checking access to strict function caller from non-strict function expression (FunctionDeclaration includes strict directive prologue) + * @onlyStrict + * @negative TypeError + */ + +var gNonStrict = function () { + return gNonStrict.caller; +} + +function f() { + "use strict"; + return gNonStrict(); +} +f(); diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-95gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-95gs.js new file mode 100644 index 0000000000000000000000000000000000000000..cd3969a4c1041cd1ef3c0c47eea48a05ac01a3ed --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-95gs.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-95gs.js + * @description Strict mode - checking access to strict function caller from non-strict, constructor-based function (FunctionDeclaration includes strict directive prologue) + * @onlyStrict + * @negative TypeError + */ + +var gNonStrict = Function("return gNonStrict.caller;"); + +function f() { + "use strict"; + return gNonStrict(); +} +f(); diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-96gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-96gs.js new file mode 100644 index 0000000000000000000000000000000000000000..d63cba2d39ac3456307898a27f7adcf69c65471d --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-96gs.js @@ -0,0 +1,39 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-96gs.js + * @description Strict mode - checking access to strict function caller from non-strict property (FunctionDeclaration includes strict directive prologue) + * @onlyStrict + * @negative TypeError + */ + +var o = { + get gNonStrict() { + return Object.getOwnPropertyDescriptor(o, "gNonStrict").get.caller; + } +}; + + +function f() { + "use strict"; + return o.gNonStrict; +} +f(); diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-97gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-97gs.js new file mode 100644 index 0000000000000000000000000000000000000000..b26d13706e46d7f9b17b90e0b4a4158d3474fb5e --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-97gs.js @@ -0,0 +1,40 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-97gs.js + * @description Strict mode - checking access to strict function caller from bound non-strict function (FunctionDeclaration includes strict directive prologue) + * @onlyStrict + * @negative TypeError + */ + +var gNonStrict = gNonStrictBindee.bind(null); + +function f() { + "use strict"; + return gNonStrict(); +} +f(); + + +function gNonStrictBindee() { + return gNonStrictBindee.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-9gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-9gs.js new file mode 100644 index 0000000000000000000000000000000000000000..64c6879057d2bea593fc7d7e24b0459d092d4f35 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-9gs.js @@ -0,0 +1,37 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-9gs.js + * @description Strict mode - checking access to non-strict function caller from strict function (New'ed Function constructor defined within strict mode) + * @onlyStrict + * @negative TypeError + */ + + +"use strict"; +var f = new Function("return gNonStrict();"); +f(); //REPLACE ME + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.9/15.9.5/15.9.5.40/15.9.5.40_1.js b/test/suite/ch15/15.9/15.9.5/15.9.5.40/15.9.5.40_1.js new file mode 100644 index 0000000000000000000000000000000000000000..704d89102d40cdb7e7a700fc923919da820f35e5 --- /dev/null +++ b/test/suite/ch15/15.9/15.9.5/15.9.5.40/15.9.5.40_1.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.9/15.9.5/15.9.5.40/15.9.5.40_1.js + * @description Date.prototype.setFullYear - Date.prototype is itself an instance of Date + */ + + +function testcase() { + try { + var origYear = Date.prototype.getFullYear(); + Date.prototype.setFullYear(2012); + return Date.prototype.getFullYear()===2012; + } finally { + Date.prototype.setFullYear(origYear); + } +} +runTestCase(testcase); diff --git a/tools/packaging/packagerConfig.py b/tools/packaging/packagerConfig.py index d86f2792d360b2d14ca480a5d2160a5214a2fe9f..37b1b009f02f505af19a4dbbbb54906b75da7375 100644 --- a/tools/packaging/packagerConfig.py +++ b/tools/packaging/packagerConfig.py @@ -88,11 +88,9 @@ def generateHarness(harnessType, jsonName, title): if TEMPLATE_LINES==None or harnessType!=__lastHarnessType: __lastHarnessType = harnessType TEMPLATE_LINES = [] - with open(os.path.join(os.getcwd(), "templates", "runner." + harnessType + ".html"), "r") as f: TEMPLATE_LINES = f.readlines() - fileName = os.path.join(TEST262_ROOT, WEBSITE_SHORT_NAME, jsonName.replace(".json", ".html")) fileNameExists = False