mirror of https://github.com/tc39/test262.git
Add boolean/Symbol() tests for trim(Start/End)
This commit is contained in:
parent
3f42003974
commit
0c796ea88b
|
@ -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)'
|
||||
);
|
|
@ -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()');
|
|
@ -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)'
|
||||
);
|
|
@ -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()');
|
Loading…
Reference in New Issue