Skip to content

Commit

Permalink
Add a test for observable calls in Temporal.Duration constructor.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ms2ger authored and rwaldron committed Mar 10, 2022
1 parent 50dc96e commit d45476b
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/built-ins/Temporal/Duration/call-builtin.js
Original file line number Diff line number Diff line change
@@ -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);

0 comments on commit d45476b

Please sign in to comment.