blob: 8d3e56e53317b2e145448df93fd72a78724335e3 [file] [log] [blame]
// Copyright 2019 Igalia, S.L. All rights reserved.
// This code is governed by the license found in the LICENSE file.
/*---
description: >
Throws a TypeError if this is not a DateTimeFormat object
features: [Intl.DateTimeFormat-formatRange]
---*/
const formatRange = Intl.DateTimeFormat.prototype.formatRange;
assert.throws(TypeError, function() {
formatRange.call({});
}, "{}");
assert.throws(TypeError, function() {
formatRange.call(new Date());
}, "new Date()");
assert.throws(TypeError, function() {
formatRange.call(Intl.DateTimeFormat);
}, "Intl.DateTimeFormat");
assert.throws(TypeError, function() {
formatRange.call(Intl.DateTimeFormat.prototype);
}, "Intl.DateTimeFormat.prototype");