blob: 40de19cef810054d179602e6c1eac90502939512 [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 formatRangeToParts = Intl.DateTimeFormat.prototype.formatRangeToParts;
assert.throws(TypeError, function() {
formatRangeToParts.call({});
}, "{}");
assert.throws(TypeError, function() {
formatRangeToParts.call(new Date());
}, "new Date()");
assert.throws(TypeError, function() {
formatRangeToParts.call(Intl.DateTimeFormat);
}, "Intl.DateTimeFormat");
assert.throws(TypeError, function() {
formatRangeToParts.call(Intl.DateTimeFormat.prototype);
}, "Intl.DateTimeFormat.prototype");