From 36d22d82aa202bb199967e9512281e9a53db42c9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 21:33:14 +0200 Subject: Adding upstream version 115.7.0esr. Signed-off-by: Daniel Baumann --- js/src/tests/non262/Tuple/isTuple/8.2.2.1.js | 54 ++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 js/src/tests/non262/Tuple/isTuple/8.2.2.1.js (limited to 'js/src/tests/non262/Tuple/isTuple/8.2.2.1.js') diff --git a/js/src/tests/non262/Tuple/isTuple/8.2.2.1.js b/js/src/tests/non262/Tuple/isTuple/8.2.2.1.js new file mode 100644 index 0000000000..9ac63ebc66 --- /dev/null +++ b/js/src/tests/non262/Tuple/isTuple/8.2.2.1.js @@ -0,0 +1,54 @@ +// |reftest| skip-if(!this.hasOwnProperty("Tuple")) +/* +8.2.2 +The Tuple constructor: +... +has the following properties: +... + +8.2.2.1 Tuple.isTuple ( arg ) +The isTuple function takes one argument arg, and performs the following steps: + +1. Return ! IsTuple(arg). +*/ + +var Tuple_isTuple = Tuple.isTuple; +assertEq(typeof Tuple_isTuple, "function"); + +assertEq(Tuple_isTuple(), false); +assertEq(Tuple_isTuple(Tuple.prototype), false); +assertEq(Tuple_isTuple([]), false); +assertEq(Tuple_isTuple(42), false); +assertEq(Tuple_isTuple(new Number(-50)), false); +assertEq(Tuple_isTuple(undefined), false); +assertEq(Tuple_isTuple(true), false); +assertEq(Tuple_isTuple(new Boolean(false)), false); +assertEq(Tuple_isTuple("hello"), false); +assertEq(Tuple_isTuple(new String("bye")), false); +assertEq(Tuple_isTuple({}), false); +assertEq(Tuple_isTuple(null), false); +assertEq(Tuple_isTuple(new RegExp()), false); +assertEq(Tuple_isTuple(JSON), false); +assertEq(Tuple_isTuple(Math), false); +assertEq(Tuple_isTuple(new Date()), false); +assertEq(Tuple_isTuple(new SyntaxError()), false); +var arg; +function fun() { arg = arguments; }(1, 2, 3); +assertEq(Tuple_isTuple(arg), false); +assertEq(Tuple_isTuple(this), false); +assertEq(Tuple_isTuple(function() {}), false); +var proto = Tuple.prototype; +var Con = function() {}; +Con.prototype = proto; +var child = new Con(); +assertEq(Tuple_isTuple(child), false); +assertEq(Tuple_isTuple({0: 1, 1: 2, length: 2}), false); + +assertEq(Tuple_isTuple.call(1), false); +assertEq(Tuple_isTuple.call(#[1]), false); +assertEq(Tuple_isTuple.call(undefined, 1), false); +assertEq(Tuple_isTuple.call(undefined, undefined), false); +assertEq(Tuple_isTuple.call(undefined, #[1]), true); +assertEq(Tuple_isTuple.call(undefined, Object(#[1])), true); + +reportCompare(0, 0); -- cgit v1.2.3