Test that Date.prototype.toString throws for non-Date receiver

Pending discussion of https://github.com/tc39/ecma262/issues/849

Test passes in V8.
This commit is contained in:
Daniel Ehrenberg 2017-03-21 10:44:32 +01:00
parent 975e54de17
commit 7151f3247e

View File

@ -0,0 +1,12 @@
// Copyright (C) 2017 V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: #sec-date.prototype.tostring
description: Date.prototype.toString throws a TypeError on non-Date receivers
---*/
assert.throws(TypeError, () => Date.prototype.toString());
assert.throws(TypeError, () => Date.prototype.toString.call(undefined));
assert.throws(TypeError, () => Date.prototype.toString.call(0));
assert.throws(TypeError, () => Date.prototype.toString.call({}));