Add object coercible tests for trim(start/End)

This commit is contained in:
Valerie R Young 2017-09-25 14:45:51 -04:00 committed by Rick Waldron
parent 5931e313fc
commit 3f42003974
2 changed files with 42 additions and 0 deletions

View File

@ -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');

View File

@ -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');