diff options
Diffstat (limited to 'js/src/tests/test262/built-ins/String/prototype/trim')
131 files changed, 1836 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-0-1.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-0-1.js new file mode 100644 index 0000000000..8356c795a6 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-0-1.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-0-1 +description: String.prototype.trim must exist as a function +---*/ + +var f = String.prototype.trim; + +assert.sameValue(typeof(f), "function", 'typeof(f)'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-0-2.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-0-2.js new file mode 100644 index 0000000000..79a711dae3 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-0-2.js @@ -0,0 +1,11 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-0-2 +description: String.prototype.trim must exist as a function taking 0 parameters +---*/ + +assert.sameValue(String.prototype.trim.length, 0, 'String.prototype.trim.length'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-1-1.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-1-1.js new file mode 100644 index 0000000000..a269a8c051 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-1-1.js @@ -0,0 +1,14 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-1-1 +description: String.prototype.trim throws TypeError when string is undefined +---*/ + + +assert.throws(TypeError, function() { + String.prototype.trim.call(undefined); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-1-2.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-1-2.js new file mode 100644 index 0000000000..9401c3c35d --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-1-2.js @@ -0,0 +1,14 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-1-2 +description: String.prototype.trim throws TypeError when string is null +---*/ + + +assert.throws(TypeError, function() { + String.prototype.trim.call(null); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-1-3.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-1-3.js new file mode 100644 index 0000000000..e08c9a6c61 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-1-3.js @@ -0,0 +1,11 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-1-3 +description: String.prototype.trim works for primitive type boolean +---*/ + +assert.sameValue(String.prototype.trim.call(true), "true", 'String.prototype.trim.call(true)'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-1-4.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-1-4.js new file mode 100644 index 0000000000..e19bb4eb48 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-1-4.js @@ -0,0 +1,11 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-1-4 +description: String.prototype.trim works for primitive type number +---*/ + +assert.sameValue(String.prototype.trim.call(0), "0", 'String.prototype.trim.call(0)'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-1-5.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-1-5.js new file mode 100644 index 0000000000..bace97dc52 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-1-5.js @@ -0,0 +1,11 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-1-5 +description: String.prototype.trim works for an Object +---*/ + +assert.sameValue(String.prototype.trim.call({}), "[object Object]", 'String.prototype.trim.call({})'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-1-6.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-1-6.js new file mode 100644 index 0000000000..8332f891bb --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-1-6.js @@ -0,0 +1,11 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-1-6 +description: String.prototype.trim works for an String +---*/ + +assert.sameValue(String.prototype.trim.call(new String()), "", 'String.prototype.trim.call(new String())'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-1-7.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-1-7.js new file mode 100644 index 0000000000..a19bcb489c --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-1-7.js @@ -0,0 +1,11 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-1-7 +description: String.prototype.trim works for a primitive string +---*/ + +assert.sameValue(String.prototype.trim.call("abc"), "abc", 'String.prototype.trim.call("abc")'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-1-8.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-1-8.js new file mode 100644 index 0000000000..0db004bc69 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-1-8.js @@ -0,0 +1,16 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-1-8 +description: > + String.prototype.trim works for a primitive string (value is ' + abc') +---*/ + +var strObj = String(" abc"); + +assert.sameValue(strObj.trim(), "abc", 'strObj.trim()'); +assert.sameValue(strObj.toString(), " abc", 'strObj.toString()'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-1-9.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-1-9.js new file mode 100644 index 0000000000..97e767d831 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-1-9.js @@ -0,0 +1,15 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-1-9 +description: > + String.prototype.trim works for a String object which value is + undefined +---*/ + +var strObj = new String(undefined); + +assert.sameValue(strObj.trim(), "undefined", 'strObj.trim()'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-1.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-1.js new file mode 100644 index 0000000000..64777d2f6c --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-1.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-2-1 +description: > + String.prototype.trim - argument 'this' is a boolean whose value + is false +---*/ + +assert.sameValue(String.prototype.trim.call(false), "false", 'String.prototype.trim.call(false)'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-10.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-10.js new file mode 100644 index 0000000000..3a5a2abfe8 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-10.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-2-10 +description: > + String.prototype.trim - argument 'this' is a number that converts + to a string (value is +Infinity) +---*/ + +assert.sameValue(String.prototype.trim.call(+Infinity), "Infinity", 'String.prototype.trim.call(+Infinity)'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-11.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-11.js new file mode 100644 index 0000000000..a9811bc1d4 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-11.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-2-11 +description: > + String.prototype.trim - argument 'this' is a number that converts + to a string (value is -Infinity) +---*/ + +assert.sameValue(String.prototype.trim.call(-Infinity), "-Infinity", 'String.prototype.trim.call(-Infinity)'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-12.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-12.js new file mode 100644 index 0000000000..ee58574fd2 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-12.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-2-12 +description: > + String.prototype.trim - argument 'this' is a number that converts + to a string (value is 1(following 20 zeros)) +---*/ + +assert.sameValue(String.prototype.trim.call(100000000000000000000), "100000000000000000000", 'String.prototype.trim.call(100000000000000000000)'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-13.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-13.js new file mode 100644 index 0000000000..0eb7e26e30 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-13.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-2-13 +description: > + String.prototype.trim - argument 'this' is a number that converts + to a string (value is 1(following 21 zeros)) +---*/ + +assert.sameValue(String.prototype.trim.call(1000000000000000000000), "1e+21", 'String.prototype.trim.call(1000000000000000000000)'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-14.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-14.js new file mode 100644 index 0000000000..5566838564 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-14.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-2-14 +description: > + String.prototype.trim - argument 'this' is a number that converts + to a string (value is 1(following 22 zeros)) +---*/ + +assert.sameValue(String.prototype.trim.call(10000000000000000000000), "1e+22", 'String.prototype.trim.call(10000000000000000000000)'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-15.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-15.js new file mode 100644 index 0000000000..0a4e50bfa7 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-15.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-2-15 +description: > + String.prototype.trim - argument 'this' is a number that converts + to a string (value is 1e+20) +---*/ + +assert.sameValue(String.prototype.trim.call(1e+20), "100000000000000000000", 'String.prototype.trim.call(1e+20)'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-16.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-16.js new file mode 100644 index 0000000000..cae3236cfb --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-16.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-2-16 +description: > + String.prototype.trim - argument 'this' is a number that converts + to string (value is 1e+21) +---*/ + +assert.sameValue(String.prototype.trim.call(1e+21), "1e+21", 'String.prototype.trim.call(1e+21)'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-17.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-17.js new file mode 100644 index 0000000000..7358155593 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-17.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-2-17 +description: > + String.prototype.trim - argument 'this' is a number that converts + to string (value is 1e+22) +---*/ + +assert.sameValue(String.prototype.trim.call(1e+22), "1e+22", 'String.prototype.trim.call(1e+22)'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-18.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-18.js new file mode 100644 index 0000000000..bf2ce163b1 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-18.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-2-18 +description: > + String.prototype.trim - argument 'this' is a number that converts + to a string (value is 0.000001) +---*/ + +assert.sameValue(String.prototype.trim.call(0.000001), "0.000001", 'String.prototype.trim.call(0.000001)'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-19.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-19.js new file mode 100644 index 0000000000..2017155aac --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-19.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-2-19 +description: > + String.prototype.trim - argument argument 'this' is a number that + converts to a string (value is 0.0000001) +---*/ + +assert.sameValue(String.prototype.trim.call(0.0000001), "1e-7", 'String.prototype.trim.call(0.0000001)'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-2.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-2.js new file mode 100644 index 0000000000..0cabe22e0c --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-2.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-2-2 +description: > + String.prototype.trim - argument 'this' is a boolean whose value + is true +---*/ + +assert.sameValue(String.prototype.trim.call(true), "true", 'String.prototype.trim.call(true)'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-20.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-20.js new file mode 100644 index 0000000000..30a21e6d38 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-20.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-2-20 +description: > + String.prototype.trim - argument 'this' is a number that converts + to a string (value is 0.00000001) +---*/ + +assert.sameValue(String.prototype.trim.call(0.00000001), "1e-8", 'String.prototype.trim.call(0.00000001)'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-21.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-21.js new file mode 100644 index 0000000000..73718c68a3 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-21.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-2-21 +description: > + String.prototype.trim - argument 'this' is a number that converts + to a string (value is 1e-7) +---*/ + +assert.sameValue(String.prototype.trim.call(1e-7), "1e-7", 'String.prototype.trim.call(1e-7)'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-22.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-22.js new file mode 100644 index 0000000000..dd0ae89b4f --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-22.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-2-22 +description: > + String.prototype.trim - argument 'this' is a number that converts + to a string (value is 1e-6) +---*/ + +assert.sameValue(String.prototype.trim.call(1e-6), "0.000001", 'String.prototype.trim.call(1e-6)'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-23.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-23.js new file mode 100644 index 0000000000..39b6168d30 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-23.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-2-23 +description: > + String.prototype.trim - argument 'this' is a number that converts + to a string (value is 1e-5) +---*/ + +assert.sameValue(String.prototype.trim.call(1e-5), "0.00001", 'String.prototype.trim.call(1e-5)'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-24.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-24.js new file mode 100644 index 0000000000..9f78f2a2ff --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-24.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-2-24 +description: > + String.prototype.trim - argument 'this' is an integer that + converts to a string (value is 123) +---*/ + +assert.sameValue(String.prototype.trim.call(123), "123", 'String.prototype.trim.call(123)'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-25.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-25.js new file mode 100644 index 0000000000..510465a130 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-25.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-2-25 +description: > + String.prototype.trim - argument 'this' is a decimal that converts + to a string (value is 123.456) +---*/ + +assert.sameValue(String.prototype.trim.call(123.456), "123.456", 'String.prototype.trim.call(123.456)'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-26.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-26.js new file mode 100644 index 0000000000..0260d57cc7 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-26.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-2-26 +description: > + String.prototype.trim - argument 'this' is a number that converts + to a string (value is 1(following 20 zeros).123) +---*/ + +assert.sameValue(String.prototype.trim.call(100000000000000000000.123), "100000000000000000000", 'String.prototype.trim.call(100000000000000000000.123)'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-27.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-27.js new file mode 100644 index 0000000000..812db57de4 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-27.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-2-27 +description: > + String.prototype.trim - argument 'this' is a number that converts + to a string (value is 123.1234567) +---*/ + +assert.sameValue(String.prototype.trim.call(123.1234567), "123.1234567", 'String.prototype.trim.call(123.1234567)'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-28.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-28.js new file mode 100644 index 0000000000..8c6c9c6566 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-28.js @@ -0,0 +1,11 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-2-28 +description: String.prototype.trim - argument 'this' is an empty string +---*/ + +assert.sameValue(String.prototype.trim.call(""), "", 'String.prototype.trim.call("")'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-29.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-29.js new file mode 100644 index 0000000000..3618258ef1 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-29.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-2-29 +description: > + String.prototype.trim - argument 'this' is a string(value is 'AB + \cd') +---*/ + +assert.sameValue(String.prototype.trim.call("AB\n\\cd"), "AB\n\\cd", 'String.prototype.trim.call("AB\n\\cd")'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-3.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-3.js new file mode 100644 index 0000000000..1b345ee9cb --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-3.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-2-3 +description: > + String.prototype.trim - argument 'this' is a number that converts + to a string (value is NaN) +---*/ + +assert.sameValue(String.prototype.trim.call(NaN), "NaN", 'String.prototype.trim.call(NaN)'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-30.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-30.js new file mode 100644 index 0000000000..84c8a964ad --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-30.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-2-30 +description: > + String.prototype.trim - argument 'this' is a string(value is + 'undefined') +---*/ + +assert.sameValue(String.prototype.trim.call("undefined"), "undefined", 'String.prototype.trim.call("undefined")'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-31.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-31.js new file mode 100644 index 0000000000..fded952e0c --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-31.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-2-31 +description: > + String.prototype.trim - argument 'this' is a string(value is + 'null') +---*/ + +assert.sameValue(String.prototype.trim.call("null"), "null", 'String.prototype.trim.call("null")'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-32.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-32.js new file mode 100644 index 0000000000..7d28522bc0 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-32.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-2-32 +description: > + String.prototype.trim - argument 'this' is a string(value is + '123#$%abc') +---*/ + +assert.sameValue(String.prototype.trim.call("123#$%abc"), "123#$%abc", 'String.prototype.trim.call("123#$%abc")'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-33.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-33.js new file mode 100644 index 0000000000..7bee4339ef --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-33.js @@ -0,0 +1,11 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-2-33 +description: String.prototype.trim - argument 'this' is a string(value is '1') +---*/ + +assert.sameValue(String.prototype.trim.call("1"), "1", 'String.prototype.trim.call("1")'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-34.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-34.js new file mode 100644 index 0000000000..8807b094f9 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-34.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-2-34 +description: > + String.prototype.trim - 'this' is an array that converts to a + string +---*/ + +assert.sameValue(String.prototype.trim.call([1]), '1', 'String.prototype.trim.call([1])'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-35.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-35.js new file mode 100644 index 0000000000..fc932b8ae5 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-35.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-2-35 +description: > + String.prototype.trim - 'this' is a String Object that converts to + a string +---*/ + +assert.sameValue(String.prototype.trim.call(new String("abc")), "abc", 'String.prototype.trim.call(new String("abc"))'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-36.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-36.js new file mode 100644 index 0000000000..641386bc94 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-36.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-2-36 +description: > + String.prototype.trim - 'this' is a Boolean Object that converts + to a string +---*/ + +assert.sameValue(String.prototype.trim.call(new Boolean(false)), "false", 'String.prototype.trim.call(new Boolean(false))'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-37.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-37.js new file mode 100644 index 0000000000..fa7814c61e --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-37.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-2-37 +description: > + String.prototype.trim - 'this' is a Number Object that converts to + a string +---*/ + +assert.sameValue(String.prototype.trim.call(new Number(123)), "123", 'String.prototype.trim.call(new Number(123))'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-38.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-38.js new file mode 100644 index 0000000000..20b065ffd8 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-38.js @@ -0,0 +1,19 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-2-38 +description: > + String.prototype.trim - 'this' is an object which has an own + toString method +---*/ + +var obj = { + toString: function() { + return "abc"; + } +}; + +assert.sameValue(String.prototype.trim.call(obj), "abc", 'String.prototype.trim.call(obj)'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-39.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-39.js new file mode 100644 index 0000000000..0b3cad4092 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-39.js @@ -0,0 +1,19 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-2-39 +description: > + String.prototype.trim - 'this' is an object which has an own + valueOf method +---*/ + +var obj = { + valueOf: function() { + return "abc"; + } +}; + +assert.sameValue(String.prototype.trim.call(obj), "[object Object]", 'String.prototype.trim.call(obj)'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-4.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-4.js new file mode 100644 index 0000000000..017891e177 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-4.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-2-4 +description: > + String.prototype.trim - argument 'this' is a number that converts + to a string (value is 0) +---*/ + +assert.sameValue(String.prototype.trim.call(0), "0", 'String.prototype.trim.call(0)'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-40.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-40.js new file mode 100644 index 0000000000..87e4daa935 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-40.js @@ -0,0 +1,29 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-2-40 +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 +---*/ + +var toStringAccessed = false; +var valueOfAccessed = false; +var obj = { + toString: function() { + toStringAccessed = true; + return {}; + }, + valueOf: function() { + valueOfAccessed = true; + return "abc"; + } +}; + +assert.sameValue(String.prototype.trim.call(obj), "abc", 'String.prototype.trim.call(obj)'); +assert(valueOfAccessed, 'valueOfAccessed !== true'); +assert(toStringAccessed, 'toStringAccessed !== true'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-41.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-41.js new file mode 100644 index 0000000000..cf30a3e129 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-41.js @@ -0,0 +1,28 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-2-41 +description: > + String.prototype.trim - 'this' is an object which has an own + toString and valueOf method. +---*/ + +var toStringAccessed = false; +var valueOfAccessed = false; +var obj = { + toString: function() { + toStringAccessed = true; + return "abc"; + }, + valueOf: function() { + valueOfAccessed = true; + return "cef"; + } +}; + +assert.sameValue(String.prototype.trim.call(obj), "abc", 'String.prototype.trim.call(obj)'); +assert.sameValue(valueOfAccessed, false, 'valueOfAccessed'); +assert(toStringAccessed, 'toStringAccessed !== true'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-42.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-42.js new file mode 100644 index 0000000000..fc63f81172 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-42.js @@ -0,0 +1,30 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-2-42 +description: > + String.prototype.trim - TypeError exception was thrown when + 'this' is an object that both toString and valueOf wouldn't return + primitive value. +---*/ + +var toStringAccessed = false; +var valueOfAccessed = false; +var obj = { + toString: function() { + toStringAccessed = true; + return {}; + }, + valueOf: function() { + valueOfAccessed = true; + return {}; + } +}; +assert.throws(TypeError, function() { + String.prototype.trim.call(obj); +}); +assert(valueOfAccessed, 'valueOfAccessed !== true'); +assert(toStringAccessed, 'toStringAccessed !== true'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-43.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-43.js new file mode 100644 index 0000000000..f579223fec --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-43.js @@ -0,0 +1,35 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-2-43 +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 +---*/ + +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"; +}; + +assert.sameValue(String.prototype.trim.call(child), "abc", 'String.prototype.trim.call(child)'); +assert(toStringAccessed, 'toStringAccessed !== true'); +assert.sameValue(valueOfAccessed, false, 'valueOfAccessed'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-44.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-44.js new file mode 100644 index 0000000000..5b9a41b105 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-44.js @@ -0,0 +1,15 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-2-44 +description: > + String.prototype.trim - 'this' is a string that contains east + Asian characters (value is 'SD咕噜') +---*/ + +var str = "SD咕噜"; + +assert.sameValue(str.trim(), str, 'str.trim()'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-45.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-45.js new file mode 100644 index 0000000000..de56d44a01 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-45.js @@ -0,0 +1,16 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-2-45 +description: > + String.prototype.trim - 'this' is a string that contains white + space, character, number, object and null characters +---*/ + +var str = "abc" + " " + 123 + " " + {} + " " + "\u0000"; +var str1 = " " + str + " "; + +assert.sameValue(str1.trim(), str, 'str1.trim()'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-46.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-46.js new file mode 100644 index 0000000000..9968dcf5da --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-46.js @@ -0,0 +1,17 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-2-46 +description: > + String.prototype.trim - 'this' is a Function Object that converts + to a string +---*/ + +var funObj = function() { + return arguments; +}; + +assert.sameValue(typeof(String.prototype.trim.call(funObj)), "string", 'typeof(String.prototype.trim.call(funObj))'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-47.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-47.js new file mode 100644 index 0000000000..10b4243db4 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-47.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-2-47 +description: > + String.prototype.trim - 'this' is a object Object that converts to + a string +---*/ + +assert.sameValue(String.prototype.trim.call({}), "[object Object]", 'String.prototype.trim.call({})'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-49.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-49.js new file mode 100644 index 0000000000..3da8e68673 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-49.js @@ -0,0 +1,15 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-2-49 +description: > + String.prototype.trim - 'this' is a RegExp Object that converts to + a string +---*/ + +var regObj = new RegExp(/test/); + +assert.sameValue(String.prototype.trim.call(regObj), "/test/", 'String.prototype.trim.call(regObj)'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-5.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-5.js new file mode 100644 index 0000000000..3f6168a04a --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-5.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-2-5 +description: > + String.prototype.trim - argument 'this' is a number that converts + to a string (value is +0) +---*/ + +assert.sameValue(String.prototype.trim.call(+0), "0", 'String.prototype.trim.call(+0)'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-50.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-50.js new file mode 100644 index 0000000000..5ad23d1bf5 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-50.js @@ -0,0 +1,15 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-2-50 +description: > + String.prototype.trim - 'this' is a Error Object that converts to + a string +---*/ + +var errObj = new Error("test"); + +assert.sameValue(String.prototype.trim.call(errObj), "Error: test", 'String.prototype.trim.call(errObj)'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-51.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-51.js new file mode 100644 index 0000000000..f1786b34de --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-51.js @@ -0,0 +1,17 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-2-51 +description: > + String.prototype.trim - 'this' is a Arguments Object that converts + to a string +---*/ + +var argObj = function() { + return arguments; +}(1, 2, true); + +assert.sameValue(String.prototype.trim.call(argObj), "[object Arguments]", 'String.prototype.trim.call(argObj)'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-6.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-6.js new file mode 100644 index 0000000000..6df39e44d0 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-6.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-2-6 +description: > + String.prototype.trim - argument 'this' is a number that converts + to a string (value is -0) +---*/ + +assert.sameValue(String.prototype.trim.call(-0), "0", 'String.prototype.trim.call(-0)'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-7.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-7.js new file mode 100644 index 0000000000..522738214a --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-7.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-2-7 +description: > + String.prototype.trim - argument 'this' is a number that converts + to a string (value is positive number) +---*/ + +assert.sameValue(String.prototype.trim.call(30), "30", 'String.prototype.trim.call(30)'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-8.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-8.js new file mode 100644 index 0000000000..4b07be308c --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-8.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-2-8 +description: > + String.prototype.trim - argument 'this' is a number that converts + to a string (value is negative number) +---*/ + +assert.sameValue(String.prototype.trim.call(-20), "-20", 'String.prototype.trim.call(-20)'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-9.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-9.js new file mode 100644 index 0000000000..7d9216a6f5 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-2-9.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-2-9 +description: > + String.prototype.trim - argument 'this' is a number that converts + to a string (value is Infinity) +---*/ + +assert.sameValue(String.prototype.trim.call(Infinity), "Infinity", 'String.prototype.trim.call(Infinity)'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-3-1.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-3-1.js new file mode 100644 index 0000000000..96b06c6b9f --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-3-1.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-3-1 +description: String.prototype.trim - 'S' is a string with all LineTerminator +---*/ + +var lineTerminatorsStr = "\u000A\u000D\u2028\u2029"; + +assert.sameValue(lineTerminatorsStr.trim(), "", 'lineTerminatorsStr.trim()'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-3-10.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-3-10.js new file mode 100644 index 0000000000..5970916ea4 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-3-10.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-3-10 +description: > + String.prototype.trim - 'S' is a string with null character + ('\u0000') +---*/ + +assert.sameValue("\u0000".trim(), "\u0000", '"\u0000".trim()'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-3-11.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-3-11.js new file mode 100644 index 0000000000..cf2050d7d0 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-3-11.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-3-11 +description: > + String.prototype.trim - 'S' is a string that starts with null + character +---*/ + +assert.sameValue("\0\u0000abc".trim(), "\0\u0000abc", '"\0\u0000abc".trim()'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-3-12.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-3-12.js new file mode 100644 index 0000000000..e878c14c5d --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-3-12.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-3-12 +description: > + String.prototype.trim - 'S' is a string that ends with null + character +---*/ + +assert.sameValue("abc\0\u0000".trim(), "abc\0\u0000", '"abc\0\u0000".trim()'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-3-13.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-3-13.js new file mode 100644 index 0000000000..73a64e0e4c --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-3-13.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-3-13 +description: > + String.prototype.trim - 'S' is a string that starts with null + character and ends with null character +---*/ + +assert.sameValue("\0\u0000abc\0\u0000".trim(), "\0\u0000abc\0\u0000", '"\0\u0000abc\0\u0000".trim()'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-3-14.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-3-14.js new file mode 100644 index 0000000000..220415d464 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-3-14.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-3-14 +description: > + String.prototype.trim - 'S' is a string that has null character in + the middle +---*/ + +assert.sameValue("a\0\u0000bc".trim(), "a\0\u0000bc", '"a\0\u0000bc".trim()'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-3-2.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-3-2.js new file mode 100644 index 0000000000..9181e9a575 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-3-2.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-3-2 +description: String.prototype.trim - 'S' is a string with all WhiteSpace +---*/ + +var whiteSpacesStr = "\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF"; + +assert.sameValue(whiteSpacesStr.trim(), "", 'whiteSpacesStr.trim()'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-3-3.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-3-3.js new file mode 100644 index 0000000000..bdcd6d317a --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-3-3.js @@ -0,0 +1,17 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-3-3 +description: > + String.prototype.trim - 'S' is a string with all union of + WhiteSpace and LineTerminator +---*/ + +var lineTerminatorsStr = "\u000A\u000D\u2028\u2029"; +var whiteSpacesStr = "\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF"; +var str = whiteSpacesStr + lineTerminatorsStr; + +assert.sameValue(str.trim(), "", 'str.trim()'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-3-4.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-3-4.js new file mode 100644 index 0000000000..429e6fce11 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-3-4.js @@ -0,0 +1,17 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-3-4 +description: > + String.prototype.trim - 'S' is a string start with union of all + LineTerminator and all WhiteSpace +---*/ + +var lineTerminatorsStr = "\u000A\u000D\u2028\u2029"; +var whiteSpacesStr = "\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF"; +var str = whiteSpacesStr + lineTerminatorsStr + "abc"; + +assert.sameValue(str.trim(), "abc", 'str.trim()'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-3-5.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-3-5.js new file mode 100644 index 0000000000..f917b2f2b7 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-3-5.js @@ -0,0 +1,17 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-3-5 +description: > + String.prototype.trim - 'S' is a string end with union of all + LineTerminator and all WhiteSpace +---*/ + +var lineTerminatorsStr = "\u000A\u000D\u2028\u2029"; +var whiteSpacesStr = "\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF"; +var str = "abc" + whiteSpacesStr + lineTerminatorsStr; + +assert.sameValue(str.trim(), "abc", 'str.trim()'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-3-6.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-3-6.js new file mode 100644 index 0000000000..5f0852d44b --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-3-6.js @@ -0,0 +1,18 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-3-6 +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 +---*/ + +var lineTerminatorsStr = "\u000A\u000D\u2028\u2029"; +var whiteSpacesStr = "\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF"; +var str = whiteSpacesStr + lineTerminatorsStr + "abc" + whiteSpacesStr + lineTerminatorsStr; + +assert.sameValue(str.trim(), "abc", 'str.trim()'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-3-7.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-3-7.js new file mode 100644 index 0000000000..f506b8f2ff --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-3-7.js @@ -0,0 +1,17 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-3-7 +description: > + String.prototype.trim - 'S' is a string that union of + LineTerminator and WhiteSpace in the middle +---*/ + +var lineTerminatorsStr = "\u000A\u000D\u2028\u2029"; +var whiteSpacesStr = "\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF"; +var str = "ab" + whiteSpacesStr + lineTerminatorsStr + "cd"; + +assert.sameValue(str.trim(), str, 'str.trim()'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-3-8.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-3-8.js new file mode 100644 index 0000000000..a715128193 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-3-8.js @@ -0,0 +1,11 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-3-8 +description: String.prototype.trim - 'S' is a string with all null character +---*/ + +assert.sameValue("\0\u0000".trim(), "\0\u0000", '"\0\u0000".trim()'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-3-9.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-3-9.js new file mode 100644 index 0000000000..b05f48d1bb --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-3-9.js @@ -0,0 +1,11 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-3-9 +description: String.prototype.trim - 'S' is a string with null character ('\0') +---*/ + +assert.sameValue("\0".trim(), "\0", '"\0".trim()'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-1.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-1.js new file mode 100644 index 0000000000..668a8a067a --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-1.js @@ -0,0 +1,18 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-4-1 +description: > + String.prototype.trim handles multiline string with whitepace and + lineterminators +---*/ + +var s = "\u0009a b\ +c \u0009" + + + +assert.sameValue(s.trim(), "a bc", 's.trim()'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-10.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-10.js new file mode 100644 index 0000000000..027aa59396 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-10.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-4-10 +description: > + String.prototype.trim handles whitepace and lineterminators + (\uFEFFabc) +---*/ + +assert.sameValue("\uFEFFabc".trim(), "abc", '"\uFEFFabc".trim()'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-11.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-11.js new file mode 100644 index 0000000000..c2f29c86bc --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-11.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-4-11 +description: > + String.prototype.trim handles whitepace and lineterminators + (abc\u0009) +---*/ + +assert.sameValue("abc\u0009".trim(), "abc", '"abc\u0009".trim()'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-12.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-12.js new file mode 100644 index 0000000000..e9ab5a6938 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-12.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-4-12 +description: > + String.prototype.trim handles whitepace and lineterminators + (abc\u000B) +---*/ + +assert.sameValue("abc\u000B".trim(), "abc", '"abc\u000B".trim()'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-13.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-13.js new file mode 100644 index 0000000000..f386d46fdf --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-13.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-4-13 +description: > + String.prototype.trim handles whitepace and lineterminators + (abc\u000C) +---*/ + +assert.sameValue("abc\u000C".trim(), "abc", '"abc\u000C".trim()'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-14.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-14.js new file mode 100644 index 0000000000..2844170718 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-14.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-4-14 +description: > + String.prototype.trim handles whitepace and lineterminators + (abc\u0020) +---*/ + +assert.sameValue("abc\u0020".trim(), "abc", '"abc\u0020".trim()'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-16.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-16.js new file mode 100644 index 0000000000..79d9e91c92 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-16.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-4-16 +description: > + String.prototype.trim handles whitepace and lineterminators + (abc\u00A0) +---*/ + +assert.sameValue("abc\u00A0".trim(), "abc", '"abc\u00A0".trim()'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-18.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-18.js new file mode 100644 index 0000000000..92c21f5d75 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-18.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-4-18 +description: > + String.prototype.trim handles whitepace and lineterminators + (abc\uFEFF) +---*/ + +assert.sameValue("abc\uFEFF".trim(), "abc", '"abc\uFEFF".trim()'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-19.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-19.js new file mode 100644 index 0000000000..03dd00e641 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-19.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-4-19 +description: > + String.prototype.trim handles whitepace and lineterminators + (\u0009abc\u0009) +---*/ + +assert.sameValue("\u0009abc\u0009".trim(), "abc", '"\u0009abc\u0009".trim()'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-2.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-2.js new file mode 100644 index 0000000000..8015077a77 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-2.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-4-2 +description: > + String.prototype.trim handles whitepace and lineterminators ( + \u0009abc \u0009) +---*/ + +assert.sameValue(" \u0009abc \u0009".trim(), "abc", '" \u0009abc \u0009".trim()'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-20.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-20.js new file mode 100644 index 0000000000..9461d07d4f --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-20.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-4-20 +description: > + String.prototype.trim handles whitepace and lineterminators + (\u000Babc\u000B) +---*/ + +assert.sameValue("\u000Babc\u000B".trim(), "abc", '"\u000Babc\u000B".trim()'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-21.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-21.js new file mode 100644 index 0000000000..aee6aa7a50 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-21.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-4-21 +description: > + String.prototype.trim handles whitepace and lineterminators + (\u000Cabc\u000C) +---*/ + +assert.sameValue("\u000Cabc\u000C".trim(), "abc", '"\u000Cabc\u000C".trim()'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-22.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-22.js new file mode 100644 index 0000000000..40e1e968ae --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-22.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-4-22 +description: > + String.prototype.trim handles whitepace and lineterminators + (\u0020abc\u0020) +---*/ + +assert.sameValue("\u0020abc\u0020".trim(), "abc", '"\u0020abc\u0020".trim()'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-24.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-24.js new file mode 100644 index 0000000000..f750bdcc9d --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-24.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-4-24 +description: > + String.prototype.trim handles whitepace and lineterminators + (\u00A0abc\u00A0) +---*/ + +assert.sameValue("\u00A0abc\u00A0".trim(), "abc", '"\u00A0abc\u00A0".trim()'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-27.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-27.js new file mode 100644 index 0000000000..2f2d01333b --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-27.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-4-27 +description: > + String.prototype.trim handles whitepace and lineterminators + (\u0009\u0009) +---*/ + +assert.sameValue("\u0009\u0009".trim(), "", '"\u0009\u0009".trim()'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-28.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-28.js new file mode 100644 index 0000000000..0b6ad4bb65 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-28.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-4-28 +description: > + String.prototype.trim handles whitepace and lineterminators + (\u000B\u000B) +---*/ + +assert.sameValue("\u000B\u000B".trim(), "", '"\u000B\u000B".trim()'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-29.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-29.js new file mode 100644 index 0000000000..8931f72d35 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-29.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-4-29 +description: > + String.prototype.trim handles whitepace and lineterminators + (\u000C\u000C) +---*/ + +assert.sameValue("\u000C\u000C".trim(), "", '"\u000C\u000C".trim()'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-3.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-3.js new file mode 100644 index 0000000000..9bf4d59664 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-3.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-4-3 +description: > + String.prototype.trim handles whitepace and lineterminators + (\u0009abc) +---*/ + +assert.sameValue("\u0009abc".trim(), "abc", '"\u0009abc".trim()'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-30.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-30.js new file mode 100644 index 0000000000..19edd41756 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-30.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-4-30 +description: > + String.prototype.trim handles whitepace and lineterminators + (\u0020\u0020) +---*/ + +assert.sameValue("\u0020\u0020".trim(), "", '"\u0020\u0020".trim()'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-32.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-32.js new file mode 100644 index 0000000000..655e95d819 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-32.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-4-32 +description: > + String.prototype.trim handles whitepace and lineterminators + (\u00A0\u00A0) +---*/ + +assert.sameValue("\u00A0\u00A0".trim(), "", '"\u00A0\u00A0".trim()'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-34.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-34.js new file mode 100644 index 0000000000..4b6e1ec258 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-34.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-4-34 +description: > + String.prototype.trim handles whitepace and lineterminators + (\uFEFF\uFEFF) +---*/ + +assert.sameValue("\uFEFF\uFEFF".trim(), "", '"\uFEFF\uFEFF".trim()'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-35.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-35.js new file mode 100644 index 0000000000..c5c3b7dd75 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-35.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-4-35 +description: > + String.prototype.trim handles whitepace and lineterminators + (ab\u0009c) +---*/ + +assert.sameValue("ab\u0009c".trim(), "ab\u0009c", '"ab\u0009c".trim()'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-36.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-36.js new file mode 100644 index 0000000000..7fdc2f9185 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-36.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-4-36 +description: > + String.prototype.trim handles whitepace and lineterminators + (ab\u000Bc) +---*/ + +assert.sameValue("ab\u000Bc".trim(), "ab\u000Bc", '"ab\u000Bc".trim()'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-37.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-37.js new file mode 100644 index 0000000000..dbee1c80e5 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-37.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-4-37 +description: > + String.prototype.trim handles whitepace and lineterminators + (ab\u000Cc) +---*/ + +assert.sameValue("ab\u000Cc".trim(), "ab\u000Cc", '"ab\u000Cc".trim()'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-38.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-38.js new file mode 100644 index 0000000000..d0bf8d1f16 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-38.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-4-38 +description: > + String.prototype.trim handles whitepace and lineterminators + (ab\u0020c) +---*/ + +assert.sameValue("ab\u0020c".trim(), "ab\u0020c", '"ab\u0020c".trim()'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-39.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-39.js new file mode 100644 index 0000000000..c5942adbd6 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-39.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-4-39 +description: > + String.prototype.trim handles whitepace and lineterminators + (ab\u0085c) +---*/ + +assert.sameValue("ab\u0085c".trim(), "ab\u0085c", '"ab\u0085c".trim()'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-4.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-4.js new file mode 100644 index 0000000000..b835eb401d --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-4.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-4-4 +description: > + String.prototype.trim handles whitepace and lineterminators + (\u000Babc) +---*/ + +assert.sameValue("\u000Babc".trim(), "abc", '"\u000Babc".trim()'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-40.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-40.js new file mode 100644 index 0000000000..12b8e7a386 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-40.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-4-40 +description: > + String.prototype.trim handles whitepace and lineterminators + (ab\u00A0c) +---*/ + +assert.sameValue("ab\u00A0c".trim(), "ab\u00A0c", '"ab\u00A0c".trim()'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-41.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-41.js new file mode 100644 index 0000000000..a94ad1fe0a --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-41.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-4-41 +description: > + String.prototype.trim handles whitepace and lineterminators + (ab\u200Bc) +---*/ + +assert.sameValue("ab\u200Bc".trim(), "ab\u200Bc", '"ab\u200Bc".trim()'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-42.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-42.js new file mode 100644 index 0000000000..9bbfeb1c18 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-42.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-4-42 +description: > + String.prototype.trim handles whitepace and lineterminators + (ab\uFEFFc) +---*/ + +assert.sameValue("ab\uFEFFc".trim(), "ab\uFEFFc", '"ab\uFEFFc".trim()'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-43.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-43.js new file mode 100644 index 0000000000..76c84b1026 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-43.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-4-43 +description: > + String.prototype.trim handles whitepace and lineterminators + (\u000Aabc) +---*/ + +assert.sameValue("\u000Aabc".trim(), "abc", '"\u000Aabc".trim()'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-44.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-44.js new file mode 100644 index 0000000000..9de5946f88 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-44.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-4-44 +description: > + String.prototype.trim handles whitepace and lineterminators + (\u000Dabc) +---*/ + +assert.sameValue("\u000Dabc".trim(), "abc", '"\u000Dabc".trim()'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-45.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-45.js new file mode 100644 index 0000000000..5a6a71d014 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-45.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-4-45 +description: > + String.prototype.trim handles whitepace and lineterminators + (\u2028abc) +---*/ + +assert.sameValue("\u2028abc".trim(), "abc", '"\u2028abc".trim()'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-46.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-46.js new file mode 100644 index 0000000000..3f7e429639 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-46.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-4-46 +description: > + String.prototype.trim handles whitepace and lineterminators + (\u2029abc) +---*/ + +assert.sameValue("\u2029abc".trim(), "abc", '"\u2029abc".trim()'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-47.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-47.js new file mode 100644 index 0000000000..ac61dd81a3 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-47.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-4-47 +description: > + String.prototype.trim handles whitepace and lineterminators + (abc\u000A) +---*/ + +assert.sameValue("abc\u000A".trim(), "abc", '"abc\u000A".trim()'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-48.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-48.js new file mode 100644 index 0000000000..ea0524f95c --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-48.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-4-48 +description: > + String.prototype.trim handles whitepace and lineterminators + (abc\u000D) +---*/ + +assert.sameValue("abc\u000D".trim(), "abc", '"abc\u000D".trim()'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-49.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-49.js new file mode 100644 index 0000000000..cfacd63b85 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-49.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-4-49 +description: > + String.prototype.trim handles whitepace and lineterminators + (abc\u2028) +---*/ + +assert.sameValue("abc\u2028".trim(), "abc", '"abc\u2028".trim()'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-5.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-5.js new file mode 100644 index 0000000000..6c349986d2 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-5.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-4-5 +description: > + String.prototype.trim handles whitepace and lineterminators + (\u000Cabc) +---*/ + +assert.sameValue("\u000Cabc".trim(), "abc", '"\u000Cabc".trim()'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-50.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-50.js new file mode 100644 index 0000000000..395c2e7f75 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-50.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-4-50 +description: > + String.prototype.trim handles whitepace and lineterminators + (abc\u2029) +---*/ + +assert.sameValue("abc\u2029".trim(), "abc", '"abc\u2029".trim()'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-51.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-51.js new file mode 100644 index 0000000000..e9af0ed887 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-51.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-4-51 +description: > + String.prototype.trim handles whitepace and lineterminators + (\u000Aabc\u000A) +---*/ + +assert.sameValue("\u000Aabc\u000A".trim(), "abc", '"\u000Aabc\u000A".trim()'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-52.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-52.js new file mode 100644 index 0000000000..ab0db3c2e5 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-52.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-4-52 +description: > + String.prototype.trim handles whitepace and lineterminators + (\u000Dabc\u000D) +---*/ + +assert.sameValue("\u000Dabc\u000D".trim(), "abc", '"\u000Dabc\u000D".trim()'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-53.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-53.js new file mode 100644 index 0000000000..45eef4e3e1 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-53.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-4-53 +description: > + String.prototype.trim handles whitepace and lineterminators + (\u2028abc\u2028) +---*/ + +assert.sameValue("\u2028abc\u2028".trim(), "abc", '"\u2028abc\u2028".trim()'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-54.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-54.js new file mode 100644 index 0000000000..ac47638692 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-54.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-4-54 +description: > + String.prototype.trim handles whitepace and lineterminators + (\u2029abc\u2029) +---*/ + +assert.sameValue("\u2029abc\u2029".trim(), "abc", '"\u2029abc\u2029".trim()'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-55.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-55.js new file mode 100644 index 0000000000..6e128e63de --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-55.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-4-55 +description: > + String.prototype.trim handles whitepace and lineterminators + (\u000A\u000A) +---*/ + +assert.sameValue("\u000A\u000A".trim(), "", '"\u000A\u000A".trim()'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-56.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-56.js new file mode 100644 index 0000000000..b4295f8d1b --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-56.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-4-56 +description: > + String.prototype.trim handles whitepace and lineterminators + (\u000D\u000D) +---*/ + +assert.sameValue("\u000D\u000D".trim(), "", '"\u000D\u000D".trim()'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-57.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-57.js new file mode 100644 index 0000000000..9da86804f1 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-57.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-4-57 +description: > + String.prototype.trim handles whitepace and lineterminators + (\u2028\u2028) +---*/ + +assert.sameValue("\u2028\u2028".trim(), "", '"\u2028\u2028".trim()'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-58.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-58.js new file mode 100644 index 0000000000..3e89d9d961 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-58.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-4-58 +description: > + String.prototype.trim handles whitepace and lineterminators + (\u2029\u2029) +---*/ + +assert.sameValue("\u2029\u2029".trim(), "", '"\u2029\u2029".trim()'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-59.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-59.js new file mode 100644 index 0000000000..b308590072 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-59.js @@ -0,0 +1,16 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-4-59 +description: > + String.prototype.trim handles whitepace and lineterminators + (\u2029abc as a multiline string) +---*/ + +var s = "\u2029\ + abc"; + +assert.sameValue(s.trim(), "abc", 's.trim()'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-6.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-6.js new file mode 100644 index 0000000000..19574a6ba8 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-6.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-4-6 +description: > + String.prototype.trim handles whitepace and lineterminators + (\u0020abc) +---*/ + +assert.sameValue("\u0020abc".trim(), "abc", '"\u0020abc".trim()'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-60.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-60.js new file mode 100644 index 0000000000..836b10967c --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-60.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-4-60 +description: > + String.prototype.trim handles whitepace and lineterminators + (string with just blanks) +---*/ + +assert.sameValue(" ".trim(), "", '" ".trim()'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-8.js b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-8.js new file mode 100644 index 0000000000..968ae6290e --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/15.5.4.20-4-8.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.5.4.20-4-8 +description: > + String.prototype.trim handles whitepace and lineterminators + (\u00A0abc) +---*/ + +assert.sameValue("\u00A0abc".trim(), "abc", '"\u00A0abc".trim()'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/browser.js b/js/src/tests/test262/built-ins/String/prototype/trim/browser.js new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/browser.js diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/name.js b/js/src/tests/test262/built-ins/String/prototype/trim/name.js new file mode 100644 index 0000000000..3f983c303c --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/name.js @@ -0,0 +1,28 @@ +// Copyright (C) 2015 AndrĂ© Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 21.1.3.25 +description: > + String.prototype.trim.name is "trim". +info: | + String.prototype.trim ( ) + + 17 ECMAScript Standard Built-in Objects: + Every built-in Function object, including constructors, that is not + identified as an anonymous function has a name property whose value + is a String. + + Unless otherwise specified, the name property of a built-in Function + object, if it exists, has the attributes { [[Writable]]: false, + [[Enumerable]]: false, [[Configurable]]: true }. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(String.prototype.trim.name, "trim"); + +verifyNotEnumerable(String.prototype.trim, "name"); +verifyNotWritable(String.prototype.trim, "name"); +verifyConfigurable(String.prototype.trim, "name"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/not-a-constructor.js b/js/src/tests/test262/built-ins/String/prototype/trim/not-a-constructor.js new file mode 100644 index 0000000000..20118ff8fc --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/not-a-constructor.js @@ -0,0 +1,35 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + String.prototype.trim does not implement [[Construct]], is not new-able +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. + + sec-evaluatenew + + ... + 7. If IsConstructor(constructor) is false, throw a TypeError exception. + ... +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(String.prototype.trim), + false, + 'isConstructor(String.prototype.trim) must return false' +); + +assert.throws(TypeError, () => { + new String.prototype.trim(); +}, '`new String.prototype.trim()` throws TypeError'); + + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/shell.js b/js/src/tests/test262/built-ins/String/prototype/trim/shell.js new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/shell.js diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/u180e.js b/js/src/tests/test262/built-ins/String/prototype/trim/u180e.js new file mode 100644 index 0000000000..8b26b5cbbd --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/trim/u180e.js @@ -0,0 +1,20 @@ +// Copyright (C) 2016 Mathias Bynens. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-white-space +description: > + U+180E is no longer a Unicode `Space_Separator` symbol as of Unicode v6.3.0. +info: | + String.prototype.trim ( ) + + 3. [...] The definition of white space is the union of |WhiteSpace| and + |LineTerminator|. +features: [u180e] +---*/ + +assert.sameValue("_\u180E".trim(), "_\u180E"); +assert.sameValue("\u180E".trim(), "\u180E"); +assert.sameValue("\u180E_".trim(), "\u180E_"); + +reportCompare(0, 0); |