mirror of https://github.com/tc39/test262.git
Add object coercible tests for trim(start/End)
This commit is contained in:
parent
5931e313fc
commit
3f42003974
|
@ -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: The "this" value must be object-coercible
|
||||
info: |
|
||||
1. Let O be ? RequireObjectCoercible(this value).
|
||||
---*/
|
||||
|
||||
var trimEnd = String.prototype.trimEnd;
|
||||
|
||||
assert.sameValue(typeof trimEnd, 'function');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
trimEnd.call(undefined);
|
||||
}, 'undefined');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
trimEnd.call(null);
|
||||
}, 'null');
|
|
@ -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: The "this" value must be object-coercible
|
||||
info: |
|
||||
1. Let O be ? RequireObjectCoercible(this value).
|
||||
---*/
|
||||
|
||||
var trimStart = String.prototype.trimStart;
|
||||
|
||||
assert.sameValue(typeof trimStart, 'function');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
trimStart.call(undefined);
|
||||
}, 'undefined');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
trimStart.call(null);
|
||||
}, 'null');
|
Loading…
Reference in New Issue