mirror of
https://github.com/tc39/test262.git
synced 2025-07-23 14:04:51 +02:00
fixup: Add boolean/Symbol() tests for trim(Start/End)
This commit is contained in:
parent
fdf8e8bd3f
commit
812e071f03
@ -2,20 +2,30 @@
|
|||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
esid: pending
|
esid: sec-string.prototype.trimEnd
|
||||||
description: Behavoir when "this" value is a boolean.
|
description: Behavior when "this" value is a boolean.
|
||||||
|
info: |
|
||||||
|
TrimString
|
||||||
|
2. Let S be ? ToString(str).
|
||||||
|
|
||||||
|
ToString
|
||||||
|
Argument Type: Boolean
|
||||||
|
Result:
|
||||||
|
If argument is true, return "true".
|
||||||
|
If argument is false, return "false".
|
||||||
|
features: [string-trimming]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var trimStart = String.prototype.trimStart
|
var trimEnd = String.prototype.trimEnd
|
||||||
|
|
||||||
assert.sameValue(
|
assert.sameValue(
|
||||||
trimStart.call(true),
|
trimEnd.call(true),
|
||||||
'true',
|
'true',
|
||||||
'String.prototype.trimStart.call(true)'
|
'String.prototype.trimEnd.call(true)'
|
||||||
);
|
);
|
||||||
|
|
||||||
assert.sameValue(
|
assert.sameValue(
|
||||||
String.prototype.trimStart.call(false),
|
String.prototype.trimEnd.call(false),
|
||||||
'false',
|
'false',
|
||||||
'String.prototype.trimStart.call(false)'
|
'String.prototype.trimEnd.call(false)'
|
||||||
);
|
);
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
esid: pending
|
esid: sec-string.prototype.trimEnd
|
||||||
description: Type error when "this" value is a Symbol
|
description: Type error when "this" value is a Symbol
|
||||||
info: |
|
info: |
|
||||||
TrimString
|
TrimString
|
||||||
@ -11,11 +11,14 @@ info: |
|
|||||||
ToString
|
ToString
|
||||||
Argument Type: Symbol
|
Argument Type: Symbol
|
||||||
Result: Throw a TypeError exception
|
Result: Throw a TypeError exception
|
||||||
|
features: [string-trimming]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var trimEnd = String.prototype.trimEnd;
|
var trimEnd = String.prototype.trimEnd;
|
||||||
var symbol = Symbol()
|
var symbol = Symbol();
|
||||||
|
|
||||||
assert.throws(TypeError, function() {
|
assert.throws(
|
||||||
trimEnd.call(symbol);
|
TypeError,
|
||||||
}, 'Symbol()');
|
function() { trimEnd.call(symbol); },
|
||||||
|
'String.prototype.trimEnd.call(Symbol())'
|
||||||
|
);
|
||||||
|
@ -2,8 +2,18 @@
|
|||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
esid: pending
|
esid: sec-string.prototype.trimStart
|
||||||
description: Behavoir when "this" value is a boolean.
|
description: Behavior when "this" value is a boolean.
|
||||||
|
info: |
|
||||||
|
TrimString
|
||||||
|
2. Let S be ? ToString(str).
|
||||||
|
|
||||||
|
ToString
|
||||||
|
Argument Type: Boolean
|
||||||
|
Result:
|
||||||
|
If argument is true, return "true".
|
||||||
|
If argument is false, return "false".
|
||||||
|
features: [string-trimming]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var trimStart = String.prototype.trimStart
|
var trimStart = String.prototype.trimStart
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
esid: pending
|
esid: sec-string.prototype.trimStart
|
||||||
description: Type error when "this" value is a Symbol
|
description: Type error when "this" value is a Symbol
|
||||||
info: |
|
info: |
|
||||||
TrimString
|
TrimString
|
||||||
@ -11,11 +11,14 @@ info: |
|
|||||||
ToString
|
ToString
|
||||||
Argument Type: Symbol
|
Argument Type: Symbol
|
||||||
Result: Throw a TypeError exception
|
Result: Throw a TypeError exception
|
||||||
|
features: [string-trimming]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var trimStart = String.prototype.trimStart;
|
var trimStart = String.prototype.trimStart;
|
||||||
var symbol = Symbol()
|
var symbol = Symbol();
|
||||||
|
|
||||||
assert.throws(TypeError, function() {
|
assert.throws(
|
||||||
trimStart.call(symbol);
|
TypeError,
|
||||||
}, 'Symbol()');
|
function() { trimStart.call(symbol); },
|
||||||
|
'String.prototype.trimStart.call(Symbol())'
|
||||||
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user