2021-02-16 12:45:04 +01:00
|
|
|
|
// Copyright (C) 2021 Igalia S.L. All rights reserved.
|
|
|
|
|
// This code is governed by the BSD license found in the LICENSE file.
|
|
|
|
|
|
|
|
|
|
/*---
|
2022-12-02 15:59:32 +01:00
|
|
|
|
esid: sec-intl-numberformat-constructor
|
2021-02-16 12:45:04 +01:00
|
|
|
|
description: >
|
2022-12-02 15:59:32 +01:00
|
|
|
|
Tests that the Intl.NumberFormat constructor calls
|
2021-02-16 12:45:04 +01:00
|
|
|
|
OrdinaryHasInstance instead of the instanceof operator which includes a
|
|
|
|
|
Symbol.hasInstance lookup and call among other things.
|
2022-12-02 15:59:32 +01:00
|
|
|
|
info: >
|
|
|
|
|
ChainNumberFormat ( numberFormat, newTarget, this )
|
|
|
|
|
1. If newTarget is undefined and ? OrdinaryHasInstance(%NumberFormat%, this) is true, then
|
|
|
|
|
a. Perform ? DefinePropertyOrThrow(this, %Intl%.[[FallbackSymbol]], PropertyDescriptor{
|
|
|
|
|
[[Value]]: numberFormat, [[Writable]]: false, [[Enumerable]]: false,
|
|
|
|
|
[[Configurable]]: false }).
|
|
|
|
|
b. Return this.
|
2021-02-16 12:45:04 +01:00
|
|
|
|
---*/
|
|
|
|
|
|
|
|
|
|
Object.defineProperty(Intl.NumberFormat, Symbol.hasInstance, {
|
|
|
|
|
get() { throw new Test262Error(); }
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Intl.NumberFormat();
|