mirror of
https://github.com/tc39/test262.git
synced 2025-04-08 19:35:28 +02:00
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:
parent
975e54de17
commit
7151f3247e
12
test/built-ins/Date/prototype/toString/non-date-receiver.js
vendored
Normal file
12
test/built-ins/Date/prototype/toString/non-date-receiver.js
vendored
Normal 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({}));
|
Loading…
x
Reference in New Issue
Block a user