diff --git a/test/built-ins/String/prototype/trimEnd/this-value-boolean.js b/test/built-ins/String/prototype/trimEnd/this-value-boolean.js new file mode 100644 index 0000000000000000000000000000000000000000..1a695e3b97476e8398e14c706335bc10d62a7cd7 --- /dev/null +++ b/test/built-ins/String/prototype/trimEnd/this-value-boolean.js @@ -0,0 +1,21 @@ +// Copyright (c) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: pending +description: Behavoir when "this" value is a boolean. +---*/ + +var trimStart = String.prototype.trimStart + +assert.sameValue( + trimStart.call(true), + 'true', + 'String.prototype.trimStart.call(true)' +); + +assert.sameValue( + String.prototype.trimStart.call(false), + 'false', + 'String.prototype.trimStart.call(false)' +); diff --git a/test/built-ins/String/prototype/trimEnd/this-value-symbol-typeerror.js b/test/built-ins/String/prototype/trimEnd/this-value-symbol-typeerror.js new file mode 100644 index 0000000000000000000000000000000000000000..e9f32fb76b9b775948fea96136d2e39108649777 --- /dev/null +++ b/test/built-ins/String/prototype/trimEnd/this-value-symbol-typeerror.js @@ -0,0 +1,21 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: pending +description: Type error when "this" value is a Symbol +info: | + TrimString + 2. Let S be ? ToString(str). + + ToString + Argument Type: Symbol + Result: Throw a TypeError exception +---*/ + +var trimEnd = String.prototype.trimEnd; +var symbol = Symbol() + +assert.throws(TypeError, function() { + trimEnd.call(symbol); +}, 'Symbol()'); diff --git a/test/built-ins/String/prototype/trimStart/this-value-boolean.js b/test/built-ins/String/prototype/trimStart/this-value-boolean.js new file mode 100644 index 0000000000000000000000000000000000000000..1a695e3b97476e8398e14c706335bc10d62a7cd7 --- /dev/null +++ b/test/built-ins/String/prototype/trimStart/this-value-boolean.js @@ -0,0 +1,21 @@ +// Copyright (c) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: pending +description: Behavoir when "this" value is a boolean. +---*/ + +var trimStart = String.prototype.trimStart + +assert.sameValue( + trimStart.call(true), + 'true', + 'String.prototype.trimStart.call(true)' +); + +assert.sameValue( + String.prototype.trimStart.call(false), + 'false', + 'String.prototype.trimStart.call(false)' +); diff --git a/test/built-ins/String/prototype/trimStart/this-value-symbol-typeerror.js b/test/built-ins/String/prototype/trimStart/this-value-symbol-typeerror.js new file mode 100644 index 0000000000000000000000000000000000000000..b3b87c63f8cd188a4ea3356f8c4123a4109c3606 --- /dev/null +++ b/test/built-ins/String/prototype/trimStart/this-value-symbol-typeerror.js @@ -0,0 +1,21 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: pending +description: Type error when "this" value is a Symbol +info: | + TrimString + 2. Let S be ? ToString(str). + + ToString + Argument Type: Symbol + Result: Throw a TypeError exception +---*/ + +var trimStart = String.prototype.trimStart; +var symbol = Symbol() + +assert.throws(TypeError, function() { + trimStart.call(symbol); +}, 'Symbol()');