diff options
author | David Fugate <dfugate@microsoft.com> | 2011-03-09 12:00:57 -0800 |
---|---|---|
committer | David Fugate <dfugate@microsoft.com> | 2011-03-09 12:00:57 -0800 |
commit | 0eb3f27bf9ef049aa6694369d7873213871fe181 (patch) | |
tree | 697c05347df2157aaaf1226ac811910df24dbab5 /test/suite/ietestcenter/chapter15/15.5 | |
parent | 2e0481cc8c01f2af37a42ba7aff5b8c4a3563eb6 (diff) | |
download | test262-0eb3f27bf9ef049aa6694369d7873213871fe181.tar.gz |
Added IE Test Center test case contributions to test/suite/ietestcenter.
Diffstat (limited to 'test/suite/ietestcenter/chapter15/15.5')
142 files changed, 5443 insertions, 0 deletions
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-0-1.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-0-1.js new file mode 100644 index 000000000..5a0fc3c2c --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-0-1.js @@ -0,0 +1,35 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.5.4.20-0-1",
+
+path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-0-1.js",
+
+description: "String.prototype.trim must exist as a function",
+
+test: function testcase() {
+ var f = String.prototype.trim;
+ if (typeof(f) === "function") {
+ return true;
+ }
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-0-2.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-0-2.js new file mode 100644 index 000000000..9ce4c6a1a --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-0-2.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.5.4.20-0-2",
+
+path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-0-2.js",
+
+description: "String.prototype.trim must exist as a function taking 0 parameters",
+
+test: function testcase() {
+ if (String.prototype.trim.length === 0) {
+ return true;
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-1-1.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-1-1.js new file mode 100644 index 000000000..4270a4064 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-1-1.js @@ -0,0 +1,44 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.5.4.20-1-1",
+
+path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-1-1.js",
+
+description: "String.prototype.trim throws TypeError when string is undefined",
+
+test: function testcase() {
+ try
+ {
+ String.prototype.trim.call(undefined);
+ return false;
+ }
+ catch(e)
+ {
+ return e instanceof TypeError;
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-1-2.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-1-2.js new file mode 100644 index 000000000..b8036fbf2 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-1-2.js @@ -0,0 +1,44 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.5.4.20-1-2",
+
+path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-1-2.js",
+
+description: "String.prototype.trim throws TypeError when string is null",
+
+test: function testcase() {
+ try
+ {
+ String.prototype.trim.call(null);
+ return false;
+ }
+ catch(e)
+ {
+ return e instanceof TypeError;
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-1-3.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-1-3.js new file mode 100644 index 000000000..06b09be6f --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-1-3.js @@ -0,0 +1,43 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.5.4.20-1-3",
+
+path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-1-3.js",
+
+description: "String.prototype.trim works for primitive type boolean",
+
+test: function testcase() {
+ try
+ {
+ if(String.prototype.trim.call(true) == "true")
+ return true;
+ }
+ catch(e)
+ {
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-1-4.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-1-4.js new file mode 100644 index 000000000..28b2259bb --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-1-4.js @@ -0,0 +1,43 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.5.4.20-1-4",
+
+path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-1-4.js",
+
+description: "String.prototype.trim works for primitive type number",
+
+test: function testcase() {
+ try
+ {
+ if(String.prototype.trim.call(0) == "0")
+ return true;
+ }
+ catch(e)
+ {
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-1-5.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-1-5.js new file mode 100644 index 000000000..052a0106c --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-1-5.js @@ -0,0 +1,43 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.5.4.20-1-5",
+
+path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-1-5.js",
+
+description: "String.prototype.trim works for an Object",
+
+test: function testcase() {
+ try
+ {
+ if(String.prototype.trim.call({})=="[object Object]")
+ return true;
+ }
+ catch(e)
+ {
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-1-6.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-1-6.js new file mode 100644 index 000000000..3155836c6 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-1-6.js @@ -0,0 +1,43 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.5.4.20-1-6",
+
+path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-1-6.js",
+
+description: "String.prototype.trim works for an String",
+
+test: function testcase() {
+ try
+ {
+ if(String.prototype.trim.call(new String()) == "")
+ return true;
+ }
+ catch(e)
+ {
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-1-7.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-1-7.js new file mode 100644 index 000000000..ddb35c75b --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-1-7.js @@ -0,0 +1,43 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.5.4.20-1-7",
+
+path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-1-7.js",
+
+description: "String.prototype.trim works for a primitive string",
+
+test: function testcase() {
+ try
+ {
+ if(String.prototype.trim.call("abc") === "abc")
+ return true;
+ }
+ catch(e)
+ {
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-1-8.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-1-8.js new file mode 100644 index 000000000..87ffecb87 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-1-8.js @@ -0,0 +1,37 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.5.4.20-1-8",
+
+ path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-1-8.js",
+
+ description: "String.prototype.trim works for a primitive string (value is ' abc') ",
+
+ test: function testcase() {
+ var strObj = String(" abc");
+ return "abc" === strObj.trim() && strObj.toString() === " abc";
+ },
+
+ precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-1-9.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-1-9.js new file mode 100644 index 000000000..dc84849d9 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-1-9.js @@ -0,0 +1,37 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.5.4.20-1-9",
+
+ path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-1-9.js",
+
+ description: "String.prototype.trim works for a String object which value is undefined",
+
+ test: function testcase() {
+ var strObj = new String(undefined);
+ return strObj.trim() === "undefined";
+ },
+
+ precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-1.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-1.js new file mode 100644 index 000000000..30fedc2d4 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-1.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.5.4.20-2-1",
+
+ path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-1.js",
+
+ description: "String.prototype.trim - argument 'this' is a boolean whose value is false",
+
+ test: function testcase() {
+ return String.prototype.trim.call(false) === "false";
+ },
+
+ precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-10.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-10.js new file mode 100644 index 000000000..3c6b1fc67 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-10.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.5.4.20-2-10",
+
+ path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-10.js",
+
+ description: "String.prototype.trim - argument 'this' is a number that converts to a string (value is +Infinity)",
+
+ test: function testcase() {
+ return String.prototype.trim.call(+Infinity) === "Infinity";
+ },
+
+ precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-11.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-11.js new file mode 100644 index 000000000..00cf6c383 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-11.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.5.4.20-2-11",
+
+ path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-11.js",
+
+ description: "String.prototype.trim - argument 'this' is a number that converts to a string (value is -Infinity)",
+
+ test: function testcase() {
+ return String.prototype.trim.call(-Infinity) === "-Infinity";
+ },
+
+ precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-12.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-12.js new file mode 100644 index 000000000..898a98416 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-12.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.5.4.20-2-12",
+
+ path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-12.js",
+
+ description: "String.prototype.trim - argument 'this' is a number that converts to a string (value is 1(following 20 zeros))",
+
+ test: function testcase() {
+ return String.prototype.trim.call(100000000000000000000) === "100000000000000000000";
+ },
+
+ precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-13.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-13.js new file mode 100644 index 000000000..b2e773f43 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-13.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.5.4.20-2-13",
+
+ path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-13.js",
+
+ description: "String.prototype.trim - argument 'this' is a number that converts to a string (value is 1(following 21 zeros))",
+
+ test: function testcase() {
+ return String.prototype.trim.call(1000000000000000000000) === "1e+21";
+ },
+
+ precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-14.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-14.js new file mode 100644 index 000000000..3fa04cf4b --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-14.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.5.4.20-2-14",
+
+ path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-14.js",
+
+ description: "String.prototype.trim - argument 'this' is a number that converts to a string (value is 1(following 22 zeros))",
+
+ test: function testcase() {
+ return String.prototype.trim.call(10000000000000000000000) === "1e+22";
+ },
+
+ precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-15.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-15.js new file mode 100644 index 000000000..46a402f27 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-15.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.5.4.20-2-15",
+
+ path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-15.js",
+
+ description: "String.prototype.trim - argument 'this' is a number that converts to a string (value is 1e+20)",
+
+ test: function testcase() {
+ return String.prototype.trim.call(1e+20) === "100000000000000000000";
+ },
+
+ precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-16.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-16.js new file mode 100644 index 000000000..9639a86b4 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-16.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.5.4.20-2-16",
+
+ path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-16.js",
+
+ description: "String.prototype.trim - argument 'this' is a number that converts to string (value is 1e+21)",
+
+ test: function testcase() {
+ return String.prototype.trim.call(1e+21) === "1e+21";
+ },
+
+ precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-17.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-17.js new file mode 100644 index 000000000..5d8bc7f32 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-17.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.5.4.20-2-17",
+
+ path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-17.js",
+
+ description: "String.prototype.trim - argument 'this' is a number that converts to string (value is 1e+22)",
+
+ test: function testcase() {
+ return String.prototype.trim.call(1e+22) === "1e+22";
+ },
+
+ precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-18.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-18.js new file mode 100644 index 000000000..2c067e42a --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-18.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.5.4.20-2-18",
+
+ path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-18.js",
+
+ description: "String.prototype.trim - argument 'this' is a number that converts to a string (value is 0.000001)",
+
+ test: function testcase() {
+ return String.prototype.trim.call(0.000001) === "0.000001";
+ },
+
+ precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-19.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-19.js new file mode 100644 index 000000000..5f522b726 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-19.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.5.4.20-2-19",
+
+ path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-19.js",
+
+ description: "String.prototype.trim - argument argument 'this' is a number that converts to a string (value is 0.0000001)",
+
+ test: function testcase() {
+ return String.prototype.trim.call(0.0000001) === "1e-7";
+ },
+
+ precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-2.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-2.js new file mode 100644 index 000000000..1dd3f8f29 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-2.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.5.4.20-2-2",
+
+ path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-2.js",
+
+ description: "String.prototype.trim - argument 'this' is a boolean whose value is true",
+
+ test: function testcase() {
+ return String.prototype.trim.call(true) === "true";
+ },
+
+ precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-20.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-20.js new file mode 100644 index 000000000..8a6df876c --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-20.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.5.4.20-2-20",
+
+ path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-20.js",
+
+ description: "String.prototype.trim - argument 'this' is a number that converts to a string (value is 0.00000001)",
+
+ test: function testcase() {
+ return String.prototype.trim.call(0.00000001) === "1e-8";
+ },
+
+ precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-21.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-21.js new file mode 100644 index 000000000..af4d89fb6 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-21.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.5.4.20-2-21",
+
+ path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-21.js",
+
+ description: "String.prototype.trim - argument 'this' is a number that converts to a string (value is 1e-7)",
+
+ test: function testcase() {
+ return String.prototype.trim.call(1e-7) === "1e-7";
+ },
+
+ precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-22.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-22.js new file mode 100644 index 000000000..8f04016f9 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-22.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.5.4.20-2-22",
+
+ path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-22.js",
+
+ description: "String.prototype.trim - argument 'this' is a number that converts to a string (value is 1e-6)",
+
+ test: function testcase() {
+ return String.prototype.trim.call(1e-6) === "0.000001";
+ },
+
+ precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-23.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-23.js new file mode 100644 index 000000000..1c7e17ebb --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-23.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.5.4.20-2-23",
+
+ path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-23.js",
+
+ description: "String.prototype.trim - argument 'this' is a number that converts to a string (value is 1e-5)",
+
+ test: function testcase() {
+ return String.prototype.trim.call(1e-5) === "0.00001";
+ },
+
+ precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-24.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-24.js new file mode 100644 index 000000000..db8f7497a --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-24.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.5.4.20-2-24",
+
+ path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-24.js",
+
+ description: "String.prototype.trim - argument 'this' is an integer that converts to a string (value is 123)",
+
+ test: function testcase() {
+ return String.prototype.trim.call(123) === "123";
+ },
+
+ precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-25.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-25.js new file mode 100644 index 000000000..9f93f8fa6 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-25.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.5.4.20-2-25",
+
+ path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-25.js",
+
+ description: "String.prototype.trim - argument 'this' is a decimal that converts to a string (value is 123.456)",
+
+ test: function testcase() {
+ return String.prototype.trim.call(123.456) === "123.456";
+ },
+
+ precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-26.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-26.js new file mode 100644 index 000000000..a253df99f --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-26.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.5.4.20-2-26",
+
+ path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-26.js",
+
+ description: "String.prototype.trim - argument 'this' is a number that converts to a string (value is 1(following 20 zeros).123)",
+
+ test: function testcase() {
+ return String.prototype.trim.call(100000000000000000000.123) === "100000000000000000000";
+ },
+
+ precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-27.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-27.js new file mode 100644 index 000000000..811a7f96a --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-27.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.5.4.20-2-27",
+
+ path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-27.js",
+
+ description: "String.prototype.trim - argument 'this' is a number that converts to a string (value is 123.1234567)",
+
+ test: function testcase() {
+ return String.prototype.trim.call(123.1234567) === "123.1234567";
+ },
+
+ precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-28.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-28.js new file mode 100644 index 000000000..2a66d2566 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-28.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.5.4.20-2-28",
+
+ path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-28.js",
+
+ description: "String.prototype.trim - argument 'this' is an empty string ",
+
+ test: function testcase() {
+ return String.prototype.trim.call("") === "";
+ },
+
+ precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-29.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-29.js new file mode 100644 index 000000000..0d95018db --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-29.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.5.4.20-2-29",
+
+ path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-29.js",
+
+ description: "String.prototype.trim - argument 'this' is a string(value is 'AB\n\\cd')",
+
+ test: function testcase() {
+ return String.prototype.trim.call("AB\n\\cd") === "AB\n\\cd";
+ },
+
+ precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-3.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-3.js new file mode 100644 index 000000000..80ad4cd24 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-3.js @@ -0,0 +1,36 @@ + /// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.5.4.20-2-3",
+
+ path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-3.js",
+
+ description: "String.prototype.trim - argument 'this' is a number that converts to a string (value is NaN)",
+
+ test: function testcase() {
+ return String.prototype.trim.call(NaN) === "NaN";
+ },
+
+ precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-30.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-30.js new file mode 100644 index 000000000..3ada99fc1 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-30.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.5.4.20-2-30",
+
+ path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-30.js",
+
+ description: "String.prototype.trim - argument 'this' is a string(value is 'undefined') ",
+
+ test: function testcase() {
+ return String.prototype.trim.call("undefined") === "undefined";
+ },
+
+ precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-31.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-31.js new file mode 100644 index 000000000..9127ff54e --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-31.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.5.4.20-2-31",
+
+ path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-31.js",
+
+ description: "String.prototype.trim - argument 'this' is a string(value is 'null') ",
+
+ test: function testcase() {
+ return String.prototype.trim.call("null") === "null";
+ },
+
+ precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-32.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-32.js new file mode 100644 index 000000000..08d7dd918 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-32.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.5.4.20-2-32",
+
+ path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-32.js",
+
+ description: "String.prototype.trim - argument 'this' is a string(value is '123#$%abc')",
+
+ test: function testcase() {
+ return String.prototype.trim.call("123#$%abc") === "123#$%abc";
+ },
+
+ precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-33.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-33.js new file mode 100644 index 000000000..34118135e --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-33.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.5.4.20-2-33",
+
+ path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-33.js",
+
+ description: "String.prototype.trim - argument 'this' is a string(value is '1')",
+
+ test: function testcase() {
+ return String.prototype.trim.call("1") === "1";
+ },
+
+ precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-34.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-34.js new file mode 100644 index 000000000..6028d815e --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-34.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.5.4.20-2-34",
+
+ path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-34.js",
+
+ description: "String.prototype.trim - 'this' is an array that converts to a string",
+
+ test: function testcase() {
+ return (String.prototype.trim.call([1]) === '1');
+ },
+
+ precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-35.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-35.js new file mode 100644 index 000000000..a5602c48e --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-35.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.5.4.20-2-35",
+
+ path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-35.js",
+
+ description: "String.prototype.trim - 'this' is a String Object that converts to a string",
+
+ test: function testcase() {
+ return (String.prototype.trim.call(new String("abc")) === "abc");
+ },
+
+ precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-36.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-36.js new file mode 100644 index 000000000..93c66ef9a --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-36.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.5.4.20-2-36",
+
+ path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-36.js",
+
+ description: "String.prototype.trim - 'this' is a Boolean Object that converts to a string",
+
+ test: function testcase() {
+ return (String.prototype.trim.call(new Boolean(false)) === "false");
+ },
+
+ precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-37.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-37.js new file mode 100644 index 000000000..e682a1bd8 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-37.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.5.4.20-2-37",
+
+ path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-37.js",
+
+ description: "String.prototype.trim - 'this' is a Number Object that converts to a string",
+
+ test: function testcase() {
+ return (String.prototype.trim.call(new Number(123)) === "123");
+ },
+
+ precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-38.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-38.js new file mode 100644 index 000000000..f2721532f --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-38.js @@ -0,0 +1,42 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.5.4.20-2-38",
+
+ path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-38.js",
+
+ description: "String.prototype.trim - 'this' is an object which has an own toString method",
+
+ test: function testcase() {
+ var obj = {
+ toString: function () {
+ return "abc";
+ }
+ };
+
+ return (String.prototype.trim.call(obj) === "abc");
+ },
+
+ precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-39.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-39.js new file mode 100644 index 000000000..1bb942a5d --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-39.js @@ -0,0 +1,42 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.5.4.20-2-39",
+
+ path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-39.js",
+
+ description: "String.prototype.trim - 'this' is an object which has an own valueOf method",
+
+ test: function testcase() {
+ var obj = {
+ valueOf: function () {
+ return "abc";
+ }
+ };
+
+ return (String.prototype.trim.call(obj) === "[object Object]");
+ },
+
+ precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-4.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-4.js new file mode 100644 index 000000000..2c3459ff6 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-4.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.5.4.20-2-4",
+
+ path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-4.js",
+
+ description: "String.prototype.trim - argument 'this' is a number that converts to a string (value is 0)",
+
+ test: function testcase() {
+ return String.prototype.trim.call(0) === "0";
+ },
+
+ precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-40.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-40.js new file mode 100644 index 000000000..8f2c73bc5 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-40.js @@ -0,0 +1,48 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.5.4.20-2-40",
+
+ path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-40.js",
+
+ description: "String.prototype.trim - 'this' is an object that has an own toString method that returns an object and valueOf method that returns a primitive value",
+
+ test: function testcase() {
+ var toStringAccessed = false;
+ var valueOfAccessed = false;
+ var obj = {
+ toString: function () {
+ toStringAccessed = true;
+ return {};
+ },
+ valueOf: function () {
+ valueOfAccessed = true;
+ return "abc";
+ }
+ };
+ return (String.prototype.trim.call(obj) === "abc") && valueOfAccessed && toStringAccessed;
+ },
+
+ precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-41.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-41.js new file mode 100644 index 000000000..2726ffd84 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-41.js @@ -0,0 +1,48 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.5.4.20-2-41",
+
+ path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-41.js",
+
+ description: "String.prototype.trim - 'this' is an object which has an own toString and valueOf method.",
+
+ test: function testcase() {
+ var toStringAccessed = false;
+ var valueOfAccessed = false;
+ var obj = {
+ toString: function () {
+ toStringAccessed = true;
+ return "abc";
+ },
+ valueOf: function () {
+ valueOfAccessed = true;
+ return "cef";
+ }
+ };
+ return (String.prototype.trim.call(obj) === "abc") && !valueOfAccessed && toStringAccessed;
+ },
+
+ precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-42.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-42.js new file mode 100644 index 000000000..909df968a --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-42.js @@ -0,0 +1,53 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.5.4.20-2-42",
+
+ path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-42.js",
+
+ description: "String.prototype.trim - TypeError exception was thrown when 'this' is an object that both toString and valueOf wouldn't return primitive value.",
+
+ test: function testcase() {
+ var toStringAccessed = false;
+ var valueOfAccessed = false;
+ var obj = {
+ toString: function () {
+ toStringAccessed = true;
+ return {};
+ },
+ valueOf: function () {
+ valueOfAccessed = true;
+ return {};
+ }
+ };
+ try {
+ String.prototype.trim.call(obj);
+ return false;
+ } catch (e) {
+ return valueOfAccessed && toStringAccessed && (e instanceof TypeError);
+ }
+ },
+
+ precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-43.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-43.js new file mode 100644 index 000000000..825f79490 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-43.js @@ -0,0 +1,55 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.5.4.20-2-43",
+
+ path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-43.js",
+
+ description: "String.prototype.trim - 'this' is an object with an own valueOf and inherited toString methods with hint string, verify inherited toString method will be called first",
+
+ test: function testcase() {
+
+ var toStringAccessed = false;
+ var valueOfAccessed = false;
+
+ var proto = {
+ toString: function () {
+ toStringAccessed = true;
+ return "abc";
+ }
+ };
+
+ var Con = function () { };
+ Con.prototype = proto;
+
+ var child = new Con();
+ child.valueOf = function () {
+ valueOfAccessed = true;
+ return "efg";
+ };
+ return (String.prototype.trim.call(child) === "abc") && toStringAccessed && !valueOfAccessed;
+ },
+
+ precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-44.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-44.js new file mode 100644 index 000000000..e19bc5ca5 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-44.js @@ -0,0 +1,37 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.5.4.20-2-44",
+
+ path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-44.js",
+
+ description: "String.prototype.trim - 'this' is a string that contains east Asian characters (value is 'SD咕噜')",
+
+ test: function testcase() {
+ var str = "SD咕噜";
+ return str.trim() === str;
+ },
+
+ precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-45.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-45.js new file mode 100644 index 000000000..7e51f0b3b --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-45.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.5.4.20-2-45",
+
+ path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-45.js",
+
+ description: "String.prototype.trim - 'this' is a string that contains white space, character, number, object and null characters",
+
+ test: function testcase() {
+ var str = "abc" + " " + 123 + " " + {} + " " + "\u0000";
+ var str1 = " " + str + " ";
+ return str1.trim() === str;
+ },
+
+ precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-46.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-46.js new file mode 100644 index 000000000..3175c6e07 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-46.js @@ -0,0 +1,37 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.5.4.20-2-46",
+
+ path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-46.js",
+
+ description: "String.prototype.trim - 'this' is a Function Object that converts to a string",
+
+ test: function testcase() {
+ var funObj = function () { return arguments; };
+ return String.prototype.trim.call(funObj) === "function () { return arguments; }";
+ },
+
+ precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-47.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-47.js new file mode 100644 index 000000000..f4077ccf0 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-47.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.5.4.20-2-47",
+
+ path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-47.js",
+
+ description: "String.prototype.trim - 'this' is a object Object that converts to a string",
+
+ test: function testcase() {
+ return String.prototype.trim.call({}) === "[object Object]";
+ },
+
+ precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-48.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-48.js new file mode 100644 index 000000000..ca65e29a4 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-48.js @@ -0,0 +1,37 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.5.4.20-2-48",
+
+ path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-48.js",
+
+ description: "String.prototype.trim - 'this' is a Date Object that converts to a string",
+
+ test: function testcase() {
+ var dateObj = new Date();
+ return String.prototype.trim.call(dateObj) === dateObj.toString();
+ },
+
+ precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-49.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-49.js new file mode 100644 index 000000000..a8c556eae --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-49.js @@ -0,0 +1,37 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.5.4.20-2-49",
+
+ path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-49.js",
+
+ description: "String.prototype.trim - 'this' is a RegExp Object that converts to a string",
+
+ test: function testcase() {
+ var regObj = new RegExp(/test/);
+ return String.prototype.trim.call(regObj) === "/test/";
+ },
+
+ precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-5.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-5.js new file mode 100644 index 000000000..9282ee238 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-5.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.5.4.20-2-5",
+
+ path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-5.js",
+
+ description: "String.prototype.trim - argument 'this' is a number that converts to a string (value is +0)",
+
+ test: function testcase() {
+ return String.prototype.trim.call(+0) === "0";
+ },
+
+ precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-50.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-50.js new file mode 100644 index 000000000..7a67c3170 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-50.js @@ -0,0 +1,37 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.5.4.20-2-50",
+
+ path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-50.js",
+
+ description: "String.prototype.trim - 'this' is a Error Object that converts to a string",
+
+ test: function testcase() {
+ var errObj = new Error("test");
+ return String.prototype.trim.call(errObj) === "Error: test";
+ },
+
+ precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-51.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-51.js new file mode 100644 index 000000000..a464b28ab --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-51.js @@ -0,0 +1,37 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.5.4.20-2-51",
+
+ path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-51.js",
+
+ description: "String.prototype.trim - 'this' is a Arguments Object that converts to a string",
+
+ test: function testcase() {
+ var argObj = function () { return arguments; } (1, 2, true);
+ return String.prototype.trim.call(argObj) === "[object Arguments]";
+ },
+
+ precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-52.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-52.js new file mode 100644 index 000000000..31c6b8b38 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-52.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.5.4.20-2-52",
+
+ path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-52.js",
+
+ description: "String.prototype.trim - 'this' is the host object - fnGlobalObject() that converts to a string",
+
+ test: function testcase() {
+ return String.prototype.trim.call(fnGlobalObject()) === fnGlobalObject().toString().trim();
+ },
+
+ precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-6.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-6.js new file mode 100644 index 000000000..7f3630bd9 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-6.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.5.4.20-2-6",
+
+ path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-6.js",
+
+ description: "String.prototype.trim - argument 'this' is a number that converts to a string (value is -0)",
+
+ test: function testcase() {
+ return String.prototype.trim.call(-0) === "0";
+ },
+
+ precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-7.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-7.js new file mode 100644 index 000000000..274c196cc --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-7.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.5.4.20-2-7",
+
+ path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-7.js",
+
+ description: "String.prototype.trim - argument 'this' is a number that converts to a string (value is positive number)",
+
+ test: function testcase() {
+ return String.prototype.trim.call(30) === "30";
+ },
+
+ precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-8.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-8.js new file mode 100644 index 000000000..4fa9b80ec --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-8.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.5.4.20-2-8",
+
+ path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-8.js",
+
+ description: "String.prototype.trim - argument 'this' is a number that converts to a string (value is negative number)",
+
+ test: function testcase() {
+ return String.prototype.trim.call(-20) === "-20";
+ },
+
+ precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-9.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-9.js new file mode 100644 index 000000000..c597cefaa --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-9.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.5.4.20-2-9",
+
+ path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-2-9.js",
+
+ description: "String.prototype.trim - argument 'this' is a number that converts to a string (value is Infinity)",
+
+ test: function testcase() {
+ return String.prototype.trim.call(Infinity) === "Infinity";
+ },
+
+ precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-3-1.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-3-1.js new file mode 100644 index 000000000..7eccaff9d --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-3-1.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.5.4.20-3-1",
+
+ path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-3-1.js",
+
+ description: "String.prototype.trim - 'S' is a string with all LineTerminator",
+
+ test: function testcase() {
+
+ var lineTerminatorsStr = "\u000A\u000D\u2028\u2029";
+ return (lineTerminatorsStr.trim() === "");
+ },
+
+ precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-3-10.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-3-10.js new file mode 100644 index 000000000..5deefd392 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-3-10.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.5.4.20-3-10",
+
+ path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-3-10.js",
+
+ description: "String.prototype.trim - 'S' is a string with null character ('\u0000')",
+
+ test: function testcase() {
+ return "\u0000".trim() === "\u0000";
+ },
+
+ precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-3-11.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-3-11.js new file mode 100644 index 000000000..3e5a884b6 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-3-11.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.5.4.20-3-11",
+
+ path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-3-11.js",
+
+ description: "String.prototype.trim - 'S' is a string that starts with null character",
+
+ test: function testcase() {
+ return "\0\u0000abc".trim() === "\0\u0000abc";
+ },
+
+ precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-3-12.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-3-12.js new file mode 100644 index 000000000..994b2fb6c --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-3-12.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.5.4.20-3-12",
+
+ path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-3-12.js",
+
+ description: "String.prototype.trim - 'S' is a string that ends with null character",
+
+ test: function testcase() {
+ return "abc\0\u0000".trim() === "abc\0\u0000";
+ },
+
+ precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-3-13.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-3-13.js new file mode 100644 index 000000000..c382aa1fe --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-3-13.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.5.4.20-3-13",
+
+ path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-3-13.js",
+
+ description: "String.prototype.trim - 'S' is a string that starts with null character and ends with null character",
+
+ test: function testcase() {
+ return "\0\u0000abc\0\u0000".trim() === "\0\u0000abc\0\u0000";
+ },
+
+ precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-3-14.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-3-14.js new file mode 100644 index 000000000..3a93c0c3e --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-3-14.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.5.4.20-3-14",
+
+ path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-3-14.js",
+
+ description: "String.prototype.trim - 'S' is a string that has null character in the middle",
+
+ test: function testcase() {
+ return "a\0\u0000bc".trim() === "a\0\u0000bc";
+ },
+
+ precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
\ No newline at end of file diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-3-2.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-3-2.js new file mode 100644 index 000000000..9d607d5d4 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-3-2.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.5.4.20-3-2",
+
+ path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-3-2.js",
+
+ description: "String.prototype.trim - 'S' is a string with all WhiteSpace",
+
+ test: function testcase() {
+
+ var whiteSpacesStr = "\u0009\u000A\u000B\u000C\u000D\u0020\u0085\u00A0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF";
+ return (whiteSpacesStr.trim() === "");
+ },
+
+ precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-3-3.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-3-3.js new file mode 100644 index 000000000..77bebc0e5 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-3-3.js @@ -0,0 +1,40 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.5.4.20-3-3",
+
+ path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-3-3.js",
+
+ description: "String.prototype.trim - 'S' is a string with all union of WhiteSpace and LineTerminator",
+
+ test: function testcase() {
+ var lineTerminatorsStr = "\u000A\u000D\u2028\u2029";
+ var whiteSpacesStr = "\u0009\u000A\u000B\u000C\u000D\u0020\u0085\u00A0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF";
+ var str = whiteSpacesStr + lineTerminatorsStr;
+
+ return (str.trim() === "");
+ },
+
+ precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-3-4.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-3-4.js new file mode 100644 index 000000000..707647289 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-3-4.js @@ -0,0 +1,40 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.5.4.20-3-4",
+
+ path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-3-4.js",
+
+ description: "String.prototype.trim - 'S' is a string start with union of all LineTerminator and all WhiteSpace",
+
+ test: function testcase() {
+ var lineTerminatorsStr = "\u000A\u000D\u2028\u2029";
+ var whiteSpacesStr = "\u0009\u000A\u000B\u000C\u000D\u0020\u0085\u00A0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF";
+ var str = whiteSpacesStr + lineTerminatorsStr + "abc";
+
+ return (str.trim() === "abc");
+ },
+
+ precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-3-5.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-3-5.js new file mode 100644 index 000000000..d6526febb --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-3-5.js @@ -0,0 +1,40 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.5.4.20-3-5",
+
+ path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-3-5.js",
+
+ description: "String.prototype.trim - 'S' is a string end with union of all LineTerminator and all WhiteSpace",
+
+ test: function testcase() {
+ var lineTerminatorsStr = "\u000A\u000D\u2028\u2029";
+ var whiteSpacesStr = "\u0009\u000A\u000B\u000C\u000D\u0020\u0085\u00A0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF";
+ var str = "abc" + whiteSpacesStr + lineTerminatorsStr ;
+
+ return (str.trim() === "abc");
+ },
+
+ precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-3-6.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-3-6.js new file mode 100644 index 000000000..6146b340b --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-3-6.js @@ -0,0 +1,40 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.5.4.20-3-6",
+
+ path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-3-6.js",
+
+ description: "String.prototype.trim - 'S' is a string start with union of all LineTerminator and all WhiteSpace and end with union of all LineTerminator and all WhiteSpace",
+
+ test: function testcase() {
+ var lineTerminatorsStr = "\u000A\u000D\u2028\u2029";
+ var whiteSpacesStr = "\u0009\u000A\u000B\u000C\u000D\u0020\u0085\u00A0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF";
+ var str = whiteSpacesStr + lineTerminatorsStr + "abc" + whiteSpacesStr + lineTerminatorsStr;
+
+ return (str.trim() === "abc");
+ },
+
+ precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-3-7.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-3-7.js new file mode 100644 index 000000000..1935ce8a8 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-3-7.js @@ -0,0 +1,40 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.5.4.20-3-7",
+
+ path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-3-7.js",
+
+ description: "String.prototype.trim - 'S' is a string that union of LineTerminator and WhiteSpace in the middle",
+
+ test: function testcase() {
+ var lineTerminatorsStr = "\u000A\u000D\u2028\u2029";
+ var whiteSpacesStr = "\u0009\u000A\u000B\u000C\u000D\u0020\u0085\u00A0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF";
+ var str = "ab" + whiteSpacesStr + lineTerminatorsStr + "cd";
+
+ return (str.trim() === str);
+ },
+
+ precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-3-8.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-3-8.js new file mode 100644 index 000000000..40369bf1b --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-3-8.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.5.4.20-3-8",
+
+ path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-3-8.js",
+
+ description: "String.prototype.trim - 'S' is a string with all null character",
+
+ test: function testcase() {
+ return "\0\u0000".trim() === "\0\u0000";
+ },
+
+ precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-3-9.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-3-9.js new file mode 100644 index 000000000..385bfd330 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-3-9.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.5.4.20-3-9",
+
+ path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-3-9.js",
+
+ description: "String.prototype.trim - 'S' is a string with null character ('\0')",
+
+ test: function testcase() {
+ return "\0".trim() === "\0";
+ },
+
+ precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-1.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-1.js new file mode 100644 index 000000000..62dc28ceb --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-1.js @@ -0,0 +1,42 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.5.4.20-4-1",
+
+path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-1.js",
+
+description: "String.prototype.trim handles multiline string with whitepace and lineterminators",
+
+test: function testcase() {
+var s = "\u0009a b\
+c \u0009"
+
+
+ if (s.trim() === "a bc") {
+ return true;
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-10.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-10.js new file mode 100644 index 000000000..4e59ded17 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-10.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.5.4.20-4-10",
+
+path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-10.js",
+
+description: "String.prototype.trim handles whitepace and lineterminators (\\uFEFFabc)",
+
+test: function testcase() {
+ return "\uFEFFabc".trim() === "abc";
+ },
+
+precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-11.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-11.js new file mode 100644 index 000000000..63f89310b --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-11.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.5.4.20-4-11",
+
+path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-11.js",
+
+description: "String.prototype.trim handles whitepace and lineterminators (abc\\u0009)",
+
+test: function testcase() {
+ if ("abc\u0009".trim() === "abc") {
+ return true;
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-12.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-12.js new file mode 100644 index 000000000..7871a279d --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-12.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.5.4.20-4-12",
+
+path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-12.js",
+
+description: "String.prototype.trim handles whitepace and lineterminators (abc\\u000B)",
+
+test: function testcase() {
+ if ("abc\u000B".trim() === "abc") {
+ return true;
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-13.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-13.js new file mode 100644 index 000000000..dfbc281b1 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-13.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.5.4.20-4-13",
+
+path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-13.js",
+
+description: "String.prototype.trim handles whitepace and lineterminators (abc\\u000C)",
+
+test: function testcase() {
+ if ("abc\u000C".trim() === "abc") {
+ return true;
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-14.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-14.js new file mode 100644 index 000000000..4e7239620 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-14.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.5.4.20-4-14",
+
+path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-14.js",
+
+description: "String.prototype.trim handles whitepace and lineterminators (abc\\u0020)",
+
+test: function testcase() {
+ if ("abc\u0020".trim() === "abc") {
+ return true;
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-16.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-16.js new file mode 100644 index 000000000..55c157b11 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-16.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.5.4.20-4-16",
+
+path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-16.js",
+
+description: "String.prototype.trim handles whitepace and lineterminators (abc\\u00A0)",
+
+test: function testcase() {
+ if ("abc\u00A0".trim() === "abc") {
+ return true;
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-18.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-18.js new file mode 100644 index 000000000..4c6c8fc4b --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-18.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.5.4.20-4-18",
+
+path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-18.js",
+
+description: "String.prototype.trim handles whitepace and lineterminators (abc\\uFEFF)",
+
+test: function testcase() {
+ return "abc\uFEFF".trim() === "abc";
+ },
+
+precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-19.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-19.js new file mode 100644 index 000000000..935f61d5c --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-19.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.5.4.20-4-19",
+
+path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-19.js",
+
+description: "String.prototype.trim handles whitepace and lineterminators (\\u0009abc\\u0009)",
+
+test: function testcase() {
+ if ("\u0009abc\u0009".trim() === "abc") {
+ return true;
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-2.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-2.js new file mode 100644 index 000000000..dd3c73c59 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-2.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.5.4.20-4-2",
+
+path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-2.js",
+
+description: "String.prototype.trim handles whitepace and lineterminators ( \\u0009abc \\u0009)",
+
+test: function testcase() {
+ if (" \u0009abc \u0009".trim() === "abc") {
+ return true;
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-20.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-20.js new file mode 100644 index 000000000..c93fceb45 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-20.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.5.4.20-4-20",
+
+path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-20.js",
+
+description: "String.prototype.trim handles whitepace and lineterminators (\\u000Babc\\u000B)",
+
+test: function testcase() {
+ if ("\u000Babc\u000B".trim() === "abc") {
+ return true;
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-21.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-21.js new file mode 100644 index 000000000..8d983342d --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-21.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.5.4.20-4-21",
+
+path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-21.js",
+
+description: "String.prototype.trim handles whitepace and lineterminators (\\u000Cabc\\u000C)",
+
+test: function testcase() {
+ if ("\u000Cabc\u000C".trim() === "abc") {
+ return true;
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-22.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-22.js new file mode 100644 index 000000000..6ae408208 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-22.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.5.4.20-4-22",
+
+path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-22.js",
+
+description: "String.prototype.trim handles whitepace and lineterminators (\\u0020abc\\u0020)",
+
+test: function testcase() {
+ if ("\u0020abc\u0020".trim() === "abc") {
+ return true;
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-24.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-24.js new file mode 100644 index 000000000..e5cdd16d1 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-24.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.5.4.20-4-24",
+
+path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-24.js",
+
+description: "String.prototype.trim handles whitepace and lineterminators (\\u00A0abc\\u00A0)",
+
+test: function testcase() {
+ if ("\u00A0abc\u00A0".trim() === "abc") {
+ return true;
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-27.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-27.js new file mode 100644 index 000000000..131e96a17 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-27.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.5.4.20-4-27",
+
+path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-27.js",
+
+description: "String.prototype.trim handles whitepace and lineterminators (\\u0009\\u0009)",
+
+test: function testcase() {
+ if ("\u0009\u0009".trim() === "") {
+ return true;
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-28.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-28.js new file mode 100644 index 000000000..aa1151cc4 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-28.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.5.4.20-4-28",
+
+path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-28.js",
+
+description: "String.prototype.trim handles whitepace and lineterminators (\\u000B\\u000B)",
+
+test: function testcase() {
+ if ("\u000B\u000B".trim() === "") {
+ return true;
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-29.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-29.js new file mode 100644 index 000000000..b416f8569 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-29.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.5.4.20-4-29",
+
+path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-29.js",
+
+description: "String.prototype.trim handles whitepace and lineterminators (\\u000C\\u000C)",
+
+test: function testcase() {
+ if ("\u000C\u000C".trim() === "") {
+ return true;
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-3.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-3.js new file mode 100644 index 000000000..552c13058 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-3.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.5.4.20-4-3",
+
+path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-3.js",
+
+description: "String.prototype.trim handles whitepace and lineterminators (\\u0009abc)",
+
+test: function testcase() {
+ if ("\u0009abc".trim() === "abc") {
+ return true;
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-30.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-30.js new file mode 100644 index 000000000..0a290bde0 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-30.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.5.4.20-4-30",
+
+path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-30.js",
+
+description: "String.prototype.trim handles whitepace and lineterminators (\\u0020\\u0020)",
+
+test: function testcase() {
+ if ("\u0020\u0020".trim() === "") {
+ return true;
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-32.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-32.js new file mode 100644 index 000000000..d875c76d4 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-32.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.5.4.20-4-32",
+
+path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-32.js",
+
+description: "String.prototype.trim handles whitepace and lineterminators (\\u00A0\\u00A0)",
+
+test: function testcase() {
+ if ("\u00A0\u00A0".trim() === "") {
+ return true;
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-34.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-34.js new file mode 100644 index 000000000..8652d2357 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-34.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.5.4.20-4-34",
+
+path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-34.js",
+
+description: "String.prototype.trim handles whitepace and lineterminators (\\uFEFF\\uFEFF)",
+
+test: function testcase() {
+ return "\uFEFF\uFEFF".trim() === "";
+ },
+
+precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-35.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-35.js new file mode 100644 index 000000000..b1f1d4bc9 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-35.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.5.4.20-4-35",
+
+path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-35.js",
+
+description: "String.prototype.trim handles whitepace and lineterminators (ab\\u0009c)",
+
+test: function testcase() {
+ if ("ab\u0009c".trim() === "ab\u0009c") {
+ return true;
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-36.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-36.js new file mode 100644 index 000000000..df5f6c249 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-36.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.5.4.20-4-36",
+
+path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-36.js",
+
+description: "String.prototype.trim handles whitepace and lineterminators (ab\\u000Bc)",
+
+test: function testcase() {
+ if ("ab\u000Bc".trim() === "ab\u000Bc") {
+ return true;
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-37.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-37.js new file mode 100644 index 000000000..3fa478e10 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-37.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.5.4.20-4-37",
+
+path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-37.js",
+
+description: "String.prototype.trim handles whitepace and lineterminators (ab\\u000Cc)",
+
+test: function testcase() {
+ if ("ab\u000Cc".trim() === "ab\u000Cc") {
+ return true;
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-38.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-38.js new file mode 100644 index 000000000..c427ba1aa --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-38.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.5.4.20-4-38",
+
+path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-38.js",
+
+description: "String.prototype.trim handles whitepace and lineterminators (ab\\u0020c)",
+
+test: function testcase() {
+ if ("ab\u0020c".trim() === "ab\u0020c") {
+ return true;
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-39.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-39.js new file mode 100644 index 000000000..8c8cbd86a --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-39.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.5.4.20-4-39",
+
+path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-39.js",
+
+description: "String.prototype.trim handles whitepace and lineterminators (ab\\u0085c)",
+
+test: function testcase() {
+ if ("ab\u0085c".trim() === "ab\u0085c") {
+ return true;
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-4.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-4.js new file mode 100644 index 000000000..dadc2e8eb --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-4.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.5.4.20-4-4",
+
+path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-4.js",
+
+description: "String.prototype.trim handles whitepace and lineterminators (\\u000Babc)",
+
+test: function testcase() {
+ if ("\u000Babc".trim() === "abc") {
+ return true;
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-40.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-40.js new file mode 100644 index 000000000..10b448775 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-40.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.5.4.20-4-40",
+
+path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-40.js",
+
+description: "String.prototype.trim handles whitepace and lineterminators (ab\\u00A0c)",
+
+test: function testcase() {
+ if ("ab\u00A0c".trim() === "ab\u00A0c") {
+ return true;
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-41.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-41.js new file mode 100644 index 000000000..be1a183c9 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-41.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.5.4.20-4-41",
+
+path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-41.js",
+
+description: "String.prototype.trim handles whitepace and lineterminators (ab\\u200Bc)",
+
+test: function testcase() {
+ if ("ab\u200Bc".trim() === "ab\u200Bc") {
+ return true;
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-42.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-42.js new file mode 100644 index 000000000..8d011f1af --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-42.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.5.4.20-4-42",
+
+path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-42.js",
+
+description: "String.prototype.trim handles whitepace and lineterminators (ab\\uFEFFc)",
+
+test: function testcase() {
+ if ("ab\uFEFFc".trim() === "ab\uFEFFc") {
+ return true;
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-43.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-43.js new file mode 100644 index 000000000..9b4fa63c1 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-43.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.5.4.20-4-43",
+
+path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-43.js",
+
+description: "String.prototype.trim handles whitepace and lineterminators (\\u000Aabc)",
+
+test: function testcase() {
+ if ("\u000Aabc".trim() === "abc") {
+ return true;
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-44.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-44.js new file mode 100644 index 000000000..da525b956 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-44.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.5.4.20-4-44",
+
+path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-44.js",
+
+description: "String.prototype.trim handles whitepace and lineterminators (\\u000Dabc)",
+
+test: function testcase() {
+ if ("\u000Dabc".trim() === "abc") {
+ return true;
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-45.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-45.js new file mode 100644 index 000000000..464688abc --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-45.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.5.4.20-4-45",
+
+path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-45.js",
+
+description: "String.prototype.trim handles whitepace and lineterminators (\\u2028abc)",
+
+test: function testcase() {
+ if ("\u2028abc".trim() === "abc") {
+ return true;
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-46.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-46.js new file mode 100644 index 000000000..1f5467b9e --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-46.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.5.4.20-4-46",
+
+path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-46.js",
+
+description: "String.prototype.trim handles whitepace and lineterminators (\\u2029abc)",
+
+test: function testcase() {
+ if ("\u2029abc".trim() === "abc") {
+ return true;
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-47.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-47.js new file mode 100644 index 000000000..71a64f849 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-47.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.5.4.20-4-47",
+
+path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-47.js",
+
+description: "String.prototype.trim handles whitepace and lineterminators (abc\\u000A)",
+
+test: function testcase() {
+ if ("abc\u000A".trim() === "abc") {
+ return true;
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-48.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-48.js new file mode 100644 index 000000000..56d554727 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-48.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.5.4.20-4-48",
+
+path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-48.js",
+
+description: "String.prototype.trim handles whitepace and lineterminators (abc\\u000D)",
+
+test: function testcase() {
+ if ("abc\u000D".trim() === "abc") {
+ return true;
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-49.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-49.js new file mode 100644 index 000000000..00ac35c95 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-49.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.5.4.20-4-49",
+
+path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-49.js",
+
+description: "String.prototype.trim handles whitepace and lineterminators (abc\\u2028)",
+
+test: function testcase() {
+ if ("abc\u2028".trim() === "abc") {
+ return true;
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-5.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-5.js new file mode 100644 index 000000000..fb23ee656 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-5.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.5.4.20-4-5",
+
+path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-5.js",
+
+description: "String.prototype.trim handles whitepace and lineterminators (\\u000Cabc)",
+
+test: function testcase() {
+ if ("\u000Cabc".trim() === "abc") {
+ return true;
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-50.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-50.js new file mode 100644 index 000000000..0191d4d9c --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-50.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.5.4.20-4-50",
+
+path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-50.js",
+
+description: "String.prototype.trim handles whitepace and lineterminators (abc\\u2029)",
+
+test: function testcase() {
+ if ("abc\u2029".trim() === "abc") {
+ return true;
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-51.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-51.js new file mode 100644 index 000000000..604dce2b5 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-51.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.5.4.20-4-51",
+
+path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-51.js",
+
+description: "String.prototype.trim handles whitepace and lineterminators (\\u000Aabc\\u000A)",
+
+test: function testcase() {
+ if ("\u000Aabc\u000A".trim() === "abc") {
+ return true;
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-52.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-52.js new file mode 100644 index 000000000..d83350371 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-52.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.5.4.20-4-52",
+
+path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-52.js",
+
+description: "String.prototype.trim handles whitepace and lineterminators (\\u000Dabc\\u000D)",
+
+test: function testcase() {
+ if ("\u000Dabc\u000D".trim() === "abc") {
+ return true;
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-53.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-53.js new file mode 100644 index 000000000..18d956b94 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-53.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.5.4.20-4-53",
+
+path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-53.js",
+
+description: "String.prototype.trim handles whitepace and lineterminators (\\u2028abc\\u2028)",
+
+test: function testcase() {
+ if ("\u2028abc\u2028".trim() === "abc") {
+ return true;
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-54.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-54.js new file mode 100644 index 000000000..000906c43 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-54.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.5.4.20-4-54",
+
+path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-54.js",
+
+description: "String.prototype.trim handles whitepace and lineterminators (\\u2029abc\\u2029)",
+
+test: function testcase() {
+ if ("\u2029abc\u2029".trim() === "abc") {
+ return true;
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-55.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-55.js new file mode 100644 index 000000000..9a4220c0a --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-55.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.5.4.20-4-55",
+
+path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-55.js",
+
+description: "String.prototype.trim handles whitepace and lineterminators (\\u000A\\u000A)",
+
+test: function testcase() {
+ if ("\u000A\u000A".trim() === "") {
+ return true;
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-56.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-56.js new file mode 100644 index 000000000..f672ec572 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-56.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.5.4.20-4-56",
+
+path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-56.js",
+
+description: "String.prototype.trim handles whitepace and lineterminators (\\u000D\\u000D)",
+
+test: function testcase() {
+ if ("\u000D\u000D".trim() === "") {
+ return true;
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-57.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-57.js new file mode 100644 index 000000000..2b64bd554 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-57.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.5.4.20-4-57",
+
+path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-57.js",
+
+description: "String.prototype.trim handles whitepace and lineterminators (\\u2028\\u2028)",
+
+test: function testcase() {
+ if ("\u2028\u2028".trim() === "") {
+ return true;
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-58.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-58.js new file mode 100644 index 000000000..d89ac3e9e --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-58.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.5.4.20-4-58",
+
+path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-58.js",
+
+description: "String.prototype.trim handles whitepace and lineterminators (\\u2029\\u2029)",
+
+test: function testcase() {
+ if ("\u2029\u2029".trim() === "") {
+ return true;
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-59.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-59.js new file mode 100644 index 000000000..73203dae1 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-59.js @@ -0,0 +1,40 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.5.4.20-4-59",
+
+path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-59.js",
+
+description: "String.prototype.trim handles whitepace and lineterminators (\\u2029abc as a multiline string)",
+
+test: function testcase() {
+ var s = "\u2029\
+ abc";
+ if (s.trim() === "abc") {
+ return true;
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-6.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-6.js new file mode 100644 index 000000000..b2a8b30ed --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-6.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.5.4.20-4-6",
+
+path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-6.js",
+
+description: "String.prototype.trim handles whitepace and lineterminators (\\u0020abc)",
+
+test: function testcase() {
+ if ("\u0020abc".trim() === "abc") {
+ return true;
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-60.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-60.js new file mode 100644 index 000000000..d31f7505c --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-60.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.5.4.20-4-60",
+
+path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-60.js",
+
+description: "String.prototype.trim handles whitepace and lineterminators (string with just blanks)",
+
+test: function testcase() {
+ if (" ".trim() === "") {
+ return true;
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-8.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-8.js new file mode 100644 index 000000000..b918d8faa --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-8.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.5.4.20-4-8",
+
+path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-4-8.js",
+
+description: "String.prototype.trim handles whitepace and lineterminators (\\u00A0abc)",
+
+test: function testcase() {
+ if ("\u00A0abc".trim() === "abc") {
+ return true;
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(String.prototype.trim);
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.5/15.5.5.2/15.5.5.5.2-1-1.js b/test/suite/ietestcenter/chapter15/15.5/15.5.5/15.5.5.2/15.5.5.5.2-1-1.js new file mode 100644 index 000000000..08fd0f2df --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.5/15.5.5.2/15.5.5.5.2-1-1.js @@ -0,0 +1,42 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+/*
+15.5.5.2 defines [[GetOwnProperty]] for Strings. It supports using indexing
+notation to look up non numeric property names.
+*/
+
+
+ES5Harness.registerTest( {
+id: "15.5.5.5.2-1-1",
+
+path: "TestCases/chapter15/15.5/15.5.5/15.5.5.2/15.5.5.5.2-1-1.js",
+
+description: "String object supports bracket notation to lookup of data properties",
+
+test: function testcase() {
+ var s = new String("hello world");
+ s.foo = 1;
+
+ if (s["foo"] === 1) {
+ return true;
+ }
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.5/15.5.5.2/15.5.5.5.2-1-2.js b/test/suite/ietestcenter/chapter15/15.5/15.5.5/15.5.5.2/15.5.5.5.2-1-2.js new file mode 100644 index 000000000..5acbdd9b3 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.5/15.5.5.2/15.5.5.5.2-1-2.js @@ -0,0 +1,41 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+/*
+15.5.5.2 defines [[GetOwnProperty]] for Strings. It supports using indexing
+notation to look up non numeric property names.
+*/
+
+
+ES5Harness.registerTest( {
+id: "15.5.5.5.2-1-2",
+
+path: "TestCases/chapter15/15.5/15.5.5/15.5.5.2/15.5.5.5.2-1-2.js",
+
+description: "String value supports bracket notation to lookup data properties",
+
+test: function testcase() {
+ var s = String("hello world");
+
+ if (s["foo"] === undefined) {
+ return true;
+ }
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.5/15.5.5.2/15.5.5.5.2-3-1.js b/test/suite/ietestcenter/chapter15/15.5/15.5.5/15.5.5.2/15.5.5.5.2-3-1.js new file mode 100644 index 000000000..024fbe5aa --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.5/15.5.5.2/15.5.5.5.2-3-1.js @@ -0,0 +1,41 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+/*
+15.5.5.2 defines [[GetOwnProperty]] for Strings. It supports using indexing
+notation to look up non numeric property names.
+*/
+
+
+ES5Harness.registerTest( {
+id: "15.5.5.5.2-3-1",
+
+path: "TestCases/chapter15/15.5/15.5.5/15.5.5.2/15.5.5.5.2-3-1.js",
+
+description: "String object indexing returns undefined for missing data properties",
+
+test: function testcase() {
+ var s = new String("hello world");
+
+ if (s["foo"] === undefined) {
+ return true;
+ }
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.5/15.5.5.2/15.5.5.5.2-3-2.js b/test/suite/ietestcenter/chapter15/15.5/15.5.5/15.5.5.2/15.5.5.5.2-3-2.js new file mode 100644 index 000000000..e522fb460 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.5/15.5.5.2/15.5.5.5.2-3-2.js @@ -0,0 +1,41 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+/*
+15.5.5.2 defines [[GetOwnProperty]] for Strings. It supports using indexing
+notation to look up non numeric property names.
+*/
+
+
+ES5Harness.registerTest( {
+id: "15.5.5.5.2-3-2",
+
+path: "TestCases/chapter15/15.5/15.5.5/15.5.5.2/15.5.5.5.2-3-2.js",
+
+description: "String value indexing returns undefined for missing data properties",
+
+test: function testcase() {
+ var s = String("hello world");
+
+ if (s["foo"] === undefined) {
+ return true;
+ }
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.5/15.5.5.2/15.5.5.5.2-3-3.js b/test/suite/ietestcenter/chapter15/15.5/15.5.5/15.5.5.2/15.5.5.5.2-3-3.js new file mode 100644 index 000000000..49226ade9 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.5/15.5.5.2/15.5.5.5.2-3-3.js @@ -0,0 +1,41 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+/*
+15.5.5.2 defines [[GetOwnProperty]] for Strings. It supports using indexing
+notation to look up non numeric property names.
+*/
+
+
+ES5Harness.registerTest( {
+id: "15.5.5.5.2-3-3",
+
+path: "TestCases/chapter15/15.5/15.5.5/15.5.5.2/15.5.5.5.2-3-3.js",
+
+description: "String object indexing returns undefined if the numeric index (NaN) is not an array index",
+
+test: function testcase() {
+ var s = new String("hello world");
+
+ if (s[NaN] === undefined) {
+ return true;
+ }
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.5/15.5.5.2/15.5.5.5.2-3-4.js b/test/suite/ietestcenter/chapter15/15.5/15.5.5/15.5.5.2/15.5.5.5.2-3-4.js new file mode 100644 index 000000000..914dfedd7 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.5/15.5.5.2/15.5.5.5.2-3-4.js @@ -0,0 +1,41 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+/*
+15.5.5.2 defines [[GetOwnProperty]] for Strings. It supports using indexing
+notation to look up non numeric property names.
+*/
+
+
+ES5Harness.registerTest( {
+id: "15.5.5.5.2-3-4",
+
+path: "TestCases/chapter15/15.5/15.5.5/15.5.5.2/15.5.5.5.2-3-4.js",
+
+description: "String object indexing returns undefined if the numeric index (Infinity) is not an array index",
+
+test: function testcase() {
+ var s = new String("hello world");
+
+ if (s[Infinity] === undefined) {
+ return true;
+ }
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.5/15.5.5.2/15.5.5.5.2-3-5.js b/test/suite/ietestcenter/chapter15/15.5/15.5.5/15.5.5.2/15.5.5.5.2-3-5.js new file mode 100644 index 000000000..b163393e5 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.5/15.5.5.2/15.5.5.5.2-3-5.js @@ -0,0 +1,41 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+/*
+15.5.5.2 defines [[GetOwnProperty]] for Strings. It supports using indexing
+notation to look up non numeric property names.
+*/
+
+
+ES5Harness.registerTest( {
+id: "15.5.5.5.2-3-5",
+
+path: "TestCases/chapter15/15.5/15.5.5/15.5.5.2/15.5.5.5.2-3-5.js",
+
+description: "String object indexing returns undefined if the numeric index ( 2^32-1) is not an array index",
+
+test: function testcase() {
+ var s = new String("hello world");
+
+ if (s[Math.pow(2, 32)-1]===undefined) {
+ return true;
+ }
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.5/15.5.5.2/15.5.5.5.2-3-6.js b/test/suite/ietestcenter/chapter15/15.5/15.5.5/15.5.5.2/15.5.5.5.2-3-6.js new file mode 100644 index 000000000..2f689e73a --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.5/15.5.5.2/15.5.5.5.2-3-6.js @@ -0,0 +1,41 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+/*
+15.5.5.2 defines [[GetOwnProperty]] for Strings. It supports using indexing
+notation to look up non numeric property names.
+*/
+
+
+ES5Harness.registerTest( {
+id: "15.5.5.5.2-3-6",
+
+path: "TestCases/chapter15/15.5/15.5.5/15.5.5.2/15.5.5.5.2-3-6.js",
+
+description: "String value indexing returns undefined if the numeric index (NaN) is not an array index",
+
+test: function testcase() {
+ var s = String("hello world");
+
+ if (s[NaN] === undefined) {
+ return true;
+ }
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.5/15.5.5.2/15.5.5.5.2-3-7.js b/test/suite/ietestcenter/chapter15/15.5/15.5.5/15.5.5.2/15.5.5.5.2-3-7.js new file mode 100644 index 000000000..840878f78 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.5/15.5.5.2/15.5.5.5.2-3-7.js @@ -0,0 +1,41 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+/*
+15.5.5.2 defines [[GetOwnProperty]] for Strings. It supports using indexing
+notation to look up non numeric property names.
+*/
+
+
+ES5Harness.registerTest( {
+id: "15.5.5.5.2-3-7",
+
+path: "TestCases/chapter15/15.5/15.5.5/15.5.5.2/15.5.5.5.2-3-7.js",
+
+description: "String value indexing returns undefined if the numeric index (Infinity) is not an array index",
+
+test: function testcase() {
+ var s = String("hello world");
+
+ if (s[Infinity] === undefined) {
+ return true;
+ }
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.5/15.5.5.2/15.5.5.5.2-3-8.js b/test/suite/ietestcenter/chapter15/15.5/15.5.5/15.5.5.2/15.5.5.5.2-3-8.js new file mode 100644 index 000000000..877c20be2 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.5/15.5.5.2/15.5.5.5.2-3-8.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.
+
+/*
+15.5.5.2 defines [[GetOwnProperty]] for Strings. It supports using indexing
+notation to look up non numeric property names.
+*/
+
+
+ES5Harness.registerTest( {
+id: "15.5.5.5.2-3-8",
+
+path: "TestCases/chapter15/15.5/15.5.5/15.5.5.2/15.5.5.5.2-3-8.js",
+
+description: "String value indexing returns undefined if the numeric index ( >= 2^32-1) is not an array index",
+
+test: function testcase() {
+ var s = String("hello world");
+
+ if (s[Math.pow(2, 32)-1]===undefined) {
+ return true;
+ }
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.5/15.5.5.2/15.5.5.5.2-7-1.js b/test/suite/ietestcenter/chapter15/15.5/15.5.5/15.5.5.2/15.5.5.5.2-7-1.js new file mode 100644 index 000000000..fb74434b4 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.5/15.5.5.2/15.5.5.5.2-7-1.js @@ -0,0 +1,41 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+/*
+15.5.5.2 defines [[GetOwnProperty]] for Strings. It supports using indexing
+notation to look up non numeric property names.
+*/
+
+
+ES5Harness.registerTest( {
+id: "15.5.5.5.2-7-1",
+
+path: "TestCases/chapter15/15.5/15.5.5/15.5.5.2/15.5.5.5.2-7-1.js",
+
+description: "String object indexing returns undefined if the numeric index is less than 0",
+
+test: function testcase() {
+ var s = new String("hello world");
+
+ if (s[-1] === undefined) {
+ return true;
+ }
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.5/15.5.5.2/15.5.5.5.2-7-2.js b/test/suite/ietestcenter/chapter15/15.5/15.5.5/15.5.5.2/15.5.5.5.2-7-2.js new file mode 100644 index 000000000..f5be90e18 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.5/15.5.5.2/15.5.5.5.2-7-2.js @@ -0,0 +1,41 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+/*
+15.5.5.2 defines [[GetOwnProperty]] for Strings. It supports using indexing
+notation to look up non numeric property names.
+*/
+
+
+ES5Harness.registerTest( {
+id: "15.5.5.5.2-7-2",
+
+path: "TestCases/chapter15/15.5/15.5.5/15.5.5.2/15.5.5.5.2-7-2.js",
+
+description: "String value indexing returns undefined if the numeric index is less than 0",
+
+test: function testcase() {
+ var s = String("hello world");
+
+ if (s[-1] === undefined) {
+ return true;
+ }
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.5/15.5.5.2/15.5.5.5.2-7-3.js b/test/suite/ietestcenter/chapter15/15.5/15.5.5/15.5.5.2/15.5.5.5.2-7-3.js new file mode 100644 index 000000000..70459add4 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.5/15.5.5.2/15.5.5.5.2-7-3.js @@ -0,0 +1,41 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+/*
+15.5.5.2 defines [[GetOwnProperty]] for Strings. It supports using indexing
+notation to look up non numeric property names.
+*/
+
+
+ES5Harness.registerTest( {
+id: "15.5.5.5.2-7-3",
+
+path: "TestCases/chapter15/15.5/15.5.5/15.5.5.2/15.5.5.5.2-7-3.js",
+
+description: "String object indexing returns undefined if the numeric index is greater than the string length",
+
+test: function testcase() {
+ var s = new String("hello world");
+
+ if (s[11] === undefined) {
+ return true;
+ }
+ }
+});
diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.5/15.5.5.2/15.5.5.5.2-7-4.js b/test/suite/ietestcenter/chapter15/15.5/15.5.5/15.5.5.2/15.5.5.5.2-7-4.js new file mode 100644 index 000000000..fe76f25e5 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.5/15.5.5.2/15.5.5.5.2-7-4.js @@ -0,0 +1,41 @@ +/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+/*
+15.5.5.2 defines [[GetOwnProperty]] for Strings. It supports using indexing
+notation to look up non numeric property names.
+*/
+
+
+ES5Harness.registerTest( {
+id: "15.5.5.5.2-7-4",
+
+path: "TestCases/chapter15/15.5/15.5.5/15.5.5.2/15.5.5.5.2-7-4.js",
+
+description: "String value indexing returns undefined if the numeric index is greater than the string length",
+
+test: function testcase() {
+ var s = String("hello world");
+
+ if (s[11] === undefined) {
+ return true;
+ }
+ }
+});
|