diff options
author | David Fugate <dfugate@microsoft.com> | 2012-02-27 15:46:23 -0800 |
---|---|---|
committer | David Fugate <dfugate@microsoft.com> | 2012-02-27 15:46:23 -0800 |
commit | 4fb5071cd44559b1f4f1bb06c4067a68a059994b (patch) | |
tree | b066ffcb70c151f9a8de6f0ba3c862c9e11b6183 /test/suite | |
parent | c39d9e37c85d921c762dda995b6aa5e12f39cbe0 (diff) | |
download | qtdeclarative-testsuites-4fb5071cd44559b1f4f1bb06c4067a68a059994b.tar.gz |
Migrated latest external\contributions\Microsoft\ietcLatest changes over to test\suite\*.
Diffstat (limited to 'test/suite')
395 files changed, 13503 insertions, 6 deletions
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 000000000..6321f0771 --- /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 000000000..d6a9374e1 --- /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 000000000..03a96c7b3 --- /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 000000000..bf09529a3 --- /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 000000000..6ce87a225 --- /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 000000000..0eeea1881 --- /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 000000000..cd77b0eb8 --- /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 000000000..1d9e38509 --- /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 000000000..80c731b57 --- /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 000000000..384279c4c --- /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 000000000..6923ed3a3 --- /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 000000000..42d397b48 --- /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 000000000..e2cdb8a6b --- /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 000000000..ec0d3a4cf --- /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 000000000..41644bd4a --- /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 000000000..c1bf3f4a3 --- /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 000000000..935b9c02e --- /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 000000000..85e0ca90a --- /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 000000000..1fc9c5467 --- /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 000000000..13f7b8b57 --- /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 000000000..c7aca32db --- /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 000000000..993d7815b --- /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 000000000..b36797790 --- /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 000000000..80290bc85 --- /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 000000000..f117b4063 --- /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 000000000..e2b98dc4a --- /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 000000000..9cbb0031b --- /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 000000000..c7458072d --- /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 000000000..90f5e8c4f --- /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 000000000..17ca1f1ec --- /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 000000000..f90197d76 --- /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 000000000..5db786b2f --- /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 000000000..a224d7a83 --- /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 000000000..34cbe041d --- /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 000000000..a4cf5c080 --- /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 000000000..1e29909c4 --- /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 000000000..ab06b04ad --- /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 000000000..1c960b3ea --- /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 000000000..eb38bab04 --- /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 000000000..b6b74fdda --- /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 000000000..9ec5af0d8 --- /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 000000000..cd827375b --- /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 000000000..309208100 --- /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 000000000..4f7c57f69 --- /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 000000000..4c40a2239 --- /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 000000000..49831acd4 --- /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 000000000..9a62e84b4 --- /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 000000000..3c24dce96 --- /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 000000000..979722f1b --- /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 000000000..e210386fb --- /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 000000000..96a4f7066 --- /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 000000000..4ac055699 --- /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 000000000..92504de56 --- /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 000000000..dfa48ac5d --- /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 000000000..3ff6d5524 --- /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 000000000..201b36982 --- /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 000000000..6d44900de --- /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 000000000..1b8b48e7d --- /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 000000000..2af95327e --- /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 000000000..c2b7d5c2f --- /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 000000000..f7a2543d2 --- /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 000000000..03565a398 --- /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 000000000..bbdc53d48 --- /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 000000000..761faefaf --- /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 000000000..6abb89c36 --- /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 000000000..cc8fc6870 --- /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 000000000..d049c76ca --- /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 000000000..e89c04fef --- /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 000000000..f00a5c11d --- /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 000000000..4dac505a5 --- /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 000000000..8299e2f6c --- /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 000000000..8805ce54e --- /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 000000000..b649a10a3 --- /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 000000000..b45081329 --- /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 000000000..cac94e3da --- /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 000000000..1a7d26e0c --- /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 000000000..f4e079244 --- /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 000000000..6f2b195cb --- /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 000000000..14f164d71 --- /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 000000000..0cb39f63f --- /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 000000000..646bab4fd --- /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 000000000..3bdefd51f --- /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 000000000..600f8e675 --- /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 000000000..e919eb862 --- /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 000000000..84d9131d9 --- /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 000000000..be9d69eb9 --- /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 000000000..c05c9e331 --- /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 000000000..93f20d7db --- /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 000000000..3c6f00151 --- /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 000000000..a7df22eef --- /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 000000000..e7b2467de --- /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 000000000..52857ff37 --- /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 000000000..45161b7f2 --- /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 000000000..8a658ce9b --- /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 000000000..c5fa5bd79 --- /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 000000000..2c60ec1d4 --- /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 000000000..a1e01aa83 --- /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 000000000..832b1cc90 --- /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 000000000..d91936f82 --- /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 000000000..086079f2d --- /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 000000000..c6600b113 --- /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 000000000..a18f410c3 --- /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 000000000..315cd7da2 --- /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 000000000..5c0d23023 --- /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 000000000..d5baf6e00 --- /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 000000000..984fe11e3 --- /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 000000000..05ebcb53e --- /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 000000000..54813afb8 --- /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 000000000..cc7d6ef19 --- /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 000000000..e3bf2212e --- /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 000000000..1a95f8c95 --- /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 000000000..5b906db36 --- /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 000000000..f6ff5cfd8 --- /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 000000000..e807a3d1d --- /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 000000000..069836d0e --- /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 000000000..d4d7d5c8d --- /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 000000000..43326dbf2 --- /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 000000000..9b3705148 --- /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 000000000..500d52552 --- /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 000000000..4f44eba21 --- /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 000000000..8b08a3fde --- /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 000000000..c98e18f2d --- /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 000000000..24e00c147 --- /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 000000000..190484919 --- /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 000000000..375751c4b --- /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 000000000..33d59dfe2 --- /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 000000000..94767f920 --- /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 000000000..ddbbc2023 --- /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 000000000..9de6360bd --- /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 000000000..8d6518ae2 --- /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 000000000..7e1f92591 --- /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 000000000..7ac8f22df --- /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 000000000..10f1961ab --- /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 000000000..558cc3b0a --- /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 000000000..171448218 --- /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 000000000..6d13c6a51 --- /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 000000000..4013696be --- /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 000000000..c6dd78079 --- /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 000000000..9d90c74bc --- /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 000000000..10e2b1b98 --- /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 000000000..efd4647ec --- /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 000000000..d2c91f087 --- /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 000000000..c87373005 --- /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 000000000..af7a98baf --- /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 000000000..c1fd02448 --- /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 000000000..cb30fbea1 --- /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 000000000..9908b67cb --- /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 000000000..7024f385e --- /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 000000000..565d5d539 --- /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 000000000..46df6d64d --- /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 000000000..d7c32ee82 --- /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 000000000..74620fb77 --- /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 000000000..343066554 --- /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 000000000..94e2fcb04 --- /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 000000000..507372068 --- /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 000000000..669b42b71 --- /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 000000000..f4d98309f --- /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 000000000..5e9e762ce --- /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 000000000..1b16bd4a0 --- /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 000000000..92318154f --- /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 000000000..54ba866eb --- /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 000000000..75cf067dd --- /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 000000000..620a003ca --- /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 000000000..7d900bdbc --- /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 000000000..66887c15a --- /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 000000000..2698998a4 --- /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 000000000..d1196b32a --- /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 000000000..3a58b06ff --- /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 000000000..df5f32499 --- /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 000000000..c94f0a08f --- /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 000000000..70ca76a81 --- /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 000000000..4a3df98a8 --- /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 000000000..fc60bb099 --- /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 000000000..f5de73961 --- /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 000000000..b8ed88308 --- /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 000000000..7babdbd7c --- /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 000000000..d10a6fd16 --- /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 000000000..77e7b5d0e --- /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 000000000..64a4269b7 --- /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 000000000..c808ca5c7 --- /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 000000000..d83b04a31 --- /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 000000000..0106f3f9a --- /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 000000000..2c011b50e --- /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 000000000..47ed693df --- /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 000000000..8b6ad9bac --- /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 000000000..17b8c5c01 --- /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 000000000..ee94f1385 --- /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 000000000..a2aab5192 --- /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 000000000..86688a310 --- /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 000000000..33f1b4ba4 --- /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 000000000..341dae71d --- /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 000000000..f37cc4326 --- /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 000000000..7c03a5f64 --- /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 000000000..b60af0d1b --- /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 000000000..68553162e --- /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 000000000..9218e1b53 --- /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 000000000..fba925f2b --- /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 000000000..d0fcea66a --- /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 000000000..6e9959ca0 --- /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 000000000..0da430f78 --- /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 000000000..5bf13e159 --- /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 000000000..dab370f6b --- /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 000000000..dc6e58513 --- /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 000000000..440ef17b4 --- /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 000000000..d406018ed --- /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 000000000..b19a14222 --- /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 000000000..77a5e2c6a --- /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 000000000..c4f37c698 --- /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 000000000..f14caca28 --- /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 000000000..d07bf0bad --- /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 000000000..b40b8dce6 --- /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 000000000..c617fba99 --- /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 000000000..bd4ad7cc3 --- /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 000000000..9a3d8297f --- /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 000000000..b337c11b7 --- /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 000000000..c8e2810cf --- /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 000000000..2002e9965 --- /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 000000000..b8b914e6c --- /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 000000000..08c7912cd --- /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 000000000..058e0a198 --- /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 000000000..a01414742 --- /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 000000000..01db70049 --- /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 000000000..5b48014a8 --- /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 000000000..e1317c975 --- /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 000000000..b692ad187 --- /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 000000000..77d6cc8ff --- /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 000000000..48a8fff6c --- /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 000000000..7c2d4d913 --- /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 000000000..fbcb7e186 --- /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 000000000..2e65d20cf --- /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 000000000..c9625b34d --- /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 000000000..f055e795c --- /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 000000000..3f05fadbe --- /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 000000000..5f8f96b25 --- /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 000000000..f8ddd4113 --- /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 000000000..8355cce22 --- /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 000000000..5d5fe280a --- /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 000000000..01cad6650 --- /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 000000000..8a95144e9 --- /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 000000000..b7daed489 --- /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 000000000..2133adf18 --- /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 000000000..e4a05ff50 --- /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 000000000..9de8ece66 --- /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 000000000..2e64fc80e --- /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 000000000..feb7e6f57 --- /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 000000000..d9422091d --- /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 000000000..4364527cc --- /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 000000000..c00234b5b --- /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 000000000..42d037e07 --- /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 000000000..ef5e3d317 --- /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 000000000..79f71a4e1 --- /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 000000000..423200d2d --- /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 000000000..a850a1dbb --- /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 000000000..5abd045c0 --- /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 000000000..a201b8d07 --- /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 000000000..5e63653fd --- /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 000000000..4b6f0d176 --- /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 000000000..bb1999b3d --- /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 2d8227171..af5209213 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 e648c35b6..46a2c34a3 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 000000000..8b8ffae9b --- /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 000000000..6c33127ee --- /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 000000000..8ac8d40f9 --- /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 000000000..b46625ca0 --- /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 000000000..cd834d821 --- /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 000000000..d4faf9dd6 --- /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 000000000..31daadd0c --- /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 000000000..7dddaf102 --- /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 000000000..7c4f27bae --- /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 000000000..c02bc5bd3 --- /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 000000000..13c2343d7 --- /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 000000000..e7f425b8a --- /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 000000000..06ab40e25 --- /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 000000000..dbffb8785 --- /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 000000000..c720bc892 --- /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 000000000..eb37d46cd --- /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 000000000..4b9ac5aca --- /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 000000000..fbe806fa6 --- /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 000000000..a30b1a63a --- /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 000000000..501cebf62 --- /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 000000000..63c454b2b --- /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 000000000..6a2b68eff --- /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 000000000..d6ccdd02c --- /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 000000000..f743719e1 --- /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 000000000..32b7f2ff9 --- /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 000000000..53c9242c6 --- /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 000000000..ebb765ebf --- /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 000000000..e14fb7c15 --- /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 000000000..18c8321ec --- /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 000000000..561ded3be --- /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 index 54874fa5b..df5b4f537 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 index 617da247b..5db110beb 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 index 1c3d43ea7..1081b9d81 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 index 2321f2154..c2852bf3e 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 000000000..6dc5ee508 --- /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 000000000..a7e86df04 --- /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 000000000..1d4bc57ed --- /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 000000000..92aad3a3d --- /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 000000000..1e2a9b5f3 --- /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 000000000..765ea8b09 --- /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 000000000..f1a89c5da --- /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 000000000..55641ef96 --- /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 000000000..4d2f9e092 --- /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 000000000..87bbf173e --- /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 000000000..2cadec95d --- /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 000000000..625f0a0d9 --- /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 000000000..5c0c352ee --- /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 000000000..4529d480d --- /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 000000000..6646663bc --- /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 000000000..c5c9087ef --- /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 000000000..7f88bf06f --- /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 000000000..05913a8b8 --- /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 000000000..97f8cdb6f --- /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 000000000..4be80ade9 --- /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 000000000..bd11514aa --- /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 000000000..5d6d61f0d --- /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 000000000..202fedfec --- /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 000000000..b3f4192ca --- /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 000000000..c79deeb8f --- /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 000000000..4f4b317dc --- /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 000000000..9e3411c18 --- /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 000000000..f5faa72a1 --- /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 000000000..c873f43c9 --- /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 000000000..f99bb167c --- /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 000000000..93cae80d3 --- /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 000000000..df4a8668c --- /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 000000000..3918ac800 --- /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 000000000..9b0600fce --- /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 000000000..157f1799a --- /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 000000000..beb694ae6 --- /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 000000000..fcefb9e2d --- /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 000000000..040610cf0 --- /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 000000000..8ee2a733e --- /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 000000000..cdaff2ec7 --- /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 000000000..84933722b --- /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 000000000..a0cb3fc62 --- /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 000000000..7d1f92192 --- /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 000000000..8f5a79d0d --- /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 000000000..81c70afb2 --- /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 000000000..c1a876125 --- /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 000000000..24f23b21c --- /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 000000000..fff605a91 --- /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 000000000..0367a94d3 --- /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 000000000..840220487 --- /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 000000000..3996d6b0f --- /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 000000000..5960057fc --- /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 000000000..dcdd399dc --- /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 000000000..96ae2c268 --- /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 000000000..9f5ea23cf --- /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 000000000..ba4896aba --- /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 000000000..0de2f9046 --- /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 000000000..a558cc3b4 --- /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 000000000..25c45d7b6 --- /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 000000000..06461a4c0 --- /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 000000000..df931b482 --- /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 000000000..2b190192d --- /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 000000000..1732d5114 --- /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 000000000..ed6c9a656 --- /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 000000000..b02c2e218 --- /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 000000000..f2ab4b11f --- /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 000000000..3123e935b --- /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 000000000..41e73ff48 --- /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 000000000..0984163ec --- /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 000000000..3ba84df3c --- /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 000000000..50c4f8e11 --- /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 000000000..e29ccca95 --- /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 000000000..d02589281 --- /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 000000000..e59aae69f --- /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 000000000..a46e66faf --- /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 000000000..798370c31 --- /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 000000000..b18c35aed --- /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 000000000..9ff7be956 --- /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 000000000..47c5964b0 --- /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 000000000..d5689d461 --- /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 000000000..8f175407f --- /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 000000000..330591c98 --- /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 000000000..a111de997 --- /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 000000000..488124e93 --- /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 000000000..e69f4b8a0 --- /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 000000000..b6dae5542 --- /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 000000000..967eefbba --- /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 000000000..abfdc433a --- /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 000000000..ab8cce738 --- /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 000000000..a12519da7 --- /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 000000000..837dd39c1 --- /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 000000000..a3919e30d --- /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 000000000..025eb038c --- /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 000000000..f3f838a61 --- /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 000000000..502489733 --- /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 000000000..df880935a --- /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 000000000..cd3969a4c --- /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 000000000..d63cba2d3 --- /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 000000000..b26d13706 --- /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 000000000..64c687905 --- /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 000000000..704d89102 --- /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);
|