mirror of https://github.com/tc39/test262.git
Add NumberFormat tests for OrdinaryHasInstance
Add tests to make sure NumberFormat does not call the instanceof operator and calls OrdinaryHasInstance instead. Refs: https://github.com/tc39/ecma402/pull/500
This commit is contained in:
parent
950d097516
commit
76ab0187c0
|
@ -0,0 +1,16 @@
|
|||
// 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.NumberFormat.prototype.resolvedOptions
|
||||
description: >
|
||||
Tests that Intl.NumberFormat.prototype.resolvedOptions calls
|
||||
OrdinaryHasInstance instead of the instanceof operator which includes a
|
||||
Symbol.hasInstance lookup and call among other things.
|
||||
---*/
|
||||
|
||||
Object.defineProperty(Intl.NumberFormat, Symbol.hasInstance, {
|
||||
get() { throw new Test262Error(); }
|
||||
});
|
||||
|
||||
Intl.NumberFormat();
|
|
@ -0,0 +1,18 @@
|
|||
// 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.NumberFormat.prototype.resolvedOptions
|
||||
description: >
|
||||
Tests that Intl.NumberFormat.prototype.resolvedOptions calls
|
||||
OrdinaryHasInstance instead of the instanceof operator which includes a
|
||||
Symbol.hasInstance lookup and call among other things.
|
||||
---*/
|
||||
|
||||
const nf = new Intl.NumberFormat();
|
||||
|
||||
Object.defineProperty(Intl.NumberFormat, Symbol.hasInstance, {
|
||||
get() { throw new Test262Error(); }
|
||||
});
|
||||
|
||||
nf.format;
|
|
@ -0,0 +1,18 @@
|
|||
// 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.NumberFormat.prototype.resolvedOptions
|
||||
description: >
|
||||
Tests that Intl.NumberFormat.prototype.resolvedOptions calls
|
||||
OrdinaryHasInstance instead of the instanceof operator which includes a
|
||||
Symbol.hasInstance lookup and call among other things.
|
||||
---*/
|
||||
|
||||
const nf = new Intl.NumberFormat();
|
||||
|
||||
Object.defineProperty(Intl.NumberFormat, Symbol.hasInstance, {
|
||||
get() { throw new Test262Error(); }
|
||||
});
|
||||
|
||||
nf.resolvedOptions();
|
Loading…
Reference in New Issue