test262/test/intl402/DateTimeFormat/constructor-no-instanceof.js
Ujjwal Sharma f6034ebe9f Add DateTimeFormat tests for OrdinaryHasInstance
Add tests to make sure DateTimeFormat does not call the instanceof
operator and calls OrdinaryHasInstance instead.

Refs: https://github.com/tc39/ecma402/pull/500
2021-02-16 12:20:50 -05:00

17 lines
540 B
JavaScript

// Copyright (C) 2021 Igalia S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-Intl.DateTimeFormat.prototype.resolvedOptions
description: >
Tests that Intl.DateTimeFormat.prototype.resolvedOptions calls
OrdinaryHasInstance instead of the instanceof operator which includes a
Symbol.hasInstance lookup and call among other things.
---*/
Object.defineProperty(Intl.DateTimeFormat, Symbol.hasInstance, {
get() { throw new Test262Error(); }
});
Intl.DateTimeFormat();