From d45476b9fde69b0036ef786e98f6b5fe8e488c1e Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Tue, 8 Mar 2022 10:33:29 +0100 Subject: [PATCH] Add a test for observable calls in Temporal.Duration constructor. --- test/built-ins/Temporal/Duration/call-builtin.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 test/built-ins/Temporal/Duration/call-builtin.js diff --git a/test/built-ins/Temporal/Duration/call-builtin.js b/test/built-ins/Temporal/Duration/call-builtin.js new file mode 100644 index 0000000000..1050ec9672 --- /dev/null +++ b/test/built-ins/Temporal/Duration/call-builtin.js @@ -0,0 +1,15 @@ +// Copyright (C) 2022 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.duration +description: Constructor should not call built-in functions. +includes: [temporalHelpers.js] +features: [Temporal] +---*/ + +Number.isFinite = () => { throw new Test262Error("should not call Number.isFinite") }; +Math.sign = () => { throw new Test262Error("should not call Math.sign") }; + +const duration = new Temporal.Duration(1, 1); +TemporalHelpers.assertDuration(duration, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0);