diff --git a/test/intl402/NumberFormat/constructor-no-instanceof.js b/test/intl402/NumberFormat/constructor-no-instanceof.js new file mode 100644 index 0000000000..259c37ef66 --- /dev/null +++ b/test/intl402/NumberFormat/constructor-no-instanceof.js @@ -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(); diff --git a/test/intl402/NumberFormat/prototype/format/no-instanceof.js b/test/intl402/NumberFormat/prototype/format/no-instanceof.js new file mode 100644 index 0000000000..ddeed1435f --- /dev/null +++ b/test/intl402/NumberFormat/prototype/format/no-instanceof.js @@ -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; diff --git a/test/intl402/NumberFormat/prototype/resolvedOptions/no-instanceof.js b/test/intl402/NumberFormat/prototype/resolvedOptions/no-instanceof.js new file mode 100644 index 0000000000..55fd6fd833 --- /dev/null +++ b/test/intl402/NumberFormat/prototype/resolvedOptions/no-instanceof.js @@ -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();