Skip to content

Commit

Permalink
Add object coercible tests for trim(start/End)
Browse files Browse the repository at this point in the history
  • Loading branch information
Valerie R Young committed Sep 25, 2017
1 parent 888a215 commit ef1488e
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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');
Original file line number Diff line number Diff line change
@@ -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');

0 comments on commit ef1488e

Please sign in to comment.