From 5be8900d6b9f11a3d973c1d43cbdf1a6bfd1bb4a Mon Sep 17 00:00:00 2001 From: Robin Templeton Date: Tue, 17 Apr 2018 20:26:24 -0400 Subject: [PATCH] cross-realm test for BigInt.prototype.valueOf Thanks to Jeff Walden for suggesting this test case. --- .../BigInt/prototype/valueOf/cross-realm.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 test/built-ins/BigInt/prototype/valueOf/cross-realm.js diff --git a/test/built-ins/BigInt/prototype/valueOf/cross-realm.js b/test/built-ins/BigInt/prototype/valueOf/cross-realm.js new file mode 100644 index 0000000000..97e1041712 --- /dev/null +++ b/test/built-ins/BigInt/prototype/valueOf/cross-realm.js @@ -0,0 +1,14 @@ +// Copyright 2018 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-bigint.prototype.valueof +description: valueOf called with a BigInt object from another realm +features: [BigInt, cross-realm] +---*/ + +var other = $262.createRealm().global; +var wrapped = other.Object(other.BigInt(0)); + +assert.sameValue(BigInt.prototype.valueOf.call(wrapped), 0n, + "cross-realm valueOf");